BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: menglong8.dong@gmail.com
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH net-next 1/3] net: busy-poll: introduce sk_tx_busy_loop()
Date: Fri, 12 Jun 2026 07:13:36 +0000	[thread overview]
Message-ID: <20260612071336.793CD1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260611071242.2485058-2-dongml2@chinatelecom.cn>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] TX completions processed during sk_tx_busy_loop() incorrectly inflate the LINUX_MIB_BUSYPOLLRXPACKETS metric.
--

commit 0f753148fd82b1cf0ba3816b5e615f5e3039ba1b
Author: Menglong Dong <dongml2@chinatelecom.cn>

net: busy-poll: introduce sk_tx_busy_loop()

This commit introduces sk_tx_busy_loop() for NIC drivers that support TX
NAPI. It allows scheduling the TX NAPI, if available, instead of the RX
queue NAPI during busy polling.

> diff --git a/net/core/dev.c b/net/core/dev.c
> --- a/net/core/dev.c
> +++ b/net/core/dev.c

[ ... ]

> @@ -6951,6 +6946,9 @@ static void __napi_busy_loop(unsigned int napi_id,
>  	if (!napi)
>  		return;
>  
> +	if ((flags & NAPI_F_TX_NAPI) && napi->tx_napi)
> +		napi = napi->tx_napi;
> +

[Severity: Medium]
Will the returned work from the TX NAPI incorrectly inflate the
LINUX_MIB_BUSYPOLLRXPACKETS metric?

Further down in __napi_busy_loop(), the returned work is unconditionally
added to the RX-specific busy poll metric:

count:
        if (work > 0)
                __NET_ADD_STATS(dev_net(napi->dev),
                                LINUX_MIB_BUSYPOLLRXPACKETS, work);

If sk_tx_busy_loop() causes us to use the TX NAPI, does this mean TX
completions are now accounted as RX busy poll packets, potentially polluting
system monitoring statistics during TX-heavy busy polling workloads?

>  	if (!IS_ENABLED(CONFIG_PREEMPT_RT))
>  		preempt_disable();
>  	for (;;) {

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260611071242.2485058-1-dongml2@chinatelecom.cn?part=1

  reply	other threads:[~2026-06-12  7:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-11  7:12 [PATCH net-next 0/3] xsk: support tx napi busy_poll menglong8.dong
2026-06-11  7:12 ` [PATCH net-next 1/3] net: busy-poll: introduce sk_tx_busy_loop() menglong8.dong
2026-06-12  7:13   ` sashiko-bot [this message]
2026-06-13 18:21   ` Jakub Kicinski
2026-06-11  7:12 ` [PATCH net-next 2/3] virtio_net: initialize napi.tx_napi in virtnet_alloc_queues() menglong8.dong
2026-06-11  7:12 ` [PATCH net-next 3/3] xsk: replace sk_busy_loop with sk_tx_busy_loop in __xsk_sendmsg() menglong8.dong
     [not found] ` <aisBEUmSJa1vkFYo@boxer>
2026-06-12  1:09   ` [PATCH net-next 0/3] xsk: support tx napi busy_poll Menglong Dong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260612071336.793CD1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=menglong8.dong@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox