From: netdev-bot+sashiko@kernel.org
To: antonio@mandelbit.com
Cc: intel-wired-lan@lists.osuosl.org, anthony.l.nguyen@intel.com,
przemyslaw.kitszel@intel.com, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
pabeni@redhat.com, zheng.z.yan@intel.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH net 1/3] igb: fix RTNL assertion when resuming from runtime suspend
Date: Tue, 17 Nov 2026 11:18:31 +0000 [thread overview]
Message-ID: <179491431170.3136.416423016654830307@kernel.org> (raw)
In-Reply-To: <20261113105835.3821433-1-antonio@mandelbit.com>
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.
Critical: 0 · High: 2 · 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).
- [High] Commit "igb: fix RTNL assertion when resuming from runtime
suspend" moves netif_set_real_num_queues() out of __igb_open() and…
- [High] The commit message says "The queue counts only change on paths
that re-open the device under RTNL (ethtool -L, SR-IOV…
- [Medium] Concern (baseline decision: false, resolved later in the
series).
--
igb: fix RTNL assertion when resuming from runtime suspend
This patch moves the netif_set_real_num_{tx,rx}_queues() calls out of
__igb_open() and into igb_open(). The runtime resume path runs without
RTNL, so it no longer triggers an RTNL assertion. igb_open() now publishes
the queue counts with netif_set_real_num_queues() before it calls
__igb_open().
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 131df3e09ba14..028cdd90522cb 100644
> --- a/drivers/net/ethernet/intel/igb/igb_main.c
> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
> @@ -4178,17 +4178,6 @@ 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;
> -
[Severity: High]
The commit message says:
The queue counts only change on paths that re-open the device under
RTNL (ethtool -L, SR-IOV reconfiguration)
Does that hold for suspend and resume? Every suspend goes through
__igb_shutdown(), which calls igb_clear_interrupt_scheme(). That frees
the rings and sets num_tx_queues and num_rx_queues to zero in
igb_free_q_vectors().
On resume, __igb_resume() rebuilds them:
__igb_resume()
igb_init_interrupt_scheme(adapter, true)
igb_set_interrupt_capability()
pci_enable_msix_range() fails
msi_only:
adapter->num_rx_queues = 1;
adapter->num_tx_queues = 1;
adapter->num_q_vectors = 1;
__igb_open(netdev, true)
Before this patch, __igb_open(netdev, true) updated
dev->real_num_{tx,rx}_queues after that. Now only igb_open() does, and the
resume path never calls igb_open(). The same is true when the MSI-X to MSI
fallback in igb_request_irq() runs inside __igb_open(netdev, true).
In that case, can the stack keep a larger real_num_tx_queues while only
tx_ring[0] exists? igb_tx_queue_mapping() folds the stale indices onto
ring 0:
if (r_idx >= adapter->num_tx_queues)
r_idx = r_idx % adapter->num_tx_queues;
Each stack txq has its own _xmit_lock. Couldn't several CPUs then run
igb_xmit_frame_ring() on tx_ring[0] at the same time, racing on
next_to_use, tx_buffer_info[], the tail write and the BQL state of txq 0?
__igb_maybe_stop_tx() and igb_clean_tx_irq() also only stop and wake
subqueue 0. real_num_rx_queues would likewise stay larger than the single
configured RX ring.
Runtime resume happens on every link-up after a cable unplug, and each
cycle releases and re-acquires MSI-X, so this can happen more than once.
On system resume (rpm == false), __igb_resume() already holds RTNL around
__igb_open(). Did that path need to lose the update to fix the assertion?
[Severity: Medium]
Will runtime resume still hit an RTNL assertion with this patch applied?
Later in __igb_open(), igb_set_queue_napi() is still called
unconditionally:
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(), and that calls
netdev_assert_locked_ops_compat_or_invisible(). For igb, that check is
ASSERT_RTNL(). __igb_resume() only takes rtnl_lock() when !rpm, so this
chain runs without RTNL:
igb_runtime_resume()
__igb_resume(dev, true)
__igb_open(netdev, true)
igb_set_queue_napi()
netif_queue_set_napi()
ASSERT_RTNL()
It also updates the queue napi pointers without RTNL.
The next patch in the series, "igb: link queues to NAPIs under RTNL after
runtime resume", fixes this. It calls igb_set_queue_napi() only when
!resuming, and links the NAPIs under RTNL from a new igb_queue_napi_task
work item. So the problem is gone by the end of the series. With only this
commit applied, though, the "RTNL: assertion failed" warning from the
commit message still looks reachable on runtime resume.
[ ... ]
> @@ -4241,6 +4228,17 @@ static int __igb_open(struct net_device *netdev, bool resuming)
>
> int igb_open(struct net_device *netdev)
> {
> + struct igb_adapter *adapter = netdev_priv(netdev);
> + int err;
> +
> + /* Notify the stack of the actual queue counts. */
> + err = netif_set_real_num_queues(netdev, adapter->num_tx_queues,
> + adapter->num_rx_queues);
[Severity: High]
Can the queue counts still change after this call? __igb_open() calls
igb_request_irq(). If igb_request_msix() fails, it falls back to MSI and
rebuilds the interrupt scheme:
drivers/net/ethernet/intel/igb/igb_main.c:igb_request_irq() {
...
/* fall back to MSI */
igb_free_all_tx_resources(adapter);
igb_free_all_rx_resources(adapter);
igb_clear_interrupt_scheme(adapter);
err = igb_init_interrupt_scheme(adapter, false);
...
}
When msix is false, igb_set_interrupt_capability() takes the msi_only path.
That sets num_tx_queues, num_rx_queues and num_q_vectors to 1.
Before this patch, the netif_set_real_num_{tx,rx}_queues() calls ran after
igb_request_irq() and saw the reduced count. Now dev->real_num_tx_queues
keeps the value set here (for example 4 or 8), while only tx_ring[0]
exists.
Would igb_tx_queue_mapping() then fold txq 1..N-1 onto tx_ring[0]? Each of
those stack txqs takes a different _xmit_lock, so igb_xmit_frame_ring()
could run concurrently on the same ring. real_num_rx_queues would also
stay larger than the single configured RX ring.
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261113105835.3821433-1-antonio%40mandelbit.com
prev parent reply other threads:[~2026-11-17 11:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 10:58 Antonio Quartulli
2026-11-13 10:58 ` [PATCH net 2/3] igb: link queues to NAPIs under RTNL after runtime resume Antonio Quartulli
2026-11-17 11:18 ` netdev-bot+sashiko
2026-11-13 10:58 ` [PATCH net 3/3] igb: only allow runtime PM if the device can wake up Antonio Quartulli
2026-11-17 11:18 ` netdev-bot+sashiko
2026-11-13 11:03 ` [PATCH net 1/3] igb: fix RTNL assertion when resuming from runtime suspend netdev-bot+sinfo
2026-11-15 19:37 ` Antonio Quartulli
2026-11-17 11:18 ` netdev-bot+sashiko [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=179491431170.3136.416423016654830307@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=antonio@mandelbit.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=stable@vger.kernel.org \
--cc=zheng.z.yan@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®