X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fdpdk%2Fdevice%2Fcli.c;h=7e168afb64e71a8ae1914a8a23611d18815cd2d6;hb=5d64c7868f67749a6c99eb4ee5998b518ab6c71c;hp=2a49771ef2659d061d5998bc7d99d9cf62d54167;hpb=0e969ac8431c80ff4bca5f6985876b1c584eefcd;p=vpp.git diff --git a/src/plugins/dpdk/device/cli.c b/src/plugins/dpdk/device/cli.c index 2a49771ef26..7e168afb64e 100644 --- a/src/plugins/dpdk/device/cli.c +++ b/src/plugins/dpdk/device/cli.c @@ -68,11 +68,7 @@ get_hqos (u32 hw_if_index, u32 subport_id, dpdk_device_t ** xd, rte_eth_dev_info_get ((*xd)->port_id, &dev_info); -#if RTE_VERSION < RTE_VERSION_NUM(18, 5, 0, 0) - pci_dev = dev_info.pci_dev; -#else pci_dev = RTE_DEV_TO_PCI (dev_info.device); -#endif if (pci_dev) { /* bonded interface has no pci info */ @@ -147,7 +143,7 @@ pcap_trace_command_internal (vlib_main_t * vm, clib_error_report (error); else vlib_cli_output (vm, "saved to %s...", - dm->pcap[rx_tx].pcap_filename); + dm->pcap[rx_tx].pcap_main.file_name); } dm->pcap[rx_tx].pcap_enable = 0; @@ -211,23 +207,25 @@ pcap_trace_command_internal (vlib_main_t * vm, { vlib_cli_output (vm, "max is %d for any interface to file %s", - dm->pcap_pkts_to_capture ? - dm->pcap[rx_tx].pcap_pkts_to_capture + dm->pcap[rx_tx].pcap_main.n_packets_to_capture ? + dm->pcap[rx_tx].pcap_main.n_packets_to_capture : PCAP_DEF_PKT_TO_CAPTURE, - dm->pcap_filename ? - dm->pcap[rx_tx].pcap_filename : (u8 *) "/tmp/vpe.pcap"); + dm->pcap[rx_tx].pcap_main.file_name ? + (u8 *) dm->pcap[rx_tx].pcap_main.file_name : + (u8 *) "/tmp/vpe.pcap"); } else { vlib_cli_output (vm, "max is %d for interface %U to file %s", - dm->pcap[rx_tx].pcap_pkts_to_capture - ? dm->pcap_pkts_to_capture - : PCAP_DEF_PKT_TO_CAPTURE, + dm->pcap[rx_tx].pcap_main.n_packets_to_capture + ? dm->pcap[rx_tx]. + pcap_main.n_packets_to_capture : + PCAP_DEF_PKT_TO_CAPTURE, format_vnet_sw_if_index_name, dm->vnet_main, dm->pcap_sw_if_index, - dm->pcap[rx_tx].pcap_filename - ? dm->pcap[rx_tx].pcap_filename : (u8 *) - "/tmp/vpe.pcap"); + dm->pcap[rx_tx]. + pcap_main.file_name ? (u8 *) dm->pcap[rx_tx]. + pcap_main.file_name : (u8 *) "/tmp/vpe.pcap"); } if (dm->pcap[rx_tx].pcap_enable == 0) @@ -262,34 +260,28 @@ pcap_trace_command_internal (vlib_main_t * vm, /* Since no error, save configured values. */ if (chroot_filename) { - if (dm->pcap[rx_tx].pcap_filename) - vec_free (dm->pcap[rx_tx].pcap_filename); + if (dm->pcap[rx_tx].pcap_main.file_name) + vec_free (dm->pcap[rx_tx].pcap_main.file_name); vec_add1 (chroot_filename, 0); - dm->pcap[rx_tx].pcap_filename = chroot_filename; + dm->pcap[rx_tx].pcap_main.file_name = (char *) chroot_filename; } if (max) - dm->pcap[rx_tx].pcap_pkts_to_capture = max; - + dm->pcap[rx_tx].pcap_main.n_packets_to_capture = max; if (enabled) { - if (dm->pcap[rx_tx].pcap_filename == 0) - dm->pcap[rx_tx].pcap_filename = format (0, "/tmp/vpe.pcap%c", 0); - - memset (&dm->pcap[rx_tx].pcap_main, 0, - sizeof (dm->pcap[rx_tx].pcap_main)); - dm->pcap[rx_tx].pcap_main.file_name = - (char *) dm->pcap[rx_tx].pcap_filename; - dm->pcap[rx_tx].pcap_main.n_packets_to_capture - = PCAP_DEF_PKT_TO_CAPTURE; - if (dm->pcap[rx_tx].pcap_pkts_to_capture) - dm->pcap[rx_tx].pcap_main.n_packets_to_capture - = dm->pcap[rx_tx].pcap_pkts_to_capture; + if (dm->pcap[rx_tx].pcap_main.file_name == 0) + dm->pcap[rx_tx].pcap_main.file_name + = (char *) format (0, "/tmp/vpe.pcap%c", 0); + dm->pcap[rx_tx].pcap_main.n_packets_captured = 0; dm->pcap[rx_tx].pcap_main.packet_type = PCAP_PACKET_TYPE_ethernet; + if (dm->pcap[rx_tx].pcap_main.lock == 0) + clib_spinlock_init (&(dm->pcap[rx_tx].pcap_main.lock)); dm->pcap[rx_tx].pcap_enable = 1; - vlib_cli_output (vm, "pcap tx capture on..."); + vlib_cli_output (vm, "pcap %s capture on...", + rx_tx == VLIB_RX ? "rx" : "tx"); } } else if (chroot_filename) @@ -345,7 +337,7 @@ pcap_tx_trace_command_fn (vlib_main_t * vm, * associated with a packet capture. If packet capture is in progress, * 'status' also will return the number of packets currently in * the local buffer. All additional attributes entered on command line - * with 'status' will be ingnored and not applied. + * with 'status' will be ignored and not applied. * * @cliexpar * Example of how to display the status of a tx packet capture when off: @@ -579,7 +571,7 @@ test_dpdk_buffer (vlib_main_t * vm, unformat_input_t * input, * @cliexpar * @parblock * - * Example of how to display how many DPDK buffer test command has allcoated: + * Example of how to display how many DPDK buffer test command has allocated: * @cliexstart{test dpdk buffer} * Currently 0 buffers allocated * @cliexend @@ -735,7 +727,7 @@ show_dpdk_if_hqos_placement (vlib_main_t * vm, unformat_input_t * input, cpu < (dm->hqos_cpu_first_index + dm->hqos_cpu_count)) vlib_cli_output (vm, "Thread %u (%s at lcore %u):", cpu, vlib_worker_threads[cpu].name, - vlib_worker_threads[cpu].lcore_id); + vlib_worker_threads[cpu].cpu_id); vec_foreach (dq, dm->devices_by_hqos_cpu[cpu]) { @@ -1294,11 +1286,7 @@ set_dpdk_if_hqos_pktfield (vlib_main_t * vm, unformat_input_t * input, rte_eth_dev_info_get (xd->port_id, &dev_info); -#if RTE_VERSION < RTE_VERSION_NUM(18, 5, 0, 0) - pci_dev = dev_info.pci_dev; -#else pci_dev = RTE_DEV_TO_PCI (dev_info.device); -#endif if (pci_dev) { /* bonded interface has no pci info */ @@ -1396,7 +1384,7 @@ done: } /*? - * This command is used to set the packet fields required for classifiying the + * This command is used to set the packet fields required for classifying the * incoming packet. As a result of classification process, packet field * information will be mapped to 5 tuples (subport, pipe, traffic class, pipe, * color) and stored in packet mbuf. @@ -1493,11 +1481,7 @@ show_dpdk_if_hqos (vlib_main_t * vm, unformat_input_t * input, rte_eth_dev_info_get (xd->port_id, &dev_info); -#if RTE_VERSION < RTE_VERSION_NUM(18, 5, 0, 0) - pci_dev = dev_info.pci_dev; -#else pci_dev = RTE_DEV_TO_PCI (dev_info.device); -#endif if (pci_dev) { /* bonded interface has no pci info */ @@ -2019,7 +2003,7 @@ show_dpdk_version_command_fn (vlib_main_t * vm, * the list of arguments passed to DPDK when started. * * @cliexpar - * Example of how to display how many DPDK buffer test command has allcoated: + * Example of how to display how many DPDK buffer test command has allocated: * @cliexstart{show dpdk version} * DPDK Version: DPDK 16.11.0 * 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