mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Antonio Quartulli <antonio@mandelbit.com>
To: Janis Edvarts Lacis <janislacis06@gmail.com>
Cc: intel-wired-lan@lists.osuosl.org,
	Tony Nguyen <anthony.l.nguyen@intel.com>,
	Przemek Kitszel <przemyslaw.kitszel@intel.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH net v2 1/3] igb: fix RTNL assertion when resuming from runtime suspend
Date: Wed, 18 Nov 2026 15:52:28 +0100	[thread overview]
Message-ID: <3f6b535c-fce1-41d7-90a4-b15cfa20db52@mandelbit.com> (raw)
In-Reply-To: <rab7ustlezklu43vnjkby5mqh33bgqoztlz6bv5wxkjqfvbtfd@imjngi6j72nz>

Hi Janis, thanks for the review!

On 18/11/2026 14:21, Janis Edvarts Lacis wrote:
> On 16 Nov 16:30, Antonio Quartulli wrote:
>> Since commit ac8c58f5b535 ("igb: fix deadlock caused by taking RTNL in
>> RPM resume path") __igb_resume() doesn't take RTNL for runtime resume,
>> but __igb_open() still calls netif_set_real_num_{tx,rx}_queues(), which
>> require it. An asynchronous runtime resume (e.g. after the link comes
>> back) then triggers "RTNL: assertion failed".
>>
>> Skip them when resuming. The counts are set again on every regular open,
>> which happens under RTNL; the only case left out is a fallback from
>> MSI-X to MSI during a resume, which leaves the stack with more queues
>> than the device uses until the next open.
> 
> RTNL is not held only on runtime resume, it is held on a normal resume.
> __igb_open() skips netif_set_real_num_{tx,rx}_queues() for both resume
> types. Maybe it makes sense to skip them only on runtime resume when the
> RTNL is not held?

You're right.
RTNL is held on normal (system sleep) resume, so the counts can and 
should be set there.

> 
> May I ask why is it okay to leave out the fallback case, can't it lead
> to trouble if the counts are not updated but a fallback happens?

Ouch..you're right again.
The fallback case can't be left out: with fewer rings than the stack's 
real queue count, igb_tx_queue_mapping() maps several TX queues onto 
tx_ring[0], each under its own xmit lock, and igb_xsk_pool_disable() can 
index a ring that doesn't exist (Sashiko reported the same on this 
version....).

To summarize: in v3 I'll set the counts directly on normal resume and on 
runtime resume from a work item that takes RTNL (as patch 2 already does 
for the NAPI links).
Until the work item has run, igb_xmit_frame() will drop packets for 
queues the device doesn't have instead of mapping them onto tx_ring[0] 
(the stack drops them anyway when the count is lowered), and the XSK 
disable path will skip rings that don't exist.

Best,

> 
> Best regards,
> Janis

-- 
Antonio Quartulli

CEO and Co-Founder
Mandelbit Srl
https://www.mandelbit.com


  reply	other threads:[~2026-11-18 14:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 15:30 [PATCH net v2 0/3] igb: fix runtime PM resume issues Antonio Quartulli
2026-11-16 15:30 ` [PATCH net v2 1/3] igb: fix RTNL assertion when resuming from runtime suspend Antonio Quartulli
2026-11-18 13:21   ` Janis Edvarts Lacis
2026-11-18 14:52     ` Antonio Quartulli [this message]
2026-11-16 15:30 ` [PATCH net v2 2/3] igb: link queues to NAPIs under RTNL after runtime resume Antonio Quartulli
2026-11-18 15:05   ` Joe Damato
2026-11-16 15:30 ` [PATCH net v2 3/3] igb: only allow runtime PM if the device can wake up Antonio Quartulli

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=3f6b535c-fce1-41d7-90a4-b15cfa20db52@mandelbit.com \
    --to=antonio@mandelbit.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=janislacis06@gmail.com \
    --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 \
    /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®