Linux Power Management development
 help / color / mirror / Atom feed
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, janislacis06@gmail.com, ast@kernel.org,
	daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com,
	sdf@fomichev.me, sriram.yagnaraman@ericsson.com,
	kurt@linutronix.de, maciej.fijalkowski@intel.com,
	hkallweit1@gmail.com, joe@dama.to, rafael@kernel.org,
	sven.auhagen@voleatech.de, netdev@vger.kernel.org,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	bpf@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH net v6 3/7] igb: fix RTNL assertion when resuming from runtime suspend
Date: Tue, 01 Dec 2026 22:20:36 +0000	[thread overview]
Message-ID: <179616363685.3146.13049074289378045040@kernel.org> (raw)
In-Reply-To: <20261130213740.3323814-4-antonio@mandelbit.com>

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/20261130213740.3323814-1-antonio%40mandelbit.com

  reply	other threads:[~2026-12-01 22:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 21:37 [PATCH net v6 0/7] igb: fix runtime PM resume issues Antonio Quartulli
2026-11-30 21:37 ` [PATCH net v6 1/7] igb: don't wait for RTNL when runtime suspending Antonio Quartulli
2026-11-30 21:37 ` [PATCH net v6 2/7] igb: don't touch rings that don't exist when disabling an XSK pool Antonio Quartulli
2026-11-30 21:37 ` [PATCH net v6 3/7] igb: fix RTNL assertion when resuming from runtime suspend Antonio Quartulli
2026-12-01 22:20   ` netdev-bot+sashiko [this message]
2026-11-30 21:37 ` [PATCH net v6 4/7] igb: keep the stack's Rx queues that still have an XSK pool Antonio Quartulli
2026-12-01 22:20   ` netdev-bot+sashiko
2026-11-30 21:37 ` [PATCH net v6 5/7] igb: link queues to NAPIs under RTNL after runtime resume Antonio Quartulli
2026-11-30 21:37 ` [PATCH net v6 6/7] igb: resume the device before changing XDP or XSK settings Antonio Quartulli
2026-12-01 22:20   ` netdev-bot+sashiko
2026-11-30 21:37 ` [PATCH net v6 7/7] igb: only allow runtime PM if the device can wake up Antonio Quartulli
2026-12-01 22:20   ` netdev-bot+sashiko

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=179616363685.3146.13049074289378045040@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=antonio@mandelbit.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=hawk@kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=janislacis06@gmail.com \
    --cc=joe@dama.to \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=kurt@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=maciej.fijalkowski@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=rafael@kernel.org \
    --cc=sdf@fomichev.me \
    --cc=sriram.yagnaraman@ericsson.com \
    --cc=stable@vger.kernel.org \
    --cc=sven.auhagen@voleatech.de \
    /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