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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
15 #include <vnet/vnet.h>
16 #include <vppinfra/vec.h>
17 #include <vppinfra/error.h>
18 #include <vppinfra/format.h>
19 #include <vppinfra/xxhash.h>
21 #include <vnet/ethernet/ethernet.h>
22 #include <dpdk/device/dpdk.h>
23 #include <vnet/classify/vnet_classify.h>
24 #include <vnet/mpls/packet.h>
26 #include <dpdk/device/dpdk_priv.h>
30 * @brief CLI for DPDK Abstraction Layer and pcap Tx Trace.
32 * This file contains the source code for CLI for DPDK
33 * Abstraction Layer and pcap Tx Trace.
38 get_hqos (u32 hw_if_index, u32 subport_id, dpdk_device_t ** xd,
39 dpdk_device_config_t ** devconf)
41 dpdk_main_t *dm = &dpdk_main;
42 vnet_hw_interface_t *hw;
43 struct rte_eth_dev_info dev_info;
45 clib_error_t *error = NULL;
48 if (hw_if_index == (u32) ~ 0)
50 error = clib_error_return (0, "please specify valid interface name");
56 error = clib_error_return (0, "Invalid subport");
60 hw = vnet_get_hw_interface (dm->vnet_main, hw_if_index);
61 *xd = vec_elt_at_index (dm->devices, hw->dev_instance);
63 rte_eth_dev_info_get ((*xd)->device_index, &dev_info);
65 { /* bonded interface has no pci info */
66 vlib_pci_addr_t pci_addr;
68 pci_addr.domain = dev_info.pci_dev->addr.domain;
69 pci_addr.bus = dev_info.pci_dev->addr.bus;
70 pci_addr.slot = dev_info.pci_dev->addr.devid;
71 pci_addr.function = dev_info.pci_dev->addr.function;
74 hash_get (dm->conf->device_config_index_by_pci_addr, pci_addr.as_u32);
78 (*devconf) = pool_elt_at_index (dm->conf->dev_confs, p[0]);
80 (*devconf) = &dm->conf->default_devconf;
87 pcap_trace_command_fn (vlib_main_t * vm,
88 unformat_input_t * input, vlib_cli_command_t * cmd)
90 #define PCAP_DEF_PKT_TO_CAPTURE (100)
92 unformat_input_t _line_input, *line_input = &_line_input;
93 dpdk_main_t *dm = &dpdk_main;
95 u8 *chroot_filename = 0;
99 clib_error_t *error = 0;
101 /* Get a line of input. */
102 if (!unformat_user (input, unformat_line_input, line_input))
105 while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
107 if (unformat (line_input, "on"))
109 if (dm->tx_pcap_enable == 0)
115 vlib_cli_output (vm, "pcap tx capture already on...");
120 else if (unformat (line_input, "off"))
122 if (dm->tx_pcap_enable)
124 vlib_cli_output (vm, "captured %d pkts...",
125 dm->pcap_main.n_packets_captured + 1);
126 if (dm->pcap_main.n_packets_captured)
128 dm->pcap_main.n_packets_to_capture =
129 dm->pcap_main.n_packets_captured;
130 error = pcap_write (&dm->pcap_main);
132 clib_error_report (error);
134 vlib_cli_output (vm, "saved to %s...", dm->pcap_filename);
137 dm->tx_pcap_enable = 0;
141 vlib_cli_output (vm, "pcap tx capture already off...");
146 else if (unformat (line_input, "max %d", &max))
148 if (dm->tx_pcap_enable)
151 "can't change max value while pcap tx capture active...");
156 else if (unformat (line_input, "intfc %U",
157 unformat_vnet_sw_interface, dm->vnet_main,
158 &dm->pcap_sw_if_index))
161 else if (unformat (line_input, "intfc any"))
163 dm->pcap_sw_if_index = 0;
165 else if (unformat (line_input, "file %s", &filename))
167 if (dm->tx_pcap_enable)
170 "can't change file while pcap tx capture active...");
175 /* Brain-police user path input */
176 if (strstr ((char *) filename, "..")
177 || index ((char *) filename, '/'))
179 vlib_cli_output (vm, "illegal characters in filename '%s'",
182 "Hint: Only filename, do not enter directory structure.");
188 chroot_filename = format (0, "/tmp/%s%c", filename, 0);
191 else if (unformat (line_input, "status"))
193 if (dm->pcap_sw_if_index == 0)
195 vlib_cli_output (vm, "max is %d for any interface to file %s",
197 pcap_pkts_to_capture ? dm->pcap_pkts_to_capture
198 : PCAP_DEF_PKT_TO_CAPTURE,
200 pcap_filename ? dm->pcap_filename : (u8 *)
205 vlib_cli_output (vm, "max is %d for interface %U to file %s",
207 pcap_pkts_to_capture ? dm->pcap_pkts_to_capture
208 : PCAP_DEF_PKT_TO_CAPTURE,
209 format_vnet_sw_if_index_name, dm->vnet_main,
210 dm->pcap_sw_if_index,
212 pcap_filename ? dm->pcap_filename : (u8 *)
216 if (dm->tx_pcap_enable == 0)
218 vlib_cli_output (vm, "pcap tx capture is off...");
222 vlib_cli_output (vm, "pcap tx capture is on: %d of %d pkts...",
223 dm->pcap_main.n_packets_captured,
224 dm->pcap_main.n_packets_to_capture);
231 error = clib_error_return (0, "unknown input `%U'",
232 format_unformat_error, line_input);
237 unformat_free (line_input);
242 /* Since no error, save configured values. */
245 if (dm->pcap_filename)
246 vec_free (dm->pcap_filename);
247 vec_add1 (chroot_filename, 0);
248 dm->pcap_filename = chroot_filename;
252 dm->pcap_pkts_to_capture = max;
257 if (dm->pcap_filename == 0)
258 dm->pcap_filename = format (0, "/tmp/vpe.pcap%c", 0);
260 memset (&dm->pcap_main, 0, sizeof (dm->pcap_main));
261 dm->pcap_main.file_name = (char *) dm->pcap_filename;
262 dm->pcap_main.n_packets_to_capture = PCAP_DEF_PKT_TO_CAPTURE;
263 if (dm->pcap_pkts_to_capture)
264 dm->pcap_main.n_packets_to_capture = dm->pcap_pkts_to_capture;
266 dm->pcap_main.packet_type = PCAP_PACKET_TYPE_ethernet;
267 dm->tx_pcap_enable = 1;
268 vlib_cli_output (vm, "pcap tx capture on...");
271 else if (chroot_filename)
272 vec_free (chroot_filename);
279 * This command is used to start or stop a packet capture, or show
280 * the status of packet capture.
282 * This command has the following optional parameters:
284 * - <b>on|off</b> - Used to start or stop a packet capture.
286 * - <b>max <nn></b> - Depth of local buffer. Once '<em>nn</em>' number
287 * of packets have been received, buffer is flushed to file. Once another
288 * '<em>nn</em>' number of packets have been received, buffer is flushed
289 * to file, overwriting previous write. If not entered, value defaults
290 * to 100. Can only be updated if packet capture is off.
292 * - <b>intfc <interface>|any</b> - Used to specify a given interface,
293 * or use '<em>any</em>' to run packet capture on all interfaces.
294 * '<em>any</em>' is the default if not provided. Settings from a previous
295 * packet capture are preserved, so '<em>any</em>' can be used to reset
296 * the interface setting.
298 * - <b>file <name></b> - Used to specify the output filename. The file will
299 * be placed in the '<em>/tmp</em>' directory, so only the filename is
300 * supported. Directory should not be entered. If file already exists, file
301 * will be overwritten. If no filename is provided, '<em>/tmp/vpe.pcap</em>'
302 * will be used. Can only be updated if packet capture is off.
304 * - <b>status</b> - Displays the current status and configured attributes
305 * associated with a packet capture. If packet capture is in progress,
306 * '<em>status</em>' also will return the number of packets currently in
307 * the local buffer. All additional attributes entered on command line
308 * with '<em>status</em>' will be ingnored and not applied.
311 * Example of how to display the status of a tx packet capture when off:
312 * @cliexstart{pcap tx trace status}
313 * max is 100, for any interface to file /tmp/vpe.pcap
314 * pcap tx capture is off...
316 * Example of how to start a tx packet capture:
317 * @cliexstart{pcap tx trace on max 35 intfc GigabitEthernet0/8/0 file vppTest.pcap}
318 * pcap tx capture on...
320 * Example of how to display the status of a tx packet capture in progress:
321 * @cliexstart{pcap tx trace status}
322 * max is 35, for interface GigabitEthernet0/8/0 to file /tmp/vppTest.pcap
323 * pcap tx capture is on: 20 of 35 pkts...
325 * Example of how to stop a tx packet capture:
326 * @cliexstart{vppctl pcap tx trace off}
327 * captured 21 pkts...
328 * saved to /tmp/vppTest.pcap...
332 VLIB_CLI_COMMAND (pcap_trace_command, static) = {
333 .path = "pcap tx trace",
335 "pcap tx trace [on|off] [max <nn>] [intfc <interface>|any] [file <name>] [status]",
336 .function = pcap_trace_command_fn,
341 static clib_error_t *
342 show_dpdk_buffer (vlib_main_t * vm, unformat_input_t * input,
343 vlib_cli_command_t * cmd)
345 struct rte_mempool *rmp;
348 for (i = 0; i < vec_len (dpdk_main.pktmbuf_pools); i++)
350 rmp = dpdk_main.pktmbuf_pools[i];
353 unsigned count = rte_mempool_avail_count (rmp);
354 unsigned free_count = rte_mempool_in_use_count (rmp);
357 "name=\"%s\" available = %7d allocated = %7d total = %7d\n",
358 rmp->name, (u32) count, (u32) free_count,
359 (u32) (count + free_count));
363 vlib_cli_output (vm, "rte_mempool is NULL (!)\n");
370 * This command displays statistics of each DPDK mempool.
373 * Example of how to display DPDK buffer data:
374 * @cliexstart{show dpdk buffer}
375 * name="mbuf_pool_socket0" available = 15104 allocated = 1280 total = 16384
379 VLIB_CLI_COMMAND (cmd_show_dpdk_bufferr,static) = {
380 .path = "show dpdk buffer",
381 .short_help = "show dpdk buffer",
382 .function = show_dpdk_buffer,
387 static clib_error_t *
388 test_dpdk_buffer (vlib_main_t * vm, unformat_input_t * input,
389 vlib_cli_command_t * cmd)
391 static u32 *allocated_buffers;
394 u32 first, actual_alloc;
396 while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
398 if (unformat (input, "allocate %d", &n_alloc))
400 else if (unformat (input, "free %d", &n_free))
408 if (vec_len (allocated_buffers) < n_free)
409 return clib_error_return (0, "Can't free %d, only %d allocated",
410 n_free, vec_len (allocated_buffers));
412 first = vec_len (allocated_buffers) - n_free;
413 vlib_buffer_free (vm, allocated_buffers + first, n_free);
414 _vec_len (allocated_buffers) = first;
418 first = vec_len (allocated_buffers);
419 vec_validate (allocated_buffers,
420 vec_len (allocated_buffers) + n_alloc - 1);
422 actual_alloc = vlib_buffer_alloc (vm, allocated_buffers + first,
424 _vec_len (allocated_buffers) = first + actual_alloc;
426 if (actual_alloc < n_alloc)
427 vlib_cli_output (vm, "WARNING: only allocated %d buffers",
431 vlib_cli_output (vm, "Currently %d buffers allocated",
432 vec_len (allocated_buffers));
434 if (allocated_buffers && vec_len (allocated_buffers) == 0)
435 vec_free (allocated_buffers);
441 * This command tests the allocation and freeing of DPDK buffers.
442 * If both '<em>allocate</em>' and '<em>free</em>' are entered on the
443 * same command, the '<em>free</em>' is executed first. If no
444 * parameters are provided, this command display how many DPDK buffers
445 * the test command has allocated.
450 * Example of how to display how many DPDK buffer test command has allcoated:
451 * @cliexstart{test dpdk buffer}
452 * Currently 0 buffers allocated
455 * Example of how to allocate DPDK buffers using the test command:
456 * @cliexstart{test dpdk buffer allocate 10}
457 * Currently 10 buffers allocated
460 * Example of how to free DPDK buffers allocated by the test command:
461 * @cliexstart{test dpdk buffer free 10}
462 * Currently 0 buffers allocated
467 VLIB_CLI_COMMAND (cmd_test_dpdk_buffer,static) = {
468 .path = "test dpdk buffer",
469 .short_help = "test dpdk buffer [allocate <nn>] [free <nn>]",
470 .function = test_dpdk_buffer,
475 static clib_error_t *
476 set_dpdk_if_desc (vlib_main_t * vm, unformat_input_t * input,
477 vlib_cli_command_t * cmd)
479 unformat_input_t _line_input, *line_input = &_line_input;
480 dpdk_main_t *dm = &dpdk_main;
481 vnet_hw_interface_t *hw;
483 u32 hw_if_index = (u32) ~ 0;
484 u32 nb_rx_desc = (u32) ~ 0;
485 u32 nb_tx_desc = (u32) ~ 0;
486 clib_error_t *error = NULL;
488 if (!unformat_user (input, unformat_line_input, line_input))
491 while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
494 (line_input, "%U", unformat_vnet_hw_interface, dm->vnet_main,
497 else if (unformat (line_input, "tx %d", &nb_tx_desc))
499 else if (unformat (line_input, "rx %d", &nb_rx_desc))
503 error = clib_error_return (0, "parse error: '%U'",
504 format_unformat_error, line_input);
509 if (hw_if_index == (u32) ~ 0)
511 error = clib_error_return (0, "please specify valid interface name");
515 hw = vnet_get_hw_interface (dm->vnet_main, hw_if_index);
516 xd = vec_elt_at_index (dm->devices, hw->dev_instance);
518 if ((xd->flags & DPDK_DEVICE_FLAG_PMD) == 0)
521 clib_error_return (0,
522 "number of descriptors can be set only for "
527 if ((nb_rx_desc == (u32) ~ 0 || nb_rx_desc == xd->nb_rx_desc) &&
528 (nb_tx_desc == (u32) ~ 0 || nb_tx_desc == xd->nb_tx_desc))
530 error = clib_error_return (0, "nothing changed");
534 if (nb_rx_desc != (u32) ~ 0)
535 xd->nb_rx_desc = nb_rx_desc;
537 if (nb_tx_desc != (u32) ~ 0)
538 xd->nb_tx_desc = nb_tx_desc;
540 dpdk_device_setup (xd);
542 if (vec_len (xd->errors))
543 return clib_error_return (0, "%U", format_dpdk_device_errors, xd);
546 unformat_free (line_input);
552 * This command sets the number of DPDK '<em>rx</em>' and
553 * '<em>tx</em>' descriptors for the given physical interface. Use
554 * the command '<em>show hardware-interface</em>' to display the
555 * current descriptor allocation.
558 * Example of how to set the DPDK interface descriptors:
559 * @cliexcmd{set dpdk interface descriptors GigabitEthernet0/8/0 rx 512 tx 512}
562 VLIB_CLI_COMMAND (cmd_set_dpdk_if_desc,static) = {
563 .path = "set dpdk interface descriptors",
564 .short_help = "set dpdk interface descriptors <interface> [rx <nn>] [tx <nn>]",
565 .function = set_dpdk_if_desc,
570 dpdk_device_queue_sort (void *a1, void *a2)
572 dpdk_device_and_queue_t *dq1 = a1;
573 dpdk_device_and_queue_t *dq2 = a2;
575 if (dq1->device > dq2->device)
577 else if (dq1->device < dq2->device)
579 else if (dq1->queue_id > dq2->queue_id)
581 else if (dq1->queue_id < dq2->queue_id)
588 static clib_error_t *
589 show_dpdk_if_hqos_placement (vlib_main_t * vm, unformat_input_t * input,
590 vlib_cli_command_t * cmd)
592 vlib_thread_main_t *tm = vlib_get_thread_main ();
593 dpdk_main_t *dm = &dpdk_main;
594 dpdk_device_and_queue_t *dq;
597 if (tm->n_vlib_mains == 1)
598 vlib_cli_output (vm, "All interfaces are handled by main thread");
600 for (cpu = 0; cpu < vec_len (dm->devices_by_hqos_cpu); cpu++)
602 if (cpu >= dm->hqos_cpu_first_index &&
603 cpu < (dm->hqos_cpu_first_index + dm->hqos_cpu_count))
604 vlib_cli_output (vm, "Thread %u (%s at lcore %u):", cpu,
605 vlib_worker_threads[cpu].name,
606 vlib_worker_threads[cpu].lcore_id);
608 vec_foreach (dq, dm->devices_by_hqos_cpu[cpu])
610 u32 hw_if_index = dm->devices[dq->device].hw_if_index;
611 vnet_hw_interface_t *hi =
612 vnet_get_hw_interface (dm->vnet_main, hw_if_index);
613 vlib_cli_output (vm, " %v queue %u", hi->name, dq->queue_id);
620 * This command is used to display the thread and core each
621 * DPDK output interface and HQoS queue is assigned too.
624 * Example of how to display the DPDK output interface and HQoS queue placement:
625 * @cliexstart{show dpdk interface hqos placement}
626 * Thread 1 (vpp_hqos-threads_0 at lcore 3):
627 * GigabitEthernet0/8/0 queue 0
628 * Thread 2 (vpp_hqos-threads_1 at lcore 4):
629 * GigabitEthernet0/9/0 queue 0
633 VLIB_CLI_COMMAND (cmd_show_dpdk_if_hqos_placement, static) = {
634 .path = "show dpdk interface hqos placement",
635 .short_help = "show dpdk interface hqos placement",
636 .function = show_dpdk_if_hqos_placement,
640 static clib_error_t *
641 set_dpdk_if_hqos_placement (vlib_main_t * vm, unformat_input_t * input,
642 vlib_cli_command_t * cmd)
644 unformat_input_t _line_input, *line_input = &_line_input;
645 dpdk_main_t *dm = &dpdk_main;
646 dpdk_device_and_queue_t *dq;
647 vnet_hw_interface_t *hw;
649 u32 hw_if_index = (u32) ~ 0;
652 clib_error_t *error = NULL;
654 if (!unformat_user (input, unformat_line_input, line_input))
657 while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
660 (line_input, "%U", unformat_vnet_hw_interface, dm->vnet_main,
663 else if (unformat (line_input, "thread %d", &cpu))
667 error = clib_error_return (0, "parse error: '%U'",
668 format_unformat_error, line_input);
673 if (hw_if_index == (u32) ~ 0)
674 return clib_error_return (0, "please specify valid interface name");
676 if (cpu < dm->hqos_cpu_first_index ||
677 cpu >= (dm->hqos_cpu_first_index + dm->hqos_cpu_count))
679 error = clib_error_return (0, "please specify valid thread id");
683 hw = vnet_get_hw_interface (dm->vnet_main, hw_if_index);
684 xd = vec_elt_at_index (dm->devices, hw->dev_instance);
686 for (i = 0; i < vec_len (dm->devices_by_hqos_cpu); i++)
688 vec_foreach (dq, dm->devices_by_hqos_cpu[i])
690 if (hw_if_index == dm->devices[dq->device].hw_if_index)
692 if (cpu == i) /* nothing to do */
695 vec_del1 (dm->devices_by_hqos_cpu[i],
696 dq - dm->devices_by_hqos_cpu[i]);
697 vec_add2 (dm->devices_by_hqos_cpu[cpu], dq, 1);
699 dq->device = xd->device_index;
701 vec_sort_with_function (dm->devices_by_hqos_cpu[i],
702 dpdk_device_queue_sort);
704 vec_sort_with_function (dm->devices_by_hqos_cpu[cpu],
705 dpdk_device_queue_sort);
712 error = clib_error_return (0, "not found");
715 unformat_free (line_input);
721 * This command is used to assign a given DPDK output interface and
722 * HQoS queue to a different thread. This will not create a thread,
723 * so the thread must already exist. Use '<em>/etc/vpp/startup.conf</em>'
724 * for the initial thread creation. See @ref qos_doc for more details.
727 * Example of how to display the DPDK output interface and HQoS queue placement:
728 * @cliexstart{show dpdk interface hqos placement}
729 * Thread 1 (vpp_hqos-threads_0 at lcore 3):
730 * GigabitEthernet0/8/0 queue 0
731 * Thread 2 (vpp_hqos-threads_1 at lcore 4):
732 * GigabitEthernet0/9/0 queue 0
734 * Example of how to assign a DPDK output interface and HQoS queue to a thread:
735 * @cliexcmd{set dpdk interface hqos placement GigabitEthernet0/8/0 thread 2}
738 VLIB_CLI_COMMAND (cmd_set_dpdk_if_hqos_placement, static) = {
739 .path = "set dpdk interface hqos placement",
740 .short_help = "set dpdk interface hqos placement <interface> thread <n>",
741 .function = set_dpdk_if_hqos_placement,
745 static clib_error_t *
746 set_dpdk_if_hqos_pipe (vlib_main_t * vm, unformat_input_t * input,
747 vlib_cli_command_t * cmd)
749 unformat_input_t _line_input, *line_input = &_line_input;
750 dpdk_main_t *dm = &dpdk_main;
751 vnet_hw_interface_t *hw;
753 u32 hw_if_index = (u32) ~ 0;
754 u32 subport_id = (u32) ~ 0;
755 u32 pipe_id = (u32) ~ 0;
756 u32 profile_id = (u32) ~ 0;
758 clib_error_t *error = NULL;
760 if (!unformat_user (input, unformat_line_input, line_input))
763 while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
766 (line_input, "%U", unformat_vnet_hw_interface, dm->vnet_main,
769 else if (unformat (line_input, "subport %d", &subport_id))
771 else if (unformat (line_input, "pipe %d", &pipe_id))
773 else if (unformat (line_input, "profile %d", &profile_id))
777 error = clib_error_return (0, "parse error: '%U'",
778 format_unformat_error, line_input);
783 if (hw_if_index == (u32) ~ 0)
785 error = clib_error_return (0, "please specify valid interface name");
789 hw = vnet_get_hw_interface (dm->vnet_main, hw_if_index);
790 xd = vec_elt_at_index (dm->devices, hw->dev_instance);
793 rte_sched_pipe_config (xd->hqos_ht->hqos, subport_id, pipe_id,
797 error = clib_error_return (0, "pipe configuration failed");
802 unformat_free (line_input);
808 * This command is used to change the profile associate with a HQoS pipe. The
809 * '<em><profile_id></em>' is zero based. Use the command
810 * '<em>show dpdk interface hqos</em>' to display the content of each profile.
811 * See @ref qos_doc for more details.
814 * Currently there is not an API to create a new HQoS pipe profile. One is
815 * created by default in the code (search for '<em>hqos_pipe_params_default</em>'').
816 * Additional profiles can be created in code and code recompiled. Then use this
817 * command to assign it.
820 * Example of how to assign a new profile to a HQoS pipe:
821 * @cliexcmd{set dpdk interface hqos pipe GigabitEthernet0/8/0 subport 0 pipe 2 profile 1}
824 VLIB_CLI_COMMAND (cmd_set_dpdk_if_hqos_pipe, static) =
826 .path = "set dpdk interface hqos pipe",
827 .short_help = "set dpdk interface hqos pipe <interface> subport <subport_id> pipe <pipe_id> "
828 "profile <profile_id>",
829 .function = set_dpdk_if_hqos_pipe,
833 static clib_error_t *
834 set_dpdk_if_hqos_subport (vlib_main_t * vm, unformat_input_t * input,
835 vlib_cli_command_t * cmd)
837 unformat_input_t _line_input, *line_input = &_line_input;
838 dpdk_main_t *dm = &dpdk_main;
839 dpdk_device_t *xd = NULL;
840 u32 hw_if_index = (u32) ~ 0;
841 u32 subport_id = (u32) ~ 0;
842 struct rte_sched_subport_params p;
844 clib_error_t *error = NULL;
845 u32 tb_rate = (u32) ~ 0;
846 u32 tb_size = (u32) ~ 0;
847 u32 tc_rate[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE] =
848 { (u32) ~ 0, (u32) ~ 0, (u32) ~ 0, (u32) ~ 0 };
849 u32 tc_period = (u32) ~ 0;
850 dpdk_device_config_t *devconf = NULL;
852 if (!unformat_user (input, unformat_line_input, line_input))
855 while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
858 (line_input, "%U", unformat_vnet_hw_interface, dm->vnet_main,
861 else if (unformat (line_input, "subport %d", &subport_id))
863 else if (unformat (line_input, "rate %d", &tb_rate))
865 else if (unformat (line_input, "bktsize %d", &tb_size))
867 else if (unformat (line_input, "tc0 %d", &tc_rate[0]))
869 else if (unformat (line_input, "tc1 %d", &tc_rate[1]))
871 else if (unformat (line_input, "tc2 %d", &tc_rate[2]))
873 else if (unformat (line_input, "tc3 %d", &tc_rate[3]))
875 else if (unformat (line_input, "period %d", &tc_period))
879 error = clib_error_return (0, "parse error: '%U'",
880 format_unformat_error, line_input);
885 error = get_hqos (hw_if_index, subport_id, &xd, &devconf);
889 /* Copy the current values over to local structure. */
890 memcpy (&p, &devconf->hqos.subport[subport_id], sizeof (p));
892 /* Update local structure with input values. */
893 if (tb_rate != (u32) ~ 0)
896 p.tc_rate[0] = tb_rate;
897 p.tc_rate[1] = tb_rate;
898 p.tc_rate[2] = tb_rate;
899 p.tc_rate[3] = tb_rate;
901 if (tb_size != (u32) ~ 0)
905 if (tc_rate[0] != (u32) ~ 0)
907 p.tc_rate[0] = tc_rate[0];
909 if (tc_rate[1] != (u32) ~ 0)
911 p.tc_rate[1] = tc_rate[1];
913 if (tc_rate[2] != (u32) ~ 0)
915 p.tc_rate[2] = tc_rate[2];
917 if (tc_rate[3] != (u32) ~ 0)
919 p.tc_rate[3] = tc_rate[3];
921 if (tc_period != (u32) ~ 0)
923 p.tc_period = tc_period;
927 rv = rte_sched_subport_config (xd->hqos_ht->hqos, subport_id, &p);
930 error = clib_error_return (0, "subport configuration failed");
935 /* Successfully applied, so save of the input values. */
936 memcpy (&devconf->hqos.subport[subport_id], &p, sizeof (p));
941 unformat_free (line_input);
947 * This command is used to set the subport level parameters such as token
948 * bucket rate (bytes per seconds), token bucket size (bytes), traffic class
949 * rates (bytes per seconds) and token update period (Milliseconds).
951 * By default, the '<em>rate</em>' is set to 1250000000 bytes/second (10GbE
952 * rate) and each of the four traffic classes is set to 100% of the port rate.
953 * If the '<em>rate</em>' is updated by this command, all four traffic classes
954 * are assigned the same value. Each of the four traffic classes can be updated
958 * Example of how modify the subport attributes for a 1GbE link:
959 * @cliexcmd{set dpdk interface hqos subport GigabitEthernet0/8/0 subport 0 rate 125000000}
962 VLIB_CLI_COMMAND (cmd_set_dpdk_if_hqos_subport, static) = {
963 .path = "set dpdk interface hqos subport",
964 .short_help = "set dpdk interface hqos subport <interface> subport <subport_id> "
965 "[rate <n>] [bktsize <n>] [tc0 <n>] [tc1 <n>] [tc2 <n>] [tc3 <n>] "
967 .function = set_dpdk_if_hqos_subport,
971 static clib_error_t *
972 set_dpdk_if_hqos_tctbl (vlib_main_t * vm, unformat_input_t * input,
973 vlib_cli_command_t * cmd)
975 unformat_input_t _line_input, *line_input = &_line_input;
976 vlib_thread_main_t *tm = vlib_get_thread_main ();
977 dpdk_main_t *dm = &dpdk_main;
978 vnet_hw_interface_t *hw;
980 u32 hw_if_index = (u32) ~ 0;
982 u32 queue = (u32) ~ 0;
983 u32 entry = (u32) ~ 0;
985 clib_error_t *error = NULL;
987 if (!unformat_user (input, unformat_line_input, line_input))
990 while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
993 (line_input, "%U", unformat_vnet_hw_interface, dm->vnet_main,
996 else if (unformat (line_input, "entry %d", &entry))
998 else if (unformat (line_input, "tc %d", &tc))
1000 else if (unformat (line_input, "queue %d", &queue))
1004 error = clib_error_return (0, "parse error: '%U'",
1005 format_unformat_error, line_input);
1010 if (hw_if_index == (u32) ~ 0)
1012 error = clib_error_return (0, "please specify valid interface name");
1017 error = clib_error_return (0, "invalid entry");
1020 if (tc >= RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE)
1022 error = clib_error_return (0, "invalid traffic class");
1025 if (queue >= RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS)
1027 error = clib_error_return (0, "invalid traffic class queue");
1031 hw = vnet_get_hw_interface (dm->vnet_main, hw_if_index);
1032 xd = vec_elt_at_index (dm->devices, hw->dev_instance);
1034 /* Detect the set of worker threads */
1035 uword *p = hash_get_mem (tm->thread_registrations_by_name, "workers");
1036 /* Should never happen, shut up Coverity warning */
1039 error = clib_error_return (0, "no worker registrations?");
1043 vlib_thread_registration_t *tr = (vlib_thread_registration_t *) p[0];
1044 int worker_thread_first = tr->first_index;
1045 int worker_thread_count = tr->count;
1047 val = tc * RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS + queue;
1048 for (i = 0; i < worker_thread_count; i++)
1049 xd->hqos_wt[worker_thread_first + i].hqos_tc_table[entry] = val;
1052 unformat_free (line_input);
1058 * This command is used to set the traffic class translation table. The
1059 * traffic class translation table is used to map 64 values (0-63) to one of
1060 * four traffic class and one of four HQoS input queue. Use the '<em>show
1061 * dpdk interface hqos</em>' command to display the traffic class translation
1062 * table. See @ref qos_doc for more details.
1064 * This command has the following parameters:
1066 * - <b><interface></b> - Used to specify the output interface.
1068 * - <b>entry <map_val></b> - Mapped value (0-63) to assign traffic class and queue to.
1070 * - <b>tc <tc_id></b> - Traffic class (0-3) to be used by the provided mapped value.
1072 * - <b>queue <queue_id></b> - HQoS input queue (0-3) to be used by the provided mapped value.
1075 * Example of how modify the traffic class translation table:
1076 * @cliexcmd{set dpdk interface hqos tctbl GigabitEthernet0/8/0 entry 16 tc 2 queue 2}
1079 VLIB_CLI_COMMAND (cmd_set_dpdk_if_hqos_tctbl, static) = {
1080 .path = "set dpdk interface hqos tctbl",
1081 .short_help = "set dpdk interface hqos tctbl <interface> entry <map_val> tc <tc_id> queue <queue_id>",
1082 .function = set_dpdk_if_hqos_tctbl,
1086 static clib_error_t *
1087 set_dpdk_if_hqos_pktfield (vlib_main_t * vm, unformat_input_t * input,
1088 vlib_cli_command_t * cmd)
1090 unformat_input_t _line_input, *line_input = &_line_input;
1091 vlib_thread_main_t *tm = vlib_get_thread_main ();
1092 dpdk_main_t *dm = &dpdk_main;
1093 clib_error_t *error = NULL;
1095 /* Device specific data */
1096 struct rte_eth_dev_info dev_info;
1097 dpdk_device_config_t *devconf = 0;
1098 vnet_hw_interface_t *hw;
1100 u32 hw_if_index = (u32) ~ 0;
1102 /* Detect the set of worker threads */
1103 uword *p = hash_get_mem (tm->thread_registrations_by_name, "workers");
1104 /* Should never happen, shut up Coverity warning */
1106 return clib_error_return (0, "no worker registrations?");
1108 vlib_thread_registration_t *tr = (vlib_thread_registration_t *) p[0];
1109 int worker_thread_first = tr->first_index;
1110 int worker_thread_count = tr->count;
1112 /* Packet field configuration */
1113 u64 mask = (u64) ~ 0;
1115 u32 offset = (u32) ~ 0;
1118 u32 n_subports_per_port, n_pipes_per_subport, tctbl_size;
1122 /* Parse input arguments */
1123 if (!unformat_user (input, unformat_line_input, line_input))
1126 while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
1129 (line_input, "%U", unformat_vnet_hw_interface, dm->vnet_main,
1132 else if (unformat (line_input, "id subport"))
1134 else if (unformat (line_input, "id pipe"))
1136 else if (unformat (line_input, "id tc"))
1138 else if (unformat (line_input, "id %d", &id))
1140 else if (unformat (line_input, "offset %d", &offset))
1142 else if (unformat (line_input, "mask %llx", &mask))
1146 error = clib_error_return (0, "parse error: '%U'",
1147 format_unformat_error, line_input);
1153 if (hw_if_index == (u32) ~ 0)
1155 error = clib_error_return (0, "please specify valid interface name");
1159 hw = vnet_get_hw_interface (dm->vnet_main, hw_if_index);
1160 xd = vec_elt_at_index (dm->devices, hw->dev_instance);
1162 rte_eth_dev_info_get (xd->device_index, &dev_info);
1163 if (dev_info.pci_dev)
1164 { /* bonded interface has no pci info */
1165 vlib_pci_addr_t pci_addr;
1167 pci_addr.domain = dev_info.pci_dev->addr.domain;
1168 pci_addr.bus = dev_info.pci_dev->addr.bus;
1169 pci_addr.slot = dev_info.pci_dev->addr.devid;
1170 pci_addr.function = dev_info.pci_dev->addr.function;
1173 hash_get (dm->conf->device_config_index_by_pci_addr, pci_addr.as_u32);
1177 devconf = pool_elt_at_index (dm->conf->dev_confs, p[0]);
1179 devconf = &dm->conf->default_devconf;
1181 if (devconf->hqos_enabled == 0)
1183 vlib_cli_output (vm, "HQoS disabled for this interface");
1187 n_subports_per_port = devconf->hqos.port.n_subports_per_port;
1188 n_pipes_per_subport = devconf->hqos.port.n_pipes_per_subport;
1189 tctbl_size = RTE_DIM (devconf->hqos.tc_table);
1191 /* Validate packet field configuration: id, offset and mask */
1194 error = clib_error_return (0, "invalid packet field id");
1201 if (dpdk_hqos_validate_mask (mask, n_subports_per_port) != 0)
1203 error = clib_error_return (0, "invalid subport ID mask "
1204 "(n_subports_per_port = %u)",
1205 n_subports_per_port);
1210 if (dpdk_hqos_validate_mask (mask, n_pipes_per_subport) != 0)
1212 error = clib_error_return (0, "invalid pipe ID mask "
1213 "(n_pipes_per_subport = %u)",
1214 n_pipes_per_subport);
1220 if (dpdk_hqos_validate_mask (mask, tctbl_size) != 0)
1222 error = clib_error_return (0, "invalid TC table index mask "
1223 "(TC table size = %u)", tctbl_size);
1228 /* Propagate packet field configuration to all workers */
1229 for (i = 0; i < worker_thread_count; i++)
1233 xd->hqos_wt[worker_thread_first + i].hqos_field0_slabpos = offset;
1234 xd->hqos_wt[worker_thread_first + i].hqos_field0_slabmask = mask;
1235 xd->hqos_wt[worker_thread_first + i].hqos_field0_slabshr =
1236 __builtin_ctzll (mask);
1239 xd->hqos_wt[worker_thread_first + i].hqos_field1_slabpos = offset;
1240 xd->hqos_wt[worker_thread_first + i].hqos_field1_slabmask = mask;
1241 xd->hqos_wt[worker_thread_first + i].hqos_field1_slabshr =
1242 __builtin_ctzll (mask);
1246 xd->hqos_wt[worker_thread_first + i].hqos_field2_slabpos = offset;
1247 xd->hqos_wt[worker_thread_first + i].hqos_field2_slabmask = mask;
1248 xd->hqos_wt[worker_thread_first + i].hqos_field2_slabshr =
1249 __builtin_ctzll (mask);
1253 unformat_free (line_input);
1259 * This command is used to set the packet fields required for classifiying the
1260 * incoming packet. As a result of classification process, packet field
1261 * information will be mapped to 5 tuples (subport, pipe, traffic class, pipe,
1262 * color) and stored in packet mbuf.
1264 * This command has the following parameters:
1266 * - <b><interface></b> - Used to specify the output interface.
1268 * - <b>id subport|pipe|tc</b> - Classification occurs across three fields.
1269 * This parameter indicates which of the three masks are being configured. Legacy
1270 * code used 0-2 to represent these three fields, so 0-2 is still accepted.
1271 * - <b>subport|0</b> - Currently only one subport is supported, so only
1272 * an empty mask is supported for the subport classification.
1273 * - <b>pipe|1</b> - Currently, 4096 pipes per subport are supported, so a
1274 * 12-bit mask should be configure to map to the 0-4095 pipes.
1275 * - <b>tc|2</b> - The translation table (see '<em>set dpdk interface hqos
1276 * tctbl</em>' command) maps each value (0-63) into one of the 4 traffic classes
1277 * per pipe. A 6-bit mask should be configure to map this field to a traffic class.
1279 * - <b>offset <n></b> - Offset in the packet to apply the 64-bit mask for classification.
1280 * The offset should be on an 8-byte boundary (0,8,16,24..).
1282 * - <b>mask <hex-mask></b> - 64-bit mask to apply to packet at the given '<em>offset</em>'.
1283 * Bits must be contiguous and should not include '<em>0x</em>'.
1285 * The default values for the '<em>pktfield</em>' assumes Ethernet/IPv4/UDP packets with
1286 * no VLAN. Adjust based on expected packet format and desired classification field.
1287 * - '<em>subport</em>' is always empty (offset 0 mask 0000000000000000)
1288 * - By default, '<em>pipe</em>' maps to the UDP payload bits 12 .. 23 (offset 40
1289 * mask 0000000fff000000)
1290 * - By default, '<em>tc</em>' maps to the DSCP field in IP header (offset 48 mask
1294 * Example of how modify the '<em>pipe</em>' classification filter to match VLAN:
1295 * @cliexcmd{set dpdk interface hqos pktfield GigabitEthernet0/8/0 id pipe offset 8 mask 0000000000000FFF}
1298 VLIB_CLI_COMMAND (cmd_set_dpdk_if_hqos_pktfield, static) = {
1299 .path = "set dpdk interface hqos pktfield",
1300 .short_help = "set dpdk interface hqos pktfield <interface> id subport|pipe|tc offset <n> "
1302 .function = set_dpdk_if_hqos_pktfield,
1306 static clib_error_t *
1307 show_dpdk_if_hqos (vlib_main_t * vm, unformat_input_t * input,
1308 vlib_cli_command_t * cmd)
1310 unformat_input_t _line_input, *line_input = &_line_input;
1311 vlib_thread_main_t *tm = vlib_get_thread_main ();
1312 dpdk_main_t *dm = &dpdk_main;
1313 vnet_hw_interface_t *hw;
1315 dpdk_device_config_hqos_t *cfg;
1316 dpdk_device_hqos_per_hqos_thread_t *ht;
1317 dpdk_device_hqos_per_worker_thread_t *wk;
1319 u32 hw_if_index = (u32) ~ 0;
1320 u32 profile_id, subport_id, i;
1321 struct rte_eth_dev_info dev_info;
1322 dpdk_device_config_t *devconf = 0;
1323 vlib_thread_registration_t *tr;
1325 clib_error_t *error = NULL;
1327 if (!unformat_user (input, unformat_line_input, line_input))
1330 while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
1333 (line_input, "%U", unformat_vnet_hw_interface, dm->vnet_main,
1338 error = clib_error_return (0, "parse error: '%U'",
1339 format_unformat_error, line_input);
1344 if (hw_if_index == (u32) ~ 0)
1346 error = clib_error_return (0, "please specify interface name!!");
1350 hw = vnet_get_hw_interface (dm->vnet_main, hw_if_index);
1351 xd = vec_elt_at_index (dm->devices, hw->dev_instance);
1353 rte_eth_dev_info_get (xd->device_index, &dev_info);
1354 if (dev_info.pci_dev)
1355 { /* bonded interface has no pci info */
1356 vlib_pci_addr_t pci_addr;
1358 pci_addr.domain = dev_info.pci_dev->addr.domain;
1359 pci_addr.bus = dev_info.pci_dev->addr.bus;
1360 pci_addr.slot = dev_info.pci_dev->addr.devid;
1361 pci_addr.function = dev_info.pci_dev->addr.function;
1364 hash_get (dm->conf->device_config_index_by_pci_addr, pci_addr.as_u32);
1368 devconf = pool_elt_at_index (dm->conf->dev_confs, p[0]);
1370 devconf = &dm->conf->default_devconf;
1372 if (devconf->hqos_enabled == 0)
1374 vlib_cli_output (vm, "HQoS disabled for this interface");
1378 /* Detect the set of worker threads */
1379 p = hash_get_mem (tm->thread_registrations_by_name, "workers");
1381 /* Should never happen, shut up Coverity warning */
1384 error = clib_error_return (0, "no worker registrations?");
1388 tr = (vlib_thread_registration_t *) p[0];
1390 cfg = &devconf->hqos;
1392 wk = &xd->hqos_wt[tr->first_index];
1393 tctbl = wk->hqos_tc_table;
1395 vlib_cli_output (vm, " Thread:");
1396 vlib_cli_output (vm, " Input SWQ size = %u packets", cfg->swq_size);
1397 vlib_cli_output (vm, " Enqueue burst size = %u packets",
1398 ht->hqos_burst_enq);
1399 vlib_cli_output (vm, " Dequeue burst size = %u packets",
1400 ht->hqos_burst_deq);
1402 vlib_cli_output (vm,
1403 " Packet field 0: slab position = %4u, slab bitmask = 0x%016llx (subport)",
1404 wk->hqos_field0_slabpos, wk->hqos_field0_slabmask);
1405 vlib_cli_output (vm,
1406 " Packet field 1: slab position = %4u, slab bitmask = 0x%016llx (pipe)",
1407 wk->hqos_field1_slabpos, wk->hqos_field1_slabmask);
1408 vlib_cli_output (vm,
1409 " Packet field 2: slab position = %4u, slab bitmask = 0x%016llx (tc)",
1410 wk->hqos_field2_slabpos, wk->hqos_field2_slabmask);
1411 vlib_cli_output (vm,
1412 " Packet field 2 tc translation table: ([Mapped Value Range]: tc/queue tc/queue ...)");
1413 vlib_cli_output (vm,
1415 "%u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u",
1416 tctbl[0] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1417 tctbl[0] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1418 tctbl[1] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1419 tctbl[1] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1420 tctbl[2] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1421 tctbl[2] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1422 tctbl[3] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1423 tctbl[3] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1424 tctbl[4] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1425 tctbl[4] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1426 tctbl[5] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1427 tctbl[5] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1428 tctbl[6] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1429 tctbl[6] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1430 tctbl[7] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1431 tctbl[7] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1432 tctbl[8] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1433 tctbl[8] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1434 tctbl[9] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1435 tctbl[9] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1436 tctbl[10] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1437 tctbl[10] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1438 tctbl[11] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1439 tctbl[11] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1440 tctbl[12] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1441 tctbl[12] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1442 tctbl[13] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1443 tctbl[13] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1444 tctbl[14] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1445 tctbl[14] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1446 tctbl[15] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1447 tctbl[15] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS);
1448 vlib_cli_output (vm,
1450 "%u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u",
1451 tctbl[16] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1452 tctbl[16] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1453 tctbl[17] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1454 tctbl[17] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1455 tctbl[18] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1456 tctbl[18] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1457 tctbl[19] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1458 tctbl[19] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1459 tctbl[20] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1460 tctbl[20] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1461 tctbl[21] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1462 tctbl[21] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1463 tctbl[22] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1464 tctbl[22] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1465 tctbl[23] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1466 tctbl[23] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1467 tctbl[24] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1468 tctbl[24] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1469 tctbl[25] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1470 tctbl[25] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1471 tctbl[26] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1472 tctbl[26] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1473 tctbl[27] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1474 tctbl[27] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1475 tctbl[28] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1476 tctbl[28] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1477 tctbl[29] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1478 tctbl[29] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1479 tctbl[30] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1480 tctbl[30] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1481 tctbl[31] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1482 tctbl[31] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS);
1483 vlib_cli_output (vm,
1485 "%u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u",
1486 tctbl[32] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1487 tctbl[32] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1488 tctbl[33] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1489 tctbl[33] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1490 tctbl[34] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1491 tctbl[34] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1492 tctbl[35] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1493 tctbl[35] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1494 tctbl[36] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1495 tctbl[36] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1496 tctbl[37] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1497 tctbl[37] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1498 tctbl[38] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1499 tctbl[38] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1500 tctbl[39] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1501 tctbl[39] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1502 tctbl[40] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1503 tctbl[40] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1504 tctbl[41] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1505 tctbl[41] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1506 tctbl[42] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1507 tctbl[42] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1508 tctbl[43] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1509 tctbl[43] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1510 tctbl[44] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1511 tctbl[44] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1512 tctbl[45] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1513 tctbl[45] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1514 tctbl[46] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1515 tctbl[46] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1516 tctbl[47] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1517 tctbl[47] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS);
1518 vlib_cli_output (vm,
1520 "%u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u %u/%u",
1521 tctbl[48] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1522 tctbl[48] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1523 tctbl[49] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1524 tctbl[49] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1525 tctbl[50] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1526 tctbl[50] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1527 tctbl[51] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1528 tctbl[51] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1529 tctbl[52] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1530 tctbl[52] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1531 tctbl[53] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1532 tctbl[53] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1533 tctbl[54] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1534 tctbl[54] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1535 tctbl[55] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1536 tctbl[55] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1537 tctbl[56] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1538 tctbl[56] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1539 tctbl[57] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1540 tctbl[57] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1541 tctbl[58] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1542 tctbl[58] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1543 tctbl[59] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1544 tctbl[59] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1545 tctbl[60] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1546 tctbl[60] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1547 tctbl[61] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1548 tctbl[61] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1549 tctbl[62] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1550 tctbl[62] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1551 tctbl[63] / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS,
1552 tctbl[63] % RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS);
1553 vlib_cli_output (vm, " Port:");
1554 vlib_cli_output (vm, " Rate = %u bytes/second", cfg->port.rate);
1555 vlib_cli_output (vm, " MTU = %u bytes", cfg->port.mtu);
1556 vlib_cli_output (vm, " Frame overhead = %u bytes",
1557 cfg->port.frame_overhead);
1558 vlib_cli_output (vm, " Number of subports = %u",
1559 cfg->port.n_subports_per_port);
1560 vlib_cli_output (vm, " Number of pipes per subport = %u",
1561 cfg->port.n_pipes_per_subport);
1562 vlib_cli_output (vm,
1563 " Packet queue size: TC0 = %u, TC1 = %u, TC2 = %u, TC3 = %u packets",
1564 cfg->port.qsize[0], cfg->port.qsize[1], cfg->port.qsize[2],
1565 cfg->port.qsize[3]);
1566 vlib_cli_output (vm, " Number of pipe profiles = %u",
1567 cfg->port.n_pipe_profiles);
1569 for (subport_id = 0; subport_id < vec_len (cfg->subport); subport_id++)
1571 vlib_cli_output (vm, " Subport %u:", subport_id);
1572 vlib_cli_output (vm, " Rate = %u bytes/second",
1573 cfg->subport[subport_id].tb_rate);
1574 vlib_cli_output (vm, " Token bucket size = %u bytes",
1575 cfg->subport[subport_id].tb_size);
1576 vlib_cli_output (vm,
1577 " Traffic class rate: TC0 = %u, TC1 = %u, TC2 = %u, TC3 = %u bytes/second",
1578 cfg->subport[subport_id].tc_rate[0],
1579 cfg->subport[subport_id].tc_rate[1],
1580 cfg->subport[subport_id].tc_rate[2],
1581 cfg->subport[subport_id].tc_rate[3]);
1582 vlib_cli_output (vm, " TC period = %u milliseconds",
1583 cfg->subport[subport_id].tc_period);
1586 for (profile_id = 0; profile_id < vec_len (cfg->pipe); profile_id++)
1588 vlib_cli_output (vm, " Pipe profile %u:", profile_id);
1589 vlib_cli_output (vm, " Rate = %u bytes/second",
1590 cfg->pipe[profile_id].tb_rate);
1591 vlib_cli_output (vm, " Token bucket size = %u bytes",
1592 cfg->pipe[profile_id].tb_size);
1593 vlib_cli_output (vm,
1594 " Traffic class rate: TC0 = %u, TC1 = %u, TC2 = %u, TC3 = %u bytes/second",
1595 cfg->pipe[profile_id].tc_rate[0],
1596 cfg->pipe[profile_id].tc_rate[1],
1597 cfg->pipe[profile_id].tc_rate[2],
1598 cfg->pipe[profile_id].tc_rate[3]);
1599 vlib_cli_output (vm, " TC period = %u milliseconds",
1600 cfg->pipe[profile_id].tc_period);
1601 #ifdef RTE_SCHED_SUBPORT_TC_OV
1602 vlib_cli_output (vm, " TC3 oversubscription_weight = %u",
1603 cfg->pipe[profile_id].tc_ov_weight);
1606 for (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++)
1608 vlib_cli_output (vm,
1609 " TC%u WRR weights: Q0 = %u, Q1 = %u, Q2 = %u, Q3 = %u",
1610 i, cfg->pipe[profile_id].wrr_weights[i * 4],
1611 cfg->pipe[profile_id].wrr_weights[i * 4 + 1],
1612 cfg->pipe[profile_id].wrr_weights[i * 4 + 2],
1613 cfg->pipe[profile_id].wrr_weights[i * 4 + 3]);
1617 #ifdef RTE_SCHED_RED
1618 vlib_cli_output (vm, " Weighted Random Early Detection (WRED):");
1619 for (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++)
1621 vlib_cli_output (vm, " TC%u min: G = %u, Y = %u, R = %u", i,
1622 cfg->port.red_params[i][e_RTE_METER_GREEN].min_th,
1623 cfg->port.red_params[i][e_RTE_METER_YELLOW].min_th,
1624 cfg->port.red_params[i][e_RTE_METER_RED].min_th);
1626 vlib_cli_output (vm, " TC%u max: G = %u, Y = %u, R = %u", i,
1627 cfg->port.red_params[i][e_RTE_METER_GREEN].max_th,
1628 cfg->port.red_params[i][e_RTE_METER_YELLOW].max_th,
1629 cfg->port.red_params[i][e_RTE_METER_RED].max_th);
1631 vlib_cli_output (vm,
1632 " TC%u inverted probability: G = %u, Y = %u, R = %u",
1633 i, cfg->port.red_params[i][e_RTE_METER_GREEN].maxp_inv,
1634 cfg->port.red_params[i][e_RTE_METER_YELLOW].maxp_inv,
1635 cfg->port.red_params[i][e_RTE_METER_RED].maxp_inv);
1637 vlib_cli_output (vm, " TC%u weight: R = %u, Y = %u, R = %u", i,
1638 cfg->port.red_params[i][e_RTE_METER_GREEN].wq_log2,
1639 cfg->port.red_params[i][e_RTE_METER_YELLOW].wq_log2,
1640 cfg->port.red_params[i][e_RTE_METER_RED].wq_log2);
1645 unformat_free (line_input);
1651 * This command is used to display details of an output interface's HQoS
1655 * Example of how to display HQoS settings for an interfaces:
1656 * @cliexstart{show dpdk interface hqos GigabitEthernet0/8/0}
1658 * Input SWQ size = 4096 packets
1659 * Enqueue burst size = 256 packets
1660 * Dequeue burst size = 220 packets
1661 * Packet field 0: slab position = 0, slab bitmask = 0x0000000000000000 (subport)
1662 * Packet field 1: slab position = 40, slab bitmask = 0x0000000fff000000 (pipe)
1663 * Packet field 2: slab position = 8, slab bitmask = 0x00000000000000fc (tc)
1664 * Packet field 2 tc translation table: ([Mapped Value Range]: tc/queue tc/queue ...)
1665 * [ 0 .. 15]: 0/0 0/1 0/2 0/3 1/0 1/1 1/2 1/3 2/0 2/1 2/2 2/3 3/0 3/1 3/2 3/3
1666 * [16 .. 31]: 0/0 0/1 0/2 0/3 1/0 1/1 1/2 1/3 2/0 2/1 2/2 2/3 3/0 3/1 3/2 3/3
1667 * [32 .. 47]: 0/0 0/1 0/2 0/3 1/0 1/1 1/2 1/3 2/0 2/1 2/2 2/3 3/0 3/1 3/2 3/3
1668 * [48 .. 63]: 0/0 0/1 0/2 0/3 1/0 1/1 1/2 1/3 2/0 2/1 2/2 2/3 3/0 3/1 3/2 3/3
1670 * Rate = 1250000000 bytes/second
1672 * Frame overhead = 24 bytes
1673 * Number of subports = 1
1674 * Number of pipes per subport = 4096
1675 * Packet queue size: TC0 = 64, TC1 = 64, TC2 = 64, TC3 = 64 packets
1676 * Number of pipe profiles = 2
1678 * Rate = 1250000000 bytes/second
1679 * Token bucket size = 1000000 bytes
1680 * Traffic class rate: TC0 = 1250000000, TC1 = 1250000000, TC2 = 1250000000, TC3 = 1250000000 bytes/second
1681 * TC period = 10 milliseconds
1683 * Rate = 305175 bytes/second
1684 * Token bucket size = 1000000 bytes
1685 * Traffic class rate: TC0 = 305175, TC1 = 305175, TC2 = 305175, TC3 = 305175 bytes/second
1686 * TC period = 40 milliseconds
1687 * TC0 WRR weights: Q0 = 1, Q1 = 1, Q2 = 1, Q3 = 1
1688 * TC1 WRR weights: Q0 = 1, Q1 = 1, Q2 = 1, Q3 = 1
1689 * TC2 WRR weights: Q0 = 1, Q1 = 1, Q2 = 1, Q3 = 1
1690 * TC3 WRR weights: Q0 = 1, Q1 = 1, Q2 = 1, Q3 = 1
1694 VLIB_CLI_COMMAND (cmd_show_dpdk_if_hqos, static) = {
1695 .path = "show dpdk interface hqos",
1696 .short_help = "show dpdk interface hqos <interface>",
1697 .function = show_dpdk_if_hqos,
1702 static clib_error_t *
1703 show_dpdk_hqos_queue_stats (vlib_main_t * vm, unformat_input_t * input,
1704 vlib_cli_command_t * cmd)
1706 unformat_input_t _line_input, *line_input = &_line_input;
1707 clib_error_t *error = NULL;
1708 #ifdef RTE_SCHED_COLLECT_STATS
1709 dpdk_main_t *dm = &dpdk_main;
1710 u32 hw_if_index = (u32) ~ 0;
1711 u32 subport = (u32) ~ 0;
1712 u32 pipe = (u32) ~ 0;
1714 u32 tc_q = (u32) ~ 0;
1715 vnet_hw_interface_t *hw;
1718 struct rte_eth_dev_info dev_info;
1719 dpdk_device_config_t *devconf = 0;
1721 struct rte_sched_queue_stats stats;
1724 if (!unformat_user (input, unformat_line_input, line_input))
1727 while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
1730 (line_input, "%U", unformat_vnet_hw_interface, dm->vnet_main,
1734 else if (unformat (line_input, "subport %d", &subport))
1737 else if (unformat (line_input, "pipe %d", &pipe))
1740 else if (unformat (line_input, "tc %d", &tc))
1743 else if (unformat (line_input, "tc_q %d", &tc_q))
1748 error = clib_error_return (0, "parse error: '%U'",
1749 format_unformat_error, line_input);
1754 if (hw_if_index == (u32) ~ 0)
1756 error = clib_error_return (0, "please specify interface name!!");
1760 hw = vnet_get_hw_interface (dm->vnet_main, hw_if_index);
1761 xd = vec_elt_at_index (dm->devices, hw->dev_instance);
1763 rte_eth_dev_info_get (xd->device_index, &dev_info);
1764 if (dev_info.pci_dev)
1765 { /* bonded interface has no pci info */
1766 vlib_pci_addr_t pci_addr;
1768 pci_addr.domain = dev_info.pci_dev->addr.domain;
1769 pci_addr.bus = dev_info.pci_dev->addr.bus;
1770 pci_addr.slot = dev_info.pci_dev->addr.devid;
1771 pci_addr.function = dev_info.pci_dev->addr.function;
1774 hash_get (dm->conf->device_config_index_by_pci_addr, pci_addr.as_u32);
1778 devconf = pool_elt_at_index (dm->conf->dev_confs, p[0]);
1780 devconf = &dm->conf->default_devconf;
1782 if (devconf->hqos_enabled == 0)
1784 vlib_cli_output (vm, "HQoS disabled for this interface");
1789 * Figure out which queue to query. cf rte_sched_port_qindex. (Not sure why
1790 * that method isn't made public by DPDK - how _should_ we get the queue ID?)
1792 qindex = subport * devconf->hqos.port.n_pipes_per_subport + pipe;
1793 qindex = qindex * RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE + tc;
1794 qindex = qindex * RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS + tc_q;
1796 if (rte_sched_queue_read_stats (xd->hqos_ht->hqos, qindex, &stats, &qlen) !=
1799 error = clib_error_return (0, "failed to read stats");
1803 vlib_cli_output (vm, "%=24s%=16s", "Stats Parameter", "Value");
1804 vlib_cli_output (vm, "%=24s%=16d", "Packets", stats.n_pkts);
1805 vlib_cli_output (vm, "%=24s%=16d", "Packets dropped", stats.n_pkts_dropped);
1806 #ifdef RTE_SCHED_RED
1807 vlib_cli_output (vm, "%=24s%=16d", "Packets dropped (RED)",
1808 stats.n_pkts_red_dropped);
1810 vlib_cli_output (vm, "%=24s%=16d", "Bytes", stats.n_bytes);
1811 vlib_cli_output (vm, "%=24s%=16d", "Bytes dropped", stats.n_bytes_dropped);
1815 /* Get a line of input */
1816 if (!unformat_user (input, unformat_line_input, line_input))
1819 vlib_cli_output (vm, "RTE_SCHED_COLLECT_STATS disabled in DPDK");
1825 unformat_free (line_input);
1831 * This command is used to display statistics associated with a HQoS traffic class
1835 * Statistic collection by the scheduler is disabled by default in DPDK. In order to
1836 * turn it on, add the following line to '<em>../vpp/dpdk/Makefile</em>':
1837 * - <b>$(call set,RTE_SCHED_COLLECT_STATS,y)</b>
1840 * Example of how to display statistics of HQoS a HQoS traffic class queue:
1841 * @cliexstart{show dpdk hqos queue GigabitEthernet0/9/0 subport 0 pipe 3181 tc 0 tc_q 0}
1842 * Stats Parameter Value
1850 VLIB_CLI_COMMAND (cmd_show_dpdk_hqos_queue_stats, static) = {
1851 .path = "show dpdk hqos queue",
1852 .short_help = "show dpdk hqos queue <interface> subport <subport_id> pipe <pipe_id> tc <tc_id> tc_q <queue_id>",
1853 .function = show_dpdk_hqos_queue_stats,
1857 static clib_error_t *
1858 show_dpdk_version_command_fn (vlib_main_t * vm,
1859 unformat_input_t * input,
1860 vlib_cli_command_t * cmd)
1862 #define _(a,b,c) vlib_cli_output (vm, "%-25s " b, a ":", c);
1863 _("DPDK Version", "%s", rte_version ());
1864 _("DPDK EAL init args", "%s", dpdk_config_main.eal_init_args_str);
1870 * This command is used to display the current DPDK version and
1871 * the list of arguments passed to DPDK when started.
1874 * Example of how to display how many DPDK buffer test command has allcoated:
1875 * @cliexstart{show dpdk version}
1876 * DPDK Version: DPDK 16.11.0
1877 * DPDK EAL init args: -c 1 -n 4 --huge-dir /run/vpp/hugepages --file-prefix vpp -w 0000:00:08.0 -w 0000:00:09.0 --master-lcore 0 --socket-mem 256
1881 VLIB_CLI_COMMAND (show_vpe_version_command, static) = {
1882 .path = "show dpdk version",
1883 .short_help = "show dpdk version",
1884 .function = show_dpdk_version_command_fn,
1890 static clib_error_t *
1891 dpdk_validate_buffers_fn (vlib_main_t * vm, unformat_input_t * input,
1892 vlib_cli_command_t * cmd_arg)
1894 u32 n_invalid_bufs = 0, uninitialized = 0;
1895 u32 is_poison = 0, is_test = 0;
1896 while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
1898 if (unformat (input, "poison"))
1900 else if (unformat (input, "trajectory"))
1903 return clib_error_return (0, "unknown input `%U'",
1904 format_unformat_error, input);
1907 if (VLIB_BUFFER_TRACE_TRAJECTORY == 0)
1909 vlib_cli_output (vm, "Trajectory not enabled. Recompile with "
1910 "VLIB_BUFFER_TRACE_TRAJECTORY 1");
1915 dpdk_buffer_poison_trajectory_all ();
1919 n_invalid_bufs = dpdk_buffer_validate_trajectory_all (&uninitialized);
1920 if (!n_invalid_bufs)
1921 vlib_cli_output (vm, "All buffers are valid %d uninitialized",
1924 vlib_cli_output (vm, "Found %d invalid buffers and %d uninitialized",
1925 n_invalid_bufs, uninitialized);
1931 VLIB_CLI_COMMAND (test_dpdk_buffers_command, static) =
1933 .path = "test dpdk buffers",
1934 .short_help = "test dpdk buffers [poison] [trajectory]",
1935 .function = dpdk_validate_buffers_fn,
1942 dpdk_cli_init (vlib_main_t * vm)
1947 VLIB_INIT_FUNCTION (dpdk_cli_init);
1950 * fd.io coding-style-patch-verification: ON
1953 * eval: (c-set-style "gnu")