]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit - net/core/dev.c
net: sched: allow qdiscs to handle locking
authorJohn Fastabend <john.fastabend@gmail.com>
Thu, 7 Dec 2017 17:54:25 +0000 (09:54 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 8 Dec 2017 18:32:25 +0000 (13:32 -0500)
commit6b3ba9146fe64b9bebb6346c9dcfe3b4851de2d7
tree9acd6f0cac4ac67578c21c74d29a3684c15dbe32
parent6c148184b5c868ad2c8a5a4a777cd8097622368a
net: sched: allow qdiscs to handle locking

This patch adds a flag for queueing disciplines to indicate the stack
does not need to use the qdisc lock to protect operations. This can
be used to build lockless scheduling algorithms and improving
performance.

The flag is checked in the tx path and the qdisc lock is only taken
if it is not set. For now use a conditional if statement. Later we
could be more aggressive if it proves worthwhile and use a static key
or wrap this in a likely().

Also the lockless case drops the TCQ_F_CAN_BYPASS logic. The reason
for this is synchronizing a qlen counter across threads proves to
cost more than doing the enqueue/dequeue operations when tested with
pktgen.

Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sch_generic.h
net/core/dev.c
net/sched/sch_generic.c