linux/drivers
Bartosz Staszewski 86664b8652 i40e: Fix the inability to attach XDP program on downed interface
[ Upstream commit 0c87b545a2 ]

Whenever trying to load XDP prog on downed interface, function i40e_xdp
was passing vsi->rx_buf_len field to i40e_xdp_setup() which was equal 0.
i40e_open() calls i40e_vsi_configure_rx() which configures that field,
but that only happens when interface is up. When it is down, i40e_open()
is not being called, thus vsi->rx_buf_len is not set.

Solution for this is calculate buffer length in newly created
function - i40e_calculate_vsi_rx_buf_len() that return actual buffer
length. Buffer length is being calculated based on the same rules
applied previously in i40e_vsi_configure_rx() function.

Fixes: 613142b0bb ("i40e: Log error for oversized MTU on device")
Fixes: 0c8493d90b ("i40e: add XDP support for pass and drop actions")
Signed-off-by: Bartosz Staszewski <bartoszx.staszewski@intel.com>
Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
Tested-by: Shwetha Nagaraju <Shwetha.nagaraju@intel.com>
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Reviewed-by: Saeed Mahameed <saeed@kernel.com>
Link: https://lore.kernel.org/r/20221209185411.2519898-1-anthony.l.nguyen@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2022-12-31 13:14:21 +01:00
..
accessibility speakup: fix a segfault caused by switching consoles 2022-11-26 09:24:44 +01:00
acpi ACPICA: Fix use-after-free in acpi_ut_copy_ipackage_to_ipackage() 2022-12-31 13:14:04 +01:00
amba ARM: 9120/1: Revert "amba: make use of -1 IRQs warn" 2021-11-06 14:13:31 +01:00
android binder: validate alloc->mm in ->mmap() handler 2022-12-02 17:41:00 +01:00
ata ata: libata: fix NCQ autosense logic 2022-12-31 13:14:06 +01:00
atm atm: idt77252: fix use-after-free bugs caused by tst_timer 2022-08-25 11:40:15 +02:00
auxdisplay auxdisplay: lcd2s: Use proper API to free the instance of charlcd object 2022-03-08 19:12:47 +01:00
base PM: runtime: Do not call __rpm_callback() from rpm_idle() 2022-12-31 13:14:04 +01:00
bcma Driver core update for 5.15-rc1 2021-09-01 08:44:42 -07:00
block drbd: destroy workqueue when drbd device was freed 2022-12-31 13:14:12 +01:00
bluetooth Bluetooth: hci_bcsp: don't call kfree_skb() under spin_lock_irqsave() 2022-12-31 13:14:20 +01:00
bus bus: ixp4xx: Don't touch bit 7 on IXP42x 2022-12-02 17:41:08 +01:00
cdrom scsi: sr: cdrom: Move cdrom_read_cdda_bpc() into the sr driver 2021-07-30 22:13:09 -04:00
char ipmi: kcs: Poll OBF briefly to reduce OBE latency 2022-12-31 13:14:06 +01:00
clk clk: socfpga: Fix memory leak in socfpga_gate_init() 2022-12-31 13:14:18 +01:00
clocksource clocksource/drivers/timer-ti-dm: Fix missing clk_disable_unprepare in dmtimer_systimer_init_clock() 2022-12-31 13:14:04 +01:00
comedi comedi: vmk80xx: fix expression for tx buffer size 2022-06-22 14:22:03 +02:00
connector net/connector: Add const qualifier to cb_id 2020-12-16 11:06:49 -08:00
counter counter: microchip-tcb-capture: Handle Signal1 read and Synapse 2022-11-03 23:59:13 +09:00
cpufreq cpufreq: amd_freq_sensitivity: Add missing pci_dev_put() 2022-12-31 13:14:03 +01:00
cpuidle cpuidle: dt: Return the correct numbers of parsed idle states 2022-12-31 13:14:01 +01:00
crypto crypto: cavium - prevent integer overflow loading firmware 2022-10-26 12:35:28 +02:00
cxl cxl/port: Hold port reference until decoder release 2022-07-12 16:34:58 +02:00
dax devdax: Fix soft-reservation memory description 2022-09-28 11:11:57 +02:00
dca dca: Use PTR_ERR_OR_ZERO() to simplify code 2020-05-15 16:25:20 +02:00
devfreq PM / devfreq: exynos-ppmu: Fix refcount leak in of_get_devfreq_events 2022-07-07 17:53:27 +02:00
dio dio: return -ENOMEM when kzalloc() fails 2021-07-21 15:53:24 +02:00
dma dmaengine: at_hdmac: Check return code of dma_async_device_register 2022-11-16 09:58:30 +01:00
dma-buf dma-buf: fix racing conflict of dma_heap_add() 2022-12-02 17:41:06 +01:00
edac EDAC/i10nm: fix refcount leak in pci_get_dev_wrapper() 2022-12-31 13:14:03 +01:00
eisa EISA: use DEVICE_ATTR_RO() helper macro 2021-06-04 15:28:34 +02:00
extcon extcon: Modify extcon device to be created after driver data is set 2022-06-14 18:36:22 +02:00
firewire firewire: core: extend card->lock in fw_core_handle_bus_reset 2022-05-12 12:30:05 +02:00
firmware firmware: coreboot: Register bus in module init 2022-11-26 09:24:48 +01:00
fpga fpga: prevent integer overflow in dfl_feature_ioctl_set_irq() 2022-10-26 12:35:07 +02:00
fsi fsi: core: Check error number after calling ida_simple_get 2022-10-26 12:35:17 +02:00
gnss treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
gpio gpio/rockchip: fix refcount leak in rockchip_gpiolib_register() 2022-12-14 11:37:27 +01:00
gpu drm/amdkfd: Fix memory leakage 2022-12-31 13:14:14 +01:00
greybus greybus: svc: fix an error handling bug in gb_svc_hello() 2022-04-08 14:22:50 +02:00
hid HID: hid-sensor-custom: set fixed size for custom attributes 2022-12-31 13:14:11 +01:00
hsi HSI: omap_ssi_port: Fix dma_map_sg error check 2022-10-26 12:35:05 +02:00
hv Drivers: hv: vmbus: fix possible memory leak in vmbus_device_register() 2022-12-02 17:41:05 +01:00
hwmon hwmon: (jc42) Restore the min/max/critical temperatures on resume 2022-12-31 13:14:15 +01:00
hwspinlock hwspinlock: qcom: correct MMIO max register for newer SoCs 2022-11-16 09:58:13 +01:00
hwtracing coresight: cti: Fix hang in cti_disable_hw() 2022-11-03 23:59:13 +09:00
i2c i2c: imx: Only DMA messages with I2C_M_DMA_SAFE flag set 2022-12-08 11:28:45 +01:00
i3c i3c: master: dw: check return of dw_i3c_master_get_free_pos() 2022-03-08 19:12:37 +01:00
idle intel_idle: Disable IBRS during long idle 2022-07-23 12:54:04 +02:00
iio iio: light: rpr0521: add missing Kconfig dependencies 2022-12-08 11:28:38 +01:00
infiniband RDMA/efa: Add EFA 0xefa2 PCI ID 2022-11-26 09:24:31 +01:00
input Input: wistron_btns - disable on UML 2022-12-31 13:14:14 +01:00
interconnect interconnect: imx: fix max_node_id 2022-08-17 14:23:53 +02:00
iommu iommu/vt-d: Fix PCI device refcount leak in dmar_dev_scope_init() 2022-12-08 11:28:44 +01:00
ipack ipack: ipoctal: fix module reference leak 2021-09-27 17:38:49 +02:00
irqchip irqchip/wpcm450: Fix memory leak in wpcm450_aic_of_init() 2022-12-31 13:14:03 +01:00
isdn mISDN: fix misuse of put_device() in mISDN_register_device() 2022-11-26 09:24:39 +01:00
leds leds: lm3601x: Don't use mutex after it was destroyed 2022-10-26 12:34:39 +02:00
macintosh macintosh/adb: fix oob read in do_adb_query() function 2022-08-11 13:07:54 +02:00
mailbox mailbox: bcm-ferxrm-mailbox: Fix error check for dma_map_sg 2022-10-26 12:35:21 +02:00
mcb mcb: fix error handling in mcb_alloc_bus() 2021-09-14 11:22:26 +02:00
md dm integrity: clear the journal on suspend 2022-12-02 17:41:11 +01:00
media media: coda: Add check for kmalloc 2022-12-31 13:14:18 +01:00
memory memory: of: Fix refcount leak bug in of_lpddr3_get_ddr_timings() 2022-10-26 12:34:58 +02:00
memstick memstick/ms_block: Add check for alloc_ordered_workqueue 2022-12-31 13:14:17 +01:00
message scsi: message: mptfc: Switch from pci_ to dma_ API 2021-06-22 23:00:01 -04:00
mfd mtd: spi-nor: intel-spi: Disable write protection only if asked 2022-11-26 09:24:32 +01:00
misc misc/vmw_vmci: fix an infoleak in vmci_host_do_receive_datagram() 2022-11-26 09:24:48 +01:00
mmc mmc: core: Normalize the error handling branch in sd_read_ext_regs() 2022-12-31 13:14:17 +01:00
most most: fix control-message timeouts 2021-11-18 19:16:08 +01:00
mtd mtd: maps: pxa2xx-flash: fix memory leak in probe 2022-12-31 13:14:12 +01:00
mux mux: gpio: Simplify code by using dev_err_probe() 2021-04-02 16:28:53 +02:00
net i40e: Fix the inability to attach XDP program on downed interface 2022-12-31 13:14:21 +01:00
nfc nfc: st-nci: fix incorrect sizing calculations in EVT_TRANSACTION 2022-12-02 17:41:07 +01:00
ntb NTB: ntb_tool: uninitialized heap data in tool_fn_write() 2022-08-25 11:40:14 +02:00
nubus nubus: Simplify check in remove callback 2021-08-05 14:37:03 +02:00
nvdimm nvdimm: Fix badblocks clear off-by-one error 2022-07-07 17:53:24 +02:00
nvme nvme: return err on nvme_init_non_mdts_limits fail 2022-12-31 13:14:10 +01:00
nvmem nvmem: rmem: Fix return value check in rmem_read() 2022-12-08 11:28:39 +01:00
of of: overlay: fix null pointer dereferencing in find_dup_cset_node_entry() and find_dup_cset_prop() 2022-12-31 13:14:19 +01:00
opp opp: Fix error check in dev_pm_opp_attach_genpd() 2022-08-17 14:24:01 +02:00
parisc parisc: Export iosapic_serial_irq() symbol for serial port driver 2022-11-10 18:15:40 +01:00
parport parport_pc: Avoid FIFO port location truncation 2022-11-26 09:24:36 +01:00
pci PCI: Sanitise firmware BAR assignments behind a PCI-PCI bridge 2022-10-26 12:34:24 +02:00
pcmcia pcmcia: db1xxx_ss: restrict to MIPS_DB1XXX boards 2022-06-14 18:36:02 +02:00
perf perf/smmuv3: Fix hotplug callback leak in arm_smmu_pmu_init() 2022-12-31 13:13:58 +01:00
phy phy: ralink: mt7621-pci: add sentinel to quirks table 2022-11-16 09:58:17 +01:00
pinctrl pinctrl: pinconf-generic: add missing of_node_put() 2022-12-31 13:14:12 +01:00
platform platform/mellanox: mlxbf-pmc: Fix event typo 2022-12-31 13:14:05 +01:00
pnp PNP: fix name memory leak in pnp_alloc_dev() 2022-12-31 13:14:02 +01:00
power power: supply: adp5061: fix out-of-bounds read in adp5061_get_chg_type() 2022-10-26 12:35:47 +02:00
powercap powercap: intel_rapl: fix UBSAN shift-out-of-bounds issue 2022-10-26 12:35:30 +02:00
pps pps: clients: gpio: Propagate return value from pps_gpio_probe 2022-04-08 14:23:44 +02:00
ps3 powerpc/ps3: Warn on PS3 device errors 2021-06-10 21:44:58 +10:00
ptp ptp: replace snprintf with sysfs_emit 2022-04-13 20:59:01 +02:00
pwm pwm: lpc18xx: Fix period handling 2022-08-17 14:23:16 +02:00
rapidio rapidio: devices: fix missing put_device in mport_cdev_open 2022-12-31 13:14:05 +01:00
ras RAS/CEC: Correct ce_add_elem()'s returned values 2021-04-07 11:52:26 +02:00
regulator regulator: qcom-labibb: Fix missing of_node_put() in qcom_labibb_regulator_probe() 2022-12-31 13:14:17 +01:00
remoteproc remoteproc: sysmon: Wait for SSCTL service to come up 2022-08-17 14:24:09 +02:00
reset reset: imx7: Fix the iMX8MP PCIe PHY PERST support 2022-10-05 10:39:40 +02:00
rpmsg rpmsg: qcom: glink: replace strncpy() with strscpy_pad() 2022-10-12 09:53:28 +02:00
rtc rtc: cmos: avoid UIP when reading alarm time 2022-12-14 11:37:18 +01:00
s390 s390/qeth: fix use-after-free in hsci 2022-12-14 11:37:30 +01:00
sbus module: remove never implemented MODULE_SUPPORTED_DEVICE 2021-03-17 13:16:18 -07:00
scsi scsi: iscsi: Fix possible memory leak when device_register() failed 2022-12-02 17:41:11 +01:00
sh maple: fix wrong return value of maple_bus_init(). 2021-11-25 09:48:31 +01:00
siox siox: fix possible memory leak in siox_device_add() 2022-11-26 09:24:36 +01:00
slimbus slimbus: stream: correct presence rate frequencies 2022-11-26 09:24:44 +01:00
soc soc: ti: smartreflex: Fix PM disable depth imbalance in omap_sr_probe 2022-12-31 13:13:58 +01:00
soundwire soundwire: intel: Initialize clock stop timeout 2022-12-14 11:37:19 +01:00
spi spi: spi-gpio: Don't set MOSI as an input if not 3WIRE mode 2022-12-31 13:14:18 +01:00
spmi spmi: pmic-arb: correct duplicate APID to PPID mapping logic 2022-10-26 12:35:19 +02:00
ssb bus: Make remove callback return void 2021-07-21 11:53:42 +02:00
staging media: meson: vdec: fix possible refcount leak in vdec_probe() 2022-11-10 18:15:34 +01:00
target scsi: target: tcm_loop: Fix possible name leak in tcm_loop_setup_hba_bus() 2022-11-26 09:24:49 +01:00
tc The main MIPS changes for 5.6: 2020-01-31 11:28:31 -08:00
tee tee: optee: fix possible memory leak in optee_register_device() 2022-12-02 17:41:03 +01:00
thermal thermal: core: fix some possible name leaks in error paths 2022-12-31 13:14:02 +01:00
thunderbolt thunderbolt: Add DP OUT resource when DP tunnel is discovered 2022-11-16 09:58:13 +01:00
tty serial: stm32: Deassert Transmit Enable on ->rs485_config() 2022-12-08 11:28:45 +01:00
uio uio: Remove leading spaces in Kconfig 2021-05-21 14:52:37 +02:00
usb usb: musb: remove extra check in musb_gadget_vbus_draw 2022-12-31 13:13:56 +01:00
vdpa vdpa/ifcvf: fix the calculation of queuepair 2022-10-05 10:39:43 +02:00
vfio vfio/type1: Unpin zero pages 2022-09-15 11:30:02 +02:00
vhost vhost/vsock: Use kvmalloc/kvfree for larger packets. 2022-10-26 12:34:47 +02:00
video fbcon: Use kzalloc() in fbcon_prepare_logo() 2022-12-14 11:37:17 +01:00
virt vboxguest: Do not use devm for irq 2022-08-25 11:40:33 +02:00
virtio virtio_mmio: Restore guest page size on resume 2022-07-21 21:24:33 +02:00
visorbus visorbus: fix error return code in visorchipset_init() 2021-06-04 15:27:26 +02:00
vlynq bus: Make remove callback return void 2021-07-21 11:53:42 +02:00
vme bus: Make remove callback return void 2021-07-21 11:53:42 +02:00
w1 w1: w1_therm: fixes w1_seq for ds28ea00 sensors 2022-04-13 20:59:11 +02:00
watchdog watchdog: armada_37xx_wdt: check the return value of devm_ioremap() in armada_37xx_wdt_probe() 2022-08-17 14:24:11 +02:00
xen xen/privcmd: Fix a possible warning in privcmd_ioctl_mmap_resource() 2022-12-31 13:14:04 +01:00
zorro zorro: Drop useless (and hardly used) .driver member in struct zorro_dev 2021-08-05 14:37:04 +02:00
Kconfig firmware: include drivers/firmware/Kconfig unconditionally 2021-10-07 16:51:26 +02:00
Makefile virtio: always enter drivers/virtio/ 2021-12-22 09:32:39 +01:00