linux/drivers/net
Sylwester Dziedziuch 00eddb0e4e i40e: Fix queues reservation for XDP
commit 92947844b8 upstream.

When XDP was configured on a system with large number of CPUs
and X722 NIC there was a call trace with NULL pointer dereference.

i40e 0000:87:00.0: failed to get tracking for 256 queues for VSI 0 err -12
i40e 0000:87:00.0: setup of MAIN VSI failed

BUG: kernel NULL pointer dereference, address: 0000000000000000
RIP: 0010:i40e_xdp+0xea/0x1b0 [i40e]
Call Trace:
? i40e_reconfig_rss_queues+0x130/0x130 [i40e]
dev_xdp_install+0x61/0xe0
dev_xdp_attach+0x18a/0x4c0
dev_change_xdp_fd+0x1e6/0x220
do_setlink+0x616/0x1030
? ahci_port_stop+0x80/0x80
? ata_qc_issue+0x107/0x1e0
? lock_timer_base+0x61/0x80
? __mod_timer+0x202/0x380
rtnl_setlink+0xe5/0x170
? bpf_lsm_binder_transaction+0x10/0x10
? security_capable+0x36/0x50
rtnetlink_rcv_msg+0x121/0x350
? rtnl_calcit.isra.0+0x100/0x100
netlink_rcv_skb+0x50/0xf0
netlink_unicast+0x1d3/0x2a0
netlink_sendmsg+0x22a/0x440
sock_sendmsg+0x5e/0x60
__sys_sendto+0xf0/0x160
? __sys_getsockname+0x7e/0xc0
? _copy_from_user+0x3c/0x80
? __sys_setsockopt+0xc8/0x1a0
__x64_sys_sendto+0x20/0x30
do_syscall_64+0x33/0x40
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f83fa7a39e0

This was caused by PF queue pile fragmentation due to
flow director VSI queue being placed right after main VSI.
Because of this main VSI was not able to resize its
queue allocation for XDP resulting in no queues allocated
for main VSI when XDP was turned on.

Fix this by always allocating last queue in PF queue pile
for a flow director VSI.

Fixes: 41c445ff0f ("i40e: main driver core")
Fixes: 74608d17fe ("i40e: add support for XDP_TX action")
Signed-off-by: Sylwester Dziedziuch <sylwesterx.dziedziuch@intel.com>
Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Tested-by: Kiran Bhandare <kiranx.bhandare@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-01 17:27:06 +01:00
..
appletalk
arcnet
bonding bonding: Fix extraction of ports from the packet headers 2022-01-27 11:05:43 +01:00
caif
can can: m_can: m_can_fifo_{read,write}: don't read or write from/to FIFO if length is 0 2022-02-01 17:26:58 +01:00
dsa net: dsa: hellcreek: Add missing PTP via UDP rules 2022-01-27 11:03:38 +01:00
ethernet i40e: Fix queues reservation for XDP 2022-02-01 17:27:06 +01:00
fddi fddi: switch from 'pci_' to 'dma_' API 2021-08-29 10:50:24 +01:00
fjes fjes: Check for error irq 2021-12-29 12:28:44 +01:00
hamradio hamradio: improve the incomplete fix to avoid NPD 2021-12-29 12:29:03 +01:00
hippi
hyperv
ieee802154 ieee802154: atusb: fix uninit value in atusb_set_extended_addr 2022-01-11 15:35:12 +01:00
ipa net: ipa: fix atomic update in ipa_endpoint_replenish() 2022-01-27 11:05:39 +01:00
ipvlan
mctp
mdio mdio: aspeed: Fix "Link is Down" issue 2021-12-01 09:04:43 +01:00
netdevsim netdevsim: Zero-initialize memory for new map's value in function nsim_bpf_map_alloc 2021-12-22 09:32:44 +01:00
pcs net: pcs: xpcs: fix incorrect steps on disable EEE 2021-10-06 11:18:27 +01:00
phy net: sfp: ignore disabled SFP node 2022-02-01 17:26:58 +01:00
plip
ppp ppp: ensure minimum packet size in ppp_write() 2022-01-27 11:03:52 +01:00
slip
team
usb net: usb: Correct reset handling of smsc95xx 2022-01-27 11:05:22 +01:00
vmxnet3 vmxnet3: fix minimum vectors alloc issue 2021-12-17 10:30:14 +01:00
wan net: wan: wanxl: define CROSS_COMPILE_M68K 2021-09-16 14:08:04 +01:00
wireguard wireguard: ratelimiter: use kvcalloc() instead of kvzalloc() 2021-12-08 09:04:46 +01:00
wireless iwlwifi: fix Bz NMI behaviour 2022-01-27 11:05:36 +01:00
wwan net: wwan: Fix MRU mismatch issue which may lead to data connection lost 2022-01-27 11:05:40 +01:00
xen-netback xen/netback: don't queue unlimited number of packages 2021-12-22 09:32:52 +01:00
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c
ifb.c ifb: fix building without CONFIG_NET_CLS_ACT 2021-11-18 19:16:04 +01:00
Kconfig ifb: Depend on netfilter alternatively to tc 2021-11-18 19:15:58 +01:00
LICENSE.SRC
loopback.c
macsec.c
macvlan.c
macvtap.c
Makefile
mdio.c
mhi_net.c drivers: net: mhi: fix error path in mhi_net_newlink 2021-09-24 14:25:05 +01:00
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c
thunderbolt.c
tun.c tun: avoid double free in tun_free_netdev 2021-12-29 12:29:03 +01:00
veth.c veth: Do not record rx queue hint in veth_xmit 2022-01-16 09:12:44 +01:00
virtio_net.c virtio-net: fix for skb_over_panic inside big mode 2021-10-09 13:50:33 +01:00
vrf.c vrf: don't run conntrack on vrf with !dflt qdisc 2021-12-14 10:57:08 +01:00
vsockmon.c
vxlan.c nexthop: Fix memory leaks in nexthop notification chain listeners 2021-09-23 12:33:22 +01:00
xen-netfront.c xen/netfront: harden netfront against event channel storms 2021-12-22 09:32:51 +01:00