aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sch_generic.h
diff options
context:
space:
mode:
authorJohn Fastabend <john.fastabend@gmail.com>2017-12-07 09:54:25 -0800
committerDavid S. Miller <davem@davemloft.net>2017-12-08 13:32:25 -0500
commit6b3ba9146fe64b9bebb6346c9dcfe3b4851de2d7 (patch)
tree9acd6f0cac4ac67578c21c74d29a3684c15dbe32 /include/net/sch_generic.h
parentnet: sched: cleanup qdisc_run and __qdisc_run semantics (diff)
downloadlinux-dev-6b3ba9146fe64b9bebb6346c9dcfe3b4851de2d7.tar.xz
linux-dev-6b3ba9146fe64b9bebb6346c9dcfe3b4851de2d7.zip
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>
Diffstat (limited to 'include/net/sch_generic.h')
-rw-r--r--include/net/sch_generic.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 7dd8b0b0d244..77791fa055de 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -71,6 +71,7 @@ struct Qdisc {
* qdisc_tree_decrease_qlen() should stop.
*/
#define TCQ_F_INVISIBLE 0x80 /* invisible by default in dump */
+#define TCQ_F_NOLOCK 0x100 /* qdisc does not require locking */
u32 limit;
const struct Qdisc_ops *ops;
struct qdisc_size_table __rcu *stab;