linux-stable/drivers/net
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>
2022-12-31 13:14:21 +01:00
..
appletalk
arcnet
bonding bonding: uninitialized variable in bond_miimon_inspect() 2022-12-31 13:14:14 +01:00
caif
can can: tcan4x5x: Fix use of register error status mask 2022-12-31 13:14:20 +01:00
dsa net: lan9303: Fix read error execution path 2022-12-31 13:14:20 +01:00
ethernet i40e: Fix the inability to attach XDP program on downed interface 2022-12-31 13:14:21 +01:00
fddi net: defxx: Fix missing err handling in dfx_init() 2022-12-31 13:14:18 +01:00
fjes
hamradio hamradio: don't call dev_kfree_skb() under spin_lock_irqsave() 2022-12-31 13:14:19 +01:00
hippi
hyperv
ieee802154
ipa
ipvlan
mctp
mdio
netdevsim
pcs
phy
plip
ppp
slip
team
usb
vmxnet3
wan net: farsync: Fix kmemleak when rmmods farsync 2022-12-31 13:14:19 +01:00
wireguard
wireless wifi: brcmfmac: Fix error return code in brcmf_sdio_download_firmware() 2022-12-31 13:14:18 +01:00
wwan
xen-netback
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c
ifb.c
Kconfig
LICENSE.SRC
loopback.c net: loopback: use NET_NAME_PREDICTABLE for name_assign_type 2022-12-21 17:36:38 +01:00
macsec.c macsec: add missing attribute validation for offload 2022-12-14 11:37:30 +01:00
macvlan.c
macvtap.c
Makefile
mdio.c
mhi_net.c
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:14:20 +01:00
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c
thunderbolt.c
tun.c
veth.c
virtio_net.c
vrf.c
vsockmon.c
vxlan.c
xen-netfront.c