1 .. SPDX-License-Identifier: BSD-3-Clause
2 Copyright(c) 2010-2014 Intel Corporation.
4 Running the Application
5 =======================
7 EAL Command-line Options
8 ------------------------
10 Please refer to :doc:`EAL parameters (Linux) <../linux_gsg/linux_eal_parameters>`
11 or :doc:`EAL parameters (FreeBSD) <../freebsd_gsg/freebsd_eal_parameters>` for
12 a list of available EAL command-line options.
15 Testpmd Command-line Options
16 ----------------------------
18 The following are the command-line options for the testpmd applications.
19 They must be separated from the EAL options, shown in the previous section, with a ``--`` separator:
21 .. code-block:: console
23 sudo ./dpdk-testpmd -l 0-3 -n 4 -- -i --portmask=0x1 --nb-cores=2
25 The command line options are:
27 * ``-i, --interactive``
29 Run testpmd in interactive mode.
30 In this mode, the testpmd starts with a prompt that can be used to start and stop forwarding,
31 configure the application and display stats on the current packet processing session.
32 See :ref:`testpmd_runtime` for more details.
34 In non-interactive mode,
35 the application starts with the configuration specified on the command-line and
36 immediately enters forwarding mode.
40 Display a help message and quit.
42 * ``-a, --auto-start``
44 Start forwarding on initialization.
48 Start forwarding, after sending a burst of packets first.
52 This flag should be only used in non-interactive mode.
54 * ``--stats-period PERIOD``
56 Display statistics every PERIOD seconds, if interactive mode is disabled.
57 The default value is 0, which means that the statistics will not be displayed.
61 Set the number of forwarding cores,
62 where 1 <= N <= "number of cores" or ``RTE_MAX_LCORE`` from the configuration file.
63 The default value is 1.
67 Set the number of forwarding ports,
68 where 1 <= N <= "number of ports" on the board or ``RTE_MAX_ETHPORTS`` from the configuration file.
69 The default value is the number of ports on the board.
73 Set the hexadecimal bitmask of the cores running the packet forwarding test.
74 The main lcore is reserved for command line parsing only and cannot be masked on for packet forwarding.
78 Set the hexadecimal bitmask of the ports used by the packet forwarding test.
82 Set the forwarding ports based on the user input used by the packet forwarding test.
83 '-' denotes a range of ports to set including the two specified port IDs
84 ',' separates multiple port values.
85 Possible examples like --portlist=0,1 or --portlist=0-2 or --portlist=0,1-2 etc
89 Enable NUMA-aware allocation of RX/TX rings and of RX memory buffers
90 (mbufs). [Default setting]
94 Disable NUMA-aware allocation of RX/TX rings and of RX memory buffers (mbufs).
96 * ``--port-numa-config=(port,socket)[,(port,socket)]``
98 Specify the socket on which the memory pool to be used by the port will be allocated.
100 * ``--ring-numa-config=(port,flag,socket)[,(port,flag,socket)]``
102 Specify the socket on which the TX/RX rings for the port will be allocated.
103 Where flag is 1 for RX, 2 for TX, and 3 for RX and TX.
107 Set the socket from which all memory is allocated in NUMA mode,
108 where 0 <= N < number of sockets on the board.
110 * ``--mbuf-size=N[,N1[,...Nn]``
112 Set the data size of the mbufs used to N bytes, where N < 65536.
113 The default value is 2048. If multiple mbuf-size values are specified the
114 extra memory pools will be created for allocating mbufs to receive packets
115 with buffer splittling features.
117 * ``--total-num-mbufs=N``
119 Set the number of mbufs to be allocated in the mbuf pools, where N > 1024.
121 * ``--max-pkt-len=N``
123 Set the maximum packet size to N bytes, where N >= 64. The default value is 1518.
125 * ``--max-lro-pkt-size=N``
127 Set the maximum LRO aggregated packet size to N bytes, where N >= 64.
129 * ``--eth-peers-configfile=name``
131 Use a configuration file containing the Ethernet addresses of the peer ports.
132 The configuration file should contain the Ethernet addresses on separate lines::
138 * ``--eth-peer=N,XX:XX:XX:XX:XX:XX``
140 Set the MAC address ``XX:XX:XX:XX:XX:XX`` of the peer port N,
141 where 0 <= N < ``RTE_MAX_ETHPORTS``.
143 * ``--tx-ip=SRC,DST``
145 Set the source and destination IP address used when doing transmit only test.
146 The defaults address values are source 198.18.0.1 and
147 destination 198.18.0.2. These are special purpose addresses
148 reserved for benchmarking (RFC 5735).
150 * ``--tx-udp=SRC[,DST]``
152 Set the source and destination UDP port number for transmit test only test.
153 The default port is the port 9 which is defined for the discard protocol
156 * ``--pkt-filter-mode=mode``
158 Set Flow Director mode where mode is either ``none`` (the default), ``signature`` or ``perfect``.
159 See :ref:`testpmd_flow_director` for more details.
161 * ``--pkt-filter-report-hash=mode``
163 Set Flow Director hash match reporting mode where mode is ``none``, ``match`` (the default) or ``always``.
165 * ``--pkt-filter-size=N``
167 Set Flow Director allocated memory size, where N is 64K, 128K or 256K.
168 Sizes are in kilobytes. The default is 64.
170 * ``--pkt-filter-flexbytes-offset=N``
172 Set the flexbytes offset.
173 The offset is defined in words (not bytes) counted from the first byte of the destination Ethernet MAC address,
174 where N is 0 <= N <= 32.
175 The default value is 0x6.
177 * ``--pkt-filter-drop-queue=N``
180 In perfect filter mode, when a rule is added with queue = -1, the packet will be enqueued into the RX drop-queue.
181 If the drop-queue does not exist, the packet is dropped. The default value is N=127.
183 * ``--disable-crc-strip``
185 Disable hardware CRC stripping.
189 Enable large receive offload.
191 * ``--enable-rx-cksum``
193 Enable hardware RX checksum offload.
195 * ``--enable-scatter``
197 Enable scatter (multi-segment) RX.
199 * ``--enable-hw-vlan``
201 Enable hardware VLAN.
203 * ``--enable-hw-vlan-filter``
205 Enable hardware VLAN filter.
207 * ``--enable-hw-vlan-strip``
209 Enable hardware VLAN strip.
211 * ``--enable-hw-vlan-extend``
213 Enable hardware VLAN extend.
215 * ``--enable-hw-qinq-strip``
217 Enable hardware QINQ strip.
219 * ``--enable-drop-en``
221 Enable per-queue packet drop for packets with no descriptors.
225 Disable RSS (Receive Side Scaling).
227 * ``--port-topology=mode``
229 Set port topology, where mode is ``paired`` (the default), ``chained`` or ``loop``.
231 In ``paired`` mode, the forwarding is between pairs of ports, for example: (0,1), (2,3), (4,5).
233 In ``chained`` mode, the forwarding is to the next available port in the port mask, for example: (0,1), (1,2), (2,0).
235 The ordering of the ports can be changed using the portlist testpmd runtime function.
237 In ``loop`` mode, ingress traffic is simply transmitted back on the same interface.
239 * ``--forward-mode=mode``
241 Set the forwarding mode where ``mode`` is one of the following::
258 Set RSS functions for IPv4/IPv6 only.
262 Set RSS functions for IPv4/IPv6 and UDP.
266 Set the number of RX queues per port to N, where 1 <= N <= 65535.
267 The default value is 1.
271 Set the number of descriptors in the RX rings to N, where N > 0.
272 The default value is 128.
276 Set the number of TX queues per port to N, where 1 <= N <= 65535.
277 The default value is 1.
281 Set the number of descriptors in the TX rings to N, where N > 0.
282 The default value is 512.
286 Set the number of hairpin queues per port to N, where 1 <= N <= 65535.
287 The default value is 0. The number of hairpin queues are added to the
288 number of TX queues and to the number of RX queues. then the first
289 RX hairpin is binded to the first TX hairpin, the second RX hairpin is
290 binded to the second TX hairpin and so on. The index of the first
291 RX hairpin queue is the number of RX queues as configured using --rxq.
292 The index of the first TX hairpin queue is the number of TX queues
293 as configured using --txq.
297 Set the number of packets per burst to N, where 1 <= N <= 512.
298 The default value is 32.
299 If set to 0, driver default is used if defined. Else, if driver
300 default is not defined, default of 32 is used.
304 Set the cache of mbuf memory pools to N, where 0 <= N <= 512.
305 The default value is 16.
309 Set the prefetch threshold register of RX rings to N, where N >= 0.
310 The default value is 8.
314 Set the host threshold register of RX rings to N, where N >= 0.
315 The default value is 8.
319 Set the free threshold of RX descriptors to N, where 0 <= N < value of --rxd.
320 The default value is 0.
324 Set the write-back threshold register of RX rings to N, where N >= 0.
325 The default value is 4.
329 Set the prefetch threshold register of TX rings to N, where N >= 0.
330 The default value is 36.
334 Set the host threshold register of TX rings to N, where N >= 0.
335 The default value is 0.
339 Set the write-back threshold register of TX rings to N, where N >= 0.
340 The default value is 0.
344 Set the transmit free threshold of TX rings to N, where 0 <= N <= value of ``--txd``.
345 The default value is 0.
349 Set the transmit RS bit threshold of TX rings to N, where 0 <= N <= value of ``--txd``.
350 The default value is 0.
352 * ``--rx-queue-stats-mapping=(port,queue,mapping)[,(port,queue,mapping)]``
354 Set the RX queues statistics counters mapping 0 <= mapping <= 15.
356 * ``--tx-queue-stats-mapping=(port,queue,mapping)[,(port,queue,mapping)]``
358 Set the TX queues statistics counters mapping 0 <= mapping <= 15.
362 Don't flush the RX streams before starting forwarding. Used mainly with the PCAP PMD.
366 Set the offsets of packet segments on receiving if split
367 feature is engaged. Affects only the queues configured
368 with split offloads (currently BUFFER_SPLIT is supported only).
372 Set the length of segments to scatter packets on receiving if split
373 feature is engaged. Affects only the queues configured
374 with split offloads (currently BUFFER_SPLIT is supported only).
375 Optionally the multiple memory pools can be specified with --mbuf-size
376 command line parameter and the mbufs to receive will be allocated
377 sequentially from these extra memory pools.
381 Set TX segment sizes or total packet length. Valid for ``tx-only``
382 and ``flowgen`` forwarding modes.
384 * ``--txonly-multi-flow``
386 Generate multiple flows in txonly mode.
388 * ``--disable-link-check``
390 Disable check on link status when starting/stopping ports.
392 * ``--disable-device-start``
394 Do not automatically start all ports. This allows testing
395 configuration of rx and tx queues before device is started
398 * ``--no-lsc-interrupt``
400 Disable LSC interrupts for all ports, even those supporting it.
402 * ``--no-rmv-interrupt``
404 Disable RMV interrupts for all ports, even those supporting it.
406 * ``--bitrate-stats=N``
408 Set the logical core N to perform bitrate calculation.
410 * ``--print-event <unknown|intr_lsc|queue_state|intr_reset|vf_mbox|macsec|intr_rmv|dev_probed|dev_released|flow_aged|all>``
412 Enable printing the occurrence of the designated event. Using all will
415 * ``--mask-event <unknown|intr_lsc|queue_state|intr_reset|vf_mbox|macsec|intr_rmv|dev_probed|dev_released|flow_aged|all>``
417 Disable printing the occurrence of the designated event. Using all will
420 * ``--flow-isolate-all``
422 Providing this parameter requests flow API isolated mode on all ports at
423 initialization time. It ensures all traffic is received through the
424 configured flow rules only (see flow command).
426 Ports that do not support this mode are automatically discarded.
428 * ``--tx-offloads=0xXXXXXXXX``
430 Set the hexadecimal bitmask of TX queue offloads.
431 The default value is 0.
433 * ``--rx-offloads=0xXXXXXXXX``
435 Set the hexadecimal bitmask of RX queue offloads.
436 The default value is 0.
440 Enable device event monitor mechanism for hotplug.
442 * ``--vxlan-gpe-port=N``
444 Set the UDP port number of tunnel VXLAN-GPE to N.
445 The default value is 4790.
447 * ``--geneve-parsed-port=N``
449 Set the UDP port number that is used for parsing the GENEVE protocol to N.
450 HW may be configured with another tunnel Geneve port.
451 The default value is 6081.
455 Enable locking all memory.
459 Disable locking all memory.
461 * ``--mp-alloc <native|anon|xmem|xmemhuge>``
463 Select mempool allocation mode:
465 * native: create and populate mempool using native DPDK memory
466 * anon: create mempool using native DPDK memory, but populate using
468 * xmem: create and populate mempool using externally and anonymously
470 * xmemhuge: create and populate mempool using externally and anonymously
471 allocated hugepage area
473 * ``--noisy-tx-sw-buffer-size``
475 Set the number of maximum elements of the FIFO queue to be created
476 for buffering packets. Only available with the noisy forwarding mode.
477 The default value is 0.
479 * ``--noisy-tx-sw-buffer-flushtime=N``
481 Set the time before packets in the FIFO queue is flushed.
482 Only available with the noisy forwarding mode. The default value is 0.
484 * ``--noisy-lkup-memory=N``
486 Set the size of the noisy neighbor simulation memory buffer in MB to N.
487 Only available with the noisy forwarding mode. The default value is 0.
490 * ``--noisy-lkup-num-reads=N``
492 Set the number of reads to be done in noisy neighbor simulation memory buffer to N.
493 Only available with the noisy forwarding mode. The default value is 0.
495 * ``--noisy-lkup-num-writes=N``
497 Set the number of writes to be done in noisy neighbor simulation memory buffer to N.
498 Only available with the noisy forwarding mode. The default value is 0.
500 * ``--noisy-lkup-num-reads-writes=N``
502 Set the number of r/w accesses to be done in noisy neighbor simulation memory buffer to N.
503 Only available with the noisy forwarding mode. The default value is 0.
505 * ``--no-iova-contig``
507 Enable to create mempool which is not IOVA contiguous. Valid only with --mp-alloc=anon.
508 The default value is 0.
512 Set the hexadecimal bitmask of RX multi queue mode which can be enabled.
513 The default value is 0x7::
515 ETH_MQ_RX_RSS_FLAG | ETH_MQ_RX_DCB_FLAG | ETH_MQ_RX_VMDQ_FLAG
517 * ``--record-core-cycles``
519 Enable measurement of CPU cycles per packet.
521 * ``--record-burst-stats``
523 Enable display of RX and TX burst stats.
525 * ``--hairpin-mode=0xXX``
527 Set the hairpin port mode with bitmask, only valid when hairpin queues number is set.
528 bit 4 - explicit Tx flow rule
529 bit 1 - two hairpin ports paired
530 bit 0 - two hairpin ports loop
531 The default value is 0. Hairpin will use single port mode and implicit Tx flow mode.