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/policer.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/policer.c')
-rw-r--r-- | src/vnet/policer/policer.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/vnet/policer/policer.c b/src/vnet/policer/policer.c index 8146d4bb0c3..f6a19f40020 100644 --- a/src/vnet/policer/policer.c +++ b/src/vnet/policer/policer.c @@ -54,8 +54,8 @@ policer_add_del (vlib_main_t *vm, u8 *name, qos_pol_cfg_params_st *cfg, u32 *policer_index, u8 is_add) { vnet_policer_main_t *pm = &vnet_policer_main; - policer_read_response_type_st test_policer; - policer_read_response_type_st *policer; + policer_t test_policer; + policer_t *policer; uword *p; u32 pi; int rv; @@ -99,7 +99,7 @@ policer_add_del (vlib_main_t *vm, u8 *name, qos_pol_cfg_params_st *cfg, if (rv == 0) { - policer_read_response_type_st *pp; + policer_t *pp; qos_pol_cfg_params_st *cp; int i; @@ -138,7 +138,7 @@ int policer_bind_worker (u8 *name, u32 worker, bool bind) { vnet_policer_main_t *pm = &vnet_policer_main; - policer_read_response_type_st *policer; + policer_t *policer; uword *p; p = hash_get_mem (pm->policer_index_by_name, name); @@ -168,8 +168,7 @@ policer_bind_worker (u8 *name, u32 worker, bool bind) u8 * format_policer_instance (u8 * s, va_list * va) { - policer_read_response_type_st *i - = va_arg (*va, policer_read_response_type_st *); + policer_t *i = va_arg (*va, policer_t *); uword pi = va_arg (*va, uword); int result; vlib_counter_t counts[NUM_POLICE_RESULTS]; @@ -533,7 +532,7 @@ show_policer_command_fn (vlib_main_t * vm, u8 *name; uword *pi; qos_pol_cfg_params_st *config; - policer_read_response_type_st *templ; + policer_t *templ; (void) unformat (input, "name %s", &match_name); |