aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/policer/police.h
diff options
context:
space:
mode:
authorBrian Russell <brian@graphiant.com>2021-02-09 11:36:31 +0000
committerNeale Ranns <neale@graphiant.com>2021-02-12 18:57:55 +0000
commitb2aae75c1712b733f16e97bdb69e4b93f32de10c (patch)
tree569aa2f8742e4d98d05981e758a96e397413391c /src/vnet/policer/police.h
parent950d33ef67fdccc24c74cadf679cdeadc1cf6ddc (diff)
policer: use enum types
Make the policer action enum packed and use it in the policer code. Use other policer enums where applicable. Type: improvement Signed-off-by: Brian Russell <brian@graphiant.com> Change-Id: I32f9735942af8bca3160b9ef8a75f605d9aba5fa
Diffstat (limited to 'src/vnet/policer/police.h')
-rw-r--r--src/vnet/policer/police.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/vnet/policer/police.h b/src/vnet/policer/police.h
index 602784504b2..7867a2e2f33 100644
--- a/src/vnet/policer/police.h
+++ b/src/vnet/policer/police.h
@@ -24,6 +24,13 @@ typedef enum
#define NUM_POLICE_RESULTS 3
+typedef enum
+{
+ QOS_ACTION_DROP = 0,
+ QOS_ACTION_TRANSMIT,
+ QOS_ACTION_MARK_AND_TRANSMIT
+} __clib_packed qos_action_type_en;
+
// This is the hardware representation of the policer.
// To be multithread-safe, the policer is accessed through a spin-lock
// on the lock field. (For a policer update operation, 24B needs to be
@@ -70,7 +77,7 @@ typedef struct
u32 single_rate; // 1 = single rate policer, 0 = two rate policer
u32 color_aware; // for hierarchical policing
u32 scale; // power-of-2 shift amount for lower rates
- u8 action[3];
+ qos_action_type_en action[3];
ip_dscp_t mark_dscp[3];
u8 pad[2];