From: Jakub Kicinski <kuba@kernel•org>
To: Eric Dumazet <edumazet@google•com>
Cc: "David S . Miller" <davem@davemloft•net>,
Paolo Abeni <pabeni@redhat•com>,
netdev@vger•kernel.org, Simon Horman <horms@kernel•org>,
Kuniyuki Iwashima <kuniyu@amazon•com>,
eric.dumazet@gmail•com
Subject: Re: [PATCH net-next] net: introduce netdev_napi_exit()
Date: Fri, 17 Jan 2025 17:24:45 -0800 [thread overview]
Message-ID: <20250117172445.7719a86b@kernel.org> (raw)
In-Reply-To: <20250117232113.1612899-1-edumazet@google.com>
On Fri, 17 Jan 2025 23:21:13 +0000 Eric Dumazet wrote:
> After 1b23cdbd2bbc ("net: protect netdev->napi_list with netdev_lock()")
> it makes sense to iterate through dev->napi_list while holding
> the device lock.
>
> Also call synchronize_net() at most one time.
I suspected you may send this :)
I was wondering whether we have to call sync_rcu() at all, Joe moved
unhashing the NAPI to napi_disable(). Assuming the driver is sane
it will call napi_disable() at latest in ndo_uninit(), and there's
already a synchronize_net() between ndo_uninit() and free.
But maybe drivers are not sane. We don't have
/* napi_disable() sets the SCHED bit */
WARN_ON(!test_bit(NAPI_STATE_SCHED, &val));
in netif_napi_del(). I think we should add it, after Joe's changes
if driver doesn't disable the napi it will leave a stale pointer
in the hash table.
In any case, your change makes sense:
Reviewed-by: Jakub Kicinski <kuba@kernel•org>
next prev parent reply other threads:[~2025-01-18 1:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-17 23:21 [PATCH net-next] net: introduce netdev_napi_exit() Eric Dumazet
2025-01-18 1:24 ` Jakub Kicinski [this message]
2025-01-19 1:50 ` patchwork-bot+netdevbpf
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=20250117172445.7719a86b@kernel.org \
--to=kuba@kernel$(echo .)org \
--cc=davem@davemloft$(echo .)net \
--cc=edumazet@google$(echo .)com \
--cc=eric.dumazet@gmail$(echo .)com \
--cc=horms@kernel$(echo .)org \
--cc=kuniyu@amazon$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pabeni@redhat$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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