73 s =
format (s,
"policer at %llx: %s rate, %s color-aware\n",
76 s =
format (s,
"cir %u tok/period, pir %u tok/period, scale %u\n",
79 s =
format (s,
"cur lim %u, cur bkt %u, ext lim %u, ext bkt %u\n",
100 s =
format (s,
"ILLEGAL");
115 s =
format (s,
"ILLEGAL");
131 s =
format (s,
"2r3c-2698");
134 s =
format (s,
"2r3c-4115");
137 s =
format (s,
"2r3c-mef5cf1");
139 s =
format (s,
"ILLEGAL");
148 s =
format (s,
"type %U cir %u eir %u cb %u eb %u\n",
154 s =
format (s,
"rate type %U, round type %U\n",
173 else if (
unformat (input,
"2r3c-2698"))
175 else if (
unformat (input,
"2r3c-4115"))
177 else if (
unformat (input,
"2r3c-mef5cf1"))
267 #define foreach_config_param \ 290 memset (&c, 0,
sizeof (c));
296 else if (
unformat(line_input,
"name %s", &name))
299 #define _(a) else if (unformat (line_input, "%U", unformat_policer_##a, &c)) ; 314 .path =
"configure policer",
315 .short_help =
"configure policer name <name> <params> ",
337 name = (u8 *) p->key;
338 if (match_name == 0 || !strcmp((char *) name, (char *) match_name))
340 pool_index = p->value[0];
341 config = pool_elt_at_index (pm->configs, pool_index);
342 templ = pool_elt_at_index (pm->policer_templates, pool_index);
343 vlib_cli_output (vm,
"Name \"%s\" %U ",
344 name, format_policer_config, config);
345 vlib_cli_output (vm,
"Template %U",
346 format_policer_instance, templ);
347 vlib_cli_output (vm,
"-----------");
355 .path =
"show policer",
356 .short_help =
"show policer [name]",
static uword unformat_policer_eir(unformat_input_t *input, va_list *va)
sse2_qos_pol_cfg_params_st * configs
sll srl srl sll sra u16x4 i
#define foreach_config_param
static void(BVT(clib_bihash)*h, BVT(clib_bihash_value)*v)
uword * policer_config_by_name
#define hash_set_mem(h, key, value)
trans_layer_rc sse2_pol_logical_2_physical(sse2_qos_pol_cfg_params_st *cfg, policer_read_response_type_st *phys)
static uword unformat_policer_rate_type(unformat_input_t *input, va_list *va)
union sse2_qos_pol_cfg_params_st_::@153 rb
static uword unformat_policer_type(unformat_input_t *input, va_list *va)
u8 * format_policer_instance(u8 *s, va_list *va)
static u8 * format_policer_round_type(u8 *s, va_list *va)
vnet_main_t * vnet_get_main(void)
clib_error_t * policer_add_del(vlib_main_t *vm, u8 *name, sse2_qos_pol_cfg_params_st *cfg, u8 is_add)
static clib_error_t * show_policer_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define VLIB_INIT_FUNCTION(x)
static u8 * format_policer_rate_type(u8 *s, va_list *va)
static uword unformat_policer_round_type(unformat_input_t *input, va_list *va)
static uword unformat_policer_cir(unformat_input_t *input, va_list *va)
#define hash_create_string(elts, value_bytes)
#define hash_unset_mem(h, key)
clib_error_t * policer_init(vlib_main_t *vm)
struct sse2_qos_pol_cfg_params_st_::@153::@154 kbps
void vnet_policer_node_funcs_reference(void)
uint64_t last_update_time
#define vec_free(V)
Free vector's memory (no header).
static clib_error_t * configure_policer_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define clib_memcpy(a, b, c)
#define VLIB_CLI_COMMAND(x,...)
uint32_t cir_tokens_per_period
static u8 * format_policer_type(u8 *s, va_list *va)
u8 * format_policer_config(u8 *s, va_list *va)
#define hash_foreach_pair(p, v, body)
#define hash_get_mem(h, key)
static uword unformat_policer_cb(unformat_input_t *input, va_list *va)
policer_read_response_type_st * policer_templates
#define clib_error_return(e, args...)
uint32_t pir_tokens_per_period
vnet_policer_main_t vnet_policer_main
static uword unformat_policer_eb(unformat_input_t *input, va_list *va)