diff options
author | Brian Russell <brian@graphiant.com> | 2021-02-15 11:49:42 +0000 |
---|---|---|
committer | Neale Ranns <neale@graphiant.com> | 2021-02-15 16:18:32 +0000 |
commit | 54be0cc044f445853fae7b8995c477605250af16 (patch) | |
tree | c0be40e818039fa620efda5bb85e7535f63ef296 /src/vnet/policer/xlate.c | |
parent | 1a3e08a7197addb1c07e66c1b1da3286c9bcb140 (diff) |
policer: improve policer struct
Ensure policer struct is cache aligned and fits in one cache line.
Give it a simpler name to reflect its job as the representation of
a policer.
Type: improvement
Signed-off-by: Brian Russell <brian@graphiant.com>
Change-Id: If1ae4931c818b86eee20306e503f4e5d6b84bd0d
Diffstat (limited to 'src/vnet/policer/xlate.c')
-rw-r--r-- | src/vnet/policer/xlate.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/vnet/policer/xlate.c b/src/vnet/policer/xlate.c index 92f1c4721ac..9c4d76fd990 100644 --- a/src/vnet/policer/xlate.c +++ b/src/vnet/policer/xlate.c @@ -946,8 +946,7 @@ compute_policer_params (u64 hz, /* CPU speed in clocks per second */ * Return: Status, success or failure code. */ int -x86_pol_compute_hw_params (qos_pol_cfg_params_st *cfg, - policer_read_response_type_st *hw) +x86_pol_compute_hw_params (qos_pol_cfg_params_st *cfg, policer_t *hw) { const int BYTES_PER_KBIT = (1000 / 8); u64 hz; @@ -1059,13 +1058,12 @@ x86_pol_compute_hw_params (qos_pol_cfg_params_st *cfg, * Return: Status, success or failure code. */ int -pol_logical_2_physical (qos_pol_cfg_params_st *cfg, - policer_read_response_type_st *phys) +pol_logical_2_physical (qos_pol_cfg_params_st *cfg, policer_t *phys) { int rc; qos_pol_cfg_params_st kbps_cfg; - clib_memset (phys, 0, sizeof (policer_read_response_type_st)); + clib_memset (phys, 0, sizeof (policer_t)); clib_memset (&kbps_cfg, 0, sizeof (qos_pol_cfg_params_st)); if (!cfg) @@ -1131,8 +1129,7 @@ pol_logical_2_physical (qos_pol_cfg_params_st *cfg, } static void -qos_convert_pol_bucket_to_hw_fmt (policer_read_response_type_st *bkt, - qos_pol_hw_params_st *hw_fmt) +qos_convert_pol_bucket_to_hw_fmt (policer_t *bkt, qos_pol_hw_params_st *hw_fmt) { clib_memset (hw_fmt, 0, sizeof (qos_pol_hw_params_st)); } @@ -1261,8 +1258,7 @@ qos_convert_burst_bytes_to_ms (u64 burst_bytes, u32 rate_kbps) * Return: Status, success or failure code. */ int -pol_physical_2_logical (policer_read_response_type_st *phys, - qos_pol_cfg_params_st *cfg) +pol_physical_2_logical (policer_t *phys, qos_pol_cfg_params_st *cfg) { int rc; qos_pol_hw_params_st pol_hw; |