summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorYong Xu <yong.xu@corigine.com>2021-06-09 11:52:08 +0200
committerSimon Horman <simon.horman@netronome.com>2021-07-01 20:44:07 +0200
commitc2567e533f8a83cf705f008c4a6688e457d8f756 (patch)
tree04eb38878e0256d727febcdaa7fc82e4cc5e306e /include
parentb6c5f30cfa9994a1069bc6bef28a270bbb61df6c (diff)
downloadopenvswitch-c2567e533f8a83cf705f008c4a6688e457d8f756.tar.gz
add port-based ingress policing based packet-per-second rate-limiting
OVS has support for using policing to enforce a rate limit in kilobits per second. This is configured using OVSDB. f.e. $ ovs-vsctl set interface tap0 ingress_policing_rate=1000 $ ovs-vsctl set interface tap0 ingress_policing_burst=100 This patch adds a related feature, allowing policing to enforce a rate limit in kilo-packets per second. This is also configured using OVSDB. $ ovs-vsctl set interface tap0 ingress_policing_kpkts_rate=1000 $ ovs-vsctl set interface tap0 ingress_policing_kpkts_burst=100 The kilo-bit and kilo-packet rate limits may be used separately or in combination. Add separate action for BPS and PPS in netlink message. Revise code and change action result to pipe to allow traffic pipe into second action. This patch implements the feature for: * OVSDB (northbound API) * TC policer when used both with and without TC offload (kernel API) Signed-off-by: Yong Xu <yong.xu@corigine.com> Signed-off-by: Simon Horman <simon.horman@netronome.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/pkt_cls.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
index bc51a5767..ba82e690e 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_FLOWER_KEY_CT_FLAGS_REPLY)
+#if defined(__KERNEL__) || defined(HAVE_TCA_POLICE_PKTRATE64)
#include_next <linux/pkt_cls.h>
#else
@@ -104,6 +104,10 @@ enum {
TCA_POLICE_RESULT,
TCA_POLICE_TM,
TCA_POLICE_PAD,
+ TCA_POLICE_RATE64,
+ TCA_POLICE_PEAKRATE64,
+ TCA_POLICE_PKTRATE64,
+ TCA_POLICE_PKTBURST64,
__TCA_POLICE_MAX
#define TCA_POLICE_RESULT TCA_POLICE_RESULT
};