twx-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: 80105befdb4b ("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
bcm63xx_enet.c ethernet: use eth_hw_addr_set() 2021-10-02 14:18:25 +01:00
bcm63xx_enet.h
bcm4908_enet.c net: bcm4908: Handle dma_set_coherent_mask error codes 2021-12-03 14:18:53 +00:00
bcm4908_enet.h
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
bnx2_fw.h
bnx2.c ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
bnx2.h
cnic_defs.h
cnic_if.h
cnic.c
cnic.h
Kconfig ethernet: fix PTP_1588_CLOCK dependencies 2021-08-13 17:49:05 -07:00
Makefile
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