1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/ethernet
Maxim Mikityanskiy ca49bfd90a sch_htb: Fix inconsistency when leaf qdisc creation fails
In HTB offload mode, qdiscs of leaf classes are grafted to netdev
queues. sch_htb expects the dev_queue field of these qdiscs to point to
the corresponding queues. However, qdisc creation may fail, and in that
case noop_qdisc is used instead. Its dev_queue doesn't point to the
right queue, so sch_htb can lose track of used netdev queues, which will
cause internal inconsistencies.

This commit fixes this bug by keeping track of the netdev queue inside
struct htb_class. All reads of cl->leaf.q->dev_queue are replaced by the
new field, the two values are synced on writes, and WARNs are added to
assert equality of the two values.

The driver API has changed: when TC_HTB_LEAF_DEL needs to move a queue,
the driver used to pass the old and new queue IDs to sch_htb. Now that
there is a new field (offload_queue) in struct htb_class that needs to
be updated on this operation, the driver will pass the old class ID to
sch_htb instead (it already knows the new class ID).

Fixes: d03b195b5a ("sch_htb: Hierarchical QoS hardware offload")
Signed-off-by: Maxim Mikityanskiy <maximmi@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://lore.kernel.org/r/20210826115425.1744053-1-maximmi@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-08-30 16:33:59 -07:00
..
3com ethernet: isa: convert to module_init/module_exit 2021-08-03 13:05:26 +01:00
8390 ethernet: isa: convert to module_init/module_exit 2021-08-03 13:05:26 +01:00
actions net: ethernet: actions: Add helper dependency on COMPILE_TEST 2021-08-25 12:06:53 +01:00
adaptec dev_ioctl: split out ndo_eth_ioctl 2021-07-27 20:11:45 +01:00
aeroflex net: ethernet: aeroflex: fix UAF in greth_of_remove 2021-06-19 11:45:10 -07:00
agere dev_ioctl: split out ndo_eth_ioctl 2021-07-27 20:11:45 +01:00
alacritech
allwinner dev_ioctl: split out ndo_eth_ioctl 2021-07-27 20:11:45 +01:00
alteon net: alteon: remove leading spaces before tabs 2021-05-19 12:17:30 -07:00
altera of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
amazon ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
amd ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
apm xgene-v2: Fix a resource leak in the error handling path of 'xge_probe()' 2021-08-23 11:23:48 +01:00
apple net: apple: remove leading spaces before tabs 2021-05-19 12:17:30 -07:00
aquantia ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
arc dev_ioctl: split out ndo_eth_ioctl 2021-07-27 20:11:45 +01:00
atheros dev_ioctl: split out ndo_eth_ioctl 2021-07-27 20:11:45 +01:00
broadcom bnxt_en: support multiple HWRM commands in flight 2021-08-30 09:35:04 +01:00
brocade ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
cadence Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-08-26 17:57:57 -07:00
calxeda net: calxeda: Fix wrong function name in comments 2021-05-17 14:12:38 -07:00
cavium ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
chelsio Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-08-26 17:57:57 -07:00
cirrus ethernet: isa: convert to module_init/module_exit 2021-08-03 13:05:26 +01:00
cisco ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
cortina ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
davicom dev_ioctl: split out ndo_eth_ioctl 2021-07-27 20:11:45 +01:00
dec tulip: Remove deadcode on startup true condition 2021-08-07 09:39:54 +01:00
dlink dev_ioctl: split out ndo_eth_ioctl 2021-07-27 20:11:45 +01:00
emulex ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
ezchip net: ethernet: ezchip: fix error handling 2021-06-19 11:46:00 -07:00
faraday dev_ioctl: split out ndo_eth_ioctl 2021-07-27 20:11:45 +01:00
freescale ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
fujitsu Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-05-27 09:55:10 -07:00
google gve: fix the wrong AdminQ buffer overflow check 2021-07-16 10:41:40 -07:00
hisilicon net: hns3: uniform parameter name of hclge_ptp_clean_tx_hwts() 2021-08-30 09:43:18 +01:00
huawei ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
i825xx m68k: remove legacy probing 2021-08-03 13:05:25 +01:00
ibm dev_ioctl: split out ndo_eth_ioctl 2021-07-27 20:11:45 +01:00
intel igc: Add support for CBS offloading 2021-08-27 09:31:09 -07:00
litex net: Add driver for LiteX's LiteETH network interface 2021-08-26 12:13:52 +01:00
marvell octeontx2-pf: Add vlan-etype to ntuple filters 2021-08-29 10:48:32 +01:00
mediatek dev_ioctl: split out ndo_eth_ioctl 2021-07-27 20:11:45 +01:00
mellanox sch_htb: Fix inconsistency when leaf qdisc creation fails 2021-08-30 16:33:59 -07:00
micrel dev_ioctl: split out ndo_eth_ioctl 2021-07-27 20:11:45 +01:00
microchip net: sparx5: switchdev: adding frame DMA functionality 2021-08-20 14:28:55 +01:00
microsoft net: mana: Add WARN_ON_ONCE in case of CQE read overflow 2021-08-25 11:06:54 +01:00
moxa net: moxa: fix UAF in moxart_mac_probe 2021-07-09 11:01:01 -07:00
mscc net: mscc: ocelot: use helpers for port VLAN membership 2021-08-20 14:39:52 +01:00
myricom ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
natsemi Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-08-05 15:08:47 -07:00
neterion Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-08-05 15:08:47 -07:00
netronome ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
ni ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
nvidia forcedeth: switch from 'pci_' to 'dma_' API 2021-08-23 11:56:57 +01:00
nxp dev_ioctl: split out ndo_eth_ioctl 2021-07-27 20:11:45 +01:00
oki-semi net: pch_gbe: remove mii_ethtool_gset() error handling 2021-08-19 13:06:53 +01:00
packetengines dev_ioctl: split out ndo_eth_ioctl 2021-07-27 20:11:45 +01:00
pasemi
pensando ionic: recreate hwstamp queues on ifup 2021-08-28 11:23:09 +01:00
qlogic Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-08-26 17:57:57 -07:00
qualcomm dev_ioctl: split out ndo_eth_ioctl 2021-07-27 20:11:45 +01:00
rdc dev_ioctl: split out ndo_eth_ioctl 2021-07-27 20:11:45 +01:00
realtek r8169: add rtl_enable_exit_l1 2021-08-26 12:05:43 +01:00
renesas ravb: Add reset support 2021-08-25 11:18:17 +01:00
rocker Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-08-13 06:41:22 -07:00
samsung ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
seeq net: seeq: remove leading spaces before tabs 2021-05-19 12:17:31 -07:00
sfc ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
sgi dev_ioctl: split out ndo_eth_ioctl 2021-07-27 20:11:45 +01:00
silan
sis Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-07-31 09:14:46 -07:00
smsc ethernet: isa: convert to module_init/module_exit 2021-08-03 13:05:26 +01:00
socionext ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
stmicro Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-08-26 17:57:57 -07:00
sun niu: switch from 'pci_' to 'dma_' API 2021-08-29 10:50:24 +01:00
synopsys ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
tehuti ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
ti ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
toshiba net: spider_net: switch from 'pci_' to 'dma_' API 2021-08-29 10:50:24 +01:00
tundra dev_ioctl: split out ndo_eth_ioctl 2021-07-27 20:11:45 +01:00
via ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
wiznet net: w5100: Use devm_platform_get_and_ioremap_resource() 2021-06-10 13:53:13 -07:00
xilinx ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
xircom dev_ioctl: split out ndo_eth_ioctl 2021-07-27 20:11:45 +01:00
xscale ixp4xx_eth: Probe the PTP module from the device tree 2021-08-30 09:59:11 +01:00
dnet.c dev_ioctl: split out ndo_eth_ioctl 2021-07-27 20:11:45 +01:00
dnet.h
ec_bhf.c net: ec_bhf: switch from 'pci_' to 'dma_' API 2021-08-23 11:56:57 +01:00
ethoc.c dev_ioctl: split out ndo_eth_ioctl 2021-07-27 20:11:45 +01:00
fealnx.c dev_ioctl: split out ndo_eth_ioctl 2021-07-27 20:11:45 +01:00
jme.c ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
jme.h net: jme: Replace link-change tasklet with work 2021-03-17 16:33:58 +01:00
Kconfig net: Add driver for LiteX's LiteETH network interface 2021-08-26 12:13:52 +01:00
korina.c dev_ioctl: split out ndo_eth_ioctl 2021-07-27 20:11:45 +01:00
lantiq_etop.c dev_ioctl: split out ndo_eth_ioctl 2021-07-27 20:11:45 +01:00
lantiq_xrx200.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-06-18 19:47:02 -07:00
Makefile net: Add driver for LiteX's LiteETH network interface 2021-08-26 12:13:52 +01:00