linux/drivers
Michal Kubiak 0153f36041 ice: fix Tx scheduler error handling in XDP callback
When the XDP program is loaded, the XDP callback adds new Tx queues.
This means that the callback must update the Tx scheduler with the new
queue number. In the event of a Tx scheduler failure, the XDP callback
should also fail and roll back any changes previously made for XDP
preparation.

The previous implementation had a bug that not all changes made by the
XDP callback were rolled back. This caused the crash with the following
call trace:

[  +9.549584] ice 0000:ca:00.0: Failed VSI LAN queue config for XDP, error: -5
[  +0.382335] Oops: general protection fault, probably for non-canonical address 0x50a2250a90495525: 0000 [#1] SMP NOPTI
[  +0.010710] CPU: 103 UID: 0 PID: 0 Comm: swapper/103 Not tainted 6.14.0-net-next-mar-31+ #14 PREEMPT(voluntary)
[  +0.010175] Hardware name: Intel Corporation M50CYP2SBSTD/M50CYP2SBSTD, BIOS SE5C620.86B.01.01.0005.2202160810 02/16/2022
[  +0.010946] RIP: 0010:__ice_update_sample+0x39/0xe0 [ice]

[...]

[  +0.002715] Call Trace:
[  +0.002452]  <IRQ>
[  +0.002021]  ? __die_body.cold+0x19/0x29
[  +0.003922]  ? die_addr+0x3c/0x60
[  +0.003319]  ? exc_general_protection+0x17c/0x400
[  +0.004707]  ? asm_exc_general_protection+0x26/0x30
[  +0.004879]  ? __ice_update_sample+0x39/0xe0 [ice]
[  +0.004835]  ice_napi_poll+0x665/0x680 [ice]
[  +0.004320]  __napi_poll+0x28/0x190
[  +0.003500]  net_rx_action+0x198/0x360
[  +0.003752]  ? update_rq_clock+0x39/0x220
[  +0.004013]  handle_softirqs+0xf1/0x340
[  +0.003840]  ? sched_clock_cpu+0xf/0x1f0
[  +0.003925]  __irq_exit_rcu+0xc2/0xe0
[  +0.003665]  common_interrupt+0x85/0xa0
[  +0.003839]  </IRQ>
[  +0.002098]  <TASK>
[  +0.002106]  asm_common_interrupt+0x26/0x40
[  +0.004184] RIP: 0010:cpuidle_enter_state+0xd3/0x690

Fix this by performing the missing unmapping of XDP queues from
q_vectors and setting the XDP rings pointer back to NULL after all those
queues are released.
Also, add an immediate exit from the XDP callback in case of ring
preparation failure.

Fixes: efc2214b60 ("ice: Add support for XDP")
Reviewed-by: Dawid Osuchowski <dawid.osuchowski@linux.intel.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Michal Kubiak <michal.kubiak@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Jesse Brandeburg <jbrandeburg@cloudflare.com>
Tested-by: Saritha Sanigani <sarithax.sanigani@intel.com> (A Contingent Worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2025-05-30 13:54:17 -07:00
..
accel drm for 6.16-rc1 2025-05-28 09:46:39 -07:00
accessibility
acpi arm64 updates for 6.16 2025-05-28 14:55:35 -07:00
amba
android vfs-6.16-rc1.async.dir 2025-05-26 08:02:43 -07:00
ata
atm
auxdisplay
base Power management updates for 6.16-rc1 2025-05-27 16:48:47 -07:00
bcma
block for-6.16/block-20250523 2025-05-26 11:39:36 -07:00
bluetooth Bluetooth: btintel: Check dsbr size from EFI variable 2025-05-22 13:06:28 -04:00
bus bus: moxtet: Switch to irq_domain_create_simple() 2025-05-16 21:06:08 +02:00
cache
cdrom
cdx
char drm for 6.16-rc1 2025-05-28 09:46:39 -07:00
clk Allwinner clk fixes for 6.15 2025-05-17 20:46:38 -07:00
clocksource Updates for clocksource/clockevent drivers: 2025-05-27 09:01:26 -07:00
comedi
connector
counter
cpufreq Power management updates for 6.16-rc1 2025-05-27 16:48:47 -07:00
cpuidle Power management updates for 6.16-rc1 2025-05-27 16:48:47 -07:00
crypto Core x86 updates for v6.16: 2025-05-26 16:04:17 -07:00
cxl
dax
dca
devfreq
dio
dma Linux 6.15-rc7 2025-05-21 08:45:03 +02:00
dma-buf bpf-next-6.16 2025-05-28 15:52:42 -07:00
dpll
edac - ie31200: Add support for Raptor Lake-S and Alder Lake-S compute dies 2025-05-27 10:13:06 -07:00
eisa
extcon
firewire
firmware arm64 updates for 6.16 2025-05-28 14:55:35 -07:00
fpga
fsi
fwctl
gnss
gpio gpio updates for v6.16-rc1 2025-05-27 15:22:01 -07:00
gpu drm for 6.16-rc1 2025-05-28 09:46:39 -07:00
greybus
hid
hsi
hte
hv
hwmon
hwspinlock
hwtracing
i2c A set of cleanups for the generic interrupt subsystem: 2025-05-27 08:07:32 -07:00
i3c
idle Power management updates for 6.16-rc1 2025-05-27 16:48:47 -07:00
iio A set of cleanups for the generic interrupt subsystem: 2025-05-27 08:07:32 -07:00
infiniband Networking changes for 6.16. 2025-05-28 15:24:36 -07:00
input Input updates for v6.15-rc7 2025-05-24 18:54:18 -07:00
interconnect
iommu dma-mapping updates for Linux 6.16: 2025-05-27 20:09:06 -07:00
ipack
irqchip Another set of timer API cleanups: 2025-05-27 08:31:21 -07:00
isdn
leds
macintosh
mailbox mailbox: qcom-ipcc: Switch to irq_domain_create_tree() 2025-05-16 21:06:09 +02:00
mcb
md hardening updates for v6.16-rc1 2025-05-28 07:47:10 -07:00
media [GIT PULL for v6.16] media updates 2025-05-28 09:17:20 -07:00
memory spi: Updates for v6.16 2025-05-27 15:53:55 -07:00
memstick
message
mfd gpio updates for v6.16-rc1 2025-05-27 15:22:01 -07:00
misc hardening updates for v6.16-rc1 2025-05-28 07:47:10 -07:00
mmc mmc: Merge branch fixes into next 2025-05-19 14:26:54 +02:00
most
mtd
mux
net ice: fix Tx scheduler error handling in XDP callback 2025-05-30 13:54:17 -07:00
nfc nfc: Correct Samsung "Electronics" spelling in copyright headers 2025-05-21 20:31:18 -07:00
ntb
nubus
nvdimm
nvme Networking changes for 6.16. 2025-05-28 15:24:36 -07:00
nvmem gpio updates for v6.16-rc1 2025-05-27 15:22:01 -07:00
of
opp OPP: switch to use kmemdup_array() 2025-05-19 15:37:53 +05:30
parisc
parport
pci dma-mapping updates for Linux 6.16: 2025-05-27 20:09:06 -07:00
pcmcia
peci
perf arm64 updates for 6.16 2025-05-28 14:55:35 -07:00
phy
pinctrl ACPI updates for 6.16-rc1 2025-05-27 16:32:30 -07:00
platform drm for 6.16-rc1 2025-05-28 09:46:39 -07:00
pmdomain pmdomain: ti: Fix STANDBY handling of PER power domain 2025-05-19 16:11:05 +02:00
pnp
power
powercap
pps
ps3
ptp Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-05-22 09:42:41 -07:00
pwm pwm: adp5585: make sure to include mod_devicetable.h 2025-05-19 18:07:39 +02:00
rapidio
ras
regulator regulator: Updates for v6.16 2025-05-27 15:49:58 -07:00
remoteproc
reset
rpmsg
rtc
s390 Networking changes for 6.16. 2025-05-28 15:24:36 -07:00
sbus
scsi hardening updates for v6.16-rc1 2025-05-28 07:47:10 -07:00
sh sh: Switch to irq_domain_create_*() 2025-05-16 21:06:11 +02:00
siox
slimbus
soc pwm: Changes for v6.16-rc1 2025-05-27 15:01:47 -07:00
soundwire soundwire fix for 6.15 2025-05-17 12:04:19 -07:00
spi spi: Updates for v6.16 2025-05-27 15:53:55 -07:00
spmi
ssb
staging [GIT PULL for v6.16] media updates 2025-05-28 09:17:20 -07:00
target net: core: Convert inet_addr_is_any() to sockaddr_storage 2025-05-27 08:25:42 +02:00
tc
tee
thermal Thermal control updates for 6.16-rc1 2025-05-27 16:28:02 -07:00
thunderbolt
tty
ufs Updates for the MSI subsystem (core code and PCI): 2025-05-27 08:15:26 -07:00
uio
usb Power management updates for 6.16-rc1 2025-05-27 16:48:47 -07:00
vdpa
vfio
vhost
video drm for 6.16-rc1 2025-05-28 09:46:39 -07:00
virt
virtio
w1
watchdog hardening updates for v6.16-rc1 2025-05-28 07:47:10 -07:00
xen xen/x86: fix initial memory balloon target 2025-05-23 07:09:00 +02:00
zorro
Kconfig
Makefile