36 sw_if_index, enable,
NULL, 0);
38 sw_if_index, enable,
NULL, 0);
40 sw_if_index, enable,
NULL, 0);
42 sw_if_index, enable,
NULL, 0);
48 sw_if_index, enable,
NULL, 0);
52 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);
86 return VNET_API_ERROR_NO_MATCHING_INTERFACE;
89 return VNET_API_ERROR_VALUE_EXIST;
107 u32 sw_if_index,
u32 is_add)
138 u32 n_left_from, *from, *to_next, next_index;
144 while (n_left_from > 0)
150 while (n_left_from > 0 && n_left_to_next > 0)
155 u32 sw_if_index0, next0, bi0;
178 ethertype = clib_net_to_host_u16 (*(
u16 *) (l3h - 2));
180 if (ethertype == ETHERNET_TYPE_IP4)
182 else if (ethertype == ETHERNET_TYPE_IP6)
184 else if (ethertype == ETHERNET_TYPE_MPLS)
219 b0->
flags |= VNET_BUFFER_F_QOS_DATA_VALID;
223 (b0->
flags & VLIB_BUFFER_IS_TRACED)))
236 L2INPUT_FEAT_L2_IP_QOS_RECORD);
243 to_next, n_left_to_next,
318 .name =
"ip4-qos-record",
319 .vector_size =
sizeof (
u32),
334 .arc_name =
"ip4-unicast",
335 .node_name =
"ip4-qos-record",
338 .arc_name =
"ip4-multicast",
339 .node_name =
"ip4-qos-record",
344 .name =
"ip6-qos-record",
345 .vector_size =
sizeof (
u32),
360 .arc_name =
"ip6-unicast",
361 .node_name =
"ip6-qos-record",
364 .arc_name =
"ip6-multicast",
365 .node_name =
"ip6-qos-record",
370 .name =
"mpls-qos-record",
371 .vector_size =
sizeof (
u32),
386 .arc_name =
"mpls-input",
387 .node_name =
"mpls-qos-record",
392 .name =
"vlan-mpls-qos-record",
393 .vector_size =
sizeof (
u32),
408 .arc_name =
"mpls-input",
409 .node_name =
"vlan-mpls-qos-record",
415 .name =
"vlan-ip4-qos-record",
416 .vector_size =
sizeof (
u32),
431 .arc_name =
"ip4-unicast",
432 .node_name =
"vlan-ip4-qos-record",
436 .arc_name =
"ip4-multicast",
437 .node_name =
"vlan-ip4-qos-record",
443 .name =
"vlan-ip6-qos-record",
444 .vector_size =
sizeof (
u32),
459 .arc_name =
"ip6-unicast",
460 .node_name =
"vlan-ip6-qos-record",
464 .arc_name =
"ip6-multicast",
465 .node_name =
"vlan-ip6-qos-record",
471 .name =
"l2-ip-qos-record",
472 .vector_size =
sizeof (
u32),
522 else if (
unformat (input,
"enable"))
524 else if (
unformat (input,
"disable"))
530 if (~0 == sw_if_index)
554 .path =
"qos record",
555 .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)
static_always_inline void vnet_feature_next(u32 sw_if_index, u32 *next0, vlib_buffer_t *b0)
#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 tyeps.
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.