]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit168006f6b275a88ab45c07cc5b7e3c1355589c61
tree9acd6f0cac4ac67578c21c74d29a3684c15dbe32
parent2a466fa81816f0e45bfd55796297fa565d2c4f44
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