linux_dsm_epyc7002/net
John Fastabend eb82a99447 net: sched, fix OOO packets with pfifo_fast
After the qdisc lock was dropped in pfifo_fast we allow multiple
enqueue threads and dequeue threads to run in parallel. On the
enqueue side the skb bit ooo_okay is used to ensure all related
skbs are enqueued in-order. On the dequeue side though there is
no similar logic. What we observe is with fewer queues than CPUs
it is possible to re-order packets when two instances of
__qdisc_run() are running in parallel. Each thread will dequeue
a skb and then whichever thread calls the ndo op first will
be sent on the wire. This doesn't typically happen because
qdisc_run() is usually triggered by the same core that did the
enqueue. However, drivers will trigger __netif_schedule()
when queues are transitioning from stopped to awake using the
netif_tx_wake_* APIs. When this happens netif_schedule() calls
qdisc_run() on the same CPU that did the netif_tx_wake_* which
is usually done in the interrupt completion context. This CPU
is selected with the irq affinity which is unrelated to the
enqueue operations.

To resolve this we add a RUNNING bit to the qdisc to ensure
only a single dequeue per qdisc is running. Enqueue and dequeue
operations can still run in parallel and also on multi queue
NICs we can still have a dequeue in-flight per qdisc, which
is typically per CPU.

Fixes: c5ad119fb6 ("net: sched: pfifo_fast use skb_array")
Reported-by: Jakob Unterwurzacher <jakob.unterwurzacher@theobroma-systems.com>
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-03-26 12:36:23 -04:00
..
6lowpan
9p
802
8021q vlan: Fix out of order vlan headers with reorder header off 2018-03-16 10:03:47 -04:00
appletalk
atm
ax25
batman-adv batman-adv: Fix skbuff rcsum on packet reroute 2018-03-18 13:20:32 +01:00
bluetooth
bpf
bridge
caif
can
ceph
core devlink: Remove redundant free on error path 2018-03-20 10:59:29 -04:00
dcb
dccp
decnet
dns_resolver
dsa
ethernet
hsr
ieee802154
ife
ipv4 net/ipv4: disable SMC TCP option with SYN Cookies 2018-03-25 20:53:54 -04:00
ipv6 ipv6: the entire IPv6 header chain must fit the first fragment 2018-03-25 21:17:20 -04:00
iucv net/iucv: Free memory obtained by kzalloc 2018-03-16 11:42:12 -04:00
kcm kcm: lock lower socket in kcm_attach 2018-03-16 11:12:16 -04:00
key
l2tp
l3mdev
lapb
llc
mac80211 mac80211: add ieee80211_hw flag for QoS NDP support 2018-03-21 10:56:18 +01:00
mac802154
mpls
ncsi
netfilter netfilter: nf_tables: do not hold reference on netdevice from preparation phase 2018-03-22 13:17:52 +01:00
netlabel
netlink netlink: make sure nladdr has correct size in netlink_connect() 2018-03-25 21:14:51 -04:00
netrom
nfc
nsh
openvswitch
packet
phonet
psample
qrtr
rds
rfkill
rose
rxrpc
sched net: sched, fix OOO packets with pfifo_fast 2018-03-26 12:36:23 -04:00
sctp
smc net/smc: simplify wait when closing listen socket 2018-03-15 09:49:13 -04:00
strparser
sunrpc
switchdev
tipc
tls
unix
vmw_vsock
wimax
wireless
x25
xfrm
compat.c
Kconfig
Makefile
socket.c
sysctl_net.c