diff options
author | Brian Russell <brian@graphiant.com> | 2021-02-09 11:36:31 +0000 |
---|---|---|
committer | Neale Ranns <neale@graphiant.com> | 2021-02-12 18:57:55 +0000 |
commit | b2aae75c1712b733f16e97bdb69e4b93f32de10c (patch) | |
tree | 569aa2f8742e4d98d05981e758a96e397413391c /src/vnet/policer/xlate.h | |
parent | 950d33ef67fdccc24c74cadf679cdeadc1cf6ddc (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/xlate.h')
-rw-r--r-- | src/vnet/policer/xlate.h | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/src/vnet/policer/xlate.h b/src/vnet/policer/xlate.h index 101c07074f2..46e58bd94d3 100644 --- a/src/vnet/policer/xlate.h +++ b/src/vnet/policer/xlate.h @@ -35,7 +35,7 @@ typedef enum qos_policer_type_en_ QOS_POLICER_TYPE_2R3C_RFC_4115 = 3, QOS_POLICER_TYPE_2R3C_RFC_MEF5CF1 = 4, QOS_POLICER_TYPE_MAX -} qos_policer_type_en; +} __clib_packed qos_policer_type_en; /* * edt: * enum @@ -47,7 +47,7 @@ typedef enum QOS_ROUND_TO_UP, QOS_ROUND_TO_DOWN, QOS_ROUND_INVALID -} qos_round_type_en; +} __clib_packed qos_round_type_en; /* * edt: * enum @@ -64,18 +64,7 @@ typedef enum QOS_RATE_KBPS = 0, QOS_RATE_PPS, QOS_RATE_INVALID -} qos_rate_type_en; - -/* - * edt: * enum - * Defines type of policer actions. - */ -typedef enum -{ - QOS_ACTION_DROP = 0, - QOS_ACTION_TRANSMIT, - QOS_ACTION_MARK_AND_TRANSMIT -} qos_action_type_en; +} __clib_packed qos_rate_type_en; /* * edt * struct qos_pol_action_params_st @@ -88,7 +77,7 @@ typedef enum */ typedef struct qos_pol_action_params_st_ { - u8 action_type; + qos_action_type_en action_type; ip_dscp_t dscp; } qos_pol_action_params_st; @@ -142,9 +131,9 @@ typedef struct qos_pol_cfg_params_st_ u64 eb_ms; } pps; } rb; /* rate burst config */ - u8 rate_type; /* qos_rate_type_en */ - u8 rnd_type; /* qos_round_type_en */ - u8 rfc; /* qos_policer_type_en */ + qos_rate_type_en rate_type; + qos_round_type_en rnd_type; + qos_policer_type_en rfc; u8 color_aware; u8 overwrite_bucket; /* for debugging purposes */ u32 current_bucket; /* for debugging purposes */ |