9ab4d702892bd600d5fb1cdf0dd45537ac4acfb1
[dpdk.git] / doc / guides / testpmd_app_ug / run_app.rst
1 ..  SPDX-License-Identifier: BSD-3-Clause
2     Copyright(c) 2010-2014 Intel Corporation.
3
4 Running the Application
5 =======================
6
7 EAL Command-line Options
8 ------------------------
9
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.
13
14
15 Testpmd Command-line Options
16 ----------------------------
17
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:
20
21 .. code-block:: console
22
23     sudo ./testpmd -l 0-3 -n 4 -- -i --portmask=0x1 --nb-cores=2
24
25 The command line options are:
26
27 *   ``-i, --interactive``
28
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.
33
34     In non-interactive mode,
35     the application starts with the configuration specified on the command-line and
36     immediately enters forwarding mode.
37
38 *   ``-h, --help``
39
40     Display a help message and quit.
41
42 *   ``-a, --auto-start``
43
44     Start forwarding on initialization.
45
46 *   ``--tx-first``
47
48     Start forwarding, after sending a burst of packets first.
49
50 .. Note::
51
52    This flag should be only used in non-interactive mode.
53
54 *   ``--stats-period PERIOD``
55
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.
58
59 *   ``--nb-cores=N``
60
61     Set the number of forwarding cores,
62     where 1 <= N <= "number of cores" or ``CONFIG_RTE_MAX_LCORE`` from the configuration file.
63     The default value is 1.
64
65 *   ``--nb-ports=N``
66
67     Set the number of forwarding ports,
68     where 1 <= N <= "number of ports" on the board or ``CONFIG_RTE_MAX_ETHPORTS`` from the configuration file.
69     The default value is the number of ports on the board.
70
71 *   ``--coremask=0xXX``
72
73     Set the hexadecimal bitmask of the cores running the packet forwarding test.
74     The master lcore is reserved for command line parsing only and cannot be masked on for packet forwarding.
75
76 *   ``--portmask=0xXX``
77
78     Set the hexadecimal bitmask of the ports used by the packet forwarding test.
79
80 *   ``--numa``
81
82     Enable NUMA-aware allocation of RX/TX rings and of RX memory buffers
83     (mbufs). [Default setting]
84
85 *   ``--no-numa``
86
87     Disable NUMA-aware allocation of RX/TX rings and of RX memory buffers (mbufs).
88
89 *   ``--port-numa-config=(port,socket)[,(port,socket)]``
90
91     Specify the socket on which the memory pool to be used by the port will be allocated.
92
93 *   ``--ring-numa-config=(port,flag,socket)[,(port,flag,socket)]``
94
95     Specify the socket on which the TX/RX rings for the port will be allocated.
96     Where flag is 1 for RX, 2 for TX, and 3 for RX and TX.
97
98 *   ``--socket-num=N``
99
100     Set the socket from which all memory is allocated in NUMA mode,
101     where 0 <= N < number of sockets on the board.
102
103 *   ``--mbuf-size=N``
104
105     Set the data size of the mbufs used to N bytes, where N < 65536. The default value is 2048.
106
107 *   ``--total-num-mbufs=N``
108
109     Set the number of mbufs to be allocated in the mbuf pools, where N > 1024.
110
111 *   ``--max-pkt-len=N``
112
113     Set the maximum packet size to N bytes, where N >= 64. The default value is 1518.
114
115 *   ``--max-lro-pkt-size=N``
116
117     Set the maximum LRO aggregated packet size to N bytes, where N >= 64.
118
119 *   ``--eth-peers-configfile=name``
120
121     Use a configuration file containing the Ethernet addresses of the peer ports.
122     The configuration file should contain the Ethernet addresses on separate lines::
123
124        XX:XX:XX:XX:XX:01
125        XX:XX:XX:XX:XX:02
126        ...
127
128 *   ``--eth-peer=N,XX:XX:XX:XX:XX:XX``
129
130     Set the MAC address ``XX:XX:XX:XX:XX:XX`` of the peer port N,
131     where 0 <= N < ``CONFIG_RTE_MAX_ETHPORTS`` from the configuration file.
132
133 *   ``--tx-ip=SRC,DST``
134
135     Set the source and destination IP address used when doing transmit only test.
136     The defaults address values are source 198.18.0.1 and
137     destination 198.18.0.2. These are special purpose addresses
138     reserved for benchmarking (RFC 5735).
139
140 *   ``--tx-udp=SRC[,DST]``
141
142     Set the source and destination UDP port number for transmit test only test.
143     The default port is the port 9 which is defined for the discard protocol
144     (RFC 863).
145
146 *   ``--pkt-filter-mode=mode``
147
148     Set Flow Director mode where mode is either ``none`` (the default), ``signature`` or ``perfect``.
149     See :ref:`testpmd_flow_director` for more details.
150
151 *   ``--pkt-filter-report-hash=mode``
152
153     Set Flow Director hash match reporting mode where mode is ``none``, ``match`` (the default) or ``always``.
154
155 *   ``--pkt-filter-size=N``
156
157     Set Flow Director allocated memory size, where N is 64K, 128K or 256K.
158     Sizes are in kilobytes. The default is 64.
159
160 *   ``--pkt-filter-flexbytes-offset=N``
161
162     Set the flexbytes offset.
163     The offset is defined in words (not bytes) counted from the first byte of the destination Ethernet MAC address,
164     where N is 0 <= N <= 32.
165     The default value is 0x6.
166
167 *   ``--pkt-filter-drop-queue=N``
168
169     Set the drop-queue.
170     In perfect filter mode, when a rule is added with queue = -1, the packet will be enqueued into the RX drop-queue.
171     If the drop-queue does not exist, the packet is dropped. The default value is N=127.
172
173 *   ``--disable-crc-strip``
174
175     Disable hardware CRC stripping.
176
177 *   ``--enable-lro``
178
179     Enable large receive offload.
180
181 *   ``--enable-rx-cksum``
182
183     Enable hardware RX checksum offload.
184
185 *   ``--enable-scatter``
186
187     Enable scatter (multi-segment) RX.
188
189 *   ``--enable-hw-vlan``
190
191     Enable hardware VLAN.
192
193 *   ``--enable-hw-vlan-filter``
194
195     Enable hardware VLAN filter.
196
197 *   ``--enable-hw-vlan-strip``
198
199     Enable hardware VLAN strip.
200
201 *   ``--enable-hw-vlan-extend``
202
203     Enable hardware VLAN extend.
204
205 *   ``--enable-hw-qinq-strip``
206
207     Enable hardware QINQ strip.
208
209 *   ``--enable-drop-en``
210
211     Enable per-queue packet drop for packets with no descriptors.
212
213 *   ``--disable-rss``
214
215     Disable RSS (Receive Side Scaling).
216
217 *   ``--port-topology=mode``
218
219     Set port topology, where mode is ``paired`` (the default), ``chained`` or ``loop``.
220
221     In ``paired`` mode, the forwarding is between pairs of ports, for example: (0,1), (2,3), (4,5).
222
223     In ``chained`` mode, the forwarding is to the next available port in the port mask, for example: (0,1), (1,2), (2,0).
224
225     The ordering of the ports can be changed using the portlist testpmd runtime function.
226
227     In ``loop`` mode, ingress traffic is simply transmitted back on the same interface.
228
229 *   ``--forward-mode=mode``
230
231     Set the forwarding mode where ``mode`` is one of the following::
232
233        io (the default)
234        mac
235        macswap
236        flowgen
237        rxonly
238        txonly
239        csum
240        icmpecho
241        ieee1588
242        tm
243        noisy
244
245 *   ``--rss-ip``
246
247     Set RSS functions for IPv4/IPv6 only.
248
249 *   ``--rss-udp``
250
251     Set RSS functions for IPv4/IPv6 and UDP.
252
253 *   ``--rxq=N``
254
255     Set the number of RX queues per port to N, where 1 <= N <= 65535.
256     The default value is 1.
257
258 *   ``--rxd=N``
259
260     Set the number of descriptors in the RX rings to N, where N > 0.
261     The default value is 128.
262
263 *   ``--txq=N``
264
265     Set the number of TX queues per port to N, where 1 <= N <= 65535.
266     The default value is 1.
267
268 *   ``--txd=N``
269
270     Set the number of descriptors in the TX rings to N, where N > 0.
271     The default value is 512.
272
273 *   ``--hairpinq=N``
274
275     Set the number of hairpin queues per port to N, where 1 <= N <= 65535.
276     The default value is 0. The number of hairpin queues are added to the
277     number of TX queues and to the number of RX queues. then the first
278     RX hairpin is binded to the first TX hairpin, the second RX hairpin is
279     binded to the second TX hairpin and so on. The index of the first
280     RX hairpin queue is the number of RX queues as configured using --rxq.
281     The index of the first TX hairpin queue is the number of TX queues
282     as configured using --txq.
283
284 *   ``--burst=N``
285
286     Set the number of packets per burst to N, where 1 <= N <= 512.
287     The default value is 32.
288     If set to 0, driver default is used if defined. Else, if driver
289     default is not defined, default of 32 is used.
290
291 *   ``--mbcache=N``
292
293     Set the cache of mbuf memory pools to N, where 0 <= N <= 512.
294     The default value is 16.
295
296 *   ``--rxpt=N``
297
298     Set the prefetch threshold register of RX rings to N, where N >= 0.
299     The default value is 8.
300
301 *   ``--rxht=N``
302
303     Set the host threshold register of RX rings to N, where N >= 0.
304     The default value is 8.
305
306 *   ``--rxfreet=N``
307
308     Set the free threshold of RX descriptors to N, where 0 <= N < value of --rxd.
309     The default value is 0.
310
311 *   ``--rxwt=N``
312
313     Set the write-back threshold register of RX rings to N, where N >= 0.
314     The default value is 4.
315
316 *   ``--txpt=N``
317
318     Set the prefetch threshold register of TX rings to N, where N >= 0.
319     The default value is 36.
320
321 *   ``--txht=N``
322
323     Set the host threshold register of TX rings to N, where N >= 0.
324     The default value is 0.
325
326 *   ``--txwt=N``
327
328     Set the write-back threshold register of TX rings to N, where N >= 0.
329     The default value is 0.
330
331 *   ``--txfreet=N``
332
333     Set the transmit free threshold of TX rings to N, where 0 <= N <= value of ``--txd``.
334     The default value is 0.
335
336 *   ``--txrst=N``
337
338     Set the transmit RS bit threshold of TX rings to N, where 0 <= N <= value of ``--txd``.
339     The default value is 0.
340
341 *   ``--rx-queue-stats-mapping=(port,queue,mapping)[,(port,queue,mapping)]``
342
343     Set the RX queues statistics counters mapping 0 <= mapping <= 15.
344
345 *   ``--tx-queue-stats-mapping=(port,queue,mapping)[,(port,queue,mapping)]``
346
347     Set the TX queues statistics counters mapping 0 <= mapping <= 15.
348
349 *   ``--no-flush-rx``
350
351     Don't flush the RX streams before starting forwarding. Used mainly with the PCAP PMD.
352
353 *   ``--txpkts=X[,Y]``
354
355     Set TX segment sizes or total packet length. Valid for ``tx-only``
356     and ``flowgen`` forwarding modes.
357
358 *   ``--txonly-multi-flow``
359
360     Generate multiple flows in txonly mode.
361
362 *   ``--disable-link-check``
363
364     Disable check on link status when starting/stopping ports.
365
366 *   ``--disable-device-start``
367
368     Do not automatically start all ports. This allows testing
369     configuration of rx and tx queues before device is started
370     for the first time.
371
372 *   ``--no-lsc-interrupt``
373
374     Disable LSC interrupts for all ports, even those supporting it.
375
376 *   ``--no-rmv-interrupt``
377
378     Disable RMV interrupts for all ports, even those supporting it.
379
380 *   ``--bitrate-stats=N``
381
382     Set the logical core N to perform bitrate calculation.
383
384 *   ``--print-event <unknown|intr_lsc|queue_state|intr_reset|vf_mbox|macsec|intr_rmv|dev_probed|dev_released|all>``
385
386     Enable printing the occurrence of the designated event. Using all will
387     enable all of them.
388
389 *   ``--mask-event <unknown|intr_lsc|queue_state|intr_reset|vf_mbox|macsec|intr_rmv|dev_probed|dev_released|all>``
390
391     Disable printing the occurrence of the designated event. Using all will
392     disable all of them.
393
394 *   ``--flow-isolate-all``
395
396     Providing this parameter requests flow API isolated mode on all ports at
397     initialization time. It ensures all traffic is received through the
398     configured flow rules only (see flow command).
399
400     Ports that do not support this mode are automatically discarded.
401
402 *   ``--tx-offloads=0xXXXXXXXX``
403
404     Set the hexadecimal bitmask of TX queue offloads.
405     The default value is 0.
406
407 *   ``--rx-offloads=0xXXXXXXXX``
408
409     Set the hexadecimal bitmask of RX queue offloads.
410     The default value is 0.
411
412 *   ``--hot-plug``
413
414     Enable device event monitor mechanism for hotplug.
415
416 *   ``--vxlan-gpe-port=N``
417
418     Set the UDP port number of tunnel VXLAN-GPE to N.
419     The default value is 4790.
420
421 *   ``--mlockall``
422
423     Enable locking all memory.
424
425 *   ``--no-mlockall``
426
427     Disable locking all memory.
428
429 *   ``--mp-alloc <native|anon|xmem|xmemhuge>``
430
431     Select mempool allocation mode:
432
433     * native: create and populate mempool using native DPDK memory
434     * anon: create mempool using native DPDK memory, but populate using
435       anonymous memory
436     * xmem: create and populate mempool using externally and anonymously
437       allocated area
438     * xmemhuge: create and populate mempool using externally and anonymously
439       allocated hugepage area
440
441 *   ``--noisy-tx-sw-buffer-size``
442
443     Set the number of maximum elements  of the FIFO queue to be created
444     for buffering packets. Only available with the noisy forwarding mode.
445     The default value is 0.
446
447 *   ``--noisy-tx-sw-buffer-flushtime=N``
448
449     Set the time before packets in the FIFO queue is flushed.
450     Only available with the noisy forwarding mode. The default value is 0.
451
452 *   ``--noisy-lkup-memory=N``
453
454     Set the size of the noisy neighbor simulation memory buffer in MB to N.
455     Only available with the noisy forwarding mode. The default value is 0.
456
457
458 *   ``--noisy-lkup-num-reads=N``
459
460     Set the number of reads to be done in noisy neighbor simulation memory buffer to N.
461     Only available with the noisy forwarding mode. The default value is 0.
462
463 *   ``--noisy-lkup-num-writes=N``
464
465     Set the number of writes to be done in noisy neighbor simulation memory buffer to N.
466     Only available with the noisy forwarding mode. The default value is 0.
467
468 *   ``--noisy-lkup-num-reads-writes=N``
469
470     Set the number of r/w accesses to be done in noisy neighbor simulation memory buffer to N.
471     Only available with the noisy forwarding mode. The default value is 0.
472
473 *   ``--no-iova-contig``
474
475     Enable to create mempool which is not IOVA contiguous. Valid only with --mp-alloc=anon.
476     The default value is 0.