FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
device.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 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 #include <vnet/vnet.h>
16 #include <vppinfra/vec.h>
17 #include <vppinfra/format.h>
18 #include <assert.h>
19 
20 #include <vnet/ethernet/ethernet.h>
21 #include <dpdk/buffer.h>
22 #include <dpdk/device/dpdk.h>
23 #include <dpdk/device/dpdk_priv.h>
24 #include <vppinfra/error.h>
25 #include <vlib/unix/unix.h>
26 
27 #define foreach_dpdk_tx_func_error \
28  _(BAD_RETVAL, "DPDK tx function returned an error") \
29  _(PKT_DROP, "Tx packet drops (dpdk tx failure)")
30 
31 typedef enum
32 {
33 #define _(f,s) DPDK_TX_FUNC_ERROR_##f,
35 #undef _
38 
39 static char *dpdk_tx_func_error_strings[] = {
40 #define _(n,s) s,
42 #undef _
43 };
44 
45 static clib_error_t *
47  const u8 * address, u8 is_add)
48 {
49  int error;
50  dpdk_main_t *dm = &dpdk_main;
51  dpdk_device_t *xd = vec_elt_at_index (dm->devices, hi->dev_instance);
52 
53  if (is_add)
54  error = rte_eth_dev_mac_addr_add (xd->port_id,
55  (struct rte_ether_addr *) address, 0);
56  else
57  error = rte_eth_dev_mac_addr_remove (xd->port_id,
58  (struct rte_ether_addr *) address);
59 
60  if (error)
61  {
62  return clib_error_return (0, "mac address add/del failed: %d", error);
63  }
64 
65  return NULL;
66 }
67 
68 static clib_error_t *
70  const u8 * old_address, const u8 * address)
71 {
72  int error;
73  dpdk_main_t *dm = &dpdk_main;
74  dpdk_device_t *xd = vec_elt_at_index (dm->devices, hi->dev_instance);
75 
76  error = rte_eth_dev_default_mac_addr_set (xd->port_id, (void *) address);
77 
78  if (error)
79  {
80  return clib_error_return (0, "mac address set failed: %d", error);
81  }
82  else
83  {
86  return NULL;
87  }
88 }
89 
90 static void
92  dpdk_device_t * xd, u16 queue_id,
94 {
96  dpdk_tx_trace_t *t0;
97  struct rte_mbuf *mb;
98 
100 
101  t0 = vlib_add_trace (vm, node, buffer, sizeof (t0[0]));
102  t0->queue_index = queue_id;
103  t0->device_index = xd->device_index;
105  clib_memcpy_fast (&t0->mb, mb, sizeof (t0->mb));
107  sizeof (buffer[0]) - sizeof (buffer->pre_data));
108  clib_memcpy_fast (t0->buffer.pre_data, buffer->data + buffer->current_data,
109  sizeof (t0->buffer.pre_data));
110  clib_memcpy_fast (&t0->data, mb->buf_addr + mb->data_off,
111  sizeof (t0->data));
112 }
113 
116  int maybe_multiseg)
117 {
118  struct rte_mbuf *mb, *first_mb, *last_mb;
119  last_mb = first_mb = mb = rte_mbuf_from_vlib_buffer (b);
120 
121  /* buffer is coming from non-dpdk source so we need to init
122  rte_mbuf header */
123  if (PREDICT_FALSE ((b->flags & VLIB_BUFFER_EXT_HDR_VALID) == 0))
124  rte_pktmbuf_reset (mb);
125 
126  first_mb->nb_segs = 1;
127  mb->data_len = b->current_length;
128  mb->pkt_len = maybe_multiseg ? vlib_buffer_length_in_chain (vm, b) :
129  b->current_length;
130  mb->data_off = VLIB_BUFFER_PRE_DATA_SIZE + b->current_data;
131 
132  while (maybe_multiseg && (b->flags & VLIB_BUFFER_NEXT_PRESENT))
133  {
136  if (PREDICT_FALSE ((b->flags & VLIB_BUFFER_EXT_HDR_VALID) == 0))
137  rte_pktmbuf_reset (mb);
138  last_mb->next = mb;
139  last_mb = mb;
140  mb->data_len = b->current_length;
141  mb->pkt_len = b->current_length;
142  mb->data_off = VLIB_BUFFER_PRE_DATA_SIZE + b->current_data;
143  first_mb->nb_segs++;
144  if (PREDICT_FALSE (b->ref_count > 1))
145  mb->pool =
147  }
148 }
149 
150 /*
151  * This function calls the dpdk's tx_burst function to transmit the packets.
152  * It manages a lock per-device if the device does not
153  * support multiple queues. It returns the number of packets untransmitted
154  * If all packets are transmitted (the normal case), the function returns 0.
155  */
158  dpdk_device_t * xd,
159  struct rte_mbuf **mb, u32 n_left)
160 {
161  dpdk_main_t *dm = &dpdk_main;
162  dpdk_tx_queue_t *txq;
163  u32 n_retry;
164  int n_sent = 0;
165  int queue_id;
166 
167  n_retry = 16;
168  queue_id = vm->thread_index % xd->tx_q_used;
169  txq = vec_elt_at_index (xd->tx_queues, queue_id);
170 
171  do
172  {
174 
175  if (PREDICT_TRUE (xd->flags & DPDK_DEVICE_FLAG_PMD))
176  {
177  /* no wrap, transmit in one burst */
178  n_sent = rte_eth_tx_burst (xd->port_id, queue_id, mb, n_left);
179  n_retry--;
180  }
181  else
182  {
183  ASSERT (0);
184  n_sent = 0;
185  }
186 
188 
189  if (PREDICT_FALSE (n_sent < 0))
190  {
191  // emit non-fatal message, bump counter
192  vnet_main_t *vnm = dm->vnet_main;
194  u32 node_index;
195 
197  xd->hw_if_index)->tx_node_index;
198 
199  vlib_error_count (vm, node_index, DPDK_TX_FUNC_ERROR_BAD_RETVAL, 1);
200  return n_left; // untransmitted packets
201  }
202  n_left -= n_sent;
203  mb += n_sent;
204  }
205  while (n_sent && n_left && (n_retry > 0));
206 
207  return n_left;
208 }
209 
210 static_always_inline __clib_unused void
211 dpdk_prefetch_buffer (vlib_main_t * vm, struct rte_mbuf *mb)
212 {
214  CLIB_PREFETCH (mb, sizeof (struct rte_mbuf), STORE);
216 }
217 
220  struct rte_mbuf *mb)
221 {
222  int is_ip4 = b->flags & VNET_BUFFER_F_IS_IP4;
223  u32 tso = b->flags & VNET_BUFFER_F_GSO, max_pkt_len;
224  u32 ip_cksum, tcp_cksum, udp_cksum, outer_hdr_len = 0;
225  u32 outer_ip_cksum, vxlan_tunnel;
226  u64 ol_flags;
227  vnet_buffer_oflags_t oflags = 0;
228 
229  /* Is there any work for us? */
230  if (PREDICT_TRUE (((b->flags & VNET_BUFFER_F_OFFLOAD) | tso) == 0))
231  return;
232 
233  oflags = vnet_buffer (b)->oflags;
234  ip_cksum = oflags & VNET_BUFFER_OFFLOAD_F_IP_CKSUM;
235  tcp_cksum = oflags & VNET_BUFFER_OFFLOAD_F_TCP_CKSUM;
236  udp_cksum = oflags & VNET_BUFFER_OFFLOAD_F_UDP_CKSUM;
237  outer_ip_cksum = oflags & VNET_BUFFER_OFFLOAD_F_OUTER_IP_CKSUM;
238  vxlan_tunnel = oflags & VNET_BUFFER_OFFLOAD_F_TNL_VXLAN;
239 
240  ol_flags = is_ip4 ? PKT_TX_IPV4 : PKT_TX_IPV6;
241  ol_flags |= ip_cksum ? PKT_TX_IP_CKSUM : 0;
242  ol_flags |= tcp_cksum ? PKT_TX_TCP_CKSUM : 0;
243  ol_flags |= udp_cksum ? PKT_TX_UDP_CKSUM : 0;
244 
245  if (vxlan_tunnel)
246  {
247  ol_flags |= outer_ip_cksum ? PKT_TX_OUTER_IPV4 | PKT_TX_OUTER_IP_CKSUM :
248  PKT_TX_OUTER_IPV6;
249  ol_flags |= PKT_TX_TUNNEL_VXLAN;
250  mb->l2_len =
251  vnet_buffer (b)->l3_hdr_offset - vnet_buffer2 (b)->outer_l4_hdr_offset;
252  mb->l3_len =
253  vnet_buffer (b)->l4_hdr_offset - vnet_buffer (b)->l3_hdr_offset;
254  mb->outer_l2_len =
255  vnet_buffer2 (b)->outer_l3_hdr_offset - b->current_data;
256  mb->outer_l3_len = vnet_buffer2 (b)->outer_l4_hdr_offset -
257  vnet_buffer2 (b)->outer_l3_hdr_offset;
258  outer_hdr_len = mb->outer_l2_len + mb->outer_l3_len;
259  }
260  else
261  {
262  mb->l2_len = vnet_buffer (b)->l3_hdr_offset - b->current_data;
263  mb->l3_len =
264  vnet_buffer (b)->l4_hdr_offset - vnet_buffer (b)->l3_hdr_offset;
265  mb->outer_l2_len = 0;
266  mb->outer_l3_len = 0;
267  }
268 
269  if (tso)
270  {
271  mb->l4_len = vnet_buffer2 (b)->gso_l4_hdr_sz;
272  mb->tso_segsz = vnet_buffer2 (b)->gso_size;
273  /* ensure packet is large enough to require tso */
274  max_pkt_len =
275  outer_hdr_len + mb->l2_len + mb->l3_len + mb->l4_len + mb->tso_segsz;
276  if (mb->tso_segsz != 0 && mb->pkt_len > max_pkt_len)
277  ol_flags |= (tcp_cksum ? PKT_TX_TCP_SEG : PKT_TX_UDP_SEG);
278  }
279 
280  mb->ol_flags |= ol_flags;
281 
282  /* we are trying to help compiler here by using local ol_flags with known
283  state of all flags */
284  if (xd->flags & DPDK_DEVICE_FLAG_INTEL_PHDR_CKSUM)
285  rte_net_intel_cksum_flags_prepare (mb, ol_flags);
286 }
287 
288 /*
289  * Transmits the packets on the frame to the interface associated with the
290  * node. It first copies packets on the frame to a per-thread arrays
291  * containing the rte_mbuf pointers.
292  */
295  vlib_frame_t * f)
296 {
297  dpdk_main_t *dm = &dpdk_main;
298  vnet_interface_output_runtime_t *rd = (void *) node->runtime_data;
300  u32 n_packets = f->n_vectors;
301  u32 n_left;
303  int queue_id = thread_index;
304  u32 tx_pkts = 0, all_or_flags = 0;
306  thread_index);
307  struct rte_mbuf **mb;
308  vlib_buffer_t *b[4];
309 
310  ASSERT (n_packets <= VLIB_FRAME_SIZE);
311 
312  /* calculate rte_mbuf pointers out of buffer indices */
314  (void **) ptd->mbufs, n_packets,
315  -(i32) sizeof (struct rte_mbuf));
316 
317  n_left = n_packets;
318  mb = ptd->mbufs;
319 
320 #if (CLIB_N_PREFETCHES >= 8)
321  while (n_left >= 8)
322  {
323  u32 or_flags;
324 
325  dpdk_prefetch_buffer (vm, mb[4]);
326  dpdk_prefetch_buffer (vm, mb[5]);
327  dpdk_prefetch_buffer (vm, mb[6]);
328  dpdk_prefetch_buffer (vm, mb[7]);
329 
330  b[0] = vlib_buffer_from_rte_mbuf (mb[0]);
331  b[1] = vlib_buffer_from_rte_mbuf (mb[1]);
332  b[2] = vlib_buffer_from_rte_mbuf (mb[2]);
333  b[3] = vlib_buffer_from_rte_mbuf (mb[3]);
334 
335  or_flags = b[0]->flags | b[1]->flags | b[2]->flags | b[3]->flags;
336  all_or_flags |= or_flags;
337 
338  if (or_flags & VLIB_BUFFER_NEXT_PRESENT)
339  {
340  dpdk_validate_rte_mbuf (vm, b[0], 1);
341  dpdk_validate_rte_mbuf (vm, b[1], 1);
342  dpdk_validate_rte_mbuf (vm, b[2], 1);
343  dpdk_validate_rte_mbuf (vm, b[3], 1);
344  }
345  else
346  {
347  dpdk_validate_rte_mbuf (vm, b[0], 0);
348  dpdk_validate_rte_mbuf (vm, b[1], 0);
349  dpdk_validate_rte_mbuf (vm, b[2], 0);
350  dpdk_validate_rte_mbuf (vm, b[3], 0);
351  }
352 
353  if (PREDICT_FALSE ((xd->flags & DPDK_DEVICE_FLAG_TX_OFFLOAD) &&
354  (or_flags & VNET_BUFFER_F_OFFLOAD)))
355  {
356  dpdk_buffer_tx_offload (xd, b[0], mb[0]);
357  dpdk_buffer_tx_offload (xd, b[1], mb[1]);
358  dpdk_buffer_tx_offload (xd, b[2], mb[2]);
359  dpdk_buffer_tx_offload (xd, b[3], mb[3]);
360  }
361 
362  if (PREDICT_FALSE (node->flags & VLIB_NODE_FLAG_TRACE))
363  {
364  if (b[0]->flags & VLIB_BUFFER_IS_TRACED)
365  dpdk_tx_trace_buffer (dm, node, xd, queue_id, b[0]);
366  if (b[1]->flags & VLIB_BUFFER_IS_TRACED)
367  dpdk_tx_trace_buffer (dm, node, xd, queue_id, b[1]);
368  if (b[2]->flags & VLIB_BUFFER_IS_TRACED)
369  dpdk_tx_trace_buffer (dm, node, xd, queue_id, b[2]);
370  if (b[3]->flags & VLIB_BUFFER_IS_TRACED)
371  dpdk_tx_trace_buffer (dm, node, xd, queue_id, b[3]);
372  }
373 
374  mb += 4;
375  n_left -= 4;
376  }
377 #elif (CLIB_N_PREFETCHES >= 4)
378  while (n_left >= 4)
379  {
380  vlib_buffer_t *b2, *b3;
381  u32 or_flags;
382 
383  clib_prefetch_store (mb[2]);
384  clib_prefetch_store (mb[3]);
385  b2 = vlib_buffer_from_rte_mbuf (mb[2]);
386  clib_prefetch_load (b2);
387  b3 = vlib_buffer_from_rte_mbuf (mb[3]);
388  clib_prefetch_load (b3);
389 
390  b[0] = vlib_buffer_from_rte_mbuf (mb[0]);
391  b[1] = vlib_buffer_from_rte_mbuf (mb[1]);
392 
393  or_flags = b[0]->flags | b[1]->flags;
394  all_or_flags |= or_flags;
395 
396  if (or_flags & VLIB_BUFFER_NEXT_PRESENT)
397  {
398  dpdk_validate_rte_mbuf (vm, b[0], 1);
399  dpdk_validate_rte_mbuf (vm, b[1], 1);
400  }
401  else
402  {
403  dpdk_validate_rte_mbuf (vm, b[0], 0);
404  dpdk_validate_rte_mbuf (vm, b[1], 0);
405  }
406 
407  if (PREDICT_FALSE ((xd->flags & DPDK_DEVICE_FLAG_TX_OFFLOAD) &&
408  (or_flags & VNET_BUFFER_F_OFFLOAD)))
409  {
410  dpdk_buffer_tx_offload (xd, b[0], mb[0]);
411  dpdk_buffer_tx_offload (xd, b[1], mb[1]);
412  }
413 
414  if (PREDICT_FALSE (node->flags & VLIB_NODE_FLAG_TRACE))
415  {
416  if (b[0]->flags & VLIB_BUFFER_IS_TRACED)
417  dpdk_tx_trace_buffer (dm, node, xd, queue_id, b[0]);
418  if (b[1]->flags & VLIB_BUFFER_IS_TRACED)
419  dpdk_tx_trace_buffer (dm, node, xd, queue_id, b[1]);
420  }
421 
422  mb += 2;
423  n_left -= 2;
424  }
425 #endif
426 
427  while (n_left > 0)
428  {
429  b[0] = vlib_buffer_from_rte_mbuf (mb[0]);
430  all_or_flags |= b[0]->flags;
431 
432  dpdk_validate_rte_mbuf (vm, b[0], 1);
433  dpdk_buffer_tx_offload (xd, b[0], mb[0]);
434 
435  if (PREDICT_FALSE (node->flags & VLIB_NODE_FLAG_TRACE))
436  if (b[0]->flags & VLIB_BUFFER_IS_TRACED)
437  dpdk_tx_trace_buffer (dm, node, xd, queue_id, b[0]);
438 
439  mb++;
440  n_left--;
441  }
442 
443  /* transmit as many packets as possible */
444  tx_pkts = n_packets = mb - ptd->mbufs;
445  n_left = tx_burst_vector_internal (vm, xd, ptd->mbufs, n_packets);
446 
447  {
448  /* If there is no callback then drop any non-transmitted packets */
449  if (PREDICT_FALSE (n_left))
450  {
451  tx_pkts -= n_left;
453  vnet_main_t *vnm = vnet_get_main ();
454 
457 
458  vlib_increment_simple_counter (cm, thread_index, xd->sw_if_index,
459  n_left);
460 
461  vlib_error_count (vm, node->node_index, DPDK_TX_FUNC_ERROR_PKT_DROP,
462  n_left);
463 
464  while (n_left--)
465  rte_pktmbuf_free (ptd->mbufs[n_packets - n_left - 1]);
466  }
467  }
468 
469  return tx_pkts;
470 }
471 
472 static void
474 {
475  dpdk_main_t *dm = &dpdk_main;
477 
478  rte_eth_stats_reset (xd->port_id);
479  rte_eth_xstats_reset (xd->port_id);
480 }
481 
482 static clib_error_t *
484 {
485  vnet_hw_interface_t *hif = vnet_get_hw_interface (vnm, hw_if_index);
487  dpdk_main_t *dm = &dpdk_main;
489 
490  if (xd->flags & DPDK_DEVICE_FLAG_PMD_INIT_FAIL)
491  return clib_error_return (0, "Interface not initialized");
492 
493  if (is_up)
494  {
495  if ((xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP) == 0)
496  {
497  dpdk_device_start (xd);
498  if (vec_len (xd->errors))
499  return clib_error_create ("Interface start failed");
500  xd->flags |= DPDK_DEVICE_FLAG_ADMIN_UP;
501  f64 now = vlib_time_now (dm->vlib_main);
504  }
505  }
506  else
507  {
509  if ((xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP) != 0)
510  dpdk_device_stop (xd);
511  xd->flags &= ~DPDK_DEVICE_FLAG_ADMIN_UP;
512  }
513 
514  return /* no error */ 0;
515 }
516 
517 /*
518  * Dynamically redirect all pkts from a specific interface
519  * to the specified node
520  */
521 static void
523  u32 node_index)
524 {
525  dpdk_main_t *xm = &dpdk_main;
526  vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, hw_if_index);
528 
529  /* Shut off redirection */
530  if (node_index == ~0)
531  {
533  return;
534  }
535 
538 }
539 
540 
541 static clib_error_t *
543  u32 hw_if_index,
544  struct vnet_sw_interface_t *st, int is_add)
545 {
546  dpdk_main_t *xm = &dpdk_main;
547  vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, hw_if_index);
550  int r, vlan_offload;
551  u32 prev_subifs = xd->num_subifs;
552  clib_error_t *err = 0;
553 
554  if (is_add)
555  xd->num_subifs++;
556  else if (xd->num_subifs)
557  xd->num_subifs--;
558 
559  if ((xd->flags & DPDK_DEVICE_FLAG_PMD) == 0)
560  goto done;
561 
562  /* currently we program VLANS only for IXGBE VF */
563  if (xd->pmd != VNET_DPDK_PMD_IXGBEVF)
564  goto done;
565 
566  if (t->sub.eth.flags.no_tags == 1)
567  goto done;
568 
569  if ((t->sub.eth.flags.one_tag != 1) || (t->sub.eth.flags.exact_match != 1))
570  {
571  xd->num_subifs = prev_subifs;
572  err = clib_error_return (0, "unsupported VLAN setup");
573  goto done;
574  }
575 
576  vlan_offload = rte_eth_dev_get_vlan_offload (xd->port_id);
577  vlan_offload |= ETH_VLAN_FILTER_OFFLOAD;
578 
579  if ((r = rte_eth_dev_set_vlan_offload (xd->port_id, vlan_offload)))
580  {
581  xd->num_subifs = prev_subifs;
582  err = clib_error_return (0, "rte_eth_dev_set_vlan_offload[%d]: err %d",
583  xd->port_id, r);
584  goto done;
585  }
586 
587 
588  if ((r =
589  rte_eth_dev_vlan_filter (xd->port_id,
590  t->sub.eth.outer_vlan_id, is_add)))
591  {
592  xd->num_subifs = prev_subifs;
593  err = clib_error_return (0, "rte_eth_dev_vlan_filter[%d]: err %d",
594  xd->port_id, r);
595  goto done;
596  }
597 
598 done:
599  if (xd->num_subifs)
600  xd->flags |= DPDK_DEVICE_FLAG_HAVE_SUBIF;
601  else
602  xd->flags &= ~DPDK_DEVICE_FLAG_HAVE_SUBIF;
603 
604  return err;
605 }
606 
607 static clib_error_t *
609  struct vnet_hw_interface_t *hi,
610  clib_bitmap_t * bitmap)
611 {
612  dpdk_main_t *xm = &dpdk_main;
613  u32 hw_if_index = hi->hw_if_index;
614  vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, hw_if_index);
616  clib_error_t *err = 0;
617  struct rte_eth_rss_reta_entry64 *reta_conf = NULL;
618  struct rte_eth_dev_info dev_info;
619  u16 *reta = NULL;
620  u16 *valid_queue = NULL;
621  u16 valid_queue_count = 0;
622  uint32_t i, j;
623  uint32_t ret;
624 
625  rte_eth_dev_info_get (xd->port_id, &dev_info);
626 
627  /* parameter check */
628  if (clib_bitmap_count_set_bits (bitmap) == 0)
629  {
630  err = clib_error_return (0, "must assign at least one valid rss queue");
631  goto done;
632  }
633 
634  if (clib_bitmap_count_set_bits (bitmap) > dev_info.nb_rx_queues)
635  {
636  err = clib_error_return (0, "too many rss queues");
637  goto done;
638  }
639 
640  /* new RETA */
641  reta = clib_mem_alloc (dev_info.reta_size * sizeof (*reta));
642  if (reta == NULL)
643  {
644  err = clib_error_return (0, "clib_mem_alloc failed");
645  goto done;
646  }
647 
648  clib_memset (reta, 0, dev_info.reta_size * sizeof (*reta));
649 
650  valid_queue_count = 0;
651  /* *INDENT-OFF* */
652  clib_bitmap_foreach (i, bitmap) {
653  if (i >= dev_info.nb_rx_queues)
654  {
655  err = clib_error_return (0, "illegal queue number");
656  goto done;
657  }
658  reta[valid_queue_count++] = i;
659  }
660  /* *INDENT-ON* */
661 
662  /* check valid_queue_count not zero, make coverity happy */
663  if (valid_queue_count == 0)
664  {
665  err = clib_error_return (0, "must assign at least one valid rss queue");
666  goto done;
667  }
668 
669  valid_queue = reta;
670  for (i = valid_queue_count, j = 0; i < dev_info.reta_size; i++, j++)
671  {
672  j = j % valid_queue_count;
673  reta[i] = valid_queue[j];
674  }
675 
676  /* update reta table */
677  reta_conf =
678  (struct rte_eth_rss_reta_entry64 *) clib_mem_alloc (dev_info.reta_size /
679  RTE_RETA_GROUP_SIZE *
680  sizeof (*reta_conf));
681  if (reta_conf == NULL)
682  {
683  err = clib_error_return (0, "clib_mem_alloc failed");
684  goto done;
685  }
686 
687  clib_memset (reta_conf, 0,
688  dev_info.reta_size / RTE_RETA_GROUP_SIZE *
689  sizeof (*reta_conf));
690 
691  for (i = 0; i < dev_info.reta_size; i++)
692  {
693  uint32_t reta_id = i / RTE_RETA_GROUP_SIZE;
694  uint32_t reta_pos = i % RTE_RETA_GROUP_SIZE;
695 
696  reta_conf[reta_id].mask = UINT64_MAX;
697  reta_conf[reta_id].reta[reta_pos] = reta[i];
698  }
699 
700  ret =
701  rte_eth_dev_rss_reta_update (xd->port_id, reta_conf, dev_info.reta_size);
702  if (ret)
703  {
704  err = clib_error_return (0, "rte_eth_dev_rss_reta_update err %d", ret);
705  goto done;
706  }
707 
708 done:
709  if (reta)
710  clib_mem_free (reta);
711  if (reta_conf)
712  clib_mem_free (reta_conf);
713 
714  return err;
715 }
716 
717 static clib_error_t *
720 {
721  dpdk_main_t *xm = &dpdk_main;
722  vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, hw_if_index);
725  dpdk_rx_queue_t *rxq;
726  clib_file_t *f;
727  int rv = 0;
728  if (!(xd->flags & DPDK_DEVICE_FLAG_INT_SUPPORTED))
729  return clib_error_return (0, "unsupported op (is the interface up?)", rv);
731  !(xd->flags & DPDK_DEVICE_FLAG_INT_UNMASKABLE))
732  rv = rte_eth_dev_rx_intr_disable (xd->port_id, qid);
733  else if (mode == VNET_HW_IF_RX_MODE_POLLING)
734  {
735  rxq = vec_elt_at_index (xd->rx_queues, qid);
736  f = pool_elt_at_index (fm->file_pool, rxq->clib_file_index);
737  fm->file_update (f, UNIX_FILE_UPDATE_DELETE);
738  }
739  else if (!(xd->flags & DPDK_DEVICE_FLAG_INT_UNMASKABLE))
740  rv = rte_eth_dev_rx_intr_enable (xd->port_id, qid);
741  else
742  {
743  rxq = vec_elt_at_index (xd->rx_queues, qid);
744  f = pool_elt_at_index (fm->file_pool, rxq->clib_file_index);
745  fm->file_update (f, UNIX_FILE_UPDATE_ADD);
746  }
747  if (rv)
748  return clib_error_return (0, "dpdk_interface_rx_mode_change err %d", rv);
749  return 0;
750 }
751 
752 /* *INDENT-OFF* */
754  .name = "dpdk",
755  .tx_function_n_errors = DPDK_TX_FUNC_N_ERROR,
756  .tx_function_error_strings = dpdk_tx_func_error_strings,
757  .format_device_name = format_dpdk_device_name,
758  .format_device = format_dpdk_device,
759  .format_tx_trace = format_dpdk_tx_trace,
760  .clear_counters = dpdk_clear_hw_interface_counters,
761  .admin_up_down_function = dpdk_interface_admin_up_down,
762  .subif_add_del_function = dpdk_subif_add_del_function,
763  .rx_redirect_to_node = dpdk_set_interface_next_node,
764  .mac_addr_change_function = dpdk_set_mac_address,
765  .mac_addr_add_del_function = dpdk_add_del_mac_address,
766  .format_flow = format_dpdk_flow,
767  .flow_ops_function = dpdk_flow_ops_fn,
768  .set_rss_queues_function = dpdk_interface_set_rss_queues,
769  .rx_mode_change_function = dpdk_interface_rx_mode_change,
770 };
771 /* *INDENT-ON* */
772 
773 #define UP_DOWN_FLAG_EVENT 1
774 
775 static uword
778 {
779  clib_error_t *error = 0;
780  uword event_type;
781  uword *event_data = 0;
783  u32 flags;
784 
785  while (1)
786  {
788 
789  event_type = vlib_process_get_events (vm, &event_data);
790 
792 
793  switch (event_type)
794  {
795  case UP_DOWN_FLAG_EVENT:
796  {
797  if (vec_len (event_data) == 2)
798  {
799  sw_if_index = event_data[0];
800  flags = event_data[1];
801  error =
803  flags);
805  }
806  }
807  break;
808  }
809 
810  vec_reset_length (event_data);
811 
813 
814  }
815  return 0; /* or not */
816 }
817 
818 /* *INDENT-OFF* */
820  .function = admin_up_down_process,
821  .type = VLIB_NODE_TYPE_PROCESS,
822  .name = "admin-up-down-process",
823  .process_log2_n_stack_bytes = 17, // 256KB
824 };
825 /* *INDENT-ON* */
826 
827 /*
828  * fd.io coding-style-patch-verification: ON
829  *
830  * Local Variables:
831  * eval: (c-set-style "gnu")
832  * End:
833  */
vec_reset_length
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
Definition: vec_bootstrap.h:194
vlib_buffer_t::next_buffer
u32 next_buffer
Next buffer for this linked-list of buffers.
Definition: buffer.h:149
vlib_frame_t::n_vectors
u16 n_vectors
Definition: node.h:387
dpdk_set_interface_next_node
static void dpdk_set_interface_next_node(vnet_main_t *vnm, u32 hw_if_index, u32 node_index)
Definition: device.c:522
dpdk.h
im
vnet_interface_main_t * im
Definition: interface_output.c:415
vlib_buffer_t::buffer_pool_index
u8 buffer_pool_index
index of buffer pool this buffer belongs.
Definition: buffer.h:142
DPDK_TX_FUNC_N_ERROR
@ DPDK_TX_FUNC_N_ERROR
Definition: device.c:36
file_main
clib_file_main_t file_main
Definition: main.c:63
vnet_sw_interface_set_flags
clib_error_t * vnet_sw_interface_set_flags(vnet_main_t *vnm, u32 sw_if_index, vnet_sw_interface_flags_t flags)
Definition: interface.c:523
vec_add
#define vec_add(V, E, N)
Add N elements to end of vector V (no header, unspecified alignment)
Definition: vec.h:688
dpdk_device_class
VNET_DEVICE_CLASS_TX_FN() dpdk_device_class(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)
Definition: device.c:293
vnet_sub_interface_t::eth
struct vnet_sub_interface_t::@374 eth
dpdk_set_mac_address
static clib_error_t * dpdk_set_mac_address(vnet_hw_interface_t *hi, const u8 *old_address, const u8 *address)
Definition: device.c:69
thread_index
u32 thread_index
Definition: nat44_ei_hairpinning.c:495
vnet_sw_interface_t
Definition: interface.h:869
dpdk_device_start
void dpdk_device_start(dpdk_device_t *xd)
Definition: common.c:247
dpdk_tx_func_error_strings
static char * dpdk_tx_func_error_strings[]
Definition: device.c:39
dpdk_device_t::flags
u16 flags
Definition: dpdk.h:200
buffer
char * buffer
Definition: cJSON.h:163
vnet_sub_interface_t::flags
struct vnet_sub_interface_t::@374::@375::@377 flags
format_dpdk_flow
format_function_t format_dpdk_flow
Definition: dpdk.h:484
vlib_node_add_next
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
Definition: node_funcs.h:1177
dpdk_tx_trace_t::buffer_index
u32 buffer_index
Definition: dpdk.h:395
dpdk_main_t::devices
dpdk_device_t * devices
Definition: dpdk.h:361
dpdk_rx_queue_t::clib_file_index
uword clib_file_index
Definition: dpdk.h:173
vnet_sub_interface_t::outer_vlan_id
u16 outer_vlan_id
Definition: interface.h:783
clib_spinlock_lock_if_init
static_always_inline void clib_spinlock_lock_if_init(clib_spinlock_t *p)
Definition: lock.h:106
vlib_get_buffer
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
Definition: buffer_funcs.h:111
vlib_process_wait_for_event
static uword * vlib_process_wait_for_event(vlib_main_t *vm)
Definition: node_funcs.h:660
f
vlib_frame_t * f
Definition: interface_output.c:1098
dpdk_rx_queue_t
Definition: dpdk.h:167
pool_elt_at_index
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:549
vlib_get_buffers_with_offset
static_always_inline void vlib_get_buffers_with_offset(vlib_main_t *vm, u32 *bi, void **b, int count, i32 offset)
Translate array of buffer indices into buffer pointers with offset.
Definition: buffer_funcs.h:204
dpdk_main_t::vnet_main
vnet_main_t * vnet_main
Definition: dpdk.h:379
clib_bitmap_t
uword clib_bitmap_t
Definition: bitmap.h:50
dpdk_input_node
vlib_node_registration_t dpdk_input_node
(constructor) VLIB_REGISTER_NODE (dpdk_input_node)
Definition: node.c:542
clib_mem_free
static void clib_mem_free(void *p)
Definition: mem.h:314
VLIB_FRAME_SIZE
#define VLIB_FRAME_SIZE
Definition: node.h:368
node
vlib_main_t vlib_node_runtime_t * node
Definition: nat44_ei.c:3047
vnet_buffer_oflags_t
vnet_buffer_oflags_t
Definition: buffer.h:119
clib_error_return
#define clib_error_return(e, args...)
Definition: error.h:99
VNET_DEVICE_CLASS
VNET_DEVICE_CLASS(af_xdp_device_class)
dpdk_device_t::default_mac_address
u8 * default_mac_address
Definition: dpdk.h:242
vnet_interface_main_t
Definition: interface.h:990
u16
unsigned short u16
Definition: types.h:57
mode
vl_api_tunnel_mode_t mode
Definition: gre.api:48
VNET_SW_INTERFACE_FLAG_ADMIN_UP
@ VNET_SW_INTERFACE_FLAG_ADMIN_UP
Definition: interface.h:844
dpdk_tx_queue_t
Definition: dpdk.h:176
VNET_HW_IF_RX_MODE_POLLING
@ VNET_HW_IF_RX_MODE_POLLING
Definition: interface.h:56
admin_up_down_process_node
vlib_node_registration_t admin_up_down_process_node
(constructor) VLIB_REGISTER_NODE (admin_up_down_process_node)
Definition: device.c:819
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
dpdk_clear_hw_interface_counters
static void dpdk_clear_hw_interface_counters(u32 instance)
Definition: device.c:473
fm
vnet_feature_main_t * fm
Definition: nat44_ei_hairpinning.c:592
node_index
node node_index
Definition: interface_output.c:440
dpdk_device_t::port_id
dpdk_portid_t port_id
Definition: dpdk.h:203
vnet_interface_main_t::sw_if_counters
vlib_simple_counter_main_t * sw_if_counters
Definition: interface.h:1023
hi
vl_api_ip4_address_t hi
Definition: arp.api:37
vnet_buffer2
#define vnet_buffer2(b)
Definition: buffer.h:505
vnet_interface_main_t::hw_interfaces
vnet_hw_interface_t * hw_interfaces
Definition: interface.h:993
dpdk_device_t::errors
clib_error_t * errors
Definition: dpdk.h:245
clib_file_main_t
Definition: file.h:85
clib_error_report
#define clib_error_report(e)
Definition: error.h:113
vnet_hw_interface_t::dev_instance
u32 dev_instance
Definition: interface.h:660
r
vnet_hw_if_output_node_runtime_t * r
Definition: interface_output.c:1089
vlib_error_count
static void vlib_error_count(vlib_main_t *vm, uword node_index, uword counter, uword increment)
Definition: error_funcs.h:57
UNIX_FILE_UPDATE_ADD
@ UNIX_FILE_UPDATE_ADD
Definition: file.h:80
vlib_frame_t
Definition: node.h:372
vlib_buffer_length_in_chain
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
Definition: buffer_funcs.h:433
clib_memcpy_fast
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
Definition: string.h:92
ethernet.h
VNET_DEVICE_CLASS_TX_FN
#define VNET_DEVICE_CLASS_TX_FN(devclass)
Definition: interface.h:317
error
Definition: cJSON.c:88
dpdk_device_t::num_subifs
u16 num_subifs
Definition: dpdk.h:215
i32
signed int i32
Definition: types.h:77
dpdk_subif_add_del_function
static clib_error_t * dpdk_subif_add_del_function(vnet_main_t *vnm, u32 hw_if_index, struct vnet_sw_interface_t *st, int is_add)
Definition: device.c:542
dpdk_device_t::tx_queues
dpdk_tx_queue_t * tx_queues
Definition: dpdk.h:187
CLIB_PREFETCH
#define CLIB_PREFETCH(addr, size, type)
Definition: cache.h:76
vlib_process_get_events
static uword vlib_process_get_events(vlib_main_t *vm, uword **data_vector)
Return the first event type which has occurred and a vector of per-event data of that type,...
Definition: node_funcs.h:583
vlib_buffer_t::current_data
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
Definition: buffer.h:119
dpdk_tx_trace_t
Definition: dpdk.h:393
dpdk_device_t::per_interface_next_index
u32 per_interface_next_index
Definition: dpdk.h:196
vlib_increment_simple_counter
static void vlib_increment_simple_counter(vlib_simple_counter_main_t *cm, u32 thread_index, u32 index, u64 increment)
Increment a simple counter.
Definition: counter.h:74
dpdk_buffer_tx_offload
static_always_inline void dpdk_buffer_tx_offload(dpdk_device_t *xd, vlib_buffer_t *b, struct rte_mbuf *mb)
Definition: device.c:219
dpdk_device_t::hw_if_index
u32 hw_if_index
Definition: dpdk.h:192
clib_error_create
#define clib_error_create(args...)
Definition: error.h:96
vec_len
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
Definition: vec_bootstrap.h:142
error.h
vnet_sw_interface_t::sub
vnet_sub_interface_t sub
Definition: interface.h:893
vnet_interface_output_runtime_t::dev_instance
u32 dev_instance
Definition: interface_funcs.h:479
vnet_buffer
#define vnet_buffer(b)
Definition: buffer.h:441
vec_elt_at_index
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
Definition: vec_bootstrap.h:203
vnet_get_hw_interface
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
Definition: interface_funcs.h:44
vnet_get_main
vnet_main_t * vnet_get_main(void)
Definition: pnat_test_stubs.h:56
dpdk_tx_trace_t::data
u8 data[256]
Definition: dpdk.h:399
clib_file
Definition: file.h:51
VLIB_NODE_FLAG_TRACE
#define VLIB_NODE_FLAG_TRACE
Definition: node.h:291
clib_bitmap_count_set_bits
static uword clib_bitmap_count_set_bits(uword *ai)
Return the number of set bits in a bitmap.
Definition: bitmap.h:449
PREDICT_FALSE
#define PREDICT_FALSE(x)
Definition: clib.h:124
vlib_get_buffer_index
static u32 vlib_get_buffer_index(vlib_main_t *vm, void *p)
Translate buffer pointer into buffer index.
Definition: buffer_funcs.h:324
vlib_frame_vector_args
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
Definition: node_funcs.h:301
dpdk_device_t::device_index
u32 device_index
Definition: dpdk.h:190
dpdk_main
dpdk_main_t dpdk_main
Definition: init.c:48
dpdk_main_t
Definition: dpdk.h:357
vnet_hw_if_rx_mode
vnet_hw_if_rx_mode
Definition: interface.h:53
static_always_inline
#define static_always_inline
Definition: clib.h:112
vlib_buffer_from_rte_mbuf
#define vlib_buffer_from_rte_mbuf(x)
Definition: buffer.h:20
uword
u64 uword
Definition: types.h:112
dpdk_main_t::per_thread_data
dpdk_per_thread_data_t * per_thread_data
Definition: dpdk.h:362
buffer.h
dpdk_flow_ops_fn
vnet_flow_dev_ops_function_t dpdk_flow_ops_fn
Definition: dpdk.h:488
tx_burst_vector_internal
static_always_inline u32 tx_burst_vector_internal(vlib_main_t *vm, dpdk_device_t *xd, struct rte_mbuf **mb, u32 n_left)
Definition: device.c:157
vlib_main_t::thread_index
u32 thread_index
Definition: main.h:215
f64
double f64
Definition: types.h:142
dpdk_tx_func_error_t
dpdk_tx_func_error_t
Definition: device.c:31
dpdk_per_thread_data_t
Definition: dpdk.h:346
cm
vnet_feature_config_main_t * cm
Definition: nat44_ei_hairpinning.c:594
address
manual_print typedef address
Definition: ip_types.api:96
format.h
vlib_buffer_t::ref_count
volatile u8 ref_count
Reference count for this buffer.
Definition: buffer.h:139
dpdk_device_t::tx_q_used
u16 tx_q_used
Definition: dpdk.h:199
vlib_node_registration_t
struct _vlib_node_registration vlib_node_registration_t
dpdk_interface_admin_up_down
static clib_error_t * dpdk_interface_admin_up_down(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
Definition: device.c:483
vlib_buffer_t::current_length
u16 current_length
Nbytes between current data and the end of this buffer.
Definition: buffer.h:122
UNIX_FILE_UPDATE_DELETE
@ UNIX_FILE_UPDATE_DELETE
Definition: file.h:82
dpdk_no_cache_mempool_by_buffer_pool_index
struct rte_mempool ** dpdk_no_cache_mempool_by_buffer_pool_index
Definition: buffer.c:34
rte_mbuf_from_vlib_buffer
#define rte_mbuf_from_vlib_buffer(x)
Definition: buffer.h:19
dpdk_tx_trace_t::queue_index
u8 queue_index
Definition: dpdk.h:397
dpdk_per_thread_data_t::mbufs
struct rte_mbuf * mbufs[DPDK_RX_BURST_SZ]
Definition: dpdk.h:349
vnet_hw_interface_t
Definition: interface.h:638
vnet_main_t
Definition: vnet.h:76
dpdk_interface_set_rss_queues
static clib_error_t * dpdk_interface_set_rss_queues(struct vnet_main_t *vnm, struct vnet_hw_interface_t *hi, clib_bitmap_t *bitmap)
Definition: device.c:608
u64
unsigned long u64
Definition: types.h:89
VNET_INTERFACE_COUNTER_TX_ERROR
@ VNET_INTERFACE_COUNTER_TX_ERROR
Definition: interface.h:911
ASSERT
#define ASSERT(truth)
Definition: error_bootstrap.h:69
dpdk_update_link_state
void dpdk_update_link_state(dpdk_device_t *xd, f64 now)
Definition: init.c:1812
dpdk_device_stop
void dpdk_device_stop(dpdk_device_t *xd)
Definition: common.c:283
dpdk_main_t::admin_up_down_in_progress
u8 admin_up_down_in_progress
Definition: dpdk.h:371
VLIB_BUFFER_PRE_DATA_SIZE
#define VLIB_BUFFER_PRE_DATA_SIZE
Definition: buffer.h:51
u32
unsigned int u32
Definition: types.h:88
dpdk_validate_rte_mbuf
static_always_inline void dpdk_validate_rte_mbuf(vlib_main_t *vm, vlib_buffer_t *b, int maybe_multiseg)
Definition: device.c:115
clib_prefetch_load
static_always_inline void clib_prefetch_load(void *p)
Definition: cache.h:92
n_left
u32 n_left
Definition: interface_output.c:1096
VLIB_NODE_TYPE_PROCESS
@ VLIB_NODE_TYPE_PROCESS
Definition: node.h:84
instance
u32 instance
Definition: gre.api:51
dpdk_interface_rx_mode_change
static clib_error_t * dpdk_interface_rx_mode_change(vnet_main_t *vnm, u32 hw_if_index, u32 qid, vnet_hw_if_rx_mode mode)
Definition: device.c:718
foreach_dpdk_tx_func_error
#define foreach_dpdk_tx_func_error
Definition: device.c:27
dpdk_tx_trace_buffer
static void dpdk_tx_trace_buffer(dpdk_main_t *dm, vlib_node_runtime_t *node, dpdk_device_t *xd, u16 queue_id, vlib_buffer_t *buffer)
Definition: device.c:91
dpdk_device_t::pmd
dpdk_pmd_t pmd
Definition: dpdk.h:204
mac_address_t_
Definition: mac_address.h:21
vec.h
dpdk_main_t::vlib_main
vlib_main_t * vlib_main
Definition: dpdk.h:378
now
f64 now
Definition: nat44_ei_out2in.c:710
clib_memset
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
vlib_main_t
Definition: main.h:102
vlib_simple_counter_main_t
A collection of simple counters.
Definition: counter.h:57
dpdk_prefetch_buffer
static_always_inline __clib_unused void dpdk_prefetch_buffer(vlib_main_t *vm, struct rte_mbuf *mb)
Definition: device.c:211
dpdk_add_del_mac_address
static clib_error_t * dpdk_add_del_mac_address(vnet_hw_interface_t *hi, const u8 *address, u8 is_add)
Definition: device.c:46
vlib_add_trace
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
Definition: trace.c:628
vlib_get_main
static vlib_main_t * vlib_get_main(void)
Definition: global_funcs.h:38
b
vlib_buffer_t ** b
Definition: nat44_ei_out2in.c:717
u8
unsigned char u8
Definition: types.h:56
clib_error_t
Definition: clib_error.h:21
vnet_hw_interface_set_flags
clib_error_t * vnet_hw_interface_set_flags(vnet_main_t *vnm, u32 hw_if_index, vnet_hw_interface_flags_t flags)
Definition: interface.c:513
unix.h
rt
vnet_interface_output_runtime_t * rt
Definition: interface_output.c:419
dpdk_tx_trace_t::buffer
vlib_buffer_t buffer
Definition: dpdk.h:401
i
int i
Definition: flowhash_template.h:376
rv
int __clib_unused rv
Definition: application.c:491
vlib_time_now
static f64 vlib_time_now(vlib_main_t *vm)
Definition: main.h:327
clib_prefetch_store
static_always_inline void clib_prefetch_store(void *p)
Definition: cache.h:98
vlib_buffer_t::pre_data
u8 pre_data[VLIB_BUFFER_PRE_DATA_SIZE]
Space for inserting data before buffer start.
Definition: buffer.h:201
vnet.h
admin_up_down_process
static uword admin_up_down_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
Definition: device.c:776
clib_bitmap_foreach
#define clib_bitmap_foreach(i, ai)
Macro to iterate across set bits in a bitmap.
Definition: bitmap.h:361
vlib_node_runtime_t
Definition: node.h:454
clib_spinlock_unlock_if_init
static_always_inline void clib_spinlock_unlock_if_init(clib_spinlock_t *p)
Definition: lock.h:129
dpdk_tx_queue_t::lock
clib_spinlock_t lock
Definition: dpdk.h:179
dpdk_update_counters
static void dpdk_update_counters(dpdk_device_t *xd, f64 now)
Definition: dpdk_priv.h:99
PREDICT_TRUE
#define PREDICT_TRUE(x)
Definition: clib.h:125
format_dpdk_device
format_function_t format_dpdk_device
Definition: dpdk.h:478
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
format_dpdk_device_name
format_function_t format_dpdk_device_name
Definition: dpdk.h:477
clib_mem_alloc
static void * clib_mem_alloc(uword size)
Definition: mem.h:256
format_dpdk_tx_trace
format_function_t format_dpdk_tx_trace
Definition: dpdk.h:480
vnet_main_t::interface_main
vnet_interface_main_t interface_main
Definition: vnet.h:81
dpdk_priv.h
vlib_buffer_t::flags
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
Definition: buffer.h:133
dpdk_device_t::rx_queues
dpdk_rx_queue_t * rx_queues
Definition: dpdk.h:186
dpdk_tx_trace_t::mb
struct rte_mbuf mb
Definition: dpdk.h:398
UP_DOWN_FLAG_EVENT
#define UP_DOWN_FLAG_EVENT
Definition: device.c:773
vlib_buffer_t
VLIB buffer representation.
Definition: buffer.h:111
vnet_interface_output_runtime_t
Definition: interface_funcs.h:475
VLIB_REGISTER_NODE
#define VLIB_REGISTER_NODE(x,...)
Definition: node.h:169
dpdk_tx_trace_t::device_index
u16 device_index
Definition: dpdk.h:396
dpdk_device_t
Definition: dpdk.h:182
flags
vl_api_wireguard_peer_flags_t flags
Definition: wireguard.api:105