Netdev List
 help / color / mirror / Atom feed
* [PATCH net v4 0/4] igb: fix runtime PM resume issues
@ 2026-11-20 21:01 Antonio Quartulli
  2026-11-20 21:01 ` [PATCH net v4 1/4] igb: don't touch rings that don't exist when disabling an XSK pool Antonio Quartulli
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Antonio Quartulli @ 2026-11-20 21:01 UTC (permalink / raw)
  To: intel-wired-lan
  Cc: Antonio Quartulli, Tony Nguyen, Przemek Kitszel, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Janis Edvarts Lacis, Alexei Starovoitov, Daniel Borkmann,
	Jesper Dangaard Brouer, John Fastabend, Stanislav Fomichev,
	Sriram Yagnaraman, Kurt Kanzenbach, Maciej Fijalkowski,
	Heiner Kallweit, Joe Damato, netdev, linux-kernel, bpf

igb can be runtime suspended when the link goes down (with
power/control set to auto). Resuming it calls functions that need RTNL
without holding it (patches 2 and 3), and devices that can't signal a
wake-up are suspended anyway, so their port stays down when the link
comes back (patch 4). Patch 1 fixes the XSK pool disable path when the
device has fewer rings than the stack has queues: a NULL dereference
with VFs (a single Tx queue on 82576), or after a fallback from MSI-X to
MSI on resume.

Tested with the 82576 emulated by QEMU, including, with test-only hooks,
a runtime resume and a simulated system sleep (the suspend/resume
callbacks called directly, as the test kernel has no CONFIG_SUSPEND)
with the device forced to come back with MSI and a single queue. Not
tested: real hardware and PME wake-up, a real system sleep, the MSI-X
allocation failure itself, the window before the work item runs, and
SR-IOV with runtime PM. Patch 1 was tested with a zero-copy AF_XDP socket
on queue 1: closing it after enabling a VF oopses in
igb_txrx_ring_disable() with stock igb and v3, not with v4, and the Rx
ring then no longer references the pool. Not run under KASAN.

igc has the same issues (see the notes); Joe Damato offered to test on
igc, so its fix will be sent separately.

Changes in v4:
- patch 1: also handle queues with an Rx but no Tx ring, as with VFs:
  tear down the Rx ring and skip only the Tx part (Sashiko); subject
  changed from "don't disable rings ..." to "don't touch rings ..."

Changes in v3:
- new patch 1
- patch 2: set the real queue counts on system sleep resume and from a
  work item on runtime resume, and drop packets for queues the device
  doesn't have until then (Janis, Sashiko)
- patch 3: link the NAPIs from the same work item

Changes in v2:
- patch 2 (v2 patch 1): keep setting the queue counts in __igb_open(),
  only skipping them on resume (Sashiko)
- mention the tested hardware in the commit messages

v3: https://lore.kernel.org/netdev/20261119140412.163202-1-antonio@mandelbit.com/
v2: https://lore.kernel.org/netdev/20261116153041.3002666-1-antonio@mandelbit.com/
v1: https://lore.kernel.org/netdev/20261113105835.3821433-1-antonio@mandelbit.com/

Antonio Quartulli (4):
  igb: don't touch rings that don't exist when disabling an XSK pool
  igb: fix RTNL assertion when resuming from runtime suspend
  igb: link queues to NAPIs under RTNL after runtime resume
  igb: only allow runtime PM if the device can wake up

 drivers/net/ethernet/intel/igb/igb.h      |  1 +
 drivers/net/ethernet/intel/igb/igb_main.c | 96 +++++++++++++++++------
 drivers/net/ethernet/intel/igb/igb_xsk.c  | 37 ++++++---
 3 files changed, 100 insertions(+), 34 deletions(-)

-- 
2.56.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-20 21:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20 21:01 [PATCH net v4 0/4] igb: fix runtime PM resume issues Antonio Quartulli
2026-11-20 21:01 ` [PATCH net v4 1/4] igb: don't touch rings that don't exist when disabling an XSK pool Antonio Quartulli
2026-11-20 21:01 ` [PATCH net v4 2/4] igb: fix RTNL assertion when resuming from runtime suspend Antonio Quartulli
2026-11-20 21:01 ` [PATCH net v4 3/4] igb: link queues to NAPIs under RTNL after runtime resume Antonio Quartulli
2026-11-20 21:01 ` [PATCH net v4 4/4] igb: only allow runtime PM if the device can wake up Antonio Quartulli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox