linux/drivers/net
Florian Fainelli eb4687c744 net: systemport: Add global locking for descriptor lifecycle
[ Upstream commit 8b8e6e7824 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-12-22 09:32:44 +01:00
..
appletalk
arcnet
bonding bonding: make tx_rebalance_counter an atomic 2021-12-14 10:57:09 +01:00
caif
can can: m_can: Disable and ignore ELO interrupt 2021-12-14 10:57:08 +01:00
dsa dsa: mv88e6xxx: fix debug print for SPEED_UNFORCED 2021-12-22 09:32:44 +01:00
ethernet net: systemport: Add global locking for descriptor lifecycle 2021-12-22 09:32:44 +01:00
fddi
fjes
hamradio
hippi
hyperv
ieee802154
ipa net: ipa: kill ipa_cmd_pipeline_clear() 2021-12-01 09:04:51 +01:00
ipvlan
mctp
mdio mdio: aspeed: Fix "Link is Down" issue 2021-12-01 09:04:43 +01:00
netdevsim netdevsim: Zero-initialize memory for new map's value in function nsim_bpf_map_alloc 2021-12-22 09:32:44 +01:00
pcs
phy net: phylink: Force retrigger in case of latched link-fail indicator 2021-12-01 09:04:52 +01:00
plip
ppp
slip
team
usb net: cdc_ncm: Allow for dwNtbOutMaxSize to be unset or zero 2021-12-14 10:57:19 +01:00
vmxnet3 vmxnet3: fix minimum vectors alloc issue 2021-12-17 10:30:14 +01:00
wan
wireguard wireguard: ratelimiter: use kvcalloc() instead of kvzalloc() 2021-12-08 09:04:46 +01:00
wireless iwlwifi: mvm: don't crash on invalid rate w/o STA 2021-12-22 09:32:39 +01:00
wwan
xen-netback
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c
ifb.c ifb: fix building without CONFIG_NET_CLS_ACT 2021-11-18 19:16:04 +01:00
Kconfig ifb: Depend on netfilter alternatively to tc 2021-11-18 19:15:58 +01:00
LICENSE.SRC
loopback.c
macsec.c
macvlan.c
macvtap.c
Makefile
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c
thunderbolt.c
tun.c tun: fix bonding active backup with arp monitoring 2021-11-25 09:48:42 +01:00
veth.c
virtio_net.c
vrf.c vrf: don't run conntrack on vrf with !dflt qdisc 2021-12-14 10:57:08 +01:00
vsockmon.c
vxlan.c
xen-netfront.c xen/netfront: stop tx queues during live migration 2021-10-25 16:13:12 +01:00