summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBaowen Zheng <baowen.zheng@corigine.com>2022-09-30 14:07:56 +0800
committerSimon Horman <simon.horman@corigine.com>2022-11-01 10:18:16 +0100
commitffcb6f115fe5e00be3ca8fb9a940a3224e687e23 (patch)
tree2aeb478eabd799933e30218adfee15698d8bca70 /include
parent743499607bdd0dcb3541a179ba2bb41ea10c4b3b (diff)
downloadopenvswitch-ffcb6f115fe5e00be3ca8fb9a940a3224e687e23.tar.gz
netdev-linux: Allow meter to work in tc software datapath when tc-policy is specified
Add tc action flags when adding police action to offload meter table. There is a restriction that the flag of skip_sw/skip_hw should be same for filter rule and the independent created tc actions the rule uses. In this case, if we configure the tc-policy as skip_hw, filter rule will be created with skip_hw flag and the police action according to meter table will have no action flag, then flower rule will fail to add to tc kernel system. To fix this issue, we will add tc action flag when adding police action to offload a meter table, so it will allow meter table to work in tc software datapath. Fixes: 5c039ddc64ff ("netdev-linux: Add functions to manipulate tc police action") Signed-off-by: Baowen Zheng <baowen.zheng@corigine.com> Acked-by: Ilya Maximets <i.maximets@ovn.org> Signed-off-by: Simon Horman <simon.horman@corigine.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/pkt_cls.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
index ba82e690e..a8cd8db5b 100644
--- a/include/linux/pkt_cls.h
+++ b/include/linux/pkt_cls.h
@@ -1,7 +1,7 @@
#ifndef __LINUX_PKT_CLS_WRAPPER_H
#define __LINUX_PKT_CLS_WRAPPER_H 1
-#if defined(__KERNEL__) || defined(HAVE_TCA_POLICE_PKTRATE64)
+#if defined(__KERNEL__) || defined(HAVE_TCA_ACT_FLAGS_SKIP_HW)
#include_next <linux/pkt_cls.h>
#else
@@ -21,9 +21,12 @@ enum {
__TCA_ACT_MAX
};
-#define TCA_ACT_FLAGS_NO_PERCPU_STATS 1 /* Don't use percpu allocator for
- * actions stats.
- */
+/* See other TCA_ACT_FLAGS_ * flags in include/net/act_api.h. */
+#define TCA_ACT_FLAGS_NO_PERCPU_STATS (1 << 0) /* Don't use percpu allocator for
+ * actions stats.
+ */
+#define TCA_ACT_FLAGS_SKIP_HW (1 << 1) /* don't offload action to HW */
+#define TCA_ACT_FLAGS_SKIP_SW (1 << 2) /* don't use action in SW */
#define TCA_ACT_MAX __TCA_ACT_MAX
#define TCA_OLD_COMPAT (TCA_ACT_MAX+1)