linux/drivers/net/ethernet
Íñigo Huguet 624290f368 sfc: ensure correct number of XDP queues
[ Upstream commit 788bc000d4 ]

Commit 99ba0ea616 ("sfc: adjust efx->xdp_tx_queue_count with the real
number of initialized queues") intended to fix a problem caused by a
round up when calculating the number of XDP channels and queues.
However, this was not the real problem. The real problem was that the
number of XDP TX queues had been reduced to half in
commit e26ca4b535 ("sfc: reduce the number of requested xdp ev queues"),
but the variable xdp_tx_queue_count had remained the same.

Once the correct number of XDP TX queues is created again in the
previous patch of this series, this also can be reverted since the error
doesn't actually exist.

Only in the case that there is a bug in the code we can have different
values in xdp_queue_number and efx->xdp_tx_queue_count. Because of this,
and per Edward Cree's suggestion, I add instead a WARN_ON to catch if it
happens again in the future.

Note that the number of allocated queues can be higher than the number
of used ones due to the round up, as explained in the existing comment
in the code. That's why we also have to stop increasing xdp_queue_number
beyond efx->xdp_tx_queue_count.

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2021-07-28 14:35:48 +02:00
..
3com networking changes for the 5.10 merge window 2020-10-15 18:42:13 -07:00
8390 lib8390: Use netif_msg_init to initialize msg_enable bits 2020-10-01 19:08:46 -07:00
adaptec starfire: switch from 'pci_' to 'dma_' API 2020-08-24 17:33:11 -07:00
aeroflex net: ethernet: aeroflex: fix UAF in greth_of_remove 2021-07-14 16:56:24 +02:00
agere ethernet: select CONFIG_CRC32 as needed 2020-12-04 14:42:21 -08:00
alacritech treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
allwinner net: allwinner: Fix some resources leak in the error handling path of the probe and in the remove function 2020-12-30 11:53:57 +01:00
alteon net: alteon: convert tasklets to use new tasklet_setup() API 2020-09-14 13:02:37 -07:00
altera treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
amazon net: ena: fix packet's addresses for rx_offset feature 2020-11-24 16:07:13 -08:00
amd pcnet32: Use pci_resource_len to validate PCI resource 2021-04-21 13:00:54 +02:00
apm net: xgene: Move shared header file into include/linux 2020-08-27 06:55:50 -07:00
apple treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
aquantia net: atlantic: fix the macsec key length 2021-07-14 16:56:28 +02:00
arc drivers/net/ethernet: add some basic kdoc tags 2020-09-25 16:29:00 -07:00
atheros alx: Fix an error handling path in 'alx_probe()' 2021-06-23 14:42:44 +02:00
aurora net: nb8800: fix nb8800_xmit()'s return type 2020-06-28 20:52:53 -07:00
broadcom bnxt_en: Check abort error state in bnxt_half_open_nic() 2021-07-28 14:35:39 +02:00
brocade net: bna: Use fallthrough pseudo-keyword 2020-10-03 17:33:23 -07:00
cadence net: macb: ensure the device is available before accessing GEMGXL control registers 2021-06-16 12:01:37 +02:00
calxeda drivers/net/ethernet: clean up mis-targeted comments 2020-09-25 16:29:00 -07:00
cavium liquidio: Fix unintentional sign extension issue on left shift of u16 2021-07-28 14:35:37 +02:00
chelsio cxgb4: fix IRQ free race during driver unload 2021-07-28 14:35:34 +02:00
cirrus ethernet: cirrus: Remove unused macros 2020-08-18 12:54:47 -07:00
cisco ethernet:enic: Fix a use after free bug in enic_hard_start_xmit 2021-05-19 10:13:06 +02:00
cortina drivers/net/ethernet: clean up mis-targeted comments 2020-09-25 16:29:00 -07:00
davicom net: davicom: Fix regulator not turned off on failed probe 2021-04-21 13:00:57 +02:00
dec drivers/net/ethernet: clean up unused assignments 2020-09-25 16:29:00 -07:00
dlink net: sundance: convert tasklets to use new tasklet_setup() API 2020-09-14 13:02:37 -07:00
emulex Revert "be2net: disable bh with spin_lock in be_process_mcc" 2021-07-14 16:56:29 +02:00
ezchip net: ethernet: ezchip: fix error handling 2021-07-14 16:56:24 +02:00
faraday net: ftgmac100: add missing error return code in ftgmac100_probe() 2021-07-14 16:56:16 +02:00
freescale net: fec: add ndo_select_queue to fix TX bandwidth fluctuations 2021-07-19 09:44:51 +02:00
fujitsu net: fujitsu: fix potential null-ptr-deref 2021-06-03 09:00:40 +02:00
google gve: Fix an error handling path in 'gve_probe()' 2021-07-28 14:35:32 +02:00
hisilicon net: hns3: fix rx VLAN offload state inconsistent issue 2021-07-28 14:35:40 +02:00
huawei Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-10-05 18:40:01 -07:00
i825xx lib82596: convert to dma_alloc_noncoherent 2020-09-25 06:20:45 +02:00
ibm ibmvnic: free tx_pool if tso_pool alloc fails 2021-07-14 16:56:28 +02:00
intel ixgbe: Fix packet corruption due to missing DMA sync 2021-07-28 14:35:45 +02:00
marvell net: mvpp2: check return value after calling platform_get_resource() 2021-07-19 09:44:47 +02:00
mediatek net: ethernet: mtk_eth_soc: Fix packet statistics support for MT7628/88 2021-06-03 09:00:50 +02:00
mellanox net/mlx5: Fix lag port remapping logic 2021-07-19 09:44:42 +02:00
micrel net: micrel: check return value after calling platform_get_resource() 2021-07-19 09:44:47 +02:00
microchip lan743x: fix rx_napi_poll/interrupt ping-pong 2020-12-30 11:53:56 +01:00
moxa net: moxa: fix UAF in moxart_mac_probe 2021-07-25 14:36:19 +02:00
mscc net: dsa: felix: re-enable TX flow control in ocelot_port_flush() 2021-06-23 14:42:42 +02:00
myricom ethernet: myri10ge: Fix missing error code in myri10ge_probe() 2021-06-18 10:00:05 +02:00
natsemi net/sonic: Fix some resource leaks in error handling paths 2021-01-17 14:16:55 +01:00
neterion net: vxge: Remove in_interrupt() conditionals 2020-09-29 14:02:54 -07:00
netronome nfp: devlink: initialize the devlink port attribute "lanes" 2021-05-14 09:50:41 +02:00
ni net: nixge: convert tasklets to use new tasklet_setup() API 2020-09-14 13:02:38 -07:00
nvidia treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
nxp ethernet: select CONFIG_CRC32 as needed 2020-12-04 14:42:21 -08:00
oki-semi net: pch_gbe: Use proper accessors to BE data in pch_ptp_match() 2021-07-19 09:44:37 +02:00
packetengines drivers/net/ethernet: clean up mis-targeted comments 2020-09-25 16:29:00 -07:00
pasemi net: pasemi: fix error return code in pasemi_mac_open() 2020-12-02 18:03:58 -08:00
pensando ionic: linearize tso skb with too many frags 2021-03-30 14:32:01 +02:00
qlogic net: qed: Fix memcpy() overflow of qed_dcbx_params() 2021-06-30 08:47:23 -04:00
qualcomm net: qcom/emac: fix UAF in emac_remove 2021-07-25 14:36:19 +02:00
rdc r6040: switch from 'pci_' to 'dma_' API 2020-07-20 17:49:50 -07:00
realtek r8169: Avoid duplicate sysfs entry creation error 2021-07-28 14:35:41 +02:00
renesas sh_eth: Avoid memcpy() over-reading of ETH_SS_STATS 2021-06-30 08:47:22 -04:00
rocker ethernet: select CONFIG_CRC32 as needed 2020-12-04 14:42:21 -08:00
samsung drivers/net/ethernet: clean up mis-targeted comments 2020-09-25 16:29:00 -07:00
seeq sgiseeq: convert to dma_alloc_noncoherent 2020-09-25 06:20:45 +02:00
sfc sfc: ensure correct number of XDP queues 2021-07-28 14:35:48 +02:00
sgi net: sgi: ioc3-eth: check return value after calling platform_get_resource() 2021-07-19 09:44:49 +02:00
silan net: silan: convert tasklets to use new tasklet_setup() API 2020-09-14 13:02:38 -07:00
sis drivers/net/ethernet: clean up mis-targeted comments 2020-09-25 16:29:00 -07:00
smsc net: smc91x: convert tasklets to use new tasklet_setup() API 2020-09-14 13:02:38 -07:00
socionext netsec: restore phy power state after controller reset 2021-03-30 14:31:53 +02:00
stmicro stmmac: platform: Fix signedness bug in stmmac_probe_config_dt() 2021-07-28 14:35:34 +02:00
sun ethernet: sun: niu: fix missing checks of niu_pci_eeprom_read() 2021-05-26 12:06:55 +02:00
synopsys drivers/net/ethernet: clean up unused assignments 2020-09-25 16:29:00 -07:00
tehuti net: tehuti: fix error return code in bdx_probe() 2021-03-30 14:31:48 +02:00
ti net: ti: fix UAF in tlan_remove_one 2021-07-25 14:36:20 +02:00
toshiba net: tc35815: switch from 'pci_' to 'dma_' API 2020-09-08 20:16:19 -07:00
tundra treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
via Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-10-05 18:40:01 -07:00
wiznet treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
xilinx net: ll_temac: Avoid ndo_start_xmit returning NETDEV_TX_BUSY 2021-06-30 08:47:24 -04:00
xircom treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
xscale net: ethernet: ixp4xx: Set the DMA masks explicitly 2021-05-14 09:50:40 +02:00
dnet.c drivers/net/ethernet: clean up unused assignments 2020-09-25 16:29:00 -07:00
dnet.h net/dnet: Delete static version from the driver 2020-03-03 17:54:55 -08:00
ec_bhf.c net: ethernet: fix potential use-after-free in ec_bhf_remove 2021-06-23 14:42:47 +02:00
ethoc.c net: ethernet: Fix memleak in ethoc_probe 2021-01-12 20:18:10 +01:00
fealnx.c net/fealnx: switch from 'pci_' to 'dma_' API 2020-07-20 18:32:49 -07:00
jme.c net: jme: convert tasklets to use new tasklet_setup() API 2020-09-14 13:02:37 -07:00
jme.h net: jme: Replace HTTP links with HTTPS ones 2020-07-13 17:45:04 -07:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
korina.c net: korina: fix return value 2020-12-30 11:53:57 +01:00
lantiq_etop.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2020-01-28 16:02:33 -08:00
lantiq_xrx200.c lantiq: net: fix duplicated skb in rx descriptor ring 2021-06-23 14:42:46 +02:00
Makefile hp100: Move 100BaseVG AnyLAN driver to staging 2019-10-31 14:49:52 -07:00