Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] At this commit, the runtime-resume path still hits the RTNL
assertion the patch says it fixes.
--
igb: fix RTNL assertion when resuming from runtime suspend
On runtime resume, __igb_open() no longer calls netif_set_real_num_queues(),
since RTNL is not held there. A new rtnl_resume_task work item does it
later under RTNL. Until that work runs, igb_xmit_frame() drops packets on
stack queues beyond adapter->num_tx_queues.
Closes: https://bugzilla.ipfire.org/show_bug.cgi?id=13562
> diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
> index 2fb9615d3bab3..5774a4d3c9810 100644
> --- a/drivers/net/ethernet/intel/igb/igb_main.c
> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
[ ... ]
> @@ -4181,16 +4209,15 @@ static int __igb_open(struct net_device *netdev, bool resuming)
> if (err)
> goto err_req_irq;
>
> - /* Notify the stack of the actual queue counts. */
> - err = netif_set_real_num_tx_queues(adapter->netdev,
> - adapter->num_tx_queues);
> - if (err)
> - goto err_set_queues;
> -
> - err = netif_set_real_num_rx_queues(adapter->netdev,
> - adapter->num_rx_queues);
> - if (err)
> - goto err_set_queues;
> + /* Notify the stack of the actual queue counts. This needs RTNL: on
> + * runtime resume igb_rtnl_resume_task() does it.
> + */
> + if (rtnl_held) {
> + err = netif_set_real_num_queues(netdev, adapter->num_tx_queues,
> + adapter->num_rx_queues);
> + if (err)
> + goto err_set_queues;
> + }
>
> /* From here on the code is the same as igb_up() */
> clear_bit(__IGB_DOWN, &adapter->state);
[Severity: Medium]
Does runtime resume still hit an RTNL assertion a few lines below this?
Only netif_set_real_num_queues() checks rtnl_held. The loop right after
clear_bit() still runs on every path:
__igb_open() {
...
for (i = 0; i < adapter->num_q_vectors; i++) {
napi = &adapter->q_vector[i]->napi;
napi_enable(napi);
igb_set_queue_napi(adapter, i, napi);
}
...
}
igb_set_queue_napi() calls netif_queue_set_napi() for the rx and tx ring
of each vector. netif_queue_set_napi() in net/core/dev.c does:
netdev_assert_locked_ops_compat_or_invisible(dev);
For a registered igb netdev that doesn't use the instance ops lock, this
becomes ASSERT_RTNL(). The resulting path would be:
igb_runtime_resume()
__igb_resume(dev, true)
__igb_open(netdev, true, false)
igb_set_queue_napi()
netif_queue_set_napi()
ASSERT_RTNL()
If so, every async runtime resume of a running interface would still
print "RTNL: assertion failed" with a WARN. The rxq->napi and txq->napi
pointers would also still be written without RTNL.
Also, igb_rtnl_resume_task() only restores the real queue counts.
__igb_shutdown() calls igb_clear_interrupt_scheme(), which frees the
q_vectors. Should the work item also link the queues to the new NAPIs
under RTNL?
A later patch in the series seems to fix this: "igb: link queues to
NAPIs under RTNL after runtime resume". It wraps igb_set_queue_napi() in
__igb_open() in an if (rtnl_held) check. It also calls a new
igb_link_queue_napis() from igb_rtnl_resume_task().
Could that change be folded into this commit? As it stands, this commit
is a bisect point that still triggers the assertion its subject says it
fixes.
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/2026…%40mandelbit.com