]> 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)
commit9b9fbba49a4bcf25abe71f7096cd3f424ad9eff2
tree9acd6f0cac4ac67578c21c74d29a3684c15dbe32
parent89ad3a2a06b04ac36466a27979508404a93b46ae
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