38 sw_if_index, enable,
NULL, 0);
40 sw_if_index, enable,
NULL, 0);
42 sw_if_index, enable,
NULL, 0);
44 sw_if_index, enable,
NULL, 0);
50 sw_if_index, enable,
NULL, 0);
54 sw_if_index, enable,
NULL, 0);
56 sw_if_index, enable,
NULL, 0);
58 sw_if_index, enable,
NULL, 0);
60 sw_if_index, enable,
NULL, 0);
62 sw_if_index, enable,
NULL, 0);
88 return VNET_API_ERROR_NO_MATCHING_INTERFACE;
91 return VNET_API_ERROR_VALUE_EXIST;
140 u32 n_left_from, *from, *to_next, next_index;
146 while (n_left_from > 0)
152 while (n_left_from > 0 && n_left_to_next > 0)
180 ethertype = clib_net_to_host_u16 (*(
u16 *) (l3h - 2));
182 if (ethertype == ETHERNET_TYPE_IP4)
184 else if (ethertype == ETHERNET_TYPE_IP6)
186 else if (ethertype == ETHERNET_TYPE_MPLS)
221 b0->
flags |= VNET_BUFFER_F_QOS_DATA_VALID;
224 (b0->
flags & VLIB_BUFFER_IS_TRACED)))
237 L2INPUT_FEAT_L2_IP_QOS_RECORD);
244 to_next, n_left_to_next,
319 .name =
"ip4-qos-record",
320 .vector_size =
sizeof (
u32),
335 .arc_name =
"ip4-unicast",
336 .node_name =
"ip4-qos-record",
339 .arc_name =
"ip4-multicast",
340 .node_name =
"ip4-qos-record",
345 .name =
"ip6-qos-record",
346 .vector_size =
sizeof (
u32),
361 .arc_name =
"ip6-unicast",
362 .node_name =
"ip6-qos-record",
365 .arc_name =
"ip6-multicast",
366 .node_name =
"ip6-qos-record",
371 .name =
"mpls-qos-record",
372 .vector_size =
sizeof (
u32),
387 .arc_name =
"mpls-input",
388 .node_name =
"mpls-qos-record",
393 .name =
"vlan-mpls-qos-record",
394 .vector_size =
sizeof (
u32),
409 .arc_name =
"mpls-input",
410 .node_name =
"vlan-mpls-qos-record",
416 .name =
"vlan-ip4-qos-record",
417 .vector_size =
sizeof (
u32),
432 .arc_name =
"ip4-unicast",
433 .node_name =
"vlan-ip4-qos-record",
437 .arc_name =
"ip4-multicast",
438 .node_name =
"vlan-ip4-qos-record",
444 .name =
"vlan-ip6-qos-record",
445 .vector_size =
sizeof (
u32),
460 .arc_name =
"ip6-unicast",
461 .node_name =
"vlan-ip6-qos-record",
465 .arc_name =
"ip6-multicast",
466 .node_name =
"vlan-ip6-qos-record",
472 .name =
"l2-ip-qos-record",
473 .vector_size =
sizeof (
u32),
523 else if (
unformat (input,
"enable"))
525 else if (
unformat (input,
"disable"))
531 if (~0 == sw_if_index)
555 .path =
"qos record",
556 .short_help =
"qos record <record-source> <INTERFACE> [disable]",
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
vlib_node_registration_t ip6_qos_record_node
(constructor) VLIB_REGISTER_NODE (ip6_qos_record_node)
static uword ip4_qos_record(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
vlib_node_registration_t vlan_ip6_qos_record_node
(constructor) VLIB_REGISTER_NODE (vlan_ip6_qos_record_node)
vnet_main_t * vnet_get_main(void)
VNET_SW_INTERFACE_ADD_DEL_FUNCTION(qos_record_ip_interface_add_del)
static u8 * qos_record_configs[QOS_N_SOURCES]
Per-interface, per-protocol vector of feature on/off configurations.
vlib_node_registration_t vlan_ip4_qos_record_node
(constructor) VLIB_REGISTER_NODE (vlan_ip4_qos_record_node)
clib_error_t * l2_ip_qos_init(vlib_main_t *vm)
unformat_function_t unformat_vnet_sw_interface
static u32 vnet_l2_feature_next(vlib_buffer_t *b, u32 *next_nodes, u32 feat_bit)
Return the graph node index for the feature corresponding to the next set bit after clearing the curr...
Some external source, e.g.
static uword mpls_qos_record(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static clib_error_t * qos_record_cli(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define VLIB_INIT_FUNCTION(x)
static uword qos_record_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, dpo_proto_t dproto, int is_l2)
static_always_inline u8 ip6_traffic_class_network_order(const ip6_header_t *ip6)
#define clib_error_return(e, args...)
#define FOR_EACH_QOS_SOURCE(_src)
enum dpo_proto_t_ dpo_proto_t
Data path protocol.
struct qos_record_trace_t_ qos_record_trace_t
per-packet trace data
static clib_error_t * qos_record_ip_interface_add_del(vnet_main_t *vnm, u32 sw_if_index, u32 is_add)
VLIB_NODE_FUNCTION_MULTIARCH(ip4_qos_record_node, ip4_qos_record)
static u32 l2_qos_input_next[QOS_N_SOURCES][32]
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static void qos_record_feature_config(u32 sw_if_index, qos_source_t input_source, u8 enable)
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
vlib_node_registration_t mpls_qos_record_node
(constructor) VLIB_REGISTER_NODE (mpls_qos_record_node)
#define VLIB_REGISTER_NODE(x,...)
enum qos_source_t_ qos_source_t
QoS types.
static_always_inline void vnet_feature_next(u32 *next0, vlib_buffer_t *b0)
static void feat_bitmap_init_next_nodes(vlib_main_t *vm, u32 node_index, u32 num_features, char **feat_names, u32 *next_nodes)
Initialize the feature next-node indexes of a graph node.
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
#define VLIB_CLI_COMMAND(x,...)
int qos_record_disable(u32 sw_if_index, qos_source_t input_source)
static u8 * format_qos_record_trace(u8 *s, va_list *args)
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
static uword ip6_qos_record(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
IPv6 to IPv4 translation.
#define VNET_FEATURES(...)
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static vlib_node_registration_t l2_ip_qos_record_node
(constructor) VLIB_REGISTER_NODE (l2_ip_qos_record_node)
static uword l2_ip_qos_record(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
vlib_node_registration_t vlan_mpls_qos_record_node
(constructor) VLIB_REGISTER_NODE (vlan_mpls_qos_record_node)
int qos_record_enable(u32 sw_if_index, qos_source_t input_source)
static uword vlan_ip6_qos_record(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static uword vlan_ip4_qos_record(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
u16 flags
Copy of main node flags.
static u32 vnet_mpls_uc_get_exp(mpls_label_t label_exp_s_ttl)
static u8 ethernet_vlan_header_get_priority_net_order(ethernet_vlan_header_t *h)
#define VLIB_NODE_FLAG_TRACE
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
vlib_node_registration_t ip4_qos_record_node
(constructor) VLIB_REGISTER_NODE (ip4_qos_record_node)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
uword unformat_qos_source(unformat_input_t *input, va_list *args)
u8 qos_bits_t
Type, er, safety for us water based entities.
VNET_FEATURE_INIT(ip4_qos_record_node, static)
static uword vlan_mpls_qos_record(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
int vnet_feature_enable_disable(const char *arc_name, const char *node_name, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)
#define QOS_N_SOURCES
The maximum number of sources.