FD.io VPP  v18.07.1-19-g511ce25
Vector Packet Processing
qos_record.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include <vnet/qos/qos_record.h>
17 #include <vnet/ip/ip.h>
18 #include <vnet/ip/ip6_to_ip4.h>
19 #include <vnet/feature/feature.h>
20 #include <vnet/qos/qos_types.h>
21 
22 /**
23  * Per-interface, per-protocol vector of feature on/off configurations
24  */
27 
28 static void
30  qos_source_t input_source, u8 enable)
31 {
32  switch (input_source)
33  {
34  case QOS_SOURCE_IP:
35  vnet_feature_enable_disable ("ip6-unicast", "ip6-qos-record",
36  sw_if_index, enable, NULL, 0);
37  vnet_feature_enable_disable ("ip6-multicast", "ip6-qos-record",
38  sw_if_index, enable, NULL, 0);
39  vnet_feature_enable_disable ("ip4-unicast", "ip4-qos-record",
40  sw_if_index, enable, NULL, 0);
41  vnet_feature_enable_disable ("ip4-multicast", "ip4-qos-record",
42  sw_if_index, enable, NULL, 0);
43  l2input_intf_bitmap_enable (sw_if_index, L2INPUT_FEAT_L2_IP_QOS_RECORD,
44  enable);
45  break;
46  case QOS_SOURCE_MPLS:
47  vnet_feature_enable_disable ("mpls-input", "mpls-qos-record",
48  sw_if_index, enable, NULL, 0);
49  break;
50  case QOS_SOURCE_VLAN:
51  vnet_feature_enable_disable ("ip6-unicast", "vlan-ip6-qos-record",
52  sw_if_index, enable, NULL, 0);
53  vnet_feature_enable_disable ("ip6-multicast", "vlan-ip6-qos-record",
54  sw_if_index, enable, NULL, 0);
55  vnet_feature_enable_disable ("ip4-unicast", "vlan-ip4-qos-record",
56  sw_if_index, enable, NULL, 0);
57  vnet_feature_enable_disable ("ip4-multicast", "vlan-ip4-qos-record",
58  sw_if_index, enable, NULL, 0);
59  vnet_feature_enable_disable ("mpls-input", "vlan-mpls-qos-record",
60  sw_if_index, enable, NULL, 0);
61  break;
62  case QOS_SOURCE_EXT:
63  /* not a valid option for recording */
64  break;
65  }
66 }
67 
68 int
69 qos_record_enable (u32 sw_if_index, qos_source_t input_source)
70 {
71  vec_validate (qos_record_configs[input_source], sw_if_index);
72 
73  if (0 == qos_record_configs[input_source][sw_if_index])
74  {
75  qos_record_feature_config (sw_if_index, input_source, 1);
76  }
77 
78  qos_record_configs[input_source][sw_if_index]++;
79  return (0);
80 }
81 
82 int
83 qos_record_disable (u32 sw_if_index, qos_source_t input_source)
84 {
85  if (vec_len (qos_record_configs[input_source]) <= sw_if_index)
86  return VNET_API_ERROR_NO_MATCHING_INTERFACE;
87 
88  if (0 == qos_record_configs[input_source][sw_if_index])
89  return VNET_API_ERROR_VALUE_EXIST;
90 
91  qos_record_configs[input_source][sw_if_index]--;
92 
93  if (0 == qos_record_configs[input_source][sw_if_index])
94  {
95  qos_record_feature_config (sw_if_index, input_source, 0);
96  }
97 
98  return (0);
99 }
100 
101 /*
102  * Disable recording feautre for all protocols when the interface
103  * is deleted
104  */
105 static clib_error_t *
107  u32 sw_if_index, u32 is_add)
108 {
109  if (!is_add)
110  {
111  qos_source_t qs;
112 
114  {
115  qos_record_disable (sw_if_index, qs);
116  }
117  }
118 
119  return (NULL);
120 }
121 
123 
124 /**
125  * per-packet trace data
126  */
127 typedef struct qos_record_trace_t_
128 {
129  /* per-pkt trace data */
132 
133 static inline uword
135  vlib_node_runtime_t * node,
136  vlib_frame_t * frame, dpo_proto_t dproto, int is_l2)
137 {
138  u32 n_left_from, *from, *to_next, next_index;
139 
140  next_index = 0;
141  n_left_from = frame->n_vectors;
142  from = vlib_frame_vector_args (frame);
143 
144  while (n_left_from > 0)
145  {
146  u32 n_left_to_next;
147 
148  vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
149 
150  while (n_left_from > 0 && n_left_to_next > 0)
151  {
152  ip4_header_t *ip4_0;
153  ip6_header_t *ip6_0;
154  vlib_buffer_t *b0;
155  u32 sw_if_index0, next0, bi0;
156  qos_bits_t qos0;
157  u8 l2_len;
158 
159  next0 = 0;
160  bi0 = from[0];
161  to_next[0] = bi0;
162  from += 1;
163  to_next += 1;
164  n_left_from -= 1;
165  n_left_to_next -= 1;
166 
167  b0 = vlib_get_buffer (vm, bi0);
168 
169  if (is_l2)
170  {
171  l2_len = vnet_buffer (b0)->l2.l2_len;
172  u8 *l3h;
173  u16 ethertype;
174 
175  vlib_buffer_advance (b0, l2_len);
176 
177  l3h = vlib_buffer_get_current (b0);
178  ethertype = clib_net_to_host_u16 (*(u16 *) (l3h - 2));
179 
180  if (ethertype == ETHERNET_TYPE_IP4)
181  dproto = DPO_PROTO_IP4;
182  else if (ethertype == ETHERNET_TYPE_IP6)
183  dproto = DPO_PROTO_IP6;
184  else if (ethertype == ETHERNET_TYPE_MPLS)
185  dproto = DPO_PROTO_MPLS;
186  else
187  goto non_ip;
188  }
189 
190  if (DPO_PROTO_IP6 == dproto)
191  {
192  ip6_0 = vlib_buffer_get_current (b0);
193  qos0 = ip6_traffic_class_network_order (ip6_0);
194  }
195  else if (DPO_PROTO_IP4 == dproto)
196  {
197  ip4_0 = vlib_buffer_get_current (b0);
198  qos0 = ip4_0->tos;
199  }
200  else if (DPO_PROTO_ETHERNET == dproto)
201  {
202  ethernet_vlan_header_t *vlan0;
203 
204  vlan0 = (vlib_buffer_get_current (b0) -
205  sizeof (ethernet_vlan_header_t));
206 
208  }
209  else if (DPO_PROTO_MPLS)
210  {
212 
213  mh = vlib_buffer_get_current (b0);
215  }
216 
217  vnet_buffer2 (b0)->qos.bits = qos0;
218  vnet_buffer2 (b0)->qos.source = QOS_SOURCE_IP;
219  b0->flags |= VNET_BUFFER_F_QOS_DATA_VALID;
220  sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_RX];
221 
222  if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE) &&
223  (b0->flags & VLIB_BUFFER_IS_TRACED)))
224  {
225  qos_record_trace_t *t =
226  vlib_add_trace (vm, node, b0, sizeof (*t));
227  t->bits = qos0;
228  }
229 
230  non_ip:
231  if (is_l2)
232  {
233  vlib_buffer_advance (b0, -l2_len);
234  next0 = vnet_l2_feature_next (b0,
236  L2INPUT_FEAT_L2_IP_QOS_RECORD);
237  }
238  else
239  vnet_feature_next (sw_if_index0, &next0, b0);
240 
241  /* verify speculative enqueue, maybe switch current next frame */
242  vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
243  to_next, n_left_to_next,
244  bi0, next0);
245  }
246 
247  vlib_put_next_frame (vm, node, next_index, n_left_to_next);
248  }
249 
250  return frame->n_vectors;
251 }
252 
253 /* packet trace format function */
254 static u8 *
255 format_qos_record_trace (u8 * s, va_list * args)
256 {
257  CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
258  CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
259  qos_record_trace_t *t = va_arg (*args, qos_record_trace_t *);
260 
261  s = format (s, "qos:%d", t->bits);
262 
263  return s;
264 }
265 
266 static inline uword
268  vlib_frame_t * frame)
269 {
270  return (qos_record_inline (vm, node, frame, DPO_PROTO_IP4, 0));
271 }
272 
273 static inline uword
275  vlib_frame_t * frame)
276 {
277  return (qos_record_inline (vm, node, frame, DPO_PROTO_IP6, 0));
278 }
279 
280 static inline uword
282  vlib_frame_t * frame)
283 {
284  return (qos_record_inline (vm, node, frame, DPO_PROTO_MPLS, 0));
285 }
286 
287 static inline uword
289  vlib_frame_t * frame)
290 {
291  return (qos_record_inline (vm, node, frame, DPO_PROTO_ETHERNET, 0));
292 }
293 
294 static inline uword
296  vlib_frame_t * frame)
297 {
298  return (qos_record_inline (vm, node, frame, DPO_PROTO_ETHERNET, 0));
299 }
300 
301 static inline uword
303  vlib_frame_t * frame)
304 {
305  return (qos_record_inline (vm, node, frame, DPO_PROTO_ETHERNET, 0));
306 }
307 
308 static inline uword
310  vlib_frame_t * frame)
311 {
312  return (qos_record_inline (vm, node, frame, 0, 1));
313 }
314 
315 /* *INDENT-OFF* */
317  .function = ip4_qos_record,
318  .name = "ip4-qos-record",
319  .vector_size = sizeof (u32),
320  .format_trace = format_qos_record_trace,
321  .type = VLIB_NODE_TYPE_INTERNAL,
322 
323  .n_errors = 0,
324  .n_next_nodes = 1,
325 
326  .next_nodes = {
327  [0] = "ip4-drop",
328  },
329 };
330 
332 
334  .arc_name = "ip4-unicast",
335  .node_name = "ip4-qos-record",
336 };
337 VNET_FEATURE_INIT (ip4m_qos_record_node, static) = {
338  .arc_name = "ip4-multicast",
339  .node_name = "ip4-qos-record",
340 };
341 
343  .function = ip6_qos_record,
344  .name = "ip6-qos-record",
345  .vector_size = sizeof (u32),
346  .format_trace = format_qos_record_trace,
347  .type = VLIB_NODE_TYPE_INTERNAL,
348 
349  .n_errors = 0,
350  .n_next_nodes = 1,
351 
352  .next_nodes = {
353  [0] = "ip6-drop",
354  },
355 };
356 
358 
360  .arc_name = "ip6-unicast",
361  .node_name = "ip6-qos-record",
362 };
363 VNET_FEATURE_INIT (ip6m_qos_record_node, static) = {
364  .arc_name = "ip6-multicast",
365  .node_name = "ip6-qos-record",
366 };
367 
369  .function = mpls_qos_record,
370  .name = "mpls-qos-record",
371  .vector_size = sizeof (u32),
372  .format_trace = format_qos_record_trace,
373  .type = VLIB_NODE_TYPE_INTERNAL,
374 
375  .n_errors = 0,
376  .n_next_nodes = 1,
377 
378  .next_nodes = {
379  [0] = "mpls-drop",
380  },
381 };
382 
384 
386  .arc_name = "mpls-input",
387  .node_name = "mpls-qos-record",
388 };
389 
391  .function = vlan_mpls_qos_record,
392  .name = "vlan-mpls-qos-record",
393  .vector_size = sizeof (u32),
394  .format_trace = format_qos_record_trace,
395  .type = VLIB_NODE_TYPE_INTERNAL,
396 
397  .n_errors = 0,
398  .n_next_nodes = 1,
399 
400  .next_nodes = {
401  [0] = "mpls-drop",
402  },
403 };
404 
406 
408  .arc_name = "mpls-input",
409  .node_name = "vlan-mpls-qos-record",
410  .runs_before = VNET_FEATURES ("mpls-qos-record"),
411 };
412 
414  .function = vlan_ip4_qos_record,
415  .name = "vlan-ip4-qos-record",
416  .vector_size = sizeof (u32),
417  .format_trace = format_qos_record_trace,
418  .type = VLIB_NODE_TYPE_INTERNAL,
419 
420  .n_errors = 0,
421  .n_next_nodes = 1,
422 
423  .next_nodes = {
424  [0] = "ip4-drop",
425  },
426 };
427 
429 
431  .arc_name = "ip4-unicast",
432  .node_name = "vlan-ip4-qos-record",
433  .runs_before = VNET_FEATURES ("ip4-qos-record"),
434 };
435 VNET_FEATURE_INIT (vlan_ip4m_qos_record_node, static) = {
436  .arc_name = "ip4-multicast",
437  .node_name = "vlan-ip4-qos-record",
438  .runs_before = VNET_FEATURES ("ip4-qos-record"),
439 };
440 
442  .function = vlan_ip6_qos_record,
443  .name = "vlan-ip6-qos-record",
444  .vector_size = sizeof (u32),
445  .format_trace = format_qos_record_trace,
446  .type = VLIB_NODE_TYPE_INTERNAL,
447 
448  .n_errors = 0,
449  .n_next_nodes = 1,
450 
451  .next_nodes = {
452  [0] = "ip6-drop",
453  },
454 };
455 
457 
459  .arc_name = "ip6-unicast",
460  .node_name = "vlan-ip6-qos-record",
461  .runs_before = VNET_FEATURES ("ip6-qos-record"),
462 };
463 VNET_FEATURE_INIT (vlan_ip6m_qos_record_node, static) = {
464  .arc_name = "ip6-multicast",
465  .node_name = "vlan-ip6-qos-record",
466  .runs_before = VNET_FEATURES ("ip6-qos-record"),
467 };
468 
470  .function = l2_ip_qos_record,
471  .name = "l2-ip-qos-record",
472  .vector_size = sizeof (u32),
473  .format_trace = format_qos_record_trace,
474  .type = VLIB_NODE_TYPE_INTERNAL,
475 
476  .n_errors = 0,
477  .n_next_nodes = 1,
478 
479  /* Consider adding error "no IP after L2, no recording" */
480  .next_nodes = {
481  [0] = "error-drop",
482  },
483 };
484 
486 
487 /* *INDENT-ON* */
488 
489 clib_error_t *
491 {
492  /* Initialize the feature next-node indexes */
494  l2_ip_qos_record_node.index,
498  return 0;
499 }
500 
502 
503 static clib_error_t *
505  unformat_input_t * input, vlib_cli_command_t * cmd)
506 {
507  vnet_main_t *vnm = vnet_get_main ();
508  u32 sw_if_index, qs;
509  u8 enable;
510 
511  qs = 0xff;
512  enable = 1;
513  sw_if_index = ~0;
514 
516  {
517  if (unformat (input, "%U", unformat_vnet_sw_interface,
518  vnm, &sw_if_index))
519  ;
520  else if (unformat (input, "%U", unformat_qos_source, &qs))
521  ;
522  else if (unformat (input, "enable"))
523  enable = 1;
524  else if (unformat (input, "disable"))
525  enable = 0;
526  else
527  break;
528  }
529 
530  if (~0 == sw_if_index)
531  return clib_error_return (0, "interface must be specified");
532  if (0xff == qs)
533  return clib_error_return (0, "input location must be specified");
534 
535  if (enable)
536  qos_record_enable (sw_if_index, qs);
537  else
538  qos_record_disable (sw_if_index, qs);
539 
540  return (NULL);
541 }
542 
543 /*?
544  * Enable QoS bit recording on an interface using the packet's input DSCP bits
545  * Which input QoS bits to use are either; IP, MPLS or VLAN. If more than
546  * one protocol is chosen (which is foolish) the higer layers override the
547  * lower.
548  *
549  * @cliexpar
550  * @cliexcmd{qos record ip GigEthernet0/1/0}
551  ?*/
552 /* *INDENT-OFF* */
553 VLIB_CLI_COMMAND (qos_record_command, static) = {
554  .path = "qos record",
555  .short_help = "qos record <record-source> <INTERFACE> [disable]",
556  .function = qos_record_cli,
557  .is_mp_safe = 1,
558 };
559 /* *INDENT-ON* */
560 
561 
562 /*
563  * fd.io coding-style-patch-verification: ON
564  *
565  * Local Variables:
566  * eval: (c-set-style "gnu")
567  * End:
568  */
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
Definition: vec.h:437
vlib_node_registration_t ip6_qos_record_node
(constructor) VLIB_REGISTER_NODE (ip6_qos_record_node)
Definition: qos_record.c:342
#define CLIB_UNUSED(x)
Definition: clib.h:79
static uword ip4_qos_record(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: qos_record.c:267
vlib_node_registration_t vlan_ip6_qos_record_node
(constructor) VLIB_REGISTER_NODE (vlan_ip6_qos_record_node)
Definition: qos_record.c:441
vnet_main_t * vnet_get_main(void)
Definition: misc.c:47
#define vnet_buffer2(b)
Definition: buffer.h:403
#define NULL
Definition: clib.h:55
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.
Definition: qos_record.c:25
vlib_node_registration_t vlan_ip4_qos_record_node
(constructor) VLIB_REGISTER_NODE (vlan_ip4_qos_record_node)
Definition: qos_record.c:413
clib_error_t * l2_ip_qos_init(vlib_main_t *vm)
Definition: qos_record.c:490
u8 * format(u8 *s, const char *fmt,...)
Definition: format.c:419
unformat_function_t unformat_vnet_sw_interface
unsigned char u8
Definition: types.h:56
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...
Definition: feat_bitmap.h:94
Some external source, e.g.
Definition: qos_types.h:35
static uword mpls_qos_record(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: qos_record.c:281
static clib_error_t * qos_record_cli(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: qos_record.c:504
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:156
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)
Definition: qos_record.c:134
static_always_inline u8 ip6_traffic_class_network_order(const ip6_header_t *ip6)
Definition: ip6_packet.h:357
#define clib_error_return(e, args...)
Definition: error.h:99
#define FOR_EACH_QOS_SOURCE(_src)
Definition: qos_types.h:54
unsigned int u32
Definition: types.h:88
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)
Definition: qos_record.c:106
VLIB_NODE_FUNCTION_MULTIARCH(ip4_qos_record_node, ip4_qos_record)
static u32 l2_qos_input_next[QOS_N_SOURCES][32]
Definition: qos_record.c:26
struct _unformat_input_t unformat_input_t
unsigned short u16
Definition: types.h:57
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
Definition: buffer.h:202
#define PREDICT_FALSE(x)
Definition: clib.h:105
static void qos_record_feature_config(u32 sw_if_index, qos_source_t input_source, u8 enable)
Definition: qos_record.c:29
static_always_inline void vnet_feature_next(u32 sw_if_index, u32 *next0, vlib_buffer_t *b0)
Definition: feature.h:237
#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.
Definition: buffer_node.h:218
#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).
Definition: node_funcs.h:364
vlib_node_registration_t mpls_qos_record_node
(constructor) VLIB_REGISTER_NODE (mpls_qos_record_node)
Definition: qos_record.c:368
#define VLIB_REGISTER_NODE(x,...)
Definition: node.h:153
#define UNFORMAT_END_OF_INPUT
Definition: format.h:144
u16 n_vectors
Definition: node.h:380
vlib_main_t * vm
Definition: buffer.c:294
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.
Definition: feat_bitmap.h:43
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.
Definition: main.c:454
char ** l2input_get_feat_names(void)
Return an array of strings containing graph node names of each feature.
Definition: l2_input.c:60
#define VLIB_CLI_COMMAND(x,...)
Definition: cli.h:154
int qos_record_disable(u32 sw_if_index, qos_source_t input_source)
Definition: qos_record.c:83
static u8 * format_qos_record_trace(u8 *s, va_list *args)
Definition: qos_record.c:255
mpls_label_t label_exp_s_ttl
Definition: packet.h:31
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
Definition: buffer.h:215
static uword ip6_qos_record(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: qos_record.c:274
IPv6 to IPv4 translation.
#define VNET_FEATURES(...)
Definition: feature.h:391
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
Definition: trace_funcs.h:55
u32 l2input_intf_bitmap_enable(u32 sw_if_index, u32 feature_bitmap, u32 enable)
Enable (or disable) the feature in the bitmap for the given interface.
Definition: l2_input.c:520
static vlib_node_registration_t l2_ip_qos_record_node
(constructor) VLIB_REGISTER_NODE (l2_ip_qos_record_node)
Definition: qos_record.c:469
static uword l2_ip_qos_record(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: qos_record.c:309
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
u64 uword
Definition: types.h:112
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
Definition: node_funcs.h:267
vlib_node_registration_t vlan_mpls_qos_record_node
(constructor) VLIB_REGISTER_NODE (vlan_mpls_qos_record_node)
Definition: qos_record.c:390
#define vnet_buffer(b)
Definition: buffer.h:360
int qos_record_enable(u32 sw_if_index, qos_source_t input_source)
Definition: qos_record.c:69
static uword vlan_ip6_qos_record(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: qos_record.c:295
per-packet trace data
Definition: qos_record.c:127
static uword vlan_ip4_qos_record(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: qos_record.c:288
u16 flags
Copy of main node flags.
Definition: node.h:486
static u32 vnet_mpls_uc_get_exp(mpls_label_t label_exp_s_ttl)
Definition: packet.h:108
static u8 ethernet_vlan_header_get_priority_net_order(ethernet_vlan_header_t *h)
Definition: packet.h:150
#define VLIB_NODE_FLAG_TRACE
Definition: node.h:295
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
Definition: buffer.h:111
vlib_node_registration_t ip4_qos_record_node
(constructor) VLIB_REGISTER_NODE (ip4_qos_record_node)
Definition: qos_record.c:316
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
Definition: buffer_funcs.h:57
uword unformat_qos_source(unformat_input_t *input, va_list *args)
Definition: qos_types.c:35
u8 qos_bits_t
Type, er, safety for us water based entities.
Definition: qos_types.h:68
VNET_FEATURE_INIT(ip4_qos_record_node, static)
uword unformat(unformat_input_t *i, const char *fmt,...)
Definition: unformat.c:972
Definition: defs.h:46
static uword vlan_mpls_qos_record(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: qos_record.c:302
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)
Definition: feature.c:233
static uword unformat_check_input(unformat_input_t *i)
Definition: format.h:170
#define QOS_N_SOURCES
The maximum number of sources.
Definition: qos_types.h:45