31 sw_if_index, enable,
NULL, 0);
33 sw_if_index, enable,
NULL, 0);
44 sw_if_index, enable,
NULL, 0);
46 sw_if_index, enable,
NULL, 0);
48 sw_if_index, enable,
NULL, 0);
55 sw_if_index, enable,
NULL, 0);
103 u32 n_left_from, *from, *to_next, next_index;
109 while (n_left_from > 0)
115 while (n_left_from > 0 && n_left_to_next > 0)
119 u32 sw_if_index0, next0, bi0;
175 mpls_bytes_0[2] &= 0xf1;
177 mpls_bytes_0[2] |= (qos0 & 0x7) << 1;
178 eos0 = mpls_bytes_0[2] & 0x1;
198 t->
input = input_source0;
199 t->
used = (b0->
flags & VNET_BUFFER_F_QOS_DATA_VALID);
204 to_next, n_left_to_next,
222 s =
format (s,
"source:%U qos:%d used:%s",
273 .name =
"ip4-qos-mark",
274 .vector_size =
sizeof (
u32),
289 .arc_name =
"ip4-output",
290 .node_name =
"ip4-qos-mark",
295 .name =
"ip6-qos-mark",
296 .vector_size =
sizeof (
u32),
311 .arc_name =
"ip6-output",
312 .node_name =
"ip6-qos-mark",
317 .name =
"mpls-qos-mark",
318 .vector_size =
sizeof (
u32),
333 .arc_name =
"mpls-output",
334 .node_name =
"mpls-qos-mark",
339 .name =
"vlan-ip4-qos-mark",
340 .vector_size =
sizeof (
u32),
355 .arc_name =
"ip4-output",
356 .node_name =
"vlan-ip4-qos-mark",
362 .name =
"vlan-ip6-qos-mark",
363 .vector_size =
sizeof (
u32),
378 .arc_name =
"ip6-output",
379 .node_name =
"vlan-ip6-qos-mark",
385 .name =
"vlan-mpls-qos-mark",
386 .vector_size =
sizeof (
u32),
401 .arc_name =
"mpls-output",
402 .node_name =
"vlan-mpls-qos-mark",
419 return VNET_API_ERROR_NO_SUCH_TABLE;
435 return VNET_API_ERROR_NO_MATCHING_INTERFACE;
437 return VNET_API_ERROR_VALUE_EXIST;
465 if (
unformat (input,
"id %d", &map_id))
467 else if (
unformat (input,
"disable"))
478 if (~0 == sw_if_index)
504 .short_help =
"qos mark <SOURCE> <INTERFACE> id <MAP>",
static uword qos_mark_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, qos_source_t output_source, int is_ip6)
qos_egress_map_t * qem_pool
Pool from which to allocate table.
vnet_main_t * vnet_get_main(void)
index_t qos_egress_map_find(qos_egress_map_id_t mid)
Get the VPP QoS map index from the user's map-ID.
VLIB_NODE_FUNCTION_MULTIARCH(ip4_qos_mark_node, ip4_qos_mark)
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
void qos_mark_vlan_enable_disable(u32 sw_if_index, u8 enable)
void qos_mark_ip_enable_disable(u32 sw_if_index, u8 enable)
unformat_function_t unformat_vnet_sw_interface
static uword ip6_qos_mark(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
int qos_mark_disable(u32 sw_if_index, qos_source_t output_source)
Some external source, e.g.
static_always_inline void ip6_set_traffic_class_network_order(ip6_header_t *ip6, u8 dscp)
vlib_node_registration_t mpls_qos_mark_node
(constructor) VLIB_REGISTER_NODE (mpls_qos_mark_node)
#define clib_error_return(e, args...)
struct qos_mark_trace_t_ qos_mark_trace_t
per-packet trace data
vlib_node_registration_t vlan_ip6_qos_mark_node
(constructor) VLIB_REGISTER_NODE (vlan_ip6_qos_mark_node)
int qos_mark_enable(u32 sw_if_index, qos_source_t output_source, qos_egress_map_id_t mid)
enable QoS marking by associating a MAP with an interface.
u8 * format_qos_source(u8 *s, va_list *args)
format/unformat QoS source types
vlib_node_registration_t vlan_mpls_qos_mark_node
(constructor) VLIB_REGISTER_NODE (vlan_mpls_qos_mark_node)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static uword vlan_mpls_qos_mark(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static void ethernet_vlan_header_set_priority_net_order(ethernet_vlan_header_t *h, u8 prio)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static qos_egress_map_t * qos_egress_map_interface(u32 sw_if_index, qos_source_t output_source)
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).
#define VLIB_REGISTER_NODE(x,...)
vlib_node_registration_t ip4_qos_mark_node
(constructor) VLIB_REGISTER_NODE (ip4_qos_mark_node)
enum qos_source_t_ qos_source_t
QoS tyeps.
static void qos_egress_map_feature_config(u32 sw_if_index, qos_source_t qs, u8 enable)
vlib_node_registration_t ip6_qos_mark_node
(constructor) VLIB_REGISTER_NODE (ip6_qos_mark_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.
static u8 * format_qos_mark_trace(u8 *s, va_list *args)
#define VLIB_CLI_COMMAND(x,...)
For a given output source a table maps each value of every input sorce.
static uword ip4_qos_mark(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
index_t * qos_mark_configs[QOS_N_SOURCES]
per-interface vector of which MAP is used by which interface for each output source ...
vlib_node_registration_t vlan_ip4_qos_mark_node
(constructor) VLIB_REGISTER_NODE (vlan_ip4_qos_mark_node)
static uword vlan_ip6_qos_mark(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static uword mpls_qos_mark(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#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)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
VNET_FEATURE_INIT(ip4_qos_mark_node, static)
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
static uword vlan_ip4_qos_mark(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static clib_error_t * qos_mark_cli(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header, unspecified alignment)
void qos_mark_mpls_enable_disable(u32 sw_if_index, u8 enable)
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
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)
static u16 ip4_header_checksum(ip4_header_t *i)
qos_bits_t qem_output[QOS_N_SOURCES][256]
The array of output mapped values; output = eq_qos[input-source][input-value].
u8 qos_bits_t
Type, er, safety for us water based entities.
u32 qos_egress_map_id_t
A QOS egress map translates from the COS bits stored in the packet's meta-data into a per-protocol CO...
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.