linux/drivers/net
Robert Hancock 0c6eeaf8c1 net: macb: Fix lost RX packet wakeup race in NAPI receive
commit 0bf476fc36 upstream.

There is an oddity in the way the RSR register flags propagate to the
ISR register (and the actual interrupt output) on this hardware: it
appears that RSR register bits only result in ISR being asserted if the
interrupt was actually enabled at the time, so enabling interrupts with
RSR bits already set doesn't trigger an interrupt to be raised. There
was already a partial fix for this race in the macb_poll function where
it checked for RSR bits being set and re-triggered NAPI receive.
However, there was a still a race window between checking RSR and
actually enabling interrupts, where a lost wakeup could happen. It's
necessary to check again after enabling interrupts to see if RSR was set
just prior to the interrupt being enabled, and re-trigger receive in that
case.

This issue was noticed in a point-to-point UDP request-response protocol
which periodically saw timeouts or abnormally high response times due to
received packets not being processed in a timely fashion. In many
applications, more packets arriving, including TCP retransmissions, would
cause the original packet to be processed, thus masking the issue.

Fixes: 02f7a34f34 ("net: macb: Re-enable RX interrupt only when RX is done")
Cc: stable@vger.kernel.org
Co-developed-by: Scott McNutt <scott.mcnutt@siriusxm.com>
Signed-off-by: Scott McNutt <scott.mcnutt@siriusxm.com>
Signed-off-by: Robert Hancock <robert.hancock@calian.com>
Tested-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-16 14:16:01 +01:00
..
appletalk
arcnet net: arcnet: com20020: Fix null-ptr-deref in com20020pci_probe() 2022-03-08 19:09:35 +01:00
bonding bonding: fix data-races around agg_select_timer 2022-02-23 12:01:02 +01:00
caif
can can: gs_usb: change active_channels's type from atomic_t to u8 2022-03-08 19:09:35 +01:00
dsa net: dsa: mt7530: fix incorrect test in mt753x_phylink_validate() 2022-03-16 14:15:57 +01:00
ethernet net: macb: Fix lost RX packet wakeup race in NAPI receive 2022-03-16 14:16:01 +01:00
fddi
fjes fjes: Check for error irq 2021-12-29 12:25:57 +01:00
hamradio hamradio: fix macro redefine warning 2022-03-08 19:09:39 +01:00
hippi
hyperv
ieee802154 net: ieee802154: ca8210: Fix lifs/sifs periods 2022-02-23 12:01:02 +01:00
ipa net: ipa: prevent concurrent replenish 2022-02-05 12:37:55 +01:00
ipvlan
mdio net: mdio: aspeed: Add missing MODULE_DEVICE_TABLE 2022-02-16 12:54:26 +01:00
netdevsim netdevsim: Zero-initialize memory for new map's value in function nsim_bpf_map_alloc 2021-12-22 09:30:55 +01:00
pcs
phy net: phy: DP83822: clear MISR2 register to disable interrupts 2022-03-16 14:15:59 +01:00
plip
ppp ppp: ensure minimum packet size in ppp_write() 2022-01-27 10:54:01 +01:00
slip
team
usb net: usb: cdc_mbim: avoid altsetting toggling for Telit FN990 2022-03-08 19:09:30 +01:00
vmxnet3 vmxnet3: do not stop tx queues after netif_device_detach() 2021-11-18 14:03:43 +01:00
wan
wimax
wireguard wireguard: ratelimiter: use kvcalloc() instead of kvzalloc() 2021-12-08 09:03:23 +01:00
wireless mac80211_hwsim: initialize ieee80211_tx_info at hw_scan_work 2022-03-08 19:09:29 +01:00
xen-netback Revert "xen-netback: Check for hotplug-status existence before watching" 2022-03-16 14:16:00 +01:00
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c
ifb.c ifb: fix building without CONFIG_NET_CLS_ACT 2021-11-18 14:03:49 +01:00
Kconfig ifb: Depend on netfilter alternatively to tc 2021-11-18 14:03:46 +01:00
LICENSE.SRC
loopback.c
macsec.c net: macsec: Verify that send_sci is on when setting Tx sci explicitly 2022-02-08 18:30:38 +01:00
macvlan.c
macvtap.c
Makefile
mdio.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-26 10:39:18 +01:00
veth.c veth: fix races around rq->rx_notify_masked 2022-02-16 12:54:26 +01:00
virtio_net.c
vrf.c vrf: don't run conntrack on vrf with !dflt qdisc 2021-12-14 11:32:36 +01:00
vsockmon.c
vxlan.c
xen-netfront.c xen/netfront: react properly to failing gnttab_end_foreign_access_ref() 2022-03-11 12:11:55 +01:00