1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/ethernet/broadcom
Florian Fainelli 8b8e6e7824 net: systemport: Add global locking for descriptor lifecycle
The descriptor list is a shared resource across all of the transmit queues, and
the locking mechanism used today only protects concurrency across a given
transmit queue between the transmit and reclaiming. This creates an opportunity
for the SYSTEMPORT hardware to work on corrupted descriptors if we have
multiple producers at once which is the case when using multiple transmit
queues.

This was particularly noticeable when using multiple flows/transmit queues and
it showed up in interesting ways in that UDP packets would get a correct UDP
header checksum being calculated over an incorrect packet length. Similarly TCP
packets would get an equally correct checksum computed by the hardware over an
incorrect packet length.

The SYSTEMPORT hardware maintains an internal descriptor list that it re-arranges
when the driver produces a new descriptor anytime it writes to the
WRITE_PORT_{HI,LO} registers, there is however some delay in the hardware to
re-organize its descriptors and it is possible that concurrent TX queues
eventually break this internal allocation scheme to the point where the
length/status part of the descriptor gets used for an incorrect data buffer.

The fix is to impose a global serialization for all TX queues in the short
section where we are writing to the WRITE_PORT_{HI,LO} registers which solves
the corruption even with multiple concurrent TX queues being used.

Fixes: 80105befdb ("net: systemport: add Broadcom SYSTEMPORT Ethernet MAC driver")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20211215202450.4086240-1-f.fainelli@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-12-16 08:15:31 -08:00
..
bnx2x net: bnx2x: fix variable dereferenced before check 2021-11-15 13:28:49 +00:00
bnxt bnxt_en: Fix compile error regression when CONFIG_BNXT_SRIOV is not set 2021-11-16 18:58:14 -08:00
genet net: bcmgenet: Fix NULL vs IS_ERR() checking 2021-12-13 14:32:08 +00:00
b44.c ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
b44.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
bcm63xx_enet.c ethernet: use eth_hw_addr_set() 2021-10-02 14:18:25 +01:00
bcm63xx_enet.h bcm63xx_enet: convert to build_skb 2021-01-07 12:39:53 -08:00
bcm4908_enet.c net: bcm4908: Handle dma_set_coherent_mask error codes 2021-12-03 14:18:53 +00:00
bcm4908_enet.h net: broadcom: rename BCM4908 driver & update DT binding 2021-02-11 15:04:17 -08:00
bcmsysport.c net: systemport: Add global locking for descriptor lifecycle 2021-12-16 08:15:31 -08:00
bcmsysport.h net: systemport: Add global locking for descriptor lifecycle 2021-12-16 08:15:31 -08:00
bgmac-bcma-mdio.c net: bgmac: support MDIO described in DT 2021-10-05 11:38:37 +01:00
bgmac-bcma.c ethernet: use of_get_ethdev_address() 2021-10-07 13:39:51 +01:00
bgmac-platform.c ethernet: use of_get_ethdev_address() 2021-10-07 13:39:51 +01:00
bgmac.c ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
bgmac.h net: broadcom: share header defining UniMAC registers 2021-01-08 19:17:28 -08:00
bnx2.c ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
bnx2.h ethernet/broadcom: use core min/max MTU checking 2016-10-18 11:34:18 -04:00
bnx2_fw.h
cnic.c cnic: convert tasklets to use new tasklet_setup() API 2020-09-14 13:02:37 -07:00
cnic.h
cnic_defs.h net: cnic: fix spelling mistake "reserverd" -> "reserved" 2020-02-17 21:59:16 -08:00
cnic_if.h
Kconfig ethernet: fix PTP_1588_CLOCK dependencies 2021-08-13 17:49:05 -07:00
Makefile net: broadcom: rename BCM4908 driver & update DT binding 2021-02-11 15:04:17 -08:00
sb1250-mac.c dev_ioctl: split out ndo_eth_ioctl 2021-07-27 20:11:45 +01:00
tg3.c tg3: Remove redundant assignments 2021-11-05 10:14:38 +00:00
tg3.h tg3: Read VPD with pci_vpd_alloc() 2021-08-20 15:49:00 -05:00
unimac.h net: broadcom: share header defining UniMAC registers 2021-01-08 19:17:28 -08:00