linux/drivers/net/ethernet/broadcom
Nicolai Buchwitz 89771ce4f8 net: bcmgenet: unshare the skb before writing the control block
bcmgenet stores first_cb, last_cb and bytes_sent in the skb control
block and reads them back on completion to free the skb and credit BQL.
ether_setup() leaves IFF_TX_SKB_SHARING set, so the stack can resubmit
a shared skb that is still in the ring. The next transmit overwrites
last_cb, so the earlier slots complete without crediting their bytes
and BQL stalls the queue until the watchdog resets it.

Unshare the skb before writing the control block.

Reproduce with pktgen in clone_skb mode, which hands the driver the same
skb while earlier copies are still in the ring:

  modprobe pktgen
  pg=/proc/net/pktgen
  echo "add_device eth0" > $pg/kpktgend_0
  echo "dst_mac AA:BB:CC:DD:EE:FF" > $pg/eth0
  echo "dst 192.0.2.1" > $pg/eth0
  echo "clone_skb 8" > $pg/eth0
  echo "count 0" > $pg/eth0
  echo start > $pg/pgctrl &
  sleep 5
  echo stop > $pg/pgctrl
  wait
  cat /sys/class/net/eth0/queues/tx-0/byte_queue_limits/inflight

inflight stays nonzero on the now idle queue. clone_skb 0 leaves it at
zero.

Fixes: f48bed16a7 ("net: bcmgenet: Free skb after last Tx frag")
Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20261009-nb-genet-shared-skb-net-v1-1-c6d0a841977d@tipi-net.de
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-10-15 12:03:14 +02:00
..
asp2 net: bcmasp: fix tx_spb_ring_full() checking same slot cnt times 2026-09-03 16:54:57 -07:00
bnge Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-08-06 11:53:47 -07:00
bnx2x bnx2x: fix double free in bnx2x_init_firmware() error path 2026-08-20 12:39:53 -07:00
bnxt bnxt_en: fix DMA mapping length for padded small packets 2026-10-07 17:53:31 -07:00
genet net: bcmgenet: unshare the skb before writing the control block 2026-10-15 12:03:14 +02:00
b44.c net: b44: use ethtool_puts 2026-06-03 17:44:45 -07:00
b44.h
bcm63xx_enet.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
bcm63xx_enet.h
bcm4908_enet.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
bcm4908_enet.h
bcmsysport.c net: systemport: Fix RUNT MIB counter register offset calculation 2026-09-28 17:06:42 -07:00
bcmsysport.h net: systemport: Move IO macros to header file 2024-10-28 15:54:37 -07:00
bgmac-bcma-mdio.c net: fill in MODULE_DESCRIPTION()s for Broadcom bgmac 2024-01-24 15:12:20 -08:00
bgmac-bcma.c net: fill in MODULE_DESCRIPTION()s for Broadcom bgmac 2024-01-24 15:12:20 -08:00
bgmac-platform.c net: ethernet: bgmac-platform: fix an OF node reference leak 2024-12-17 13:22:05 +01:00
bgmac.c net: phy: fixed_phy: remove irq argument from fixed_phy_register 2025-05-20 18:17:43 -07:00
bgmac.h bgmac: reduce max frame size to support just MTU 1500 2025-01-29 18:57:42 -08:00
bnx2_fw.h
bnx2.c net: Consistently define pci_device_ids using named initializers 2026-05-12 18:16:34 -07:00
bnx2.h bnx2: Drop redundant pci_enable_pcie_error_reporting() 2023-03-08 23:34:38 -08:00
cnic_defs.h
cnic_if.h cnic,bnx2,bnx2x: use UIO_MEM_DMA_COHERENT 2024-03-07 21:52:59 +00:00
cnic.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
cnic.h net: cnic: Convert tasklet API to new bottom half workqueue mechanism 2024-07-31 18:59:46 -07:00
Kconfig net: bcmgenet: convert RX path to page_pool 2026-06-11 15:44:10 -07:00
Makefile bng_en: Add PCI interface 2025-07-07 18:54:00 -07:00
sb1250-mac.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
tg3.c tg3: use random MAC address when tg3_get_device_address fails 2026-09-23 19:01:15 -07:00
tg3.h tg3: spelling corrections 2025-06-27 10:25:57 +01:00
unimac.h