xref: /dpdk/doc/guides/testpmd_app_ug/run_app.rst (revision bd89cca3ca34d255e48fa4246998c89bb38301d4)
1ac718398SBernard Iremonger..  BSD LICENSE
2ac718398SBernard Iremonger    Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
3ac718398SBernard Iremonger    All rights reserved.
4ac718398SBernard Iremonger
5ac718398SBernard Iremonger    Redistribution and use in source and binary forms, with or without
6ac718398SBernard Iremonger    modification, are permitted provided that the following conditions
7ac718398SBernard Iremonger    are met:
8ac718398SBernard Iremonger
9ac718398SBernard Iremonger    * Redistributions of source code must retain the above copyright
10ac718398SBernard Iremonger    notice, this list of conditions and the following disclaimer.
11ac718398SBernard Iremonger    * Redistributions in binary form must reproduce the above copyright
12ac718398SBernard Iremonger    notice, this list of conditions and the following disclaimer in
13ac718398SBernard Iremonger    the documentation and/or other materials provided with the
14ac718398SBernard Iremonger    distribution.
15ac718398SBernard Iremonger    * Neither the name of Intel Corporation nor the names of its
16ac718398SBernard Iremonger    contributors may be used to endorse or promote products derived
17ac718398SBernard Iremonger    from this software without specific prior written permission.
18ac718398SBernard Iremonger
19ac718398SBernard Iremonger    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20ac718398SBernard Iremonger    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21ac718398SBernard Iremonger    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22ac718398SBernard Iremonger    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23ac718398SBernard Iremonger    OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24ac718398SBernard Iremonger    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25ac718398SBernard Iremonger    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26ac718398SBernard Iremonger    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27ac718398SBernard Iremonger    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28ac718398SBernard Iremonger    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29ac718398SBernard Iremonger    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30ac718398SBernard Iremonger
31ac718398SBernard IremongerRunning the Application
32ac718398SBernard Iremonger=======================
33ac718398SBernard Iremonger
34ac718398SBernard IremongerEAL Command-line Options
35ac718398SBernard Iremonger------------------------
36ac718398SBernard Iremonger
37ac718398SBernard IremongerThe following are the EAL command-line options that can be used in conjunction with the testpmd,
38*bd89cca3SSiobhan Butleror any other DPDK application.
39*bd89cca3SSiobhan ButlerSee the DPDK Getting Started Guide for more information on these options.
40ac718398SBernard Iremonger
41ac718398SBernard Iremonger*   -c COREMASK
42ac718398SBernard Iremonger
43ac718398SBernard Iremonger    Set the hexadecimal bitmask of the cores to run on.
44ac718398SBernard Iremonger
45ac718398SBernard Iremonger*   -n NUM
46ac718398SBernard Iremonger
47ac718398SBernard Iremonger    Set the number of memory channels to use.
48ac718398SBernard Iremonger
49ac718398SBernard Iremonger*   -b, --pci-blacklist domain:bus:devid.func
50ac718398SBernard Iremonger
51ac718398SBernard Iremonger    Blacklist a PCI devise to prevent EAL from using it. Multiple -b options are allowed.
52ac718398SBernard Iremonger
53ac718398SBernard Iremonger*   -d LIB.so
54ac718398SBernard Iremonger
55ac718398SBernard Iremonger    Load an external driver. Multiple -d options are allowed.
56ac718398SBernard Iremonger
57ac718398SBernard Iremonger*   -w, --pci-whitelist domain:bus:devid:func
58ac718398SBernard Iremonger
59ac718398SBernard Iremonger    Add a PCI device in white list.
60ac718398SBernard Iremonger
61ac718398SBernard Iremonger*   -m MB
62ac718398SBernard Iremonger
63ac718398SBernard Iremonger    Memory to allocate. See also --socket-mem.
64ac718398SBernard Iremonger
65ac718398SBernard Iremonger*   -r NUM
66ac718398SBernard Iremonger
67ac718398SBernard Iremonger    Set the number of memory ranks (auto-detected by default).
68ac718398SBernard Iremonger
69ac718398SBernard Iremonger*   -v
70ac718398SBernard Iremonger
71ac718398SBernard Iremonger    Display the version information on startup.
72ac718398SBernard Iremonger
73ac718398SBernard Iremonger*   --xen-dom0
74ac718398SBernard Iremonger
75ac718398SBernard Iremonger    Support application running on Xen Domain0 without hugetlbfs.
76ac718398SBernard Iremonger
77ac718398SBernard Iremonger*   --syslog
78ac718398SBernard Iremonger
79ac718398SBernard Iremonger    Set the syslog facility.
80ac718398SBernard Iremonger
81ac718398SBernard Iremonger*   --socket-mem
82ac718398SBernard Iremonger
83ac718398SBernard Iremonger    Set the memory to allocate on specific sockets (use comma separated values).
84ac718398SBernard Iremonger
85ac718398SBernard Iremonger*   --huge-dir
86ac718398SBernard Iremonger
87ac718398SBernard Iremonger    Specify the directory where the hugetlbfs is mounted.
88ac718398SBernard Iremonger
89ac718398SBernard Iremonger*   --proc-type
90ac718398SBernard Iremonger
91ac718398SBernard Iremonger    Set the type of the current process.
92ac718398SBernard Iremonger
93ac718398SBernard Iremonger*   --file-prefix
94ac718398SBernard Iremonger
95ac718398SBernard Iremonger    Prefix for hugepage filenames.
96ac718398SBernard Iremonger
97ac718398SBernard Iremonger*   -vmware-tsc-map
98ac718398SBernard Iremonger
99ac718398SBernard Iremonger    Use VMware TSC map instead of native RDTSC.
100ac718398SBernard Iremonger
101ac718398SBernard Iremonger*   --vdev
102ac718398SBernard Iremonger
103ac718398SBernard Iremonger    Add a virtual device, with format "<driver><id>[,key=val, ...]", e.g. --vdev=eth_pcap0,iface=eth2.
104ac718398SBernard Iremonger
105ac718398SBernard Iremonger*   --base-virtaddr
106ac718398SBernard Iremonger
107ac718398SBernard Iremonger    Specify base virtual address.
108ac718398SBernard Iremonger
109ac718398SBernard Iremonger*   --create-uio-dev
110ac718398SBernard Iremonger
111ac718398SBernard Iremonger    Create /dev/uioX (usually done by hotplug).
112ac718398SBernard Iremonger
113ac718398SBernard Iremonger*   --no-shconf
114ac718398SBernard Iremonger
115ac718398SBernard Iremonger    No shared config (mmap'd files).
116ac718398SBernard Iremonger
117ac718398SBernard Iremonger*   --no-pci
118ac718398SBernard Iremonger
119ac718398SBernard Iremonger    Disable pci.
120ac718398SBernard Iremonger
121ac718398SBernard Iremonger*   --no-hpet
122ac718398SBernard Iremonger
123ac718398SBernard Iremonger    Disable hpet.
124ac718398SBernard Iremonger
125ac718398SBernard Iremonger*   --no-huge
126ac718398SBernard Iremonger
127ac718398SBernard Iremonger    Use malloc instead of hugetlbfs.
128ac718398SBernard Iremonger
129ac718398SBernard Iremonger
130ac718398SBernard IremongerTestpmd Command-line Options
131ac718398SBernard Iremonger----------------------------
132ac718398SBernard Iremonger
133ac718398SBernard IremongerThe following are the command-line options for the testpmd applications.
134ac718398SBernard IremongerThey must be separated from the EAL options, shown in the previous section, with a -- separator:
135ac718398SBernard Iremonger
136ac718398SBernard Iremonger.. code-block:: console
137ac718398SBernard Iremonger
138ac718398SBernard Iremonger    sudo ./testpmd -c 0xF -n 4 -- -i --portmask=0x1 --nb-cores=2
139ac718398SBernard Iremonger
140ac718398SBernard Iremonger*   -i, --interactive
141ac718398SBernard Iremonger
142ac718398SBernard Iremonger    Run testpmd in interactive mode.
143ac718398SBernard Iremonger    In this mode, the testpmd starts with a prompt that can be used to start and stop forwarding,
144ac718398SBernard Iremonger    configure the application and display stats on the current packet processing session.
145ac718398SBernard Iremonger    See the Section 5.0, "Test Runtime Functions" section for more details.
146ac718398SBernard Iremonger
147ac718398SBernard Iremonger    In non-interactive mode,
148ac718398SBernard Iremonger    the application starts with the configuration specified on the command-line and
149ac718398SBernard Iremonger    immediately enters forwarding mode.
150ac718398SBernard Iremonger
151ac718398SBernard Iremonger*   -h, --help
152ac718398SBernard Iremonger
153ac718398SBernard Iremonger    Display a help message and quit.
154ac718398SBernard Iremonger
155ac718398SBernard Iremonger*   -a, --auto-start
156ac718398SBernard Iremonger
157ac718398SBernard Iremonger    Start forwarding on init.
158ac718398SBernard Iremonger
159ac718398SBernard Iremonger*   --nb-cores=N
160ac718398SBernard Iremonger
161ac718398SBernard Iremonger    Set the number of forwarding cores,
162ac718398SBernard Iremonger    where 1 <= N <= number of cores or RTE_MAX_LCORE from the configuration file.
163ac718398SBernard Iremonger    The default value is 1.
164ac718398SBernard Iremonger
165ac718398SBernard Iremonger*   --nb-ports=N
166ac718398SBernard Iremonger
167ac718398SBernard Iremonger    Set the number of forwarding ports,
168ac718398SBernard Iremonger    where 1 <= N <= number of ports on the board or RTE_MAX_ETHPORTS from the configuration file.
169ac718398SBernard Iremonger    The default value is the number of ports on the board.
170ac718398SBernard Iremonger
171ac718398SBernard Iremonger*   --coremask=0xXX
172ac718398SBernard Iremonger
173ac718398SBernard Iremonger    Set the hexadecimal bitmask of the cores running the packet forwarding test.
174ac718398SBernard Iremonger    The master lcore is reserved for command line parsing only and cannot be masked on for packet forwarding.
175ac718398SBernard Iremonger
176ac718398SBernard Iremonger*   --portmask=0xXX
177ac718398SBernard Iremonger
178ac718398SBernard Iremonger    Set the hexadecimal bitmask of the ports used by the packet forwarding test.
179ac718398SBernard Iremonger
180ac718398SBernard Iremonger*   --numa
181ac718398SBernard Iremonger
182ac718398SBernard Iremonger    Enable NUMA-aware allocation of RX/TX rings and of RX memory buffers (mbufs).
183ac718398SBernard Iremonger
184ac718398SBernard Iremonger*   --port-numa-config=(port,socket)[,(port,socket)]
185ac718398SBernard Iremonger
186ac718398SBernard Iremonger    Specify the socket on which the memory pool to be used by the port will be allocated.
187ac718398SBernard Iremonger
188ac718398SBernard Iremonger*   --ring-numa-config=(port,flag,socket)[,(port,flag,socket)]
189ac718398SBernard Iremonger
190ac718398SBernard Iremonger    Specify the socket on which the TX/RX rings for the port will be allocated.
191ac718398SBernard Iremonger    Where flag is 1 for RX, 2 for TX, and 3 for RX and TX.
192ac718398SBernard Iremonger
193ac718398SBernard Iremonger*   --socket-num=N
194ac718398SBernard Iremonger
195ac718398SBernard Iremonger    Set the socket from which all memory is allocated in NUMA mode,
196ac718398SBernard Iremonger    where 0 <= N < number of sockets on the board.
197ac718398SBernard Iremonger
198ac718398SBernard Iremonger*   --mbuf-size=N
199ac718398SBernard Iremonger
200ac718398SBernard Iremonger    Set the data size of the mbufs used to N bytes, where N < 65536. The default value is 2048.
201ac718398SBernard Iremonger
202ac718398SBernard Iremonger*   --total-num-mbufs=N
203ac718398SBernard Iremonger
204ac718398SBernard Iremonger    Set the number of mbufs to be allocated in the mbuf pools, where N > 1024.
205ac718398SBernard Iremonger
206ac718398SBernard Iremonger*   --max-pkt-len=N
207ac718398SBernard Iremonger
208ac718398SBernard Iremonger    Set the maximum packet size to N bytes, where N >= 64. The default value is 1518.
209ac718398SBernard Iremonger
210ac718398SBernard Iremonger*   --eth-peers-configfile=name
211ac718398SBernard Iremonger
212ac718398SBernard Iremonger    Use a configuration file containing the Ethernet addresses of the peer ports.
213ac718398SBernard Iremonger    The configuration file should contain the Ethernet addresses on separate lines:
214ac718398SBernard Iremonger
215ac718398SBernard Iremonger    XX:XX:XX:XX:XX:01
216ac718398SBernard Iremonger
217ac718398SBernard Iremonger    XX:XX:XX:XX:XX:02
218ac718398SBernard Iremonger
219ac718398SBernard Iremonger    ...
220ac718398SBernard Iremonger
221ac718398SBernard Iremonger*   --eth-peer=N,XX:XX:XX:XX:XX:XX
222ac718398SBernard Iremonger
223ac718398SBernard Iremonger    Set the MAC address XX:XX:XX:XX:XX:XX of the peer port N,
224ac718398SBernard Iremonger    where 0 <= N < RTE_MAX_ETHPORTS from the configuration file.
225ac718398SBernard Iremonger
226ac718398SBernard Iremonger*   --pkt-filter-mode=mode
227ac718398SBernard Iremonger
228ac718398SBernard Iremonger    Set Flow Director mode where mode is either none (the default), signature or perfect.
229ac718398SBernard Iremonger    See the Section 5.6, "Flow Director Functions" for more detail.
230ac718398SBernard Iremonger
231ac718398SBernard Iremonger*   --pkt-filter-report-hash=mode
232ac718398SBernard Iremonger
233ac718398SBernard Iremonger    Set Flow Director hash match reporting mode where mode is none, match (the default) or always.
234ac718398SBernard Iremonger
235ac718398SBernard Iremonger*   --pkt-filter-size=N
236ac718398SBernard Iremonger
237ac718398SBernard Iremonger    Set Flow Director allocated memory size, where N is 64K, 128K or 256K.
238ac718398SBernard Iremonger    Sizes are in kilobytes. The default is 64.
239ac718398SBernard Iremonger
240ac718398SBernard Iremonger*   --pkt-filter-flexbytes-offset=N
241ac718398SBernard Iremonger
242ac718398SBernard Iremonger    Set the flexbytes offset.
243ac718398SBernard Iremonger    The offset is defined in words (not bytes) counted from the first byte of the destination Ethernet MAC address,
244ac718398SBernard Iremonger    where N is 0 <= N <= 32.
245ac718398SBernard Iremonger    The default value is 0x6.
246ac718398SBernard Iremonger
247ac718398SBernard Iremonger*   --pkt-filter-drop-queue=N
248ac718398SBernard Iremonger
249ac718398SBernard Iremonger    Set the drop-queue.
250ac718398SBernard Iremonger    In perfect filter mode, when a rule is added with queue = -1, the packet will be enqueued into the RX drop-queue.
251ac718398SBernard Iremonger    If the drop-queue does not exist, the packet is dropped. The default value is N=127.
252ac718398SBernard Iremonger
253ac718398SBernard Iremonger*   --crc-strip
254ac718398SBernard Iremonger
255ac718398SBernard Iremonger    Enable hardware CRC stripping.
256ac718398SBernard Iremonger
257ac718398SBernard Iremonger*   --enable-rx-cksum
258ac718398SBernard Iremonger
259ac718398SBernard Iremonger    Enable hardware RX checksum offload.
260ac718398SBernard Iremonger
261ac718398SBernard Iremonger*   --disable-hw-vlan
262ac718398SBernard Iremonger
263ac718398SBernard Iremonger    Disable hardware VLAN.
264ac718398SBernard Iremonger
265ac718398SBernard Iremonger*   --enable-drop-en
266ac718398SBernard Iremonger
267ac718398SBernard Iremonger    Enable per-queue packet drop for packets with no descriptors.
268ac718398SBernard Iremonger
269ac718398SBernard Iremonger*   --disable-rss
270ac718398SBernard Iremonger
271ac718398SBernard Iremonger    Disable RSS (Receive Side Scaling).
272ac718398SBernard Iremonger
273ac718398SBernard Iremonger*   --port-topology=mode
274ac718398SBernard Iremonger
275ac718398SBernard Iremonger    Set port topology, where mode is paired(the default) or chained.
276ac718398SBernard Iremonger    In paired mode, the forwarding is between pairs of ports, for example: (0,1), (2,3), (4,5).
277ac718398SBernard Iremonger    In chained mode, the forwarding is to the next available port in the port mask, for example: (0,1), (1,2), (2,0).
278ac718398SBernard Iremonger    The ordering of the ports can be changed using the portlist testpmd runtime function.
279ac718398SBernard Iremonger
280ac718398SBernard Iremonger*   --forward-mode=N
281ac718398SBernard Iremonger
282ac718398SBernard Iremonger    Set forwarding mode. (N: io|mac|mac_retry|mac_swap|flowgen|rxonly|txonly|csum|icmpecho)
283ac718398SBernard Iremonger
284ac718398SBernard Iremonger*   --rss-ip
285ac718398SBernard Iremonger
286ac718398SBernard Iremonger    Set RSS functions for IPv4/IPv6 only.
287ac718398SBernard Iremonger
288ac718398SBernard Iremonger*   --rss-udp
289ac718398SBernard Iremonger
290ac718398SBernard Iremonger    Set RSS functions for IPv4/IPv6 and UDP.
291ac718398SBernard Iremonger
292ac718398SBernard Iremonger*   --rxq=N
293ac718398SBernard Iremonger
294ac718398SBernard Iremonger    Set the number of RX queues per port to N, where 1 <= N <= 65535.
295ac718398SBernard Iremonger    The default value is 1.
296ac718398SBernard Iremonger
297ac718398SBernard Iremonger*   --rxd=N
298ac718398SBernard Iremonger
299ac718398SBernard Iremonger    Set the number of descriptors in the RX rings to N, where N > 0.
300ac718398SBernard Iremonger    The default value is 128.
301ac718398SBernard Iremonger
302ac718398SBernard Iremonger*   --txq=N
303ac718398SBernard Iremonger
304ac718398SBernard Iremonger    Set the number of TX queues per port to N, where 1 <= N <= 65535.
305ac718398SBernard Iremonger    The default value is 1.
306ac718398SBernard Iremonger
307ac718398SBernard Iremonger*   --txd=N
308ac718398SBernard Iremonger
309ac718398SBernard Iremonger    Set the number of descriptors in the TX rings to N, where N > 0.
310ac718398SBernard Iremonger    The default value is 512.
311ac718398SBernard Iremonger
312ac718398SBernard Iremonger*   --burst=N
313ac718398SBernard Iremonger
314ac718398SBernard Iremonger    Set the number of packets per burst to N, where 1 <= N <= 512.
315ac718398SBernard Iremonger    The default value is 16.
316ac718398SBernard Iremonger
317ac718398SBernard Iremonger*   --mbcache=N
318ac718398SBernard Iremonger
319ac718398SBernard Iremonger    Set the cache of mbuf memory pools to N, where 0 <= N <= 512.
320ac718398SBernard Iremonger    The default value is 16.
321ac718398SBernard Iremonger
322ac718398SBernard Iremonger*   --rxpt=N
323ac718398SBernard Iremonger
324ac718398SBernard Iremonger    Set the prefetch threshold register of RX rings to N, where N >= 0.
325ac718398SBernard Iremonger    The default value is 8.
326ac718398SBernard Iremonger
327ac718398SBernard Iremonger*   --rxht=N
328ac718398SBernard Iremonger
329ac718398SBernard Iremonger    Set the host threshold register of RX rings to N, where N >= 0.
330ac718398SBernard Iremonger    The default value is 8.
331ac718398SBernard Iremonger
332ac718398SBernard Iremonger*   --rxfreet=N
333ac718398SBernard Iremonger
334ac718398SBernard Iremonger    Set the free threshold of RX descriptors to N, where 0 <= N < value of --rxd.
335ac718398SBernard Iremonger    The default value is 0.
336ac718398SBernard Iremonger
337ac718398SBernard Iremonger*   --rxwt=N
338ac718398SBernard Iremonger
339ac718398SBernard Iremonger    Set the write-back threshold register of RX rings to N, where N >= 0.
340ac718398SBernard Iremonger    The default value is 4.
341ac718398SBernard Iremonger
342ac718398SBernard Iremonger*   --txpt=N
343ac718398SBernard Iremonger
344ac718398SBernard Iremonger    Set the prefetch threshold register of TX rings to N, where N >= 0.
345ac718398SBernard Iremonger    The default value is 36.
346ac718398SBernard Iremonger
347ac718398SBernard Iremonger*   --txht=N
348ac718398SBernard Iremonger
349ac718398SBernard Iremonger    Set the host threshold register of TX rings to N, where N >= 0.
350ac718398SBernard Iremonger    The default value is 0.
351ac718398SBernard Iremonger
352ac718398SBernard Iremonger*   --txwt=N
353ac718398SBernard Iremonger
354ac718398SBernard Iremonger    Set the write-back threshold register of TX rings to N, where N >= 0.
355ac718398SBernard Iremonger    The default value is 0.
356ac718398SBernard Iremonger
357ac718398SBernard Iremonger*   --txfreet=N
358ac718398SBernard Iremonger
359ac718398SBernard Iremonger    Set the transmit free threshold of TX rings to N, where 0 <= N <= value of --txd.
360ac718398SBernard Iremonger    The default value is 0.
361ac718398SBernard Iremonger
362ac718398SBernard Iremonger*   --txrst=N
363ac718398SBernard Iremonger
364ac718398SBernard Iremonger    Set the transmit RS bit threshold of TX rings to N, where 0 <= N <= value of --txd.
365ac718398SBernard Iremonger    The default value is 0.
366ac718398SBernard Iremonger
367ac718398SBernard Iremonger*   --txqflags=0xXXXXXXXX
368ac718398SBernard Iremonger
369ac718398SBernard Iremonger    Set the hexadecimal bitmask of TX queue flags, where 0 <= N <= 0x7FFFFFFF.
370ac718398SBernard Iremonger    The default value is 0.
371ac718398SBernard Iremonger
372ac718398SBernard Iremonger*   --rx-queue-stats-mapping=(port,queue,mapping)[,(port,queue,mapping)]
373ac718398SBernard Iremonger
374ac718398SBernard Iremonger    Set the RX queues statistics counters mapping 0 <= mapping <= 15.
375ac718398SBernard Iremonger
376ac718398SBernard Iremonger*   --tx-queue-stats-mapping=(port,queue,mapping)[,(port,queue,mapping)]
377ac718398SBernard Iremonger
378ac718398SBernard Iremonger    Set the TX queues statistics counters mapping 0 <= mapping <= 15.
379ac718398SBernard Iremonger
380ac718398SBernard Iremonger*   --no-flush-rx
381ac718398SBernard Iremonger
382ac718398SBernard Iremonger    Don't flush the RX streams before starting forwarding. Used mainly with PCAP drivers.
383ac718398SBernard Iremonger
384ac718398SBernard Iremonger*   --txpkts=X[,Y]
385ac718398SBernard Iremonger
386ac718398SBernard Iremonger    Set TX segment sizes.
387ac718398SBernard Iremonger
388ac718398SBernard Iremonger*   --disable-link-check
389ac718398SBernard Iremonger
390ac718398SBernard Iremonger    Disable check on link status when starting/stopping ports.
391