Example Testpmd Configuration
This section provides a more complex example of a testpmd command.
This command starts testpmd with the following EAL parameters:
- -l 2-11: Run DPDK on cores 2 through 11.
- -n 4: Use 4 memory channels.
- -a 11:00.2: Probe PCI device at BDF number 11:00.2.
- --file-prefix testpmd18000: Run DPDK under the specified prefix ‘testpmd18000’.
- --socket-mem=1024: Pre-allocates 1024 megabytes on socket 0.
- --proc-type=auto: Set the type of the process to auto.
And, the following testpmd parameters:
- --nb-cores=4: Set the number of cores used by the application for forwarding to 4.
- --rxq=4: Set the number of RX queues per port to 4.
- --txq=4: Set the number of TX queues per port to 4.
- -i: Start testpmd in interactive mode.
- --forward-mode=mac: Set the packet forwarding mode to mac, which changes the source and destination addresses of the packets before forwarding them.
- --eth-peer=0,68:05:ca:c1:c9:29: Set the MAC address of the peer port.
The following is the testpmd output from running the command:
./dpdk-testpmd -l 2-11 -n 4 -a 11:00.2 --file-prefix testpmd18000 --socket-mem=1024,0 --proc-type=auto -- --nb-cores=4 --rxq=4 --txq=4 -i --forward-mode=mac --eth-peer=0,68:05:ca:c1:c9:29
EAL: Detected 88 lcore(s)
EAL: Detected 2 NUMA nodes
EAL: Auto-detected process type: PRIMARY
EAL: Multi-process socket /var/run/dpdk/testpmd18000/mp_socket
EAL: Selected IOVA mode 'PA'
EAL: Probing VFIO support...
EAL: PCI device 0000:18:00.0 on NUMA socket 0
EAL: probe driver: 8086:1592 net_ice
Interactive-mode selected
Set mac packet forwarding mode
testpmd: create a new mbuf pool <mbuf_pool_socket_0>: n=219456, size=2176, socket=0
testpmd: preferred mempool ops selected: ring_mp_mc
Warning! port-topology=paired and odd forward ports number, the last port will pair with itself.
Configuring Port 0 (socket 0)
Port 0: 68:05:CA:A6:0A:B0
Checking link statuses...
Done
testpmd> start
mac packet forwarding - ports=1 - cores=4 - streams=4 - NUMA support enabled, MP allocation mode: native
Logical Core 3 (socket 0) forwards packets on 1 streams:
RX P=0/Q=0 (socket 0) -> TX P=0/Q=0 (socket 0) peer=68:05:CA:A6:0B:1C
Logical Core 4 (socket 0) forwards packets on 1 streams:
RX P=0/Q=1 (socket 0) -> TX P=0/Q=1 (socket 0) peer=68:05:CA:A6:0B:1C
Logical Core 5 (socket 0) forwards packets on 1 streams:
RX P=0/Q=2 (socket 0) -> TX P=0/Q=2 (socket 0) peer=68:05:CA:A6:0B:1C
Logical Core 6 (socket 0) forwards packets on 1 streams:
RX P=0/Q=3 (socket 0) -> TX P=0/Q=3 (socket 0) peer=68:05:CA:A6:0B:1C
mac packet forwarding packets/burst=32
nb forwarding cores=4 - nb forwarding ports=1
port 0: RX queue number: 4 Tx queue number: 4
Rx offloads=0x0 Tx offloads=0x10000
RX queue: 0
RX desc=1024 - RX free threshold=32
RX threshold registers: pthresh=8 hthresh=8 wthresh=0
RX Offloads=0x0
TX queue: 0
TX desc=1024 - TX free threshold=32
TX threshold registers: pthresh=32 hthresh=0 wthresh=0
TX offloads=0x10000 - TX RS bit threshold=32
testpmd> show port stats all
######################## NIC statistics for port 0 ########################
RX-packets: 322932478810 RX-missed: 558861443 RX-bytes: 18446743441590657960
RX-errors: 0
RX-nombuf: 0
TX-packets: 302564215177 TX-errors: 0 TX-bytes: 18446743108765253980
Throughput (since last show)
Rx-pps: 35183210
Tx-pps: 32640093
############################################################################
testpmd> stop
Telling cores to stop...
Waiting for lcores to finish...
------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 0/Queue= 0 -------
RX-packets: 155985410964 TX-packets: 146417324571 TX-dropped: 9568086393
------- Forward Stats for RX Port= 0/Queue= 1 -> TX Port= 0/Queue= 1 -------
RX-packets: 6224427006 TX-packets: 4972240065 TX-dropped: 1252186941
------- Forward Stats for RX Port= 0/Queue= 2 -> TX Port= 0/Queue= 2 -------
RX-packets: 4981979331 TX-packets: 4973665526 TX-dropped: 8313805
------- Forward Stats for RX Port= 0/Queue= 3 -> TX Port= 0/Queue= 3 -------
RX-packets: 155943833856 TX-packets: 146389491787 TX-dropped: 9554342069
---------------------- Forward statistics for port 0 ----------------------
RX-packets: 323135651965 RX-dropped: 561082081 RX-total: 323696734046
TX-packets: 302752721949 TX-dropped: 20382929208 TX-total: 323135651157
----------------------------------------------------------------------------
+++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
RX-packets: 323135651965 RX-dropped: 561082081 RX-total: 323696734046
TX-packets: 302752721949 TX-dropped: 20382929208 TX-total: 323135651157
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Done.