aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/pkt_cls.h
diff options
context:
space:
mode:
authorPaul Blakey <paulb@nvidia.com>2022-02-03 10:44:30 +0200
committerDavid S. Miller <davem@davemloft.net>2022-02-05 10:12:53 +0000
commit35d39fecbc242150af5587506e58ec1f8541fb68 (patch)
tree034d55a6ff7a088c066b6e9e50551ad508368669 /include/net/pkt_cls.h
parentMerge branch 'mptcp-improve-set-flags-command-and-update-self-tests' (diff)
downloadlinux-dev-35d39fecbc242150af5587506e58ec1f8541fb68.tar.xz
linux-dev-35d39fecbc242150af5587506e58ec1f8541fb68.zip
net/sched: Enable tc skb ext allocation on chain miss only when needed
Currently tc skb extension is used to send miss info from tc to ovs datapath module, and driver to tc. For the tc to ovs miss it is currently always allocated even if it will not be used by ovs datapath (as it depends on a requested feature). Export the static key which is used by openvswitch module to guard this code path as well, so it will be skipped if ovs datapath doesn't need it. Enable this code path once ovs datapath needs it. Signed-off-by: Paul Blakey <paulb@nvidia.com> Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--include/net/pkt_cls.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 676cb8ea9e15..a3b57a93228a 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -1028,4 +1028,15 @@ struct tc_fifo_qopt_offload {
};
};
+#ifdef CONFIG_NET_CLS_ACT
+DECLARE_STATIC_KEY_FALSE(tc_skb_ext_tc);
+void tc_skb_ext_tc_enable(void);
+void tc_skb_ext_tc_disable(void);
+#define tc_skb_ext_tc_enabled() static_branch_unlikely(&tc_skb_ext_tc)
+#else /* CONFIG_NET_CLS_ACT */
+static inline void tc_skb_ext_tc_enable(void) { }
+static inline void tc_skb_ext_tc_disable(void) { }
+#define tc_skb_ext_tc_enabled() false
+#endif
+
#endif