From: Simon Horman <horms@kernel.org>
To: Samiullah Khawaja <skhawaja@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>,
"David S . Miller " <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
willemb@google.com, netdev@vger.kernel.org
Subject: Re: [PATCH net] net: Use NAPI_* in test_bit when stopping napi kthread
Date: Fri, 12 Sep 2025 20:27:49 +0100 [thread overview]
Message-ID: <20250912192749.GG224143@horms.kernel.org> (raw)
In-Reply-To: <20250912192603.GF224143@horms.kernel.org>
On Fri, Sep 12, 2025 at 08:26:03PM +0100, Simon Horman wrote:
> On Wed, Sep 10, 2025 at 08:37:16PM +0000, Samiullah Khawaja wrote:
> > napi_stop_kthread waits for the NAPI_STATE_SCHED_THREADED to be unset
> > before stopping the kthread. But it uses test_bit with the
> > NAPIF_STATE_SCHED_THREADED and that might stop the kthread early before
> > the flag is unset.
> >
> > Use the NAPI_* variant of the NAPI state bits in test_bit instead.
>
> I think it would be useful to mention the difference between
> NAPI_STATE_SCHED_THREADED and NAPIF_STATE_SCHED_THREADED.
>
> For me, that would be that one is a bit number, while
> the other is a mask with only the corresponding bit set.
>
> >
> > Tested:
> > ./tools/testing/selftests/net/nl_netdev.py
> > TAP version 13
> > 1..7
> > ok 1 nl_netdev.empty_check
> > ok 2 nl_netdev.lo_check
> > ok 3 nl_netdev.page_pool_check
> > ok 4 nl_netdev.napi_list_check
> > ok 5 nl_netdev.dev_set_threaded
> > ok 6 nl_netdev.napi_set_threaded
> > ok 7 nl_netdev.nsim_rxq_reset_down
> > # Totals: pass:7 fail:0 xfail:0 xpass:0 skip:0 error:0
> >
> > ./tools/testing/selftests/drivers/net/napi_threaded.py
> > TAP version 13
> > 1..2
> > ok 1 napi_threaded.change_num_queues
> > ok 2 napi_threaded.enable_dev_threaded_disable_napi_threaded
> > # Totals: pass:2 fail:0 xfail:0 xpass:0 skip:0 error:0
> >
> > Fixes: 689883de94dd ("net: stop napi kthreads when THREADED napi is disabled")
> > Signed-off-by: Samiullah Khawaja <skhawaja@google.com>
>
> With the above addressed, feel free to add:
>
> Reviewed-by: Simon Horman <horms@kernel.org>
>
> ...
I now see that this patch is present in net as
commit 247981eecd3d ("net: Use NAPI_* in test_bit when stopping napi kthread")
So I think we can safely ignore the comments in my previous email.
prev parent reply other threads:[~2025-09-12 19:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-10 20:37 [PATCH net] net: Use NAPI_* in test_bit when stopping napi kthread Samiullah Khawaja
2025-09-11 13:40 ` Jakub Kicinski
2025-09-11 14:10 ` Samiullah Khawaja
2025-09-11 14:31 ` Samiullah Khawaja
2025-09-11 14:38 ` Jakub Kicinski
2025-09-12 1:40 ` patchwork-bot+netdevbpf
2025-09-12 19:26 ` Simon Horman
2025-09-12 19:27 ` Simon Horman [this message]
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=20250912192749.GG224143@horms.kernel.org \
--to=horms@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=skhawaja@google.com \
--cc=willemb@google.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.