3. Running the Application
3.1. EAL Command-line Options
The following are the EAL command-line options that can be used in conjunction with the testpmd, or any other DPDK application. See the DPDK Getting Started Guides for more information on these options.
Set the hexadecimal bitmask of the cores to run on.
List of cores to run on
The argument format is
c2, etc are core indexes between 0 and 128.
Map lcore set to physical cpu set
The argument format is:
Lcore and CPU lists are grouped by
)Within the group. The
-character is used as a range separator and
,is used as a single number separator. The grouping
()can be omitted for single element group. The
@can be omitted if cpus and lcores have the same value.
Core ID that is used as master.
Set the number of memory channels to use.
-b, --pci-blacklist domain:bus:devid.func
Blacklist a PCI device to prevent EAL from using it. Multiple -b options are allowed.
Load an external driver. Multiple -d options are allowed.
-w, --pci-whitelist domain:bus:devid:func
Add a PCI device in white list.
Memory to allocate. See also
Set the number of memory ranks (auto-detected by default).
Display the version information on startup.
Set the syslog facility.
Set the memory to allocate on specific sockets (use comma separated values).
Specify the directory where the hugetlbfs is mounted.
Pool ops name for mbuf to use.
Set the type of the current process.
Prefix for hugepage filenames.
Use VMware TSC map instead of native RDTSC.
Add a virtual device using the format:
Specify base virtual address.
/dev/uioX(usually done by hotplug).
No shared config (mmap-ed files).
Use malloc instead of hugetlbfs.
3.2. Testpmd Command-line Options
The following are the command-line options for the testpmd applications.
They must be separated from the EAL options, shown in the previous section, with a
sudo ./testpmd -l 0-3 -n 4 -- -i --portmask=0x1 --nb-cores=2
The commandline options are:
Run testpmd in interactive mode. In this mode, the testpmd starts with a prompt that can be used to start and stop forwarding, configure the application and display stats on the current packet processing session. See Testpmd Runtime Functions for more details.
In non-interactive mode, the application starts with the configuration specified on the command-line and immediately enters forwarding mode.
Display a help message and quit.
Start forwarding on initialization.
Start forwarding, after sending a burst of packets first.
This flag should be only used in non-interactive mode.
Display statistics every PERIOD seconds, if interactive mode is disabled. The default value is 0, which means that the statistics will not be displayed.
Set the number of forwarding cores, where 1 <= N <= “number of cores” or
CONFIG_RTE_MAX_LCOREfrom the configuration file. The default value is 1.
Set the number of forwarding ports, where 1 <= N <= “number of ports” on the board or
CONFIG_RTE_MAX_ETHPORTSfrom the configuration file. The default value is the number of ports on the board.
Set the hexadecimal bitmask of the cores running the packet forwarding test. The master lcore is reserved for command line parsing only and cannot be masked on for packet forwarding.
Set the hexadecimal bitmask of the ports used by the packet forwarding test.
Enable NUMA-aware allocation of RX/TX rings and of RX memory buffers (mbufs). [Default setting]
Disable NUMA-aware allocation of RX/TX rings and of RX memory buffers (mbufs).
Specify the socket on which the memory pool to be used by the port will be allocated.
Specify the socket on which the TX/RX rings for the port will be allocated. Where flag is 1 for RX, 2 for TX, and 3 for RX and TX.
Set the socket from which all memory is allocated in NUMA mode, where 0 <= N < number of sockets on the board.
Set the data size of the mbufs used to N bytes, where N < 65536. The default value is 2048.
Set the number of mbufs to be allocated in the mbuf pools, where N > 1024.
Set the maximum packet size to N bytes, where N >= 64. The default value is 1518.
Use a configuration file containing the Ethernet addresses of the peer ports. The configuration file should contain the Ethernet addresses on separate lines:
XX:XX:XX:XX:XX:01 XX:XX:XX:XX:XX:02 ...
Set the MAC address
XX:XX:XX:XX:XX:XXof the peer port N, where 0 <= N <
CONFIG_RTE_MAX_ETHPORTSfrom the configuration file.
Set Flow Director mode where mode is either
perfect. See flow_director_filter for more details.
Set Flow Director hash match reporting mode where mode is
match(the default) or
Set Flow Director allocated memory size, where N is 64K, 128K or 256K. Sizes are in kilobytes. The default is 64.
Set the flexbytes offset. The offset is defined in words (not bytes) counted from the first byte of the destination Ethernet MAC address, where N is 0 <= N <= 32. The default value is 0x6.
Set the drop-queue. In perfect filter mode, when a rule is added with queue = -1, the packet will be enqueued into the RX drop-queue. If the drop-queue does not exist, the packet is dropped. The default value is N=127.
Disable hardware CRC stripping.
Enable large receive offload.
Enable hardware RX checksum offload.
Enable scatter (multi-segment) RX.
Disable hardware VLAN.
Disable hardware VLAN filter.
Disable hardware VLAN strip.
Disable hardware VLAN extend.
Enable per-queue packet drop for packets with no descriptors.
Disable RSS (Receive Side Scaling).
Set port topology, where mode is
pairedmode, the forwarding is between pairs of ports, for example: (0,1), (2,3), (4,5).
chainedmode, the forwarding is to the next available port in the port mask, for example: (0,1), (1,2), (2,0).
The ordering of the ports can be changed using the portlist testpmd runtime function.
loopmode, ingress traffic is simply transmitted back on the same interface.
Set the forwarding mode where
modeis one of the following:
io (the default) mac macswap flowgen rxonly txonly csum icmpecho ieee1588 tm
Set RSS functions for IPv4/IPv6 only.
Set RSS functions for IPv4/IPv6 and UDP.
Set the number of RX queues per port to N, where 1 <= N <= 65535. The default value is 1.
Set the number of descriptors in the RX rings to N, where N > 0. The default value is 128.
Set the number of TX queues per port to N, where 1 <= N <= 65535. The default value is 1.
Set the number of descriptors in the TX rings to N, where N > 0. The default value is 512.
Set the number of packets per burst to N, where 1 <= N <= 512. The default value is 16.
Set the cache of mbuf memory pools to N, where 0 <= N <= 512. The default value is 16.
Set the prefetch threshold register of RX rings to N, where N >= 0. The default value is 8.
Set the host threshold register of RX rings to N, where N >= 0. The default value is 8.
Set the free threshold of RX descriptors to N, where 0 <= N < value of –rxd. The default value is 0.
Set the write-back threshold register of RX rings to N, where N >= 0. The default value is 4.
Set the prefetch threshold register of TX rings to N, where N >= 0. The default value is 36.
Set the host threshold register of TX rings to N, where N >= 0. The default value is 0.
Set the write-back threshold register of TX rings to N, where N >= 0. The default value is 0.
Set the transmit free threshold of TX rings to N, where 0 <= N <= value of
--txd. The default value is 0.
Set the transmit RS bit threshold of TX rings to N, where 0 <= N <= value of
--txd. The default value is 0.
Set the hexadecimal bitmask of TX queue flags, where 0 <= N <= 0x7FFFFFFF. The default value is 0.
When using hardware offload functions such as vlan or checksum add
txqflags=0to force the full-featured TX code path. In some PMDs this may already be the default.
Set the RX queues statistics counters mapping 0 <= mapping <= 15.
Set the TX queues statistics counters mapping 0 <= mapping <= 15.
Don’t flush the RX streams before starting forwarding. Used mainly with the PCAP PMD.
Set TX segment sizes or total packet length. Valid for
Disable check on link status when starting/stopping ports.
Disable LSC interrupts for all ports, even those supporting it.
Disable RMV interrupts for all ports, even those supporting it.
Set the logical core N to perform bitrate calculation.
Enable printing the occurrence of the designated event. Using all will enable all of them.
Disable printing the occurrence of the designated event. Using all will disable all of them.
Providing this parameter requests flow API isolated mode on all ports at initialization time. It ensures all traffic is received through the configured flow rules only (see flow command).
Ports that do not support this mode are automatically discarded.