mirror-linux/drivers/net
Bartosz Staszewski 06b81b4e66 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>
2022-12-31 13:32:29 +01:00
..
appletalk
arcnet arcnet: fix potential memory leak in com20020_probe() 2022-11-23 12:41:54 +00:00
bonding bonding: uninitialized variable in bond_miimon_inspect() 2022-12-31 13:32:20 +01:00
caif
can can: tcan4x5x: Fix use of register error status mask 2022-12-31 13:32:27 +01:00
dsa net: lan9303: Fix read error execution path 2022-12-31 13:32:28 +01:00
ethernet i40e: Fix the inability to attach XDP program on downed interface 2022-12-31 13:32:29 +01:00
fddi net: defxx: Fix missing err handling in dfx_init() 2022-12-31 13:32:26 +01:00
fjes net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
hamradio hamradio: don't call dev_kfree_skb() under spin_lock_irqsave() 2022-12-31 13:32:27 +01:00
hippi
hyperv net: hv_netvsc: Fix a warning triggered by memcpy in rndis_filter 2022-10-15 11:09:53 +01:00
ieee802154 ca8210: Fix crash by zero initializing data 2022-11-29 14:56:05 +01:00
ipa net: ipa: don't configure IDLE_INDICATION on v3.1 2022-10-25 19:49:13 -07:00
ipvlan ipvlan: hold lower dev to avoid possible use-after-free 2022-11-18 10:39:22 +00:00
mctp mctp i2c: don't count unused / invalid keys for flow release 2022-11-11 20:13:27 -08:00
mdio net: mdio: fix unbalanced fwnode reference count in mdio_device_release() 2022-12-06 12:50:00 +01:00
netdevsim netdevsim: Fix memory leak of nsim_dev->fa_cookie 2022-11-16 12:20:57 -08:00
pcs
phy net: phy: mxl-gpy: add MDINT workaround 2022-12-07 20:04:11 -08:00
plip net: plip: don't call kfree_skb/dev_kfree_skb() under spin_lock_irq() 2022-12-07 20:10:47 -08:00
ppp
pse-pd net: pse-pd: PSE_REGULATOR should depend on REGULATOR 2022-10-05 20:32:28 -07:00
slip
team
usb net/cdc_ncm: Fix multicast RX support for CDC NCM devices with ZLP 2022-11-23 13:46:42 +00:00
vmxnet3 vmxnet3: use correct intrConf reference when using extended queues 2022-12-02 10:30:07 +00:00
vxlan
wan net: farsync: Fix kmemleak when rmmods farsync 2022-12-31 13:32:26 +01:00
wireguard treewide: use get_random_bytes() when possible 2022-10-11 17:42:58 -06:00
wireless wifi: brcmfmac: Fix error return code in brcmf_sdio_download_firmware() 2022-12-31 13:32:25 +01:00
wwan net: wwan: iosm: fix memory leak in ipc_mux_init() 2022-12-06 11:39:35 +01:00
xen-netback xen/netback: fix build warning 2022-12-07 16:03:21 +01:00
Kconfig - Yu Zhao's Multi-Gen LRU patches are here. They've been under test in 2022-10-10 17:53:04 -07:00
LICENSE.SRC
Makefile net: add framework to support Ethernet PSE and PDs devices 2022-10-03 17:33:56 -07:00
Space.c
amt.c
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c
ifb.c
loopback.c net: loopback: use NET_NAME_PREDICTABLE for name_assign_type 2022-11-25 09:39:05 +00:00
macsec.c macsec: add missing attribute validation for offload 2022-12-08 09:12:18 -08:00
macvlan.c net: macvlan: Use built-in RCU list checking 2022-11-14 10:50:02 +00:00
macvtap.c
mdio.c
mhi_net.c net: mhi: Fix memory leak in mhi_net_dellink() 2022-11-14 11:21:02 +00:00
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c ntb_netdev: Use dev_kfree_skb_any() in interrupt context 2022-12-31 13:32:28 +01:00
rionet.c
sb1000.c
sungem_phy.c
tap.c
thunderbolt.c net: thunderbolt: fix memory leak in tbnet_open() 2022-12-08 09:07:37 -08:00
tun.c net: tun: Fix use-after-free in tun_detach() 2022-11-29 12:14:15 +01:00
veth.c net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
virtio_net.c virtio_net: Fix probe failed when modprobe virtio_net 2022-11-24 09:26:35 +01:00
vrf.c
vsockmon.c
xen-netfront.c xen-netfront: Fix NULL sring after live migration 2022-12-05 11:35:29 +00:00