FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
format.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 #define __USE_GNU
21 #include <dlfcn.h>
22 
23 #include <vnet/ethernet/ethernet.h>
24 #include <vnet/ethernet/sfp.h>
25 #include <dpdk/device/dpdk.h>
26 
27 #include <dpdk/device/dpdk_priv.h>
28 #include <vppinfra/error.h>
29 
30 #define foreach_dpdk_counter \
31  _ (tx_frames_ok, opackets) \
32  _ (tx_bytes_ok, obytes) \
33  _ (tx_errors, oerrors) \
34  _ (rx_frames_ok, ipackets) \
35  _ (rx_bytes_ok, ibytes) \
36  _ (rx_errors, ierrors) \
37  _ (rx_missed, imissed) \
38  _ (rx_no_bufs, rx_nombuf)
39 
40 #define foreach_dpdk_q_counter \
41  _ (rx_frames_ok, q_ipackets) \
42  _ (tx_frames_ok, q_opackets) \
43  _ (rx_bytes_ok, q_ibytes) \
44  _ (tx_bytes_ok, q_obytes) \
45  _ (rx_errors, q_errors)
46 
47 #if RTE_VERSION < RTE_VERSION_NUM(21, 5, 0, 0)
48 #define PKT_RX_OUTER_IP_CKSUM_BAD PKT_RX_EIP_CKSUM_BAD
49 #endif
50 
51 #define foreach_dpdk_pkt_rx_offload_flag \
52  _ (PKT_RX_VLAN, "RX packet is a 802.1q VLAN packet") \
53  _ (PKT_RX_RSS_HASH, "RX packet with RSS hash result") \
54  _ (PKT_RX_FDIR, "RX packet with FDIR infos") \
55  _ (PKT_RX_L4_CKSUM_BAD, "L4 cksum of RX pkt. is not OK") \
56  _ (PKT_RX_IP_CKSUM_BAD, "IP cksum of RX pkt. is not OK") \
57  _ (PKT_RX_OUTER_IP_CKSUM_BAD, "External IP header checksum error") \
58  _ (PKT_RX_VLAN_STRIPPED, "RX packet VLAN tag stripped") \
59  _ (PKT_RX_IP_CKSUM_GOOD, "IP cksum of RX pkt. is valid") \
60  _ (PKT_RX_L4_CKSUM_GOOD, "L4 cksum of RX pkt. is valid") \
61  _ (PKT_RX_IEEE1588_PTP, "RX IEEE1588 L2 Ethernet PT Packet") \
62  _ (PKT_RX_IEEE1588_TMST, "RX IEEE1588 L2/L4 timestamped packet") \
63  _ (PKT_RX_LRO, "LRO packet") \
64  _ (PKT_RX_QINQ_STRIPPED, "RX packet QinQ tags stripped")
65 
66 #define foreach_dpdk_pkt_type \
67  _ (L2, ETHER, "Ethernet packet") \
68  _ (L2, ETHER_TIMESYNC, "Ethernet packet for time sync") \
69  _ (L2, ETHER_ARP, "ARP packet") \
70  _ (L2, ETHER_LLDP, "LLDP (Link Layer Discovery Protocol) packet") \
71  _ (L2, ETHER_NSH, "NSH (Network Service Header) packet") \
72  _ (L2, ETHER_VLAN, "VLAN packet") \
73  _ (L2, ETHER_QINQ, "QinQ packet") \
74  _ (L3, IPV4, "IPv4 packet without extension headers") \
75  _ (L3, IPV4_EXT, "IPv4 packet with extension headers") \
76  _ (L3, IPV4_EXT_UNKNOWN, "IPv4 packet with or without extension headers") \
77  _ (L3, IPV6, "IPv6 packet without extension headers") \
78  _ (L3, IPV6_EXT, "IPv6 packet with extension headers") \
79  _ (L3, IPV6_EXT_UNKNOWN, "IPv6 packet with or without extension headers") \
80  _ (L4, TCP, "TCP packet") \
81  _ (L4, UDP, "UDP packet") \
82  _ (L4, FRAG, "Fragmented IP packet") \
83  _ (L4, SCTP, "SCTP (Stream Control Transmission Protocol) packet") \
84  _ (L4, ICMP, "ICMP packet") \
85  _ (L4, NONFRAG, "Non-fragmented IP packet") \
86  _ (TUNNEL, GRE, "GRE tunneling packet") \
87  _ (TUNNEL, VXLAN, "VXLAN tunneling packet") \
88  _ (TUNNEL, NVGRE, "NVGRE Tunneling packet") \
89  _ (TUNNEL, GENEVE, "GENEVE Tunneling packet") \
90  _ (TUNNEL, GRENAT, "Teredo, VXLAN or GRE Tunneling packet") \
91  _ (INNER_L2, ETHER, "Inner Ethernet packet") \
92  _ (INNER_L2, ETHER_VLAN, "Inner Ethernet packet with VLAN") \
93  _ (INNER_L3, IPV4, "Inner IPv4 packet without extension headers") \
94  _ (INNER_L3, IPV4_EXT, "Inner IPv4 packet with extension headers") \
95  _ (INNER_L3, IPV4_EXT_UNKNOWN, "Inner IPv4 packet with or without extension headers") \
96  _ (INNER_L3, IPV6, "Inner IPv6 packet without extension headers") \
97  _ (INNER_L3, IPV6_EXT, "Inner IPv6 packet with extension headers") \
98  _ (INNER_L3, IPV6_EXT_UNKNOWN, "Inner IPv6 packet with or without extension headers") \
99  _ (INNER_L4, TCP, "Inner TCP packet") \
100  _ (INNER_L4, UDP, "Inner UDP packet") \
101  _ (INNER_L4, FRAG, "Inner fragmented IP packet") \
102  _ (INNER_L4, SCTP, "Inner SCTP (Stream Control Transmission Protocol) packet") \
103  _ (INNER_L4, ICMP, "Inner ICMP packet") \
104  _ (INNER_L4, NONFRAG, "Inner non-fragmented IP packet")
105 
106 #define foreach_dpdk_pkt_tx_offload_flag \
107  _ (PKT_TX_VLAN_PKT, "TX packet is a 802.1q VLAN packet") \
108  _ (PKT_TX_TUNNEL_VXLAN, "TX packet is a VXLAN packet") \
109  _ (PKT_TX_IP_CKSUM, "IP cksum of TX pkt. computed by NIC") \
110  _ (PKT_TX_TCP_CKSUM, "TCP cksum of TX pkt. computed by NIC") \
111  _ (PKT_TX_SCTP_CKSUM, "SCTP cksum of TX pkt. computed by NIC") \
112  _ (PKT_TX_OUTER_IP_CKSUM, "Outer IP cksum of Tx pkt. computed by NIC") \
113  _ (PKT_TX_TCP_SEG, "TSO of TX pkt. done by NIC") \
114  _ (PKT_TX_IEEE1588_TMST, "TX IEEE1588 packet to timestamp")
115 
116 #define foreach_dpdk_pkt_offload_flag \
117  foreach_dpdk_pkt_rx_offload_flag \
118  foreach_dpdk_pkt_tx_offload_flag
119 
120 #define foreach_dpdk_pkt_dyn_rx_offload_flag \
121  _ (RX_TIMESTAMP, 0, "Timestamp field is valid")
122 
123 u8 *
124 format_dpdk_device_name (u8 * s, va_list * args)
125 {
126  dpdk_main_t *dm = &dpdk_main;
127  char *devname_format;
128  char *device_name;
129  u32 i = va_arg (*args, u32);
131  struct rte_eth_dev_info dev_info;
132  struct rte_pci_device *pci_dev;
133  u8 *ret;
134 
135  if (xd->name)
136  return format (s, "%s", xd->name);
137 
139  devname_format = "%s%d/%d/%d";
140  else
141  devname_format = "%s%x/%x/%x";
142 
143  switch (xd->port_type)
144  {
146  device_name = "GigabitEthernet";
147  break;
148 
150  device_name = "Two_FiveGigabitEthernet";
151  break;
152 
154  device_name = "FiveGigabitEthernet";
155  break;
156 
158  device_name = "TenGigabitEthernet";
159  break;
160 
162  device_name = "TwentyGigabitEthernet";
163  break;
164 
166  device_name = "TwentyFiveGigabitEthernet";
167  break;
168 
170  device_name = "FortyGigabitEthernet";
171  break;
172 
174  device_name = "FiftyGigabitEthernet";
175  break;
176 
178  device_name = "FiftySixGigabitEthernet";
179  break;
180 
182  device_name = "HundredGigabitEthernet";
183  break;
184 
186  device_name = "EthernetSwitch";
187  break;
188 
190  device_name = "VirtualFunctionEthernet";
191  break;
192 
194  return format (s, "af_packet%d", xd->af_packet_instance_num);
195 
197  device_name = "VirtioUser";
198  break;
199 
201  device_name = "VhostEthernet";
202  break;
203 
205  device_name = "FailsafeEthernet";
206  break;
207 
208  default:
210  device_name = "UnknownEthernet";
211  break;
212  }
213 
214  rte_eth_dev_info_get (xd->port_id, &dev_info);
215  pci_dev = dpdk_get_pci_device (&dev_info);
216 
217  if (pci_dev && xd->port_type != VNET_DPDK_PORT_TYPE_FAILSAFE)
218  ret = format (s, devname_format, device_name, pci_dev->addr.bus,
219  pci_dev->addr.devid, pci_dev->addr.function);
220  else
221  ret = format (s, "%s%d", device_name, xd->port_id);
222 
223  if (xd->interface_name_suffix)
224  return format (ret, "/%s", xd->interface_name_suffix);
225  return ret;
226 }
227 
228 u8 *
229 format_dpdk_device_flags (u8 * s, va_list * args)
230 {
231  dpdk_device_t *xd = va_arg (*args, dpdk_device_t *);
232  u8 *t = 0;
233 
234 #define _(a, b, c) if (xd->flags & (1 << a)) \
235 t = format (t, "%s%s", t ? " ":"", c);
237 #undef _
238  s = format (s, "%v", t);
239  vec_free (t);
240  return s;
241 }
242 
243 static u8 *
244 format_dpdk_device_type (u8 * s, va_list * args)
245 {
246  dpdk_main_t *dm = &dpdk_main;
247  char *dev_type;
248  u32 i = va_arg (*args, u32);
249 
250  switch (dm->devices[i].pmd)
251  {
252  case VNET_DPDK_PMD_E1000EM:
253  dev_type = "Intel 82540EM (e1000)";
254  break;
255 
256  case VNET_DPDK_PMD_IGB:
257  dev_type = "Intel e1000";
258  break;
259 
260  case VNET_DPDK_PMD_I40E:
261  dev_type = "Intel X710/XL710 Family";
262  break;
263 
264  case VNET_DPDK_PMD_I40EVF:
265  dev_type = "Intel X710/XL710 Family VF";
266  break;
267 
268  case VNET_DPDK_PMD_ICE:
269  dev_type = "Intel E810 Family";
270  break;
271 
272  case VNET_DPDK_PMD_IAVF:
273  dev_type = "Intel iAVF";
274  break;
275 
276  case VNET_DPDK_PMD_FM10K:
277  dev_type = "Intel FM10000 Family Ethernet Switch";
278  break;
279 
280  case VNET_DPDK_PMD_IGBVF:
281  dev_type = "Intel e1000 VF";
282  break;
283 
284  case VNET_DPDK_PMD_VIRTIO:
285  dev_type = "Red Hat Virtio";
286  break;
287 
288  case VNET_DPDK_PMD_IXGBEVF:
289  dev_type = "Intel 82599 VF";
290  break;
291 
292  case VNET_DPDK_PMD_IXGBE:
293  dev_type = "Intel 82599";
294  break;
295 
296  case VNET_DPDK_PMD_ENIC:
297  dev_type = "Cisco VIC";
298  break;
299 
300  case VNET_DPDK_PMD_CXGBE:
301  dev_type = "Chelsio T4/T5";
302  break;
303 
304  case VNET_DPDK_PMD_MLX4:
305  dev_type = "Mellanox ConnectX-3 Family";
306  break;
307 
308  case VNET_DPDK_PMD_MLX5:
309  dev_type = "Mellanox ConnectX-4 Family";
310  break;
311 
312  case VNET_DPDK_PMD_VMXNET3:
313  dev_type = "VMware VMXNET3";
314  break;
315 
316  case VNET_DPDK_PMD_AF_PACKET:
317  dev_type = "af_packet";
318  break;
319 
320  case VNET_DPDK_PMD_DPAA2:
321  dev_type = "NXP DPAA2 Mac";
322  break;
323 
324  case VNET_DPDK_PMD_VIRTIO_USER:
325  dev_type = "Virtio User";
326  break;
327 
328  case VNET_DPDK_PMD_THUNDERX:
329  dev_type = "Cavium ThunderX";
330  break;
331 
332  case VNET_DPDK_PMD_VHOST_ETHER:
333  dev_type = "VhostEthernet";
334  break;
335 
336  case VNET_DPDK_PMD_ENA:
337  dev_type = "AWS ENA VF";
338  break;
339 
340  case VNET_DPDK_PMD_FAILSAFE:
341  dev_type = "FailsafeEthernet";
342  break;
343 
344  case VNET_DPDK_PMD_LIOVF_ETHER:
345  dev_type = "Cavium Lio VF";
346  break;
347 
348  case VNET_DPDK_PMD_QEDE:
349  dev_type = "Cavium QLogic FastLinQ QL4xxxx";
350  break;
351 
352  case VNET_DPDK_PMD_NETVSC:
353  dev_type = "Microsoft Hyper-V Netvsc";
354  break;
355 
356  case VNET_DPDK_PMD_BNXT:
357  dev_type = "Broadcom NetXtreme E/S-Series";
358  break;
359 
360  default:
362  dev_type = "### UNKNOWN ###";
363  break;
364  }
365 
366  return format (s, dev_type);
367 }
368 
369 static u8 *
370 format_dpdk_link_status (u8 * s, va_list * args)
371 {
372  dpdk_device_t *xd = va_arg (*args, dpdk_device_t *);
373  struct rte_eth_link *l = &xd->link;
374  vnet_main_t *vnm = vnet_get_main ();
376 
377  s = format (s, "%s ", l->link_status ? "up" : "down");
378  if (l->link_status)
379  {
380  u32 promisc = rte_eth_promiscuous_get (xd->port_id);
381 
382  s = format (s, "%s duplex ", (l->link_duplex == ETH_LINK_FULL_DUPLEX) ?
383  "full" : "half");
384  s = format (s, "mtu %d %s\n", hi->max_packet_bytes, promisc ?
385  " promisc" : "");
386  }
387  else
388  s = format (s, "\n");
389 
390  return s;
391 }
392 
393 #define _(n, v, str) \
394 if (bitmap & v) { \
395  if (format_get_indent (s) > 72) \
396  s = format(s,"\n%U", format_white_space, indent); \
397  s = format(s, "%s ", str); \
398 }
399 
400 u8 *
401 format_dpdk_rss_hf_name (u8 * s, va_list * args)
402 {
403  u64 bitmap = va_arg (*args, u64);
404  u32 indent = format_get_indent (s);
405 
406  if (!bitmap)
407  return format (s, "none");
408 
409  foreach_dpdk_rss_hf return s;
410 }
411 
412 #undef _
413 
414 /* Convert to all lower case e.g "VLAN_STRIP" -> "vlan-strip"
415  Works for both vector names and null terminated c strings. */
416 static u8 *
417 format_offload (u8 * s, va_list * va)
418 {
419  u8 *id = va_arg (*va, u8 *);
420  uword i, l;
421 
422  l = ~0;
423  if (clib_mem_is_vec (id))
424  l = vec_len (id);
425 
426  if (id)
427  for (i = 0; id[i] != 0 && i < l; i++)
428  {
429  u8 c = id[i];
430 
431  if (c == '_')
432  c = '-';
433  else
434  c = tolower (c);
435  vec_add1 (s, c);
436  }
437 
438  return s;
439 }
440 
441 #define _(v, func) \
442 if (bitmap & v) { \
443  if (format_get_indent (s) > 72) \
444  s = format(s,"\n%U", format_white_space, indent); \
445  s = format(s, "%U ", format_offload, func (v)); \
446 }
447 
448 u8 *
449 format_dpdk_rx_offload_caps (u8 * s, va_list * args)
450 {
451  u64 bitmap = va_arg (*args, u32);
452  u32 indent = format_get_indent (s);
453  uword i;
454 
455  if (!bitmap)
456  return format (s, "none");
457 
458  for (i = 0; i < 64; i++)
459  {
460  u64 mask = (u64) 1 << i;
461 
462  _(mask, rte_eth_dev_rx_offload_name);
463  }
464  return s;
465 }
466 
467 u8 *
468 format_dpdk_tx_offload_caps (u8 * s, va_list * args)
469 {
470  u64 bitmap = va_arg (*args, u32);
471  u32 indent = format_get_indent (s);
472  uword i;
473 
474  if (!bitmap)
475  return format (s, "none");
476 
477  for (i = 0; i < 64; i++)
478  {
479  u64 mask = (u64) 1 << i;
480 
481  _(mask, rte_eth_dev_tx_offload_name);
482  }
483  return s;
484 }
485 
486 #undef _
487 
488 u8 *
489 format_dpdk_device_errors (u8 * s, va_list * args)
490 {
491  dpdk_device_t *xd = va_arg (*args, dpdk_device_t *);
492  clib_error_t *e;
493  u32 indent = format_get_indent (s);
494 
495  vec_foreach (e, xd->errors)
496  {
497  s = format (s, "%U%v\n", format_white_space, indent, e->what);
498  }
499  return s;
500 }
501 
502 static u8 *
503 format_dpdk_device_module_info (u8 * s, va_list * args)
504 {
505  dpdk_device_t *xd = va_arg (*args, dpdk_device_t *);
506  struct rte_eth_dev_module_info mi = { 0 };
507  struct rte_dev_eeprom_info ei = { 0 };
508 
509  if (rte_eth_dev_get_module_info (xd->port_id, &mi) != 0)
510  return format (s, "unknown");
511 
512  ei.length = mi.eeprom_len;
513  ei.data = clib_mem_alloc (mi.eeprom_len);
514 
515  if (rte_eth_dev_get_module_eeprom (xd->port_id, &ei) == 0)
516  {
517  s = format (s, "%U", format_sfp_eeprom, ei.data +
518  (mi.type == RTE_ETH_MODULE_SFF_8436 ? 0x80 : 0));
519  }
520  else
521  s = format (s, "eeprom read error");
522 
523  clib_mem_free (ei.data);
524  return s;
525 }
526 
527 static const char *
528 ptr2sname (void *p)
529 {
530  Dl_info info = { 0 };
531 
532  if (dladdr (p, &info) == 0)
533  return 0;
534 
535  return info.dli_sname;
536 }
537 
538 static u8 *
539 format_switch_info (u8 * s, va_list * args)
540 {
541  struct rte_eth_switch_info *si =
542  va_arg (*args, struct rte_eth_switch_info *);
543 
544  if (si->name)
545  s = format (s, "name %s ", si->name);
546 
547  s = format (s, "domain id %d port id %d", si->domain_id, si->port_id);
548 
549  return s;
550 }
551 
552 u8 *
553 format_dpdk_device (u8 * s, va_list * args)
554 {
555  u32 dev_instance = va_arg (*args, u32);
556  int verbose = va_arg (*args, int);
557  dpdk_main_t *dm = &dpdk_main;
558  dpdk_device_t *xd = vec_elt_at_index (dm->devices, dev_instance);
559  u32 indent = format_get_indent (s);
560  f64 now = vlib_time_now (dm->vlib_main);
561  struct rte_eth_dev_info di;
562  struct rte_eth_burst_mode mode;
563 
566  rte_eth_dev_info_get (xd->port_id, &di);
567 
568  s = format (s, "%U\n%Ucarrier %U",
569  format_dpdk_device_type, dev_instance,
571  s = format (s, "%Uflags: %U\n",
573  if (di.device->devargs && di.device->devargs->args)
574  s = format (s, "%UDevargs: %s\n",
575  format_white_space, indent + 2, di.device->devargs->args);
576  s = format (s, "%Urx: queues %d (max %d), desc %d "
577  "(min %d max %d align %d)\n",
578  format_white_space, indent + 2, xd->rx_q_used, di.max_rx_queues,
579  xd->nb_rx_desc, di.rx_desc_lim.nb_min, di.rx_desc_lim.nb_max,
580  di.rx_desc_lim.nb_align);
581  s = format (s, "%Utx: queues %d (max %d), desc %d "
582  "(min %d max %d align %d)\n",
583  format_white_space, indent + 2, xd->tx_q_used, di.max_tx_queues,
584  xd->nb_tx_desc, di.tx_desc_lim.nb_min, di.tx_desc_lim.nb_max,
585  di.tx_desc_lim.nb_align);
586 
587  if (xd->flags & DPDK_DEVICE_FLAG_PMD)
588  {
589  struct rte_pci_device *pci;
590  struct rte_eth_rss_conf rss_conf;
591  int vlan_off;
592  int retval;
593 
594  rss_conf.rss_key = 0;
595  rss_conf.rss_hf = 0;
596  retval = rte_eth_dev_rss_hash_conf_get (xd->port_id, &rss_conf);
597  if (retval < 0)
598  clib_warning ("rte_eth_dev_rss_hash_conf_get returned %d", retval);
599 
600  pci = dpdk_get_pci_device (&di);
601 
602  if (pci)
603  {
604  u8 *s2;
605  if (xd->cpu_socket > -1)
606  s2 = format (0, "%d", xd->cpu_socket);
607  else
608  s2 = format (0, "unknown");
609  s = format (s, "%Upci: device %04x:%04x subsystem %04x:%04x "
610  "address %04x:%02x:%02x.%02x numa %v\n",
611  format_white_space, indent + 2, pci->id.vendor_id,
612  pci->id.device_id, pci->id.subsystem_vendor_id,
613  pci->id.subsystem_device_id, pci->addr.domain,
614  pci->addr.bus, pci->addr.devid, pci->addr.function, s2);
615  vec_free (s2);
616  }
617 
618  if (di.switch_info.domain_id != RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID)
619  {
620  s =
621  format (s, "%Uswitch info: %U\n", format_white_space, indent + 2,
622  format_switch_info, &di.switch_info);
623  }
624 
625  if (1 < verbose)
626  {
627  s = format (s, "%Umodule: %U\n", format_white_space, indent + 2,
629  }
630 
631  s = format (s, "%Umax rx packet len: %d\n", format_white_space,
632  indent + 2, di.max_rx_pktlen);
633  s = format (s, "%Upromiscuous: unicast %s all-multicast %s\n",
634  format_white_space, indent + 2,
635  rte_eth_promiscuous_get (xd->port_id) ? "on" : "off",
636  rte_eth_allmulticast_get (xd->port_id) ? "on" : "off");
637  vlan_off = rte_eth_dev_get_vlan_offload (xd->port_id);
638  s = format (s, "%Uvlan offload: strip %s filter %s qinq %s\n",
639  format_white_space, indent + 2,
640  vlan_off & ETH_VLAN_STRIP_OFFLOAD ? "on" : "off",
641  vlan_off & ETH_VLAN_FILTER_OFFLOAD ? "on" : "off",
642  vlan_off & ETH_VLAN_EXTEND_OFFLOAD ? "on" : "off");
643  s = format (s, "%Urx offload avail: %U\n",
644  format_white_space, indent + 2,
645  format_dpdk_rx_offload_caps, di.rx_offload_capa);
646  s = format (s, "%Urx offload active: %U\n",
647  format_white_space, indent + 2,
648  format_dpdk_rx_offload_caps, xd->port_conf.rxmode.offloads);
649  s = format (s, "%Utx offload avail: %U\n",
650  format_white_space, indent + 2,
651  format_dpdk_tx_offload_caps, di.tx_offload_capa);
652  s = format (s, "%Utx offload active: %U\n",
653  format_white_space, indent + 2,
654  format_dpdk_tx_offload_caps, xd->port_conf.txmode.offloads);
655  s = format (s, "%Urss avail: %U\n"
656  "%Urss active: %U\n",
657  format_white_space, indent + 2,
658  format_dpdk_rss_hf_name, di.flow_type_rss_offloads,
659  format_white_space, indent + 2,
660  format_dpdk_rss_hf_name, rss_conf.rss_hf);
661 
662  if (rte_eth_tx_burst_mode_get (xd->port_id, 0, &mode) == 0)
663  {
664  s = format (s, "%Utx burst mode: %s%s\n",
665  format_white_space, indent + 2,
666  mode.info,
667  mode.flags & RTE_ETH_BURST_FLAG_PER_QUEUE ?
668  " (per queue)" : "");
669  }
670  else
671  {
672  s = format (s, "%Utx burst function: %s\n",
673  format_white_space, indent + 2,
674  ptr2sname (rte_eth_devices[xd->port_id].tx_pkt_burst));
675  }
676 
677  if (rte_eth_rx_burst_mode_get (xd->port_id, 0, &mode) == 0)
678  {
679  s = format (s, "%Urx burst mode: %s%s\n",
680  format_white_space, indent + 2,
681  mode.info,
682  mode.flags & RTE_ETH_BURST_FLAG_PER_QUEUE ?
683  " (per queue)" : "");
684  }
685  else
686  {
687  s = format (s, "%Urx burst function: %s\n",
688  format_white_space, indent + 2,
689  ptr2sname (rte_eth_devices[xd->port_id].rx_pkt_burst));
690  }
691  }
692 
693  /* $$$ MIB counters */
694  {
695 #define _(N, V) \
696  if (xd->stats.V != 0) { \
697  s = format (s, "\n%U%-40U%16Lu", \
698  format_white_space, indent + 2, \
699  format_c_identifier, #N, \
700  xd->stats.V); \
701  } \
702 
704 #undef _
705  }
706 
707  u8 *xs = 0;
708  u32 i = 0;
709  struct rte_eth_xstat *xstat;
710  struct rte_eth_xstat_name *xstat_names = 0;
711  int len = vec_len (xd->xstats);
712  vec_validate (xstat_names, len - 1);
713  int ret = rte_eth_xstats_get_names (xd->port_id, xstat_names, len);
714 
715  if (ret >= 0 && ret <= len)
716  {
717  /* *INDENT-OFF* */
719  {
720  xstat = vec_elt_at_index(xd->xstats, i);
721  if (verbose == 2 || (verbose && xstat->value))
722  {
723  xs = format(xs, "\n%U%-38s%16Lu",
724  format_white_space, indent + 4,
725  xstat_names[i].name,
726  xstat->value);
727  }
728  }
729  /* *INDENT-ON* */
730 
731  vec_free (xstat_names);
732  }
733 
734  if (xs)
735  {
736  s = format (s, "\n%Uextended stats:%v",
737  format_white_space, indent + 2, xs);
738  vec_free (xs);
739  }
740 
741  if (vec_len (xd->errors))
742  {
743  s = format (s, "%UErrors:\n %U", format_white_space, indent,
745  }
746 
747  return s;
748 }
749 
750 u8 *
751 format_dpdk_tx_trace (u8 * s, va_list * va)
752 {
753  CLIB_UNUSED (vlib_main_t * vm) = va_arg (*va, vlib_main_t *);
754  CLIB_UNUSED (vlib_node_t * node) = va_arg (*va, vlib_node_t *);
756  dpdk_tx_trace_t *t = va_arg (*va, dpdk_tx_trace_t *);
757  dpdk_main_t *dm = &dpdk_main;
759  u32 indent = format_get_indent (s);
761 
762  s = format (s, "%U tx queue %d",
764 
765  s = format (s, "\n%Ubuffer 0x%x: %U", format_white_space, indent,
767 
768  s = format (s, "\n%U%U",
769  format_white_space, indent,
770  format_dpdk_rte_mbuf, &t->mb, &t->data);
771 
772  s = format (s, "\n%U%U", format_white_space, indent,
774  sizeof (t->buffer.pre_data));
775 
776  return s;
777 }
778 
779 u8 *
780 format_dpdk_rx_trace (u8 * s, va_list * va)
781 {
782  CLIB_UNUSED (vlib_main_t * vm) = va_arg (*va, vlib_main_t *);
783  CLIB_UNUSED (vlib_node_t * node) = va_arg (*va, vlib_node_t *);
785  dpdk_rx_trace_t *t = va_arg (*va, dpdk_rx_trace_t *);
786  dpdk_main_t *dm = &dpdk_main;
789  u32 indent = format_get_indent (s);
791 
792  s = format (s, "%U rx queue %d",
794 
795  s = format (s, "\n%Ubuffer 0x%x: %U", format_white_space, indent,
797 
798  s = format (s, "\n%U%U",
799  format_white_space, indent,
800  format_dpdk_rte_mbuf, &t->mb, &t->data);
801 
802  if (vm->trace_main.verbose)
803  {
804  s = format (s, "\n%UPacket Dump%s", format_white_space, indent + 2,
805  t->mb.data_len > sizeof (t->data) ? " (truncated)" : "");
806  s = format (s, "\n%U%U", format_white_space, indent + 4,
807  format_hexdump, &t->data,
808  t->mb.data_len >
809  sizeof (t->data) ? sizeof (t->data) : t->mb.data_len);
810  }
811  f = node->format_buffer;
812  if (!f)
814  s = format (s, "\n%U%U", format_white_space, indent,
815  f, t->buffer.pre_data, sizeof (t->buffer.pre_data));
816 
817  return s;
818 }
819 
820 
821 static inline u8 *
822 format_dpdk_pkt_types (u8 * s, va_list * va)
823 {
824  u32 *pkt_types = va_arg (*va, u32 *);
825  u32 indent __attribute__ ((unused)) = format_get_indent (s) + 2;
826 
827  if (!*pkt_types)
828  return s;
829 
830  s = format (s, "Packet Types");
831 
832 #define _(L, F, S) \
833  if ((*pkt_types & RTE_PTYPE_##L##_MASK) == RTE_PTYPE_##L##_##F) \
834  { \
835  s = format (s, "\n%U%s (0x%04x) %s", format_white_space, indent, \
836  "RTE_PTYPE_" #L "_" #F, RTE_PTYPE_##L##_##F, S); \
837  }
838 
840 #undef _
841  return s;
842 }
843 
844 static inline u8 *
846 {
847  u64 *ol_flags = va_arg (*va, u64 *);
848  u32 indent = format_get_indent (s) + 2;
849  u64 rx_dynflag;
850  int rx_dynflag_offset;
851 
852  if (!*ol_flags)
853  return s;
854 
855  s = format (s, "Packet Offload Flags");
856 
857 #define _(F, S) \
858  if (*ol_flags & F) \
859  { \
860  s = format (s, "\n%U%s (0x%04x) %s", \
861  format_white_space, indent, #F, F, S); \
862  }
863 
865 #undef _
866 #define _(F, P, S) \
867  { \
868  rx_dynflag_offset = rte_mbuf_dynflag_lookup(RTE_MBUF_DYNFLAG_##F##_NAME, \
869  P); \
870  if (rx_dynflag_offset >= 0) \
871  { \
872  rx_dynflag = (u64) 1 << rx_dynflag_offset; \
873  if (*ol_flags & rx_dynflag) \
874  { \
875  s = format (s, "\n%U%s %s", format_white_space, indent, \
876  #F, S); \
877  } \
878  } \
879  }
881 #undef _
882  return s;
883 }
884 
885 u8 *
886 format_dpdk_rte_mbuf_tso (u8 *s, va_list *va)
887 {
888  struct rte_mbuf *mb = va_arg (*va, struct rte_mbuf *);
889  if (mb->ol_flags & PKT_TX_TCP_SEG)
890  {
891  s = format (s, "l4_len %u tso_segsz %u", mb->l4_len, mb->tso_segsz);
892  }
893  return s;
894 }
895 
896 u8 *
897 format_dpdk_rte_mbuf_vlan (u8 * s, va_list * va)
898 {
899  ethernet_vlan_header_tv_t *vlan_hdr =
900  va_arg (*va, ethernet_vlan_header_tv_t *);
901 
902  if (clib_net_to_host_u16 (vlan_hdr->type) == ETHERNET_TYPE_DOT1AD)
903  {
904  s = format (s, "%U 802.1q vlan ",
906  clib_net_to_host_u16 (vlan_hdr->priority_cfi_and_id));
907  vlan_hdr++;
908  }
909 
910  s = format (s, "%U",
912  clib_net_to_host_u16 (vlan_hdr->priority_cfi_and_id));
913 
914  return s;
915 }
916 
917 u8 *
918 format_dpdk_rte_mbuf (u8 * s, va_list * va)
919 {
920  struct rte_mbuf *mb = va_arg (*va, struct rte_mbuf *);
921  ethernet_header_t *eth_hdr = va_arg (*va, ethernet_header_t *);
922  u32 indent = format_get_indent (s) + 2;
923 
924  s = format (
925  s,
926  "PKT MBUF: port %d, nb_segs %d, pkt_len %d"
927  "\n%Ubuf_len %d, data_len %d, ol_flags 0x%lx, data_off %d, phys_addr 0x%x"
928  "\n%Upacket_type 0x%x l2_len %u l3_len %u outer_l2_len %u outer_l3_len %u "
929  "%U"
930  "\n%Urss 0x%x fdir.hi 0x%x fdir.lo 0x%x",
931  mb->port, mb->nb_segs, mb->pkt_len, format_white_space, indent,
932  mb->buf_len, mb->data_len, mb->ol_flags, mb->data_off, mb->buf_iova,
933  format_white_space, indent, mb->packet_type, mb->l2_len, mb->l3_len,
934  mb->outer_l2_len, mb->outer_l3_len, format_dpdk_rte_mbuf_tso, mb,
935  format_white_space, indent, mb->hash.rss, mb->hash.fdir.hi,
936  mb->hash.fdir.lo);
937 
938  if (mb->ol_flags)
939  s = format (s, "\n%U%U", format_white_space, indent,
940  format_dpdk_pkt_offload_flags, &mb->ol_flags);
941 
942  if ((mb->ol_flags & PKT_RX_VLAN) &&
943  ((mb->ol_flags & (PKT_RX_VLAN_STRIPPED | PKT_RX_QINQ_STRIPPED)) == 0))
944  {
945  ethernet_vlan_header_tv_t *vlan_hdr =
946  ((ethernet_vlan_header_tv_t *) & (eth_hdr->type));
947  s = format (s, " %U", format_dpdk_rte_mbuf_vlan, vlan_hdr);
948  }
949 
950  if (mb->packet_type)
951  s = format (s, "\n%U%U", format_white_space, indent,
952  format_dpdk_pkt_types, &mb->packet_type);
953 
954  return s;
955 }
956 
957 clib_error_t *
959 {
961  {
962  if (0)
963  ;
964 #undef _
965 #define _(n, f, s) \
966  else if (unformat (input, s)) \
967  *rss_fn |= f;
968 
970 #undef _
971  else
972  {
973  return clib_error_return (0, "unknown input `%U'",
974  format_unformat_error, input);
975  }
976  }
977  return 0;
978 }
979 
980 
981 /*
982  * fd.io coding-style-patch-verification: ON
983  *
984  * Local Variables:
985  * eval: (c-set-style "gnu")
986  * End:
987  */
VNET_DPDK_PORT_TYPE_VIRTIO_USER
@ VNET_DPDK_PORT_TYPE_VIRTIO_USER
Definition: dpdk.h:123
VNET_DPDK_PMD_UNKNOWN
@ VNET_DPDK_PMD_UNKNOWN
Definition: dpdk.h:105
format_dpdk_pkt_offload_flags
static u8 * format_dpdk_pkt_offload_flags(u8 *s, va_list *va)
Definition: format.c:845
dpdk.h
ethernet_vlan_header_tv_t::priority_cfi_and_id
u16 priority_cfi_and_id
Definition: packet.h:164
foreach_dpdk_pkt_offload_flag
#define foreach_dpdk_pkt_offload_flag
Definition: format.c:116
VNET_DPDK_PORT_TYPE_UNKNOWN
@ VNET_DPDK_PORT_TYPE_UNKNOWN
Definition: dpdk.h:127
clib_mem_is_vec
static uword clib_mem_is_vec(void *v)
Predicate function, says whether the supplied vector is a clib heap object.
Definition: vec.h:244
foreach_dpdk_pkt_type
#define foreach_dpdk_pkt_type
Definition: format.c:66
vnet_sw_interface_t
Definition: interface.h:869
format_dpdk_rss_hf_name
u8 * format_dpdk_rss_hf_name(u8 *s, va_list *args)
Definition: format.c:401
dpdk_config_main_t::interface_name_format_decimal
u8 interface_name_format_decimal
Definition: dpdk.h:327
dpdk_device_t::flags
u16 flags
Definition: dpdk.h:200
format_switch_info
static u8 * format_switch_info(u8 *s, va_list *args)
Definition: format.c:539
format_dpdk_device
u8 * format_dpdk_device(u8 *s, va_list *args)
Definition: format.c:553
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
format_dpdk_device_type
static u8 * format_dpdk_device_type(u8 *s, va_list *args)
Definition: format.c:244
dpdk_get_pci_device
struct rte_pci_device * dpdk_get_pci_device(const struct rte_eth_dev_info *info)
Definition: common.c:335
f
vlib_frame_t * f
Definition: interface_output.c:1098
name
string name[64]
Definition: fib.api:25
ethernet_vlan_header_tv_t
Definition: packet.h:158
format_dpdk_rte_mbuf
u8 * format_dpdk_rte_mbuf(u8 *s, va_list *va)
Definition: format.c:918
clib_mem_free
static void clib_mem_free(void *p)
Definition: mem.h:314
format_hex_bytes
u8 * format_hex_bytes(u8 *s, va_list *va)
Definition: std-formats.c:84
node
vlib_main_t vlib_node_runtime_t * node
Definition: nat44_ei.c:3047
clib_error_return
#define clib_error_return(e, args...)
Definition: error.h:99
mode
vl_api_tunnel_mode_t mode
Definition: gre.api:48
ethernet_header_t::type
u16 type
Definition: packet.h:59
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
foreach_dpdk_pkt_dyn_rx_offload_flag
#define foreach_dpdk_pkt_dyn_rx_offload_flag
Definition: format.c:120
format_dpdk_rte_mbuf_vlan
u8 * format_dpdk_rte_mbuf_vlan(u8 *s, va_list *va)
Definition: format.c:897
vnet_get_sw_interface
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
Definition: interface_funcs.h:58
dpdk_device_t::port_id
dpdk_portid_t port_id
Definition: dpdk.h:203
format_hexdump
u8 * format_hexdump(u8 *s, va_list *va)
Definition: std-formats.c:352
dpdk_rx_trace_t::mb
struct rte_mbuf mb
Definition: dpdk.h:409
hi
vl_api_ip4_address_t hi
Definition: arp.api:37
dpdk_device_t::errors
clib_error_t * errors
Definition: dpdk.h:245
unformat_input_t
struct _unformat_input_t unformat_input_t
ethernet.h
dpdk_device_t::port_type
dpdk_port_type_t port_type
Definition: dpdk.h:239
VNET_DPDK_PORT_TYPE_ETH_10G
@ VNET_DPDK_PORT_TYPE_ETH_10G
Definition: dpdk.h:113
VNET_DPDK_PORT_TYPE_ETH_40G
@ VNET_DPDK_PORT_TYPE_ETH_40G
Definition: dpdk.h:116
dpdk_rx_trace_t::buffer
vlib_buffer_t buffer
Definition: dpdk.h:411
dpdk_rx_trace_t::buffer_index
u32 buffer_index
Definition: dpdk.h:406
dpdk_tx_trace_t
Definition: dpdk.h:393
format_dpdk_rte_mbuf_tso
u8 * format_dpdk_rte_mbuf_tso(u8 *s, va_list *va)
Definition: format.c:886
VNET_DPDK_PORT_TYPE_ETH_1G
@ VNET_DPDK_PORT_TYPE_ETH_1G
Definition: dpdk.h:110
dpdk_device_t::hw_if_index
u32 hw_if_index
Definition: dpdk.h:192
vec_len
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
Definition: vec_bootstrap.h:142
len
u8 len
Definition: ip_types.api:103
error.h
vec_add1
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
Definition: vec.h:606
VNET_DPDK_PORT_TYPE_ETH_5G
@ VNET_DPDK_PORT_TYPE_ETH_5G
Definition: dpdk.h:112
dpdk_device_t::rx_q_used
u16 rx_q_used
Definition: dpdk.h:198
CLIB_UNUSED
#define CLIB_UNUSED(x)
Definition: clib.h:90
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
format_sfp_eeprom
format_function_t format_sfp_eeprom
Definition: sfp.h:133
format_dpdk_rx_offload_caps
u8 * format_dpdk_rx_offload_caps(u8 *s, va_list *args)
Definition: format.c:449
foreach_dpdk_counter
#define foreach_dpdk_counter
Definition: format.c:30
unformat_check_input
static uword unformat_check_input(unformat_input_t *i)
Definition: format.h:163
dpdk_main
dpdk_main_t dpdk_main
Definition: init.c:48
dpdk_device_t::port_conf
struct rte_eth_conf port_conf
Definition: dpdk.h:218
dpdk_main_t
Definition: dpdk.h:357
c
svmdb_client_t * c
Definition: vpp_get_metrics.c:48
dpdk_rx_trace_t
Definition: dpdk.h:404
unformat_rss_fn
clib_error_t * unformat_rss_fn(unformat_input_t *input, uword *rss_fn)
Definition: format.c:958
vec_foreach_index
#define vec_foreach_index(var, v)
Iterate over vector indices.
Definition: vec_bootstrap.h:220
uword
u64 uword
Definition: types.h:112
format_ethernet_vlan_tci
u8 * format_ethernet_vlan_tci(u8 *s, va_list *va)
Definition: format.c:79
ethernet_header_t
Definition: packet.h:52
VNET_DPDK_PORT_TYPE_AF_PACKET
@ VNET_DPDK_PORT_TYPE_AF_PACKET
Definition: dpdk.h:121
foreach_dpdk_device_flags
@ foreach_dpdk_device_flags
Definition: dpdk.h:149
f64
double f64
Definition: types.h:142
mask
vl_api_pnat_mask_t mask
Definition: pnat.api:45
format_unformat_error
u8 * format_unformat_error(u8 *s, va_list *va)
Definition: unformat.c:91
VNET_DPDK_PORT_TYPE_ETH_25G
@ VNET_DPDK_PORT_TYPE_ETH_25G
Definition: dpdk.h:115
vec_validate
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
Definition: vec.h:523
format.h
format_vnet_buffer_no_chain
format_function_t format_vnet_buffer_no_chain
Definition: buffer.h:520
dpdk_main_t::conf
dpdk_config_main_t * conf
Definition: dpdk.h:380
format_dpdk_device_flags
u8 * format_dpdk_device_flags(u8 *s, va_list *args)
Definition: format.c:229
format_dpdk_tx_offload_caps
u8 * format_dpdk_tx_offload_caps(u8 *s, va_list *args)
Definition: format.c:468
dpdk_rx_trace_t::data
u8 data[256]
Definition: dpdk.h:410
dpdk_device_t::tx_q_used
u16 tx_q_used
Definition: dpdk.h:199
VNET_DPDK_PORT_TYPE_ETH_50G
@ VNET_DPDK_PORT_TYPE_ETH_50G
Definition: dpdk.h:117
dpdk_device_t::nb_rx_desc
u16 nb_rx_desc
Definition: dpdk.h:209
format
__clib_export u8 * format(u8 *s, const char *fmt,...)
Definition: format.c:428
dpdk_device_t::name
u8 * name
Definition: dpdk.h:211
format_offload
static u8 * format_offload(u8 *s, va_list *va)
Definition: format.c:417
ptr2sname
static const char * ptr2sname(void *p)
Definition: format.c:528
dpdk_tx_trace_t::queue_index
u8 queue_index
Definition: dpdk.h:397
dpdk_device_t::af_packet_instance_num
u16 af_packet_instance_num
Definition: dpdk.h:230
format_function_t
u8 *() format_function_t(u8 *s, va_list *args)
Definition: format.h:48
format_dpdk_rx_trace
u8 * format_dpdk_rx_trace(u8 *s, va_list *va)
Definition: format.c:780
format_ethernet_header_with_length
u8 * format_ethernet_header_with_length(u8 *s, va_list *args)
Definition: format.c:97
VNET_DPDK_PORT_TYPE_ETH_56G
@ VNET_DPDK_PORT_TYPE_ETH_56G
Definition: dpdk.h:118
vnet_hw_interface_t
Definition: interface.h:638
vnet_main_t
Definition: vnet.h:76
vec_free
#define vec_free(V)
Free vector's memory (no header).
Definition: vec.h:395
VNET_DPDK_PORT_TYPE_VHOST_ETHER
@ VNET_DPDK_PORT_TYPE_VHOST_ETHER
Definition: dpdk.h:124
format_dpdk_device_name
u8 * format_dpdk_device_name(u8 *s, va_list *args)
Definition: format.c:124
dpdk_rx_trace_t::queue_index
u16 queue_index
Definition: dpdk.h:408
u64
unsigned long u64
Definition: types.h:89
format_get_indent
static u32 format_get_indent(u8 *s)
Definition: format.h:72
dpdk_update_link_state
void dpdk_update_link_state(dpdk_device_t *xd, f64 now)
Definition: init.c:1812
dpdk_device_t::link
struct rte_eth_link link
Definition: dpdk.h:232
u32
unsigned int u32
Definition: types.h:88
format_dpdk_device_module_info
static u8 * format_dpdk_device_module_info(u8 *s, va_list *args)
Definition: format.c:503
dpdk_device_t::cpu_socket
i8 cpu_socket
Definition: dpdk.h:205
si
vnet_sw_interface_t * si
Definition: interface_output.c:418
dpdk_rx_trace_t::device_index
u16 device_index
Definition: dpdk.h:407
VNET_DPDK_PORT_TYPE_ETH_20G
@ VNET_DPDK_PORT_TYPE_ETH_20G
Definition: dpdk.h:114
dpdk_device_t::xstats
struct rte_eth_xstat * xstats
Definition: dpdk.h:237
vec_foreach
#define vec_foreach(var, vec)
Vector iterator.
Definition: vec_bootstrap.h:213
format_dpdk_link_status
static u8 * format_dpdk_link_status(u8 *s, va_list *args)
Definition: format.c:370
dpdk_device_t::interface_name_suffix
u8 * interface_name_suffix
Definition: dpdk.h:212
dpdk_device_t::pmd
dpdk_pmd_t pmd
Definition: dpdk.h:204
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
ethernet_vlan_header_tv_t::type
u16 type
Definition: packet.h:161
VNET_DPDK_PORT_TYPE_FAILSAFE
@ VNET_DPDK_PORT_TYPE_FAILSAFE
Definition: dpdk.h:125
vlib_main_t
Definition: main.h:102
vlib_node_t
Definition: node.h:247
format_dpdk_device_errors
u8 * format_dpdk_device_errors(u8 *s, va_list *args)
Definition: format.c:489
u8
unsigned char u8
Definition: types.h:56
clib_error_t
Definition: clib_error.h:21
dpdk_tx_trace_t::buffer
vlib_buffer_t buffer
Definition: dpdk.h:401
VNET_DPDK_PORT_TYPE_ETH_2_5G
@ VNET_DPDK_PORT_TYPE_ETH_2_5G
Definition: dpdk.h:111
sfp.h
i
int i
Definition: flowhash_template.h:376
VNET_DPDK_PORT_TYPE_ETH_100G
@ VNET_DPDK_PORT_TYPE_ETH_100G
Definition: dpdk.h:119
clib_warning
#define clib_warning(format, args...)
Definition: error.h:59
vlib_trace_main_t::verbose
int verbose
Definition: trace.h:104
VNET_DPDK_PORT_TYPE_ETH_VF
@ VNET_DPDK_PORT_TYPE_ETH_VF
Definition: dpdk.h:122
dpdk_device_t::nb_tx_desc
u16 nb_tx_desc
Definition: dpdk.h:208
vlib_time_now
static f64 vlib_time_now(vlib_main_t *vm)
Definition: main.h:327
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
vlib_main_t::trace_main
vlib_trace_main_t trace_main
Definition: main.h:176
VNET_DPDK_PORT_TYPE_ETH_SWITCH
@ VNET_DPDK_PORT_TYPE_ETH_SWITCH
Definition: dpdk.h:120
format_dpdk_tx_trace
u8 * format_dpdk_tx_trace(u8 *s, va_list *va)
Definition: format.c:751
dpdk_update_counters
static void dpdk_update_counters(dpdk_device_t *xd, f64 now)
Definition: dpdk_priv.h:99
di
void di(unformat_input_t *i)
Definition: unformat.c:163
format_dpdk_pkt_types
static u8 * format_dpdk_pkt_types(u8 *s, va_list *va)
Definition: format.c:822
foreach_dpdk_rss_hf
#define foreach_dpdk_rss_hf
Definition: dpdk.h:449
clib_mem_alloc
static void * clib_mem_alloc(uword size)
Definition: mem.h:256
dpdk_device_t::sw_if_index
u32 sw_if_index
Definition: dpdk.h:193
clib_error_t::what
u8 * what
Definition: clib_error.h:24
format_white_space
u8 * format_white_space(u8 *s, va_list *va)
Definition: std-formats.c:129
dpdk_priv.h
UNFORMAT_END_OF_INPUT
#define UNFORMAT_END_OF_INPUT
Definition: format.h:137
format_vnet_sw_interface_name
format_function_t format_vnet_sw_interface_name
Definition: interface_funcs.h:456
dpdk_tx_trace_t::mb
struct rte_mbuf mb
Definition: dpdk.h:398
dpdk_tx_trace_t::device_index
u16 device_index
Definition: dpdk.h:396
dpdk_device_t
Definition: dpdk.h:182