0
votes

I could not tell from the documentation if it is possible to use vdev rx_pcap to simulate RSS with a pcap file, using multiple cores.

It seemed like an interesting proposition, after reading this:

For ease of use, the DPDK EAL also has been extended to allow pseudo-Ethernet devices, using one or more of these drivers, to be created at application startup time during EAL initialization.

To do so, the –vdev= parameter must be passed to the EAL. This takes take options to allow ring and pcap-based Ethernet to be allocated and used transparently by the application. This can be used, for example, for testing on a virtual machine where there are no Ethernet ports.

Pcap-based devices can be created using the virtual device –vdev option.

This is how I read one PCAP file and write to another, using their example with the dpdk-testpmd application:

sudo build/app/dpdk-testpmd -l 0-3 --vdev 'net_pcap0,rx_pcap=file_rx.pcap,tx_pcap=file_tx.pcap' -- --port-topology=chained --no-flush-rx

This works fine, and I get the file_tx.pcap generated. But if I try to set the number of RX queues to 4 it tells me that I can't:

$ sudo build/app/dpdk-testpmd -l 0-3 --vdev 'net_pcap0,rx_pcap=file_rx.pcap,tx_pcap=file_tx.pcap' -- --port-topology=chained --no-flush-rx --rxq=4
EAL: Detected 4 lcore(s)
EAL: Detected 1 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'PA'
EAL: No available hugepages reported in hugepages-1048576kB
EAL: Probing VFIO support...
EAL: VFIO support initialized
EAL:   Invalid NUMA socket, default to 0
EAL:   Invalid NUMA socket, default to 0
Fail: input rxq (4) can't be greater than max_rx_queues (1) of port 0
EAL: Error - exiting with code: 1
  Cause: rxq 4 invalid - must be >= 0 && <= 1

Is it possible to change max_rx_queues for vdev rx_pcap at all, or is there a better alternative?

1

1 Answers

1
votes

The number of queues available on a port depends upon the NIC configuration and driver from OS. Hence expecting a PCAP PMD emulating RXPCAP file as RX device will have multiple RX queue is not right. You would need to start using the actual interface from OS which has multiple queues.

Explanation below:

As per the DPDK NIC Feature there is no support for RSS on PCAP PMD. So the option of receiving packets based on 3 IP Tuple or 5 IP+TCP|UDP|SCTP Tuple on multiple queues is not present natively and needs to be implemented in SW.

A per the PCAP PMD if one needs to read from the physical port we have use option rx_iface and not rx_pcap. Similarly to send on Physical interface one has to use option tx_iface and not tx_pcap.

If your requirement was to capture the RX or TX packet from specific DPDK port, you should look DPDK PDUMP application which uses rte_pdump API. The PDUMP Documentation explains clearly how to grab packets from specific queues too.

If one needs to read packets using PCAP PMD, use rx_iface in primary application. Then to write packets from desired port-queue into a PCAP file use dpdk-pdump as secondary application with option --pdump 'port=[your desired DPDK port],queue=[your desired DPDK port queue],rx-dev=/tmp/rx.pcap.