Re: [PATCH 1/2] net: Assert proper context while calling napi_schedule()

Jakub Kicinski
2025-02-13T03:48:21Z

On Wed, 12 Feb 2025 18:43:28 +0100 Frederic Weisbecker wrote:
> napi_schedule() is expected to be called either:
>
> * From an interrupt, where raised softirqs are handled on IRQ exit
>
> * From a softirq disabled section, where raised softirqs are handled on
> the next call to local_bh_enable().
>
> * From a softirq handler, where raised softirqs are handled on the next
> round in do_softirq(), or further deferred to a dedicated kthread.
>
> Other bare tasks context may end up ignoring the raised NET_RX vector
> until the next random softirq handling opportunity, which may not
> happen before a while if the CPU goes idle afterwards with the tick
> stopped.
>
> Report inappropriate calling contexts when neither of the three above
> conditions are met.

Looks like netcons is hitting this warning in netdevsim:

[ 16.063196][ T219] nsim_start_xmit+0x4e0/0x6f0 [netdevsim]
[ 16.063219][ T219] ? netif_skb_features+0x23e/0xa80
[ 16.063237][ T219] netpoll_start_xmit+0x3c3/0x670
[ 16.063258][ T219] __netpoll_send_skb+0x3e9/0x800
[ 16.063287][ T219] netpoll_send_skb+0x2a/0xa0
[ 16.063298][ T219] send_ext_msg_udp+0x286/0x350 [netconsole]
[ 16.063325][ T219] write_ext_msg+0x1c6/0x230 [netconsole]
[ 16.063346][ T219] console_emit_next_record+0x20d/0x430

https://netdev-3.bots.linux.dev/vmksft-net-drv-dbg/results/990261/7-netcons-basic-sh/stderr

We gotta fix that first.

Please post the fixes for net, and then the warning in net-next.
So that we have some time to fix the uncovered warnings before
users are broadly exposed to them.
--
pw-bot: cr