91 s =
format (s,
"policer at %llx: %s rate, %s color-aware\n",
94 s =
format (s,
"cir %u tok/period, pir %u tok/period, scale %u\n",
97 s =
format (s,
"cur lim %u, cur bkt %u, ext lim %u, ext bkt %u\n",
118 s =
format (s,
"ILLEGAL");
133 s =
format (s,
"ILLEGAL");
149 s =
format (s,
"2r3c-2698");
152 s =
format (s,
"2r3c-4115");
155 s =
format (s,
"2r3c-mef5cf1");
157 s =
format (s,
"ILLEGAL");
167 #define _(v,f,str) case VNET_DSCP_##f: t = str; break; 171 return format (s,
"ILLEGAL");
185 s =
format (s,
"transmit");
189 s =
format (s,
"ILLEGAL");
198 s =
format (s,
"type %U cir %u eir %u cb %u eb %u\n",
204 s =
format (s,
"rate type %U, round type %U\n",
207 s =
format (s,
"conform action %U, exceed action %U, violate action %U\n",
227 else if (
unformat (input,
"2r3c-2698"))
229 else if (
unformat (input,
"2r3c-4115"))
231 else if (
unformat (input,
"2r3c-mef5cf1"))
323 u8 * r = va_arg (*va,
u8 *);
326 #define _(v,f,str) else if (unformat (input, str)) *r = VNET_DSCP_##f; 342 else if (
unformat (input,
"transmit"))
372 u32 * r = va_arg (*va,
u32 *);
377 if (
unformat (input,
"%s", &match_name))
395 u32 * r = va_arg (*va,
u32 *);
397 if (
unformat (input,
"conform-color"))
399 else if (
unformat (input,
"exceed-color"))
407 #define foreach_config_param \ 432 memset (&c, 0,
sizeof (c));
438 else if (
unformat(line_input,
"name %s", &name))
440 else if (
unformat(line_input,
"color-aware"))
443 #define _(a) else if (unformat (line_input, "%U", unformat_policer_##a, &c)) ; 458 .path =
"configure policer",
459 .short_help =
"configure policer name <name> <params> ",
477 (void)
unformat (input,
"name %s", &match_name);
481 name = (u8 *) p->key;
482 if (match_name == 0 || !strcmp((char *) name, (char *) match_name))
484 pool_index = p->value[0];
485 config = pool_elt_at_index (pm->configs, pool_index);
486 templ = pool_elt_at_index (pm->policer_templates, pool_index);
487 vlib_cli_output (vm,
"Name \"%s\" %U ",
488 name, format_policer_config, config);
489 vlib_cli_output (vm,
"Template %U",
490 format_policer_instance, templ);
491 vlib_cli_output (vm,
"-----------");
499 .path =
"show policer",
500 .short_help =
"show policer [name]",
uword * policer_index_by_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
static uword unformat_policer_action(unformat_input_t *input, va_list *va)
#define foreach_config_param
sse2_qos_pol_action_params_st conform_action
static u8 * format_dscp(u8 *s, va_list *va)
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)
static uword unformat_policer_type(unformat_input_t *input, va_list *va)
u8 * format_policer_instance(u8 *s, va_list *va)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
static u8 * format_policer_round_type(u8 *s, va_list *va)
static uword unformat_policer_action_type(unformat_input_t *input, va_list *va)
vnet_main_t * vnet_get_main(void)
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)
struct sse2_qos_pol_cfg_params_st_::@190::@191 kbps
static uword unformat_policer_round_type(unformat_input_t *input, va_list *va)
union sse2_qos_pol_cfg_params_st_::@190 rb
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)
sse2_qos_pol_action_params_st violate_action
void vnet_classify_register_unformat_opaque_index_fn(unformat_function_t *fn)
policer_read_response_type_st * policers
void vnet_policer_node_funcs_reference(void)
sse2_qos_pol_action_params_st exceed_action
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P (general version).
static uword unformat_policer_classify_next_index(unformat_input_t *input, va_list *va)
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)
uint32_t cir_tokens_per_period
clib_error_t * policer_add_del(vlib_main_t *vm, u8 *name, sse2_qos_pol_cfg_params_st *cfg, u32 *policer_index, u8 is_add)
static uword unformat_dscp(unformat_input_t *input, va_list *va)
static u8 * format_policer_type(u8 *s, va_list *va)
u8 * format_policer_config(u8 *s, va_list *va)
VLIB_CLI_COMMAND(set_interface_ip_source_and_port_range_check_command, static)
#define hash_foreach_pair(p, v, body)
static u8 * format_policer_action_type(u8 *s, va_list *va)
#define hash_get_mem(h, key)
static uword unformat_policer_cb(unformat_input_t *input, va_list *va)
static uword unformat_policer_classify_precolor(unformat_input_t *input, va_list *va)
policer_read_response_type_st * policer_templates
void vnet_classify_register_unformat_policer_next_index_fn(unformat_function_t *fn)
#define clib_error_return(e, args...)
#define CLIB_CACHE_LINE_BYTES
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)