]> git.baikalelectronics.ru Git - kernel.git/commit
qdisc: validate skb without holding lock
authorEric Dumazet <edumazet@google.com>
Fri, 3 Oct 2014 22:31:07 +0000 (15:31 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 3 Oct 2014 22:36:11 +0000 (15:36 -0700)
commitef3c95e573066ae7c78b5c2b5ae33907007a51b0
tree2c33ad6aaf7a604185bff5659d64895f5cf9a348
parenta043bc8dc66c0201d47d1dc8e981f92c3c9dafc7
qdisc: validate skb without holding lock

Validation of skb can be pretty expensive :

GSO segmentation and/or checksum computations.

We can do this without holding qdisc lock, so that other cpus
can queue additional packets.

Trick is that requeued packets were already validated, so we carry
a boolean so that sch_direct_xmit() can validate a fresh skb list,
or directly use an old one.

Tested on 40Gb NIC (8 TX queues) and 200 concurrent flows, 48 threads
host.

Turning TSO on or off had no effect on throughput, only few more cpu
cycles. Lock contention on qdisc lock disappeared.

Same if disabling TX checksum offload.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netdevice.h
include/net/pkt_sched.h
net/core/dev.c
net/sched/sch_generic.c