OpenCloudOS-Kernel/drivers/net
Sylwester Dziedziuch 92947844b8 i40e: Fix queues reservation for XDP
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>
2022-01-20 10:25:40 -08:00
..
appletalk net: Don't include filter.h from net/sock.h 2021-12-29 08:48:14 -08:00
arcnet
bonding bonding: Fix extraction of ports from the packet headers 2022-01-16 23:38:59 +00:00
caif virtio: wrap config->reset calls 2022-01-14 18:50:52 -05:00
can TTY/Serial driver updates for 5.17-rc1 2022-01-12 11:21:52 -08:00
dsa net: dsa: felix: add port fast age support 2022-01-07 18:58:25 -08:00
ethernet i40e: Fix queues reservation for XDP 2022-01-20 10:25:40 -08:00
fddi net:Remove initialization of static variables to 0 2021-12-27 14:53:00 +00:00
fjes fjes: Check for error irq 2021-12-22 10:22:13 +00:00
hamradio TTY/Serial driver updates for 5.17-rc1 2022-01-12 11:21:52 -08:00
hippi
hyperv hyperv-next for 5.17 2022-01-16 15:53:00 +02:00
ieee802154 ieee802154: atusb: fix uninit value in atusb_set_extended_addr 2022-01-04 20:10:04 +01:00
ipa net: ipa: prevent concurrent replenish 2022-01-12 14:39:53 +00:00
ipvlan ipvlan: Remove redundant if statements 2021-12-02 13:07:38 +00:00
mctp
mdio net: mdio: mscc-miim: Add depend of REGMAP_MMIO on MDIO_MSCC_MIIM 2021-12-01 18:46:54 -08:00
netdevsim Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-12-16 16:13:19 -08:00
pcs net: pcs: lynx: use a common naming scheme for all lynx_pcs variables 2022-01-02 18:48:47 +00:00
phy net: phy: broadcom: hook up soft_reset for BCM54616S 2022-01-20 11:27:06 +00:00
plip
ppp TTY/Serial driver updates for 5.17-rc1 2022-01-12 11:21:52 -08:00
slip Merge 5.16-rc4 into tty-next 2021-12-06 09:32:47 +01:00
team
usb net: usb: Correct reset handling of smsc95xx 2022-01-14 11:21:06 +00:00
vmxnet3 vmxnet3: Remove useless DMA-32 fallback configuration 2022-01-09 16:52:19 -08:00
wan net: wan/lmc: fix spelling of "its" 2021-12-24 10:23:47 +00:00
wireguard lib/crypto: blake2s: move hmac construction into wireguard 2022-01-18 13:03:55 +01:00
wireless Merge branch 'akpm' (patches from Andrew) 2022-01-20 10:41:01 +02:00
wwan net: wwan: Fix MRU mismatch issue which may lead to data connection lost 2022-01-15 22:40:52 +00:00
xen-netback xen/netback: don't queue unlimited number of packages 2021-12-16 08:43:12 +01:00
Kconfig lib/crypto: blake2s: include as built-in 2022-01-07 00:25:25 +01:00
LICENSE.SRC
Makefile
Space.c
amt.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-01-09 17:00:17 -08:00
bareudp.c bareudp: Add extack support to bareudp_configure() 2021-12-14 12:39:17 +00:00
dummy.c
eql.c net: eql: add net device refcount tracker 2021-12-07 20:44:58 -08:00
geneve.c
gtp.c
ifb.c net: ifb: support ethtools stats 2021-11-29 20:15:03 -08:00
loopback.c net: Don't include filter.h from net/sock.h 2021-12-29 08:48:14 -08:00
macsec.c
macvlan.c
macvtap.c
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c netpoll: add net device refcount tracker to struct netpoll 2021-12-06 16:06:02 -08:00
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
sungem_phy.c
tap.c
thunderbolt.c
tun.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-12-31 14:35:40 +00:00
veth.c veth: Do not record rx queue hint in veth_xmit 2022-01-06 13:49:54 +00:00
virtio_net.c virtio,vdpa,qemu_fw_cfg: features, cleanups, fixes 2022-01-18 10:05:48 +02:00
vrf.c net: Don't include filter.h from net/sock.h 2021-12-29 08:48:14 -08:00
vsockmon.c
vxlan.c
xen-netfront.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-12-31 14:35:40 +00:00