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 <vnet/devices/dpdk/dpdk.h>
23 #include <vnet/classify/vnet_classify.h>
24 #include <vnet/mpls-gre/packet.h>
26 #include "dpdk_priv.h"
29 pcap_trace_command_fn (vlib_main_t * vm,
30 unformat_input_t * input,
31 vlib_cli_command_t * cmd)
33 dpdk_main_t * dm = &dpdk_main;
37 clib_error_t * error = 0;
39 while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
41 if (unformat (input, "on"))
43 if (dm->tx_pcap_enable == 0)
45 if (dm->pcap_filename == 0)
46 dm->pcap_filename = format (0, "/tmp/vpe.pcap%c", 0);
48 memset (&dm->pcap_main, 0, sizeof (dm->pcap_main));
49 dm->pcap_main.file_name = (char *) dm->pcap_filename;
50 dm->pcap_main.n_packets_to_capture = 100;
51 if (dm->pcap_pkts_to_capture)
52 dm->pcap_main.n_packets_to_capture = dm->pcap_pkts_to_capture;
54 dm->pcap_main.packet_type = PCAP_PACKET_TYPE_ethernet;
55 dm->tx_pcap_enable = 1;
57 vlib_cli_output (vm, "pcap tx capture on...");
61 vlib_cli_output (vm, "pcap tx capture already on...");
65 else if (unformat (input, "off"))
67 if (dm->tx_pcap_enable)
69 vlib_cli_output (vm, "captured %d pkts...",
70 dm->pcap_main.n_packets_captured+1);
71 if (dm->pcap_main.n_packets_captured)
73 dm->pcap_main.n_packets_to_capture =
74 dm->pcap_main.n_packets_captured;
75 error = pcap_write (&dm->pcap_main);
77 clib_error_report (error);
79 vlib_cli_output (vm, "saved to %s...", dm->pcap_filename);
84 vlib_cli_output (vm, "pcap tx capture already off...");
87 dm->tx_pcap_enable = 0;
90 else if (unformat (input, "max %d", &max))
92 dm->pcap_pkts_to_capture = max;
96 else if (unformat (input, "intfc %U",
97 unformat_vnet_sw_interface, dm->vnet_main,
98 &dm->pcap_sw_if_index))
100 else if (unformat (input, "intfc any"))
102 dm->pcap_sw_if_index = 0;
105 else if (unformat (input, "file %s", &filename))
107 u8 * chroot_filename;
108 /* Brain-police user path input */
109 if (strstr((char *)filename, "..") || index((char *)filename, '/'))
111 vlib_cli_output (vm, "illegal characters in filename '%s'",
116 chroot_filename = format (0, "/tmp/%s%c", filename, 0);
119 if (dm->pcap_filename)
120 vec_free (dm->pcap_filename);
121 vec_add1 (filename, 0);
122 dm->pcap_filename = chroot_filename;
125 else if (unformat (input, "status"))
127 if (dm->tx_pcap_enable == 0)
129 vlib_cli_output (vm, "pcap tx capture is off...");
133 vlib_cli_output (vm, "pcap tx capture: %d of %d pkts...",
134 dm->pcap_main.n_packets_captured,
135 dm->pcap_main.n_packets_to_capture);
144 return clib_error_return (0, "unknown input `%U'",
145 format_unformat_error, input);
150 VLIB_CLI_COMMAND (pcap_trace_command, static) = {
151 .path = "pcap tx trace",
153 "pcap tx trace on off max <nn> intfc <intfc> file <name> status",
154 .function = pcap_trace_command_fn,
158 static clib_error_t *
159 show_dpdk_buffer (vlib_main_t * vm, unformat_input_t * input,
160 vlib_cli_command_t * cmd)
162 struct rte_mempool * rmp;
165 for(i = 0; i < vec_len(vm->buffer_main->pktmbuf_pools); i++)
167 rmp = vm->buffer_main->pktmbuf_pools[i];
170 unsigned count = rte_mempool_count(rmp);
171 unsigned free_count = rte_mempool_free_count(rmp);
173 vlib_cli_output(vm, "name=\"%s\" available = %7d allocated = %7d total = %7d\n",
174 rmp->name, (u32)count, (u32)free_count,
175 (u32)(count+free_count));
179 vlib_cli_output(vm, "rte_mempool is NULL (!)\n");
185 VLIB_CLI_COMMAND (cmd_show_dpdk_bufferr,static) = {
186 .path = "show dpdk buffer",
187 .short_help = "show dpdk buffer state",
188 .function = show_dpdk_buffer,
192 static clib_error_t *
193 test_dpdk_buffer (vlib_main_t * vm, unformat_input_t * input,
194 vlib_cli_command_t * cmd)
196 static u32 * allocated_buffers;
199 u32 first, actual_alloc;
201 while (unformat_check_input(input) != UNFORMAT_END_OF_INPUT)
203 if (unformat (input, "allocate %d", &n_alloc))
205 else if (unformat (input, "free %d", &n_free))
213 if (vec_len (allocated_buffers) < n_free)
214 return clib_error_return (0, "Can't free %d, only %d allocated",
215 n_free, vec_len (allocated_buffers));
217 first = vec_len(allocated_buffers) - n_free;
218 vlib_buffer_free (vm, allocated_buffers + first, n_free);
219 _vec_len (allocated_buffers) = first;
223 first = vec_len (allocated_buffers);
224 vec_validate (allocated_buffers,
225 vec_len (allocated_buffers) + n_alloc - 1);
227 actual_alloc = vlib_buffer_alloc (vm, allocated_buffers + first,
229 _vec_len (allocated_buffers) = first + actual_alloc;
231 if (actual_alloc < n_alloc)
232 vlib_cli_output (vm, "WARNING: only allocated %d buffers",
236 vlib_cli_output (vm, "Currently %d buffers allocated",
237 vec_len (allocated_buffers));
239 if (allocated_buffers && vec_len(allocated_buffers) == 0)
240 vec_free(allocated_buffers);
245 VLIB_CLI_COMMAND (cmd_test_dpdk_buffer,static) = {
246 .path = "test dpdk buffer",
247 .short_help = "test dpdk buffer [allocate <nn>][free <nn>]",
248 .function = test_dpdk_buffer,
253 show_dpdk_device_stats (vlib_main_t * vm, dpdk_device_t * xd)
257 " last_burst_sz %d\n"
259 " full_frames_cnt %u\n"
260 " consec_full_frames_cnt %u\n"
261 " congestion_cnt %d\n"
262 " last_poll_time %llu\n"
263 " max_poll_delay %llu\n"
265 " total_packet_cnt %u\n",
267 xd->efd_agent.last_burst_sz,
268 xd->efd_agent.max_burst_sz,
269 xd->efd_agent.full_frames_cnt,
270 xd->efd_agent.consec_full_frames_cnt,
271 xd->efd_agent.congestion_cnt,
272 xd->efd_agent.last_poll_time,
273 xd->efd_agent.max_poll_delay,
274 xd->efd_agent.discard_cnt,
275 xd->efd_agent.total_packet_cnt);
277 u32 device_queue_sz = rte_eth_rx_queue_count(xd->device_index,
280 " device_queue_sz %u\n",
285 show_efd_config (vlib_main_t * vm)
287 vlib_thread_main_t * tm = vlib_get_thread_main();
288 dpdk_main_t * dm = &dpdk_main;
291 "dpdk: (0x%04x) enabled:%d monitor:%d drop_all:%d\n"
292 " dpdk_queue_hi_thresh %d\n"
293 " consec_full_frames_hi_thresh %d\n"
295 "worker: (0x%04x) enabled:%d monitor:%d\n"
296 " worker_queue_hi_thresh %d\n",
298 ((dm->efd.enabled & DPDK_EFD_DISCARD_ENABLED) ? 1:0),
299 ((dm->efd.enabled & DPDK_EFD_MONITOR_ENABLED) ? 1:0),
300 ((dm->efd.enabled & DPDK_EFD_DROPALL_ENABLED) ? 1:0),
301 dm->efd.queue_hi_thresh,
302 dm->efd.consec_full_frames_hi_thresh,
304 ((tm->efd.enabled & VLIB_EFD_DISCARD_ENABLED) ? 1:0),
305 ((dm->efd.enabled & VLIB_EFD_MONITOR_ENABLED) ? 1:0),
306 tm->efd.queue_hi_thresh);
309 "ip_prec_bitmap 0x%02x\n"
310 "mpls_exp_bitmap 0x%02x\n"
311 "vlan_cos_bitmap 0x%02x\n",
312 tm->efd.ip_prec_bitmap,
313 tm->efd.mpls_exp_bitmap,
314 tm->efd.vlan_cos_bitmap);
317 static clib_error_t *
318 show_efd (vlib_main_t * vm,
319 unformat_input_t * input,
320 vlib_cli_command_t * cmd)
323 if (unformat(input, "config")) {
325 } else if (unformat(input, "dpdk")) {
326 dpdk_main_t * dm = &dpdk_main;
330 unformat(input, "device %d", &device_id);
331 vec_foreach (xd, dm->devices) {
332 if ((xd->device_index == device_id) || (device_id == ~0)) {
333 show_dpdk_device_stats(vm, xd);
336 } else if (unformat(input, "worker")) {
337 vlib_thread_main_t * tm = vlib_get_thread_main();
338 vlib_frame_queue_t *fq;
339 vlib_thread_registration_t * tr;
342 u32 first_worker_index = 0;
345 p = hash_get_mem (tm->thread_registrations_by_name, "workers");
347 tr = (vlib_thread_registration_t *) p[0];
350 num_workers = tr->count;
351 first_worker_index = tr->first_index;
356 "first_worker_index %d\n"
357 "vlib_frame_queues[%d]:\n",
362 for (thread_id = 0; thread_id < tm->n_vlib_mains; thread_id++) {
363 fq = vlib_frame_queues[thread_id];
366 "%2d: frames_queued %u\n"
367 " frames_queued_hint %u\n"
368 " enqueue_full_events %u\n"
369 " enqueue_efd_discards %u\n",
371 (fq->tail - fq->head),
372 (fq->tail - fq->head_hint),
373 fq->enqueue_full_events,
374 fq->enqueue_efd_discards);
377 } else if (unformat(input, "help")) {
378 vlib_cli_output(vm, "Usage: show efd config | "
379 "dpdk [device <id>] | worker\n");
387 VLIB_CLI_COMMAND (show_efd_command, static) = {
389 .short_help = "Show efd [device <id>] | [config]",
390 .function = show_efd,
393 static clib_error_t *
394 clear_efd (vlib_main_t * vm,
395 unformat_input_t * input,
396 vlib_cli_command_t * cmd)
398 dpdk_main_t * dm = &dpdk_main;
400 vlib_thread_main_t * tm = vlib_get_thread_main();
401 vlib_frame_queue_t *fq;
404 vec_foreach (xd, dm->devices) {
405 xd->efd_agent.last_burst_sz = 0;
406 xd->efd_agent.max_burst_sz = 0;
407 xd->efd_agent.full_frames_cnt = 0;
408 xd->efd_agent.consec_full_frames_cnt = 0;
409 xd->efd_agent.congestion_cnt = 0;
410 xd->efd_agent.last_poll_time = 0;
411 xd->efd_agent.max_poll_delay = 0;
412 xd->efd_agent.discard_cnt = 0;
413 xd->efd_agent.total_packet_cnt = 0;
416 for (thread_id = 0; thread_id < tm->n_vlib_mains; thread_id++) {
417 fq = vlib_frame_queues[thread_id];
419 fq->enqueue_full_events = 0;
420 fq->enqueue_efd_discards = 0;
427 VLIB_CLI_COMMAND (clear_efd_command,static) = {
429 .short_help = "Clear early-fast-discard counters",
430 .function = clear_efd,
433 static clib_error_t *
434 parse_op_and_prec (vlib_main_t *vm, unformat_input_t *input,
435 vlib_cli_command_t *cmd,
436 char *prec_type, u8 *prec_bitmap)
438 clib_error_t * error = NULL;
442 if (unformat(input, "ge")) {
443 op = EFD_OPERATION_GREATER_OR_EQUAL;
444 } else if (unformat(input, "lt")) {
445 op = EFD_OPERATION_LESS_THAN;
446 } else if (unformat(input, "help")) {
448 "enter operation [ge | lt] and precedence <0-7>)");
451 return clib_error_return(0, "unknown input `%U'",
452 format_unformat_error, input);
455 if (unformat (input, "%u", &prec)) {
457 return clib_error_return(0, "precedence %d is out of range <0-7>",
461 return clib_error_return(0, "unknown input `%U'",
462 format_unformat_error, input);
465 set_efd_bitmap(prec_bitmap, prec, op);
468 "EFD will be set for %s precedence %s%u%s.",
470 (op == EFD_OPERATION_LESS_THAN) ? "less than " : "",
472 (op == EFD_OPERATION_GREATER_OR_EQUAL) ? " and greater" : "");
478 static clib_error_t *
479 set_efd (vlib_main_t *vm, unformat_input_t *input,
480 vlib_cli_command_t *cmd)
482 dpdk_main_t * dm = &dpdk_main;
483 vlib_thread_main_t * tm = vlib_get_thread_main();
484 clib_error_t * error = NULL;
485 vlib_node_runtime_t * rt = vlib_node_get_runtime (vm, dpdk_input_node.index);
487 if (unformat(input, "enable")) {
488 if (unformat(input, "dpdk")) {
489 dm->efd.enabled |= DPDK_EFD_DISCARD_ENABLED;
490 } else if (unformat(input, "worker")) {
491 tm->efd.enabled |= VLIB_EFD_DISCARD_ENABLED;
492 } else if (unformat(input, "monitor")) {
493 dm->efd.enabled |= DPDK_EFD_MONITOR_ENABLED;
494 tm->efd.enabled |= VLIB_EFD_MONITOR_ENABLED;
495 } else if (unformat(input, "drop_all")) {
496 dm->efd.enabled |= DPDK_EFD_DROPALL_ENABLED;
497 } else if (unformat(input, "default")) {
498 dm->efd.enabled = (DPDK_EFD_DISCARD_ENABLED |
499 DPDK_EFD_MONITOR_ENABLED);
500 tm->efd.enabled = (VLIB_EFD_DISCARD_ENABLED |
501 VLIB_EFD_MONITOR_ENABLED);
503 return clib_error_return(0, "Usage: set efd enable [dpdk | "
504 "worker | monitor | drop_all | default]");
506 } else if (unformat(input, "disable")) {
507 if (unformat(input, "dpdk")) {
508 dm->efd.enabled &= ~DPDK_EFD_DISCARD_ENABLED;
509 } else if (unformat(input, "worker")) {
510 tm->efd.enabled &= ~VLIB_EFD_DISCARD_ENABLED;
511 } else if (unformat(input, "monitor")) {
512 dm->efd.enabled &= ~DPDK_EFD_MONITOR_ENABLED;
513 tm->efd.enabled &= ~VLIB_EFD_MONITOR_ENABLED;
514 } else if (unformat(input, "drop_all")) {
515 dm->efd.enabled &= ~DPDK_EFD_DROPALL_ENABLED;
516 } else if (unformat(input, "all")) {
520 return clib_error_return(0, "Usage: set efd disable [dpdk | "
521 "worker | monitor | drop_all | all]");
523 } else if (unformat(input, "worker_queue_hi_thresh")) {
525 if (unformat (input, "%u", &mark)) {
526 tm->efd.queue_hi_thresh = mark;
528 return clib_error_return(0, "unknown input `%U'",
529 format_unformat_error, input);
531 } else if (unformat(input, "dpdk_device_hi_thresh")) {
533 if (unformat (input, "%u", &thresh)) {
534 dm->efd.queue_hi_thresh = thresh;
536 return clib_error_return(0, "unknown input `%U'",
537 format_unformat_error, input);
539 } else if (unformat(input, "consec_full_frames_hi_thresh")) {
541 if (unformat (input, "%u", &thresh)) {
542 dm->efd.consec_full_frames_hi_thresh = thresh;
544 return clib_error_return(0, "unknown input `%U'",
545 format_unformat_error, input);
547 } else if (unformat(input, "ip-prec")) {
548 return (parse_op_and_prec(vm, input, cmd,
549 "ip", &tm->efd.ip_prec_bitmap));
550 } else if (unformat(input, "mpls-exp")) {
551 return (parse_op_and_prec(vm, input, cmd,
552 "mpls", &tm->efd.mpls_exp_bitmap));
553 } else if (unformat(input, "vlan-cos")) {
554 return (parse_op_and_prec(vm, input, cmd,
555 "vlan", &tm->efd.vlan_cos_bitmap));
556 } else if (unformat(input, "help")) {
559 " set efd enable <dpdk | worker | monitor | drop_all | default> |\n"
560 " set efd disable <dpdk | worker | monitor | drop_all | all> |\n"
561 " set efd <ip-prec | mpls-exp | vlan-cos> <ge | lt> <0-7>\n"
562 " set efd worker_queue_hi_thresh <0-32> |\n"
563 " set efd dpdk_device_hi_thresh <0-%d> |\n"
564 " set efd consec_full_frames_hi_thresh <count> |\n",
565 DPDK_NB_RX_DESC_10GE);
567 return clib_error_return(0, "unknown input `%U'",
568 format_unformat_error, input);
572 rt->function = dpdk_input_efd_multiarch_select();
573 else if (dm->use_rss)
574 rt->function = dpdk_input_rss_multiarch_select();
576 rt->function = dpdk_input_multiarch_select();
581 VLIB_CLI_COMMAND (cmd_set_efd,static) = {
583 .short_help = "set early-fast-discard commands",
587 static clib_error_t *
588 set_dpdk_if_desc (vlib_main_t *vm, unformat_input_t *input,
589 vlib_cli_command_t *cmd)
591 unformat_input_t _line_input, * line_input = &_line_input;
592 dpdk_main_t * dm = &dpdk_main;
593 vnet_hw_interface_t * hw;
595 u32 hw_if_index = (u32) ~0;
596 u32 nb_rx_desc = (u32) ~0;
597 u32 nb_tx_desc = (u32) ~0;
600 if (! unformat_user (input, unformat_line_input, line_input))
603 while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) {
604 if (unformat (line_input, "%U", unformat_vnet_hw_interface, dm->vnet_main,
607 else if (unformat (line_input, "tx %d", &nb_tx_desc))
609 else if (unformat (line_input, "rx %d", &nb_rx_desc))
612 return clib_error_return (0, "parse error: '%U'",
613 format_unformat_error, line_input);
616 unformat_free (line_input);
618 if (hw_if_index == (u32) ~0)
619 return clib_error_return (0, "please specify valid interface name");
621 hw = vnet_get_hw_interface (dm->vnet_main, hw_if_index);
622 xd = vec_elt_at_index (dm->devices, hw->dev_instance);
624 if (xd->dev_type != VNET_DPDK_DEV_ETH)
625 return clib_error_return (0, "number of descriptors can be set only for "
628 if ((nb_rx_desc == (u32) ~0 || nb_rx_desc == xd->nb_rx_desc) &&
629 (nb_tx_desc == (u32) ~0 || nb_tx_desc == xd->nb_tx_desc))
630 return clib_error_return (0, "nothing changed");
632 if (nb_rx_desc != (u32) ~0)
633 xd->nb_rx_desc = nb_rx_desc;
635 if (nb_tx_desc != (u32) ~0)
636 xd->nb_rx_desc = nb_rx_desc;
638 rv = dpdk_port_setup(dm, xd);
640 return rv < 0 ? rv : 0;
643 VLIB_CLI_COMMAND (cmd_set_dpdk_if_desc,static) = {
644 .path = "set dpdk interface descriptors",
645 .short_help = "set dpdk interface descriptors <if-name> [rx <n>] [tx <n>]",
646 .function = set_dpdk_if_desc,
649 static clib_error_t *
650 show_dpdk_if_placement (vlib_main_t *vm, unformat_input_t *input,
651 vlib_cli_command_t *cmd)
653 vlib_thread_main_t * tm = vlib_get_thread_main();
654 dpdk_main_t * dm = &dpdk_main;
655 dpdk_device_and_queue_t * dq;
658 if (tm->n_vlib_mains == 1)
659 vlib_cli_output(vm, "All interfaces are handled by main thread");
661 for(cpu = 0; cpu < vec_len(dm->devices_by_cpu); cpu++)
663 if (vec_len(dm->devices_by_cpu[cpu]))
664 vlib_cli_output(vm, "Thread %u (%s at lcore %u):", cpu,
665 vlib_worker_threads[cpu].name,
666 vlib_worker_threads[cpu].dpdk_lcore_id);
668 vec_foreach(dq, dm->devices_by_cpu[cpu])
670 u32 hw_if_index = dm->devices[dq->device].vlib_hw_if_index;
671 vnet_hw_interface_t * hi = vnet_get_hw_interface(dm->vnet_main, hw_if_index);
672 vlib_cli_output(vm, " %v queue %u", hi->name, dq->queue_id);
678 VLIB_CLI_COMMAND (cmd_show_dpdk_if_placement,static) = {
679 .path = "show dpdk interface placement",
680 .short_help = "show dpdk interface placement",
681 .function = show_dpdk_if_placement,
685 dpdk_device_queue_sort(void * a1, void * a2)
687 dpdk_device_and_queue_t * dq1 = a1;
688 dpdk_device_and_queue_t * dq2 = a2;
690 if (dq1->device > dq2->device)
692 else if (dq1->device < dq2->device)
694 else if (dq1->queue_id > dq2->queue_id)
696 else if (dq1->queue_id < dq2->queue_id)
702 static clib_error_t *
703 set_dpdk_if_placement (vlib_main_t *vm, unformat_input_t *input,
704 vlib_cli_command_t *cmd)
706 unformat_input_t _line_input, * line_input = &_line_input;
707 dpdk_main_t * dm = &dpdk_main;
708 dpdk_device_and_queue_t * dq;
709 vnet_hw_interface_t * hw;
711 u32 hw_if_index = (u32) ~0;
716 if (! unformat_user (input, unformat_line_input, line_input))
719 while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) {
720 if (unformat (line_input, "%U", unformat_vnet_hw_interface, dm->vnet_main,
723 else if (unformat (line_input, "queue %d", &queue))
725 else if (unformat (line_input, "thread %d", &cpu))
728 return clib_error_return (0, "parse error: '%U'",
729 format_unformat_error, line_input);
732 unformat_free (line_input);
734 if (hw_if_index == (u32) ~0)
735 return clib_error_return (0, "please specify valid interface name");
737 if (cpu < dm->input_cpu_first_index ||
738 cpu >= (dm->input_cpu_first_index + dm->input_cpu_count))
739 return clib_error_return (0, "please specify valid thread id");
741 hw = vnet_get_hw_interface (dm->vnet_main, hw_if_index);
742 xd = vec_elt_at_index (dm->devices, hw->dev_instance);
744 for(i = 0; i < vec_len(dm->devices_by_cpu); i++)
746 vec_foreach(dq, dm->devices_by_cpu[i])
748 if (hw_if_index == dm->devices[dq->device].vlib_hw_if_index &&
749 queue == dq->queue_id)
751 if (cpu == i) /* nothing to do */
754 vec_del1(dm->devices_by_cpu[i], dq - dm->devices_by_cpu[i]);
755 vec_add2(dm->devices_by_cpu[cpu], dq, 1);
756 dq->queue_id = queue;
757 dq->device = xd->device_index;
758 xd->cpu_socket_id_by_queue[queue] =
759 rte_lcore_to_socket_id(vlib_worker_threads[cpu].dpdk_lcore_id);
761 vec_sort_with_function(dm->devices_by_cpu[i],
762 dpdk_device_queue_sort);
764 vec_sort_with_function(dm->devices_by_cpu[cpu],
765 dpdk_device_queue_sort);
767 if (vec_len(dm->devices_by_cpu[i]) == 0)
768 vlib_node_set_state (vlib_mains[i], dpdk_input_node.index,
769 VLIB_NODE_STATE_DISABLED);
771 if (vec_len(dm->devices_by_cpu[cpu]) == 1)
772 vlib_node_set_state (vlib_mains[cpu], dpdk_input_node.index,
773 VLIB_NODE_STATE_POLLING);
780 return clib_error_return (0, "not found");
783 VLIB_CLI_COMMAND (cmd_set_dpdk_if_placement,static) = {
784 .path = "set dpdk interface placement",
785 .short_help = "set dpdk interface placement <if-name> [queue <n>] thread <n>",
786 .function = set_dpdk_if_placement,
790 dpdk_cli_init (vlib_main_t * vm)
795 VLIB_INIT_FUNCTION (dpdk_cli_init);