linux-yocto/drivers
Jason Xing 6a471e5957 ixgbe: xsk: resolve the negative overflow of budget in ixgbe_xmit_zc
[ Upstream commit 4d4d9ef9dfee877d494e5418f68a1016ef08cad6 ]

Resolve the budget negative overflow which leads to returning true in
ixgbe_xmit_zc even when the budget of descs are thoroughly consumed.

Before this patch, when the budget is decreased to zero and finishes
sending the last allowed desc in ixgbe_xmit_zc, it will always turn back
and enter into the while() statement to see if it should keep processing
packets, but in the meantime it unexpectedly decreases the value again to
'unsigned int (0--)', namely, UINT_MAX. Finally, the ixgbe_xmit_zc returns
true, showing 'we complete cleaning the budget'. That also means
'clean_complete = true' in ixgbe_poll.

The true theory behind this is if that budget number of descs are consumed,
it implies that we might have more descs to be done. So we should return
false in ixgbe_xmit_zc to tell napi poll to find another chance to start
polling to handle the rest of descs. On the contrary, returning true here
means job done and we know we finish all the possible descs this time and
we don't intend to start a new napi poll.

It is apparently against our expectations. Please also see how
ixgbe_clean_tx_irq() handles the problem: it uses do..while() statement
to make sure the budget can be decreased to zero at most and the negative
overflow never happens.

The patch adds 'likely' because we rarely would not hit the loop condition
since the standard budget is 256.

Fixes: 8221c5eba8 ("ixgbe: add AF_XDP zero-copy Tx support")
Signed-off-by: Jason Xing <kernelxing@tencent.com>
Reviewed-by: Larysa Zaremba <larysa.zaremba@intel.com>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Priya Singh <priyax.singh@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Link: https://patch.msgid.link/20250819222000.3504873-4-anthony.l.nguyen@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-08-28 16:22:59 +02:00
..
accessibility
acpi ACPI: processor: idle: Check acpi_fetch_acpi_dev() return value 2025-08-28 16:22:56 +02:00
amba
android
ata ata: Fix SATA_MOBILE_LPM_POLICY description in Kconfig 2025-08-28 16:22:56 +02:00
atm atm: idt77252: Add missing dma_map_error() 2025-07-17 18:27:59 +02:00
auxdisplay
base pmdomain: governor: Consider CPU latency tolerance from pm_domain_cpu_gov 2025-08-28 16:22:53 +02:00
bcma
block drbd: add missing kref_get in handle_write_conflicts 2025-08-28 16:22:39 +02:00
bluetooth Bluetooth: btrtl: Prevent potential NULL dereference 2025-05-02 07:40:59 +02:00
bus bus: mhi: host: Fix endianness of BHI vector table 2025-08-28 16:22:49 +02:00
cdrom
char ipmi: Fix strcpy source and destination the same 2025-08-28 16:22:47 +02:00
clk clk: sunxi-ng: v3s: Fix de clock definition 2025-08-28 16:22:34 +02:00
clocksource clocksource: mips-gic-timer: Enable counter when CPUs start 2025-06-04 14:37:03 +02:00
connector
counter counter: microchip-tcb-capture: Fix undefined counter channel state on probe 2025-04-10 14:30:54 +02:00
cpufreq cpufreq: armada-8k: Fix off by one in armada_8k_cpufreq_free_table() 2025-08-28 16:22:48 +02:00
cpuidle cpuidle: governors: menu: Avoid using invalid recent intervals data 2025-08-28 16:22:39 +02:00
crypto crypto: qat - fix seq_file position update in adf_ring_next() 2025-08-28 16:22:35 +02:00
dax
dca
devfreq PM / devfreq: governor: Replace sscanf() with kstrtoul() in set_freq_store() 2025-08-28 16:22:40 +02:00
dio
dma dmaengine: nbpfaxi: Add missing check after DMA map 2025-08-28 16:22:35 +02:00
dma-buf dma-buf: insert memory barrier before updating num_fences 2025-08-28 16:22:55 +02:00
edac EDAC/altera: Use correct write width with the INTTEST register 2025-06-27 11:04:13 +01:00
eisa
extcon
firewire
firmware firmware: SDEI: Allow sdei initialization without ACPI_APEI_GHES 2025-06-27 11:04:02 +01:00
fpga fpga: zynq_fpga: Fix the wrong usage of dma_map_sgtable() 2025-08-28 16:22:52 +02:00
fsi
gnss
gpio gpio: rcar: Use raw_spinlock to protect register access 2025-08-28 16:22:58 +02:00
gpu drm/dp: Change AUX DPCD probe address from DPCD_REV to LANE0_1_STATUS 2025-08-28 16:22:57 +02:00
greybus
hid HID: core: do not bypass hid_hw_raw_request 2025-08-28 16:22:27 +02:00
hsi HSI: ssi_protocol: Fix use after free vulnerability in ssi_protocol Driver Due to Race Condition 2025-05-02 07:40:58 +02:00
hv Drivers: hv: vmbus: Add utility function for querying ring size 2025-07-17 18:27:40 +02:00
hwmon hwmon: (gsc-hwmon) fix fan pwm setpoint show functions 2025-08-28 16:22:50 +02:00
hwspinlock
hwtracing coresight: catu: Fix number of pages while using 64k pages 2025-04-10 14:30:58 +02:00
i2c i2c: Force DLL0945 touchpad i2c freq to 100khz 2025-08-28 16:22:46 +02:00
i3c i3c: don't fail if GETHDRCAP is unsupported 2025-08-28 16:22:46 +02:00
ide
idle intel_idle: Allow loading ACPI tables for any family 2025-08-28 16:22:39 +02:00
iio iio: light: as73211: Ensure buffer holes are zeroed 2025-08-28 16:22:58 +02:00
infiniband RDMA/bnxt_re: Fix to initialize the PBL array 2025-08-28 16:22:58 +02:00
input Input: xpad - set correct controller type for Acer NGR200 2025-08-28 16:22:27 +02:00
interconnect
iommu iommu/amd: Avoid stack buffer overflow from kernel cmdline 2025-08-28 16:22:59 +02:00
ipack
irqchip irqchip/gic-v2m: Prevent use after free of gicv2m_get_fwnode() 2025-06-04 14:36:53 +02:00
isdn
leds leds: leds-lp50xx: Handle reg to get correct multi_index 2025-08-28 16:22:45 +02:00
lightnvm
macintosh
mailbox mailbox: Not protect module_put with spin_lock_irqsave 2025-07-17 18:27:36 +02:00
mcb mcb: fix a double free bug in chameleon_parse_gdd() 2025-05-02 07:41:16 +02:00
md dm rq: don't queue request to blk-mq during DM suspend 2025-08-28 16:22:58 +02:00
media media: venus: vdec: Clamp param smaller than 1fps and bigger than 240. 2025-08-28 16:22:57 +02:00
memory
memstick memstick: Fix deadlock by moving removing flag earlier 2025-08-28 16:22:51 +02:00
message
mfd mfd: max14577: Fix wakeup source leaks on device unbind 2025-07-17 18:27:36 +02:00
misc misc: rtsx: usb: Ensure mmc child device is active when card is present 2025-08-28 16:22:48 +02:00
mmc mmc: sdhci-pci-gli: GL9763e: Rename the gli_set_gl9763e() for consistency 2025-08-28 16:22:51 +02:00
most most: core: Drop device reference after usage in get_channel() 2025-08-28 16:22:52 +02:00
mtd mtd: rawnand: fsmc: Add missing check after DMA map 2025-08-28 16:22:50 +02:00
mux
net ixgbe: xsk: resolve the negative overflow of budget in ixgbe_xmit_zc 2025-08-28 16:22:59 +02:00
nfc
ntb ntb: reduce stack usage in idt_scan_mws 2025-05-02 07:41:19 +02:00
nubus
nvdimm libnvdimm/labels: Fix divide error in nd_label_data_init() 2025-06-04 14:36:59 +02:00
nvme nvmet-tcp: don't restore null sk_state_change 2025-06-04 14:37:06 +02:00
nvmem nvmem: core: improve range check for nvmem_cell_write() 2025-03-13 12:47:12 +01:00
of of: module: add buffer overflow check in of_modalias() 2025-06-04 14:36:52 +02:00
opp
oprofile
parisc
parport parport_pc: add support for ASIX AX99100 2025-03-13 12:47:23 +01:00
pci PCI/ACPI: Fix runtime PM ref imbalance on Hot-Plug Capable ports 2025-08-28 16:22:54 +02:00
pcmcia
perf perf/arm-cmn: Initialise cmn->cpu earlier 2025-06-04 14:37:09 +02:00
phy phy: tegra: xusb: Fix unbalanced regulator disable in UTMI PHY mode 2025-08-28 16:22:26 +02:00
pinctrl pinctrl: stm32: Manage irq affinity settings 2025-08-28 16:22:45 +02:00
platform platform/chrome: cros_ec: Unregister notifier in cros_ec_unregister() 2025-08-28 16:22:56 +02:00
pnp
power power: supply: max14577: Handle NULL pdata when CONFIG_OF is not set 2025-08-28 16:22:34 +02:00
powercap powercap: call put_device() on an error path in powercap_register_control_type() 2025-04-10 14:30:49 +02:00
pps pps: fix poll support 2025-08-28 16:22:31 +02:00
ps3
ptp ptp: Fix possible memory leak in ptp_clock_register() 2025-08-28 16:22:54 +02:00
pwm pwm: mediatek: Fix duty and period setting 2025-08-28 16:22:56 +02:00
rapidio drivers/rapidio/rio_cm.c: prevent possible heap overwrite 2025-06-27 11:04:20 +01:00
ras
regulator regulator: core: fix NULL dereference on unbind due to stale coupling data 2025-08-28 16:22:29 +02:00
remoteproc remoteproc: qcom_q6v5_pas: Make single-PD handling more robust 2025-04-10 14:30:57 +02:00
reset reset: brcmstb: Enable reset drivers for ARCH_BCM2835 2025-08-28 16:22:41 +02:00
rpmsg rpmsg: qcom_smd: Fix uninitialized return variable in __qcom_smd_send() 2025-06-27 11:04:05 +01:00
rtc rtc: ds1307: remove clear of oscillator stop flag (OSF) in probe 2025-08-28 16:22:47 +02:00
s390 scsi: s390: zfcp: Ensure synchronous unit_add 2025-06-27 11:04:20 +01:00
sbus
scsi scsi: qla4xxx: Prevent a potential error pointer dereference 2025-08-28 16:22:58 +02:00
sfi
sh
siox
slimbus slimbus: messaging: Free transaction ID in delayed interrupt scenario 2025-03-13 12:47:42 +01:00
soc soc: qcom: mdt_loader: Ensure we don't read past the ELF header 2025-08-28 16:22:56 +02:00
soundwire soundwire: stream: restore params when prepare ports fail 2025-08-28 16:22:34 +02:00
spi spi: spi-fsl-dspi: Clear completion counter before initiating transfer 2025-07-17 18:27:46 +02:00
spmi
ssb
staging comedi: Fail COMEDI_INSNLIST ioctl if n_insns is too large 2025-08-28 16:22:54 +02:00
target scsi: target: Fix NULL pointer dereference in core_scsi3_decode_spec_i_port() 2025-07-17 18:27:48 +02:00
tc
tee tee: Prevent size calculation wraparound on 32-bit kernels 2025-06-27 11:04:19 +01:00
thermal thermal: sysfs: Return ENODATA instead of EAGAIN for reads 2025-08-28 16:22:41 +02:00
thunderbolt thunderbolt: Fix copy+paste error in match_service_id() 2025-08-28 16:22:48 +02:00
tty vt: defkeymap: Map keycodes above 127 to K_HOLE 2025-08-28 16:22:49 +02:00
uio uio_hv_generic: Fix another memory leak in error handling paths 2025-08-28 16:22:57 +02:00
usb usb: xhci: Fix slot_id resource race conflict 2025-08-28 16:22:58 +02:00
vdpa vdpa/mlx5: Fix oversized null mkey longer than 32bit 2025-05-02 07:40:55 +02:00
vfio vfio/type1: Fix error unwind in migration dirty bitmap allocation 2025-06-27 11:04:04 +01:00
vhost vhost: fail early when __vhost_add_used() fails 2025-08-28 16:22:44 +02:00
video Revert "vgacon: Add check for vc_origin address range in vgacon_scroll()" 2025-08-28 16:22:49 +02:00
virt
virtio
visorbus
vlynq
vme
w1
watchdog watchdog: dw_wdt: Fix default timeout 2025-08-28 16:22:44 +02:00
xen xen/gntdev: remove struct gntdev_copy_batch from stack 2025-08-28 16:22:33 +02:00
zorro
Kconfig
Makefile