linux/drivers/net
Vimlesh Kumar 43b3160cb6 octeon_ep: avoid compiler and IQ/OQ reordering
Utilize READ_ONCE and WRITE_ONCE APIs for IO queue Tx/Rx
variable access to prevent compiler optimization and reordering.
Additionally, ensure IO queue OUT/IN_CNT registers are flushed
by performing a read-back after writing.

The compiler could reorder reads/writes to pkts_pending, last_pkt_count,
etc., causing stale values to be used when calculating packets to process
or register updates to send to hardware. The Octeon hardware requires a
read-back after writing to OUT_CNT/IN_CNT registers to ensure the write
has been flushed through any posted write buffers before the interrupt
resend bit is set. Without this, we have observed cases where the hardware
didn't properly update its internal state.

wmb/rmb only provides ordering guarantees but doesn't prevent the compiler
from performing optimizations like caching in registers, load tearing etc.

Fixes: 37d79d0596 ("octeon_ep: add Tx/Rx processing and interrupt support")
Signed-off-by: Sathesh Edara <sedara@marvell.com>
Signed-off-by: Shinas Rasheed <srasheed@marvell.com>
Signed-off-by: Vimlesh Kumar <vimleshk@marvell.com>
Link: https://patch.msgid.link/20260227091402.1773833-3-vimleshk@marvell.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-03-03 11:34:20 +01:00
..
arcnet Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
bonding bpf/bonding: reject vlan+srcmac xmit_hash_policy change when XDP is loaded 2026-03-03 10:47:37 +01:00
caif treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
can Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
dsa net: dsa: realtek: rtl8365mb: fix rtl8365mb_phy_ocp_write return value 2026-03-02 18:32:40 -08:00
ethernet octeon_ep: avoid compiler and IQ/OQ reordering 2026-03-03 11:34:20 +01:00
fddi
fjes Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hamradio Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hyperv Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
ieee802154 Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
ipa Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
ipvlan Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mctp Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mdio net: mdio: rtl9300: use scoped for loops 2025-12-28 08:55:48 +01:00
netdevsim Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
ovpn Including fixes from IPsec, Bluetooth and netfilter 2026-02-26 08:00:13 -08:00
pcs Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
phy Including fixes from IPsec, Bluetooth and netfilter 2026-02-26 08:00:13 -08:00
plip
ppp Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
pse-pd Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
slip Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
team Including fixes from IPsec, Bluetooth and netfilter 2026-02-26 08:00:13 -08:00
thunderbolt net: thunderbolt: Allow reading link settings 2026-01-19 12:09:58 -08:00
usb net: usb: r8152: add TRENDnet TUC-ET2G 2026-02-27 19:27:31 -08:00
vmxnet3 net: vmxnet3: convert to use .get_rx_ring_count 2025-11-19 20:14:21 -08:00
vxlan Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
wan Including fixes from IPsec, Bluetooth and netfilter 2026-02-26 08:00:13 -08:00
wireguard Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
wireless Including fixes from IPsec, Bluetooth and netfilter 2026-02-26 08:00:13 -08:00
wwan Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
xen-netback Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
amt.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
bareudp.c
dummy.c
eql.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
geneve.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
gtp.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
ifb.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
Kconfig printk: add CONFIG_PRINTK dependency for netconsole 2026-02-17 13:04:20 +01:00
LICENSE.SRC
loopback.c
macsec.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
macvlan.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
macvtap.c
Makefile net: remove HIPPI support and RoadRunner HIPPI driver 2026-01-20 19:12:06 -08:00
mdio.c
mhi_net.c
mii.c
net_failover.c net: remove unnecessary module_init/exit functions 2026-02-02 17:25:23 -08:00
netconsole.c Including fixes from IPsec, Bluetooth and netfilter 2026-02-26 08:00:13 -08:00
netkit.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
nlmon.c
ntb_netdev.c
pfcp.c
rionet.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
Space.c
sungem_phy.c net: sungem_phy: Fix a typo error in sungem_phy 2025-11-04 17:00:55 -08:00
tap.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
tun.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
tun_vnet.h virtio-net: avoid unnecessary checksum calculation on guest RX 2025-11-26 19:45:54 -08:00
veth.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
virtio_net.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
vrf.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
vsockmon.c
xen-netfront.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00