Re: [PATCH net] net: keep the NAPI_DISABLE flag while napi is disabled
From: Jakub Kicinski
Date: Wed Sep 30 2026 - 17:18:25 EST
On Mon, 28 Sep 2026 09:08:29 +0200 Maxime Chevallier wrote:
> On 9/28/26 00:41, Jakub Kicinski wrote:
> > On Sat, 26 Sep 2026 21:47:13 +0200 Maxime Chevallier wrote:
> >> This seems to be more general than stmmac though, there are lots of
> >> drivers that create the napi instances in .probe(), so they still live
> >> outside of .open()/.close(). It was verified by running the following on
> >> an mvneta board :
> >
> > Not sure this works, you assume ownership if DISABLE is set but we set
> > it to start the shutdown, not once we stopped the poller.
> >
> > We've been tempted to "fix" this multiple times. I'd prefer to fix
> > drivers.
>
> There's 2 classes of problems then
>
> - drivers that create a napi instance but don't use it even when
> admin up (stmmac, I think it used to be the case for i40e looking
> at the history). Fixing the driver makes sense then
>
> - drivers that add napi instances at .probe() time, in which
> case setting threaded to 1 -> 0 when the interface is admin down
> is always going to hang. There's quite a few of them :
>
> git grep -p netif_napi_add | grep probe | wc -l
> 75
TIL git grep -p, nice!
> So at least 75 drivers call netif_napi_add from their probe
> functions.
Mostly old drivers, half of which we should probably delete :S
Can we not refuse disabling the threaded state if the device
is down and has NAPIs?