xref: /dpdk/doc/guides/testpmd_app_ug/testpmd_funcs.rst (revision 045e35aa3fd6a9f82a6b30be81403a77fe4ee551)
15630257fSFerruh Yigit..  SPDX-License-Identifier: BSD-3-Clause
25630257fSFerruh Yigit    Copyright(c) 2010-2016 Intel Corporation.
3ac718398SBernard Iremonger
4e76d7a76SJohn McNamara.. _testpmd_runtime:
5e76d7a76SJohn McNamara
6ac718398SBernard IremongerTestpmd Runtime Functions
7ac718398SBernard Iremonger=========================
8ac718398SBernard Iremonger
9e76d7a76SJohn McNamaraWhere the testpmd application is started in interactive mode, (``-i|--interactive``),
10ac718398SBernard Iremongerit displays a prompt that can be used to start and stop forwarding,
110e51eb87SMaryam Tahhanconfigure the application, display statistics (including the extended NIC
120e51eb87SMaryam Tahhanstatistics aka xstats) , set the Flow Director and other tasks::
13ac718398SBernard Iremonger
14ac718398SBernard Iremonger   testpmd>
15ac718398SBernard Iremonger
16ac718398SBernard IremongerThe testpmd prompt has some, limited, readline support.
17e76d7a76SJohn McNamaraCommon bash command-line functions such as ``Ctrl+a`` and ``Ctrl+e`` to go to the start and end of the prompt line are supported
18ac718398SBernard Iremongeras well as access to the command history via the up-arrow.
19ac718398SBernard Iremonger
20ac718398SBernard IremongerThere is also support for tab completion.
21e76d7a76SJohn McNamaraIf you type a partial command and hit ``<TAB>`` you get a list of the available completions:
22ac718398SBernard Iremonger
23ac718398SBernard Iremonger.. code-block:: console
24ac718398SBernard Iremonger
25ac718398SBernard Iremonger   testpmd> show port <TAB>
26ac718398SBernard Iremonger
27a2258ea1SHuisong Li       info [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|dcb_tc|cap X
28a2258ea1SHuisong Li       info [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|dcb_tc|cap all
29a2258ea1SHuisong Li       stats [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|dcb_tc|cap X
30a2258ea1SHuisong Li       stats [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|dcb_tc|cap all
31ac718398SBernard Iremonger       ...
32ac718398SBernard Iremonger
33e76d7a76SJohn McNamara
34e76d7a76SJohn McNamara.. note::
35e76d7a76SJohn McNamara
36f43d3dbbSDavid Marchand   Some examples in this document are too long to fit on one line are shown wrapped at `"\\"` for display purposes::
37e76d7a76SJohn McNamara
38e76d7a76SJohn McNamara      testpmd> set flow_ctrl rx (on|off) tx (on|off) (high_water) (low_water) \
39e76d7a76SJohn McNamara               (pause_time) (send_xon) (port_id)
40e76d7a76SJohn McNamara
41e76d7a76SJohn McNamaraIn the real ``testpmd>`` prompt these commands should be on a single line.
42e76d7a76SJohn McNamara
43ac718398SBernard IremongerHelp Functions
44ac718398SBernard Iremonger--------------
45ac718398SBernard Iremonger
46ac718398SBernard IremongerThe testpmd has on-line help for the functions that are available at runtime.
47ac718398SBernard IremongerThese are divided into sections and can be accessed using help, help section or help all:
48ac718398SBernard Iremonger
49ac718398SBernard Iremonger.. code-block:: console
50ac718398SBernard Iremonger
51ac718398SBernard Iremonger   testpmd> help
52592ab76fSDavid Marchand       Help is available for the following sections:
53ac718398SBernard Iremonger
54ac718398SBernard Iremonger           help control                    : Start and stop forwarding.
55ac718398SBernard Iremonger           help display                    : Displaying port, stats and config information.
56ac718398SBernard Iremonger           help config                     : Configuration information.
57ac718398SBernard Iremonger           help ports                      : Configuring ports.
58ac718398SBernard Iremonger           help filters                    : Filters configuration help.
59592ab76fSDavid Marchand           help traffic_management         : Traffic Management commands.
60592ab76fSDavid Marchand           help devices                    : Device related commands.
61592ab76fSDavid Marchand           help drivers                    : Driver specific commands.
62ac718398SBernard Iremonger           help all                        : All of the above sections.
63ac718398SBernard Iremonger
6481ef862bSAllain LegacyCommand File Functions
6581ef862bSAllain Legacy----------------------
6681ef862bSAllain Legacy
6781ef862bSAllain LegacyTo facilitate loading large number of commands or to avoid cutting and pasting where not
6881ef862bSAllain Legacypractical or possible testpmd supports alternative methods for executing commands.
6981ef862bSAllain Legacy
7081ef862bSAllain Legacy* If started with the ``--cmdline-file=FILENAME`` command line argument testpmd
7181ef862bSAllain Legacy  will execute all CLI commands contained within the file immediately before
7281ef862bSAllain Legacy  starting packet forwarding or entering interactive mode.
7381ef862bSAllain Legacy
7481ef862bSAllain Legacy.. code-block:: console
7581ef862bSAllain Legacy
76e2a94f9aSCiara Power   ./dpdk-testpmd -n4 -r2 ... -- -i --cmdline-file=/home/ubuntu/flow-create-commands.txt
7781ef862bSAllain Legacy   Interactive-mode selected
7881ef862bSAllain Legacy   CLI commands to be read from /home/ubuntu/flow-create-commands.txt
7981ef862bSAllain Legacy   Configuring Port 0 (socket 0)
8081ef862bSAllain Legacy   Port 0: 7C:FE:90:CB:74:CE
8181ef862bSAllain Legacy   Configuring Port 1 (socket 0)
8281ef862bSAllain Legacy   Port 1: 7C:FE:90:CB:74:CA
8381ef862bSAllain Legacy   Checking link statuses...
8481ef862bSAllain Legacy   Port 0 Link Up - speed 10000 Mbps - full-duplex
8581ef862bSAllain Legacy   Port 1 Link Up - speed 10000 Mbps - full-duplex
8681ef862bSAllain Legacy   Done
8781ef862bSAllain Legacy   Flow rule #0 created
8881ef862bSAllain Legacy   Flow rule #1 created
8981ef862bSAllain Legacy   ...
9081ef862bSAllain Legacy   ...
9181ef862bSAllain Legacy   Flow rule #498 created
9281ef862bSAllain Legacy   Flow rule #499 created
9381ef862bSAllain Legacy   Read all CLI commands from /home/ubuntu/flow-create-commands.txt
9481ef862bSAllain Legacy   testpmd>
9581ef862bSAllain Legacy
9681ef862bSAllain Legacy
97a8c6a1aeSAllain Legacy* At run-time additional commands can be loaded in bulk by invoking the ``load FILENAME``
98a8c6a1aeSAllain Legacy  command.
99a8c6a1aeSAllain Legacy
100a8c6a1aeSAllain Legacy.. code-block:: console
101a8c6a1aeSAllain Legacy
102a8c6a1aeSAllain Legacy   testpmd> load /home/ubuntu/flow-create-commands.txt
103a8c6a1aeSAllain Legacy   Flow rule #0 created
104a8c6a1aeSAllain Legacy   Flow rule #1 created
105a8c6a1aeSAllain Legacy   ...
106a8c6a1aeSAllain Legacy   ...
107a8c6a1aeSAllain Legacy   Flow rule #498 created
108a8c6a1aeSAllain Legacy   Flow rule #499 created
109a8c6a1aeSAllain Legacy   Read all CLI commands from /home/ubuntu/flow-create-commands.txt
110a8c6a1aeSAllain Legacy   testpmd>
111a8c6a1aeSAllain Legacy
112a8c6a1aeSAllain Legacy
11381ef862bSAllain LegacyIn all cases output from any included command will be displayed as standard output.
11481ef862bSAllain LegacyExecution will continue until the end of the file is reached regardless of
11581ef862bSAllain Legacywhether any errors occur.  The end user must examine the output to determine if
11681ef862bSAllain Legacyany failures occurred.
11781ef862bSAllain Legacy
11881ef862bSAllain Legacy
119ac718398SBernard IremongerControl Functions
120ac718398SBernard Iremonger-----------------
121ac718398SBernard Iremonger
122ac718398SBernard Iremongerstart
123ac718398SBernard Iremonger~~~~~
124ac718398SBernard Iremonger
125e76d7a76SJohn McNamaraStart packet forwarding with current configuration::
126ac718398SBernard Iremonger
127e76d7a76SJohn McNamara   testpmd> start
128ac718398SBernard Iremonger
129ac718398SBernard Iremongerstart tx_first
130ac718398SBernard Iremonger~~~~~~~~~~~~~~
131ac718398SBernard Iremonger
132acbf77a6SZhihong WangStart packet forwarding with current configuration after sending specified number of bursts of packets::
133ac718398SBernard Iremonger
134acbf77a6SZhihong Wang   testpmd> start tx_first (""|burst_num)
135acbf77a6SZhihong Wang
136acbf77a6SZhihong WangThe default burst number is 1 when ``burst_num`` not presented.
137ac718398SBernard Iremonger
138ac718398SBernard Iremongerstop
139ac718398SBernard Iremonger~~~~
140ac718398SBernard Iremonger
141e76d7a76SJohn McNamaraStop packet forwarding, and display accumulated statistics::
142ac718398SBernard Iremonger
143e76d7a76SJohn McNamara   testpmd> stop
144ac718398SBernard Iremonger
145ac718398SBernard Iremongerquit
146ac718398SBernard Iremonger~~~~
147ac718398SBernard Iremonger
148e76d7a76SJohn McNamaraQuit to prompt::
149ac718398SBernard Iremonger
150e76d7a76SJohn McNamara   testpmd> quit
151e76d7a76SJohn McNamara
152ac718398SBernard Iremonger
153ac718398SBernard IremongerDisplay Functions
154ac718398SBernard Iremonger-----------------
155ac718398SBernard Iremonger
156ac718398SBernard IremongerThe functions in the following sections are used to display information about the
157ac718398SBernard Iremongertestpmd configuration or the NIC status.
158ac718398SBernard Iremonger
159ac718398SBernard Iremongershow port
160ac718398SBernard Iremonger~~~~~~~~~
161ac718398SBernard Iremonger
162e76d7a76SJohn McNamaraDisplay information for a given port or all ports::
163ac718398SBernard Iremonger
164a2258ea1SHuisong Li   testpmd> show port (info|summary|stats|xstats|fdir|dcb_tc|cap) (port_id|all)
165ac718398SBernard Iremonger
166ac718398SBernard IremongerThe available information categories are:
167ac718398SBernard Iremonger
168e76d7a76SJohn McNamara* ``info``: General port information such as MAC address.
169ac718398SBernard Iremonger
1704bfcbcf5SEmma Finn* ``summary``: Brief port summary such as Device Name, Driver Name etc.
1714bfcbcf5SEmma Finn
172e76d7a76SJohn McNamara* ``stats``: RX/TX statistics.
173ac718398SBernard Iremonger
1740e51eb87SMaryam Tahhan* ``xstats``: RX/TX extended NIC statistics.
1750e51eb87SMaryam Tahhan
176e76d7a76SJohn McNamara* ``fdir``: Flow Director information and statistics.
177ac718398SBernard Iremonger
178cd80f411SJingjing Wu* ``dcb_tc``: DCB information such as TC mapping.
179cd80f411SJingjing Wu
180ac718398SBernard IremongerFor example:
181ac718398SBernard Iremonger
182ac718398SBernard Iremonger.. code-block:: console
183ac718398SBernard Iremonger
184ac718398SBernard Iremonger   testpmd> show port info 0
185ac718398SBernard Iremonger
186ac718398SBernard Iremonger   ********************* Infos for port 0 *********************
187ac718398SBernard Iremonger
188ac718398SBernard Iremonger   MAC address: XX:XX:XX:XX:XX:XX
189ef7d2866SHelin Zhang   Connect to socket: 0
190ef7d2866SHelin Zhang   memory allocation on the socket: 0
191ac718398SBernard Iremonger   Link status: up
192ef7d2866SHelin Zhang   Link speed: 40000 Mbps
193ac718398SBernard Iremonger   Link duplex: full-duplex
194ac718398SBernard Iremonger   Promiscuous mode: enabled
195ac718398SBernard Iremonger   Allmulticast mode: disabled
196ef7d2866SHelin Zhang   Maximum number of MAC addresses: 64
197ef7d2866SHelin Zhang   Maximum number of MAC addresses of hash filtering: 0
198ac718398SBernard Iremonger   VLAN offload:
1992a0b4198SVivek Sharma       strip on, filter on, extend off, qinq strip off
200ef7d2866SHelin Zhang   Redirection table size: 512
201ef7d2866SHelin Zhang   Supported flow types:
202ef7d2866SHelin Zhang     ipv4-frag
203ef7d2866SHelin Zhang     ipv4-tcp
204ef7d2866SHelin Zhang     ipv4-udp
205ef7d2866SHelin Zhang     ipv4-sctp
206ef7d2866SHelin Zhang     ipv4-other
207ef7d2866SHelin Zhang     ipv6-frag
208ef7d2866SHelin Zhang     ipv6-tcp
209ef7d2866SHelin Zhang     ipv6-udp
210ef7d2866SHelin Zhang     ipv6-sctp
211ef7d2866SHelin Zhang     ipv6-other
212ef7d2866SHelin Zhang     l2_payload
213f56620ddSJerin Jacob     port
214f56620ddSJerin Jacob     vxlan
215f56620ddSJerin Jacob     geneve
216f56620ddSJerin Jacob     nvgre
217389fca75SGavin Li     vxlan-gpe
218ac718398SBernard Iremonger
2196b67721dSDavid Liushow port (module_eeprom|eeprom)
2206b67721dSDavid Liu~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2216b67721dSDavid Liu
2226b67721dSDavid LiuDisplay the EEPROM information of a port::
2236b67721dSDavid Liu
2246b67721dSDavid Liu   testpmd> show port (port_id) (module_eeprom|eeprom)
2256b67721dSDavid Liu
22654780542SJames Hershawset eeprom
22754780542SJames Hershaw~~~~~~~~~~
22854780542SJames Hershaw
22954780542SJames HershawWrite a value to the device EEPROM of a port at a specific offset::
23054780542SJames Hershaw
23154780542SJames Hershaw   testpmd> set port (port_id) eeprom (accept_risk) magic (magic_num) value (value) \
23254780542SJames Hershaw            offset (offset)
23354780542SJames Hershaw
23454780542SJames HershawValue should be given in the form of a hex-as-string, with no leading ``0x``.
23554780542SJames HershawThe offset field here is optional,
23654780542SJames Hershawif not specified then the offset will default to 0.
23754780542SJames Hershaw
23854780542SJames Hershaw.. note::
23954780542SJames Hershaw
24054780542SJames Hershaw   This is a high-risk command
24154780542SJames Hershaw   and its misuse may result in unexpected behaviour from the NIC.
24254780542SJames Hershaw   By inserting "accept_risk" into the command,
24354780542SJames Hershaw   the user is acknowledging and taking responsibility for this risk.
24454780542SJames Hershaw
2456fe5f2f7SPablo de Larashow port rss reta
2466fe5f2f7SPablo de Lara~~~~~~~~~~~~~~~~~~
2476fe5f2f7SPablo de Lara
248e76d7a76SJohn McNamaraDisplay the rss redirection table entry indicated by masks on port X::
2496fe5f2f7SPablo de Lara
250e76d7a76SJohn McNamara   testpmd> show port (port_id) rss reta (size) (mask0, mask1...)
2516fe5f2f7SPablo de Lara
2526fe5f2f7SPablo de Larasize is used to indicate the hardware supported reta size
2536fe5f2f7SPablo de Lara
254ac718398SBernard Iremongershow port rss-hash
255ac718398SBernard Iremonger~~~~~~~~~~~~~~~~~~
256ac718398SBernard Iremonger
25792628e2bSJie HaiDisplay the RSS hash functions and RSS hash key or RSS hash algorithm of a port::
258ac718398SBernard Iremonger
25992628e2bSJie Hai   testpmd> show port (port_id) rss-hash [key | algorithm]
2605e2d17aeSPablo de Lara
2615e2d17aeSPablo de Laraclear port
2625e2d17aeSPablo de Lara~~~~~~~~~~
263ac718398SBernard Iremonger
2649eb97422SWei Hu (Xavier)Clear the port statistics and forward engine statistics for a given port or for all ports::
265ac718398SBernard Iremonger
266a2258ea1SHuisong Li   testpmd> clear port (info|stats|xstats|fdir) (port_id|all)
267ac718398SBernard Iremonger
268e76d7a76SJohn McNamaraFor example::
269ac718398SBernard Iremonger
270ac718398SBernard Iremonger   testpmd> clear port stats all
271ac718398SBernard Iremonger
27257ccb278SKonstantin Ananyevshow (rxq|txq)
27357ccb278SKonstantin Ananyev~~~~~~~~~~~~~~
27457ccb278SKonstantin Ananyev
27557ccb278SKonstantin AnanyevDisplay information for a given port's RX/TX queue::
27657ccb278SKonstantin Ananyev
27757ccb278SKonstantin Ananyev   testpmd> show (rxq|txq) info (port_id) (queue_id)
27857ccb278SKonstantin Ananyev
279fae9aa71SKiran Kumar Kshow desc status(rxq|txq)
280fae9aa71SKiran Kumar K~~~~~~~~~~~~~~~~~~~~~~~~~
281fae9aa71SKiran Kumar K
282fae9aa71SKiran Kumar KDisplay information for a given port's RX/TX descriptor status::
283fae9aa71SKiran Kumar K
284fae9aa71SKiran Kumar K   testpmd> show port (port_id) (rxq|txq) (queue_id) desc (desc_id) status
285fae9aa71SKiran Kumar K
2864d9b46a2SSatha Raoshow desc used count(rxq|txq)
2874d9b46a2SSatha Rao~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2886f04fa45SLance Richardson
2894d9b46a2SSatha RaoDisplay the number of packet descriptors currently used by hardware for a queue::
2906f04fa45SLance Richardson
2914d9b46a2SSatha Rao   testpmd> show port (port_id) (rxq|txq) (queue_id) desc used count
292fae9aa71SKiran Kumar K
293ac718398SBernard Iremongershow config
294ac718398SBernard Iremonger~~~~~~~~~~~
295ac718398SBernard Iremonger
296ac718398SBernard IremongerDisplays the configuration of the application.
297e76d7a76SJohn McNamaraThe configuration comes from the command-line, the runtime or the application defaults::
298ac718398SBernard Iremonger
29952e2e7edSYuan Wang   testpmd> show config (rxtx|cores|fwd|rxoffs|rxpkts|rxhdrs|txpkts|txtimes)
300ac718398SBernard Iremonger
301ac718398SBernard IremongerThe available information categories are:
302ac718398SBernard Iremonger
303e76d7a76SJohn McNamara* ``rxtx``: RX/TX configuration items.
304ac718398SBernard Iremonger
305e76d7a76SJohn McNamara* ``cores``: List of forwarding cores.
306ac718398SBernard Iremonger
307e76d7a76SJohn McNamara* ``fwd``: Packet forwarding configuration.
308ac718398SBernard Iremonger
30991c78e09SViacheslav Ovsiienko* ``rxoffs``: Packet offsets for RX split.
31091c78e09SViacheslav Ovsiienko
31152e2e7edSYuan Wang* ``rxpkts``: Packets to RX length-based split configuration.
31252e2e7edSYuan Wang
31352e2e7edSYuan Wang* ``rxhdrs``: Packets to RX proto-based split configuration.
3140f2096d7SViacheslav Ovsiienko
31579bec05bSKonstantin Ananyev* ``txpkts``: Packets to TX configuration.
31679bec05bSKonstantin Ananyev
3174940344dSViacheslav Ovsiienko* ``txtimes``: Burst time pattern for Tx only mode.
3184940344dSViacheslav Ovsiienko
319ac718398SBernard IremongerFor example:
320ac718398SBernard Iremonger
321ac718398SBernard Iremonger.. code-block:: console
322ac718398SBernard Iremonger
323ac718398SBernard Iremonger   testpmd> show config rxtx
324ac718398SBernard Iremonger
325ac718398SBernard Iremonger   io packet forwarding - CRC stripping disabled - packets/burst=16
326ac718398SBernard Iremonger   nb forwarding cores=2 - nb forwarding ports=1
327ac718398SBernard Iremonger   RX queues=1 - RX desc=128 - RX free threshold=0
328ac718398SBernard Iremonger   RX threshold registers: pthresh=8 hthresh=8 wthresh=4
329ac718398SBernard Iremonger   TX queues=1 - TX desc=512 - TX free threshold=0
330ac718398SBernard Iremonger   TX threshold registers: pthresh=36 hthresh=0 wthresh=0
331ac718398SBernard Iremonger   TX RS bit threshold=0 - TXQ flags=0x0
332ac718398SBernard Iremonger
333e76d7a76SJohn McNamaraset fwd
334e76d7a76SJohn McNamara~~~~~~~
335e76d7a76SJohn McNamara
336e76d7a76SJohn McNamaraSet the packet forwarding mode::
337e76d7a76SJohn McNamara
338bf56fce1SZhihong Wang   testpmd> set fwd (io|mac|macswap|flowgen| \
3395fe42bc6SFeifei Wang                     rxonly|txonly|csum|icmpecho|noisy|5tswap|shared-rxq|recycle_mbufs) (""|retry)
340bf56fce1SZhihong Wang
341bf56fce1SZhihong Wang``retry`` can be specified for forwarding engines except ``rx_only``.
342e76d7a76SJohn McNamara
343e76d7a76SJohn McNamaraThe available information categories are:
344e76d7a76SJohn McNamara
345e76d7a76SJohn McNamara* ``io``: Forwards packets "as-is" in I/O mode.
346e76d7a76SJohn McNamara  This is the fastest possible forwarding operation as it does not access packets data.
347e76d7a76SJohn McNamara  This is the default mode.
348e76d7a76SJohn McNamara
349e76d7a76SJohn McNamara* ``mac``: Changes the source and the destination Ethernet addresses of packets before forwarding them.
350d629b7b5SJohn McNamara  Default application behavior is to set source Ethernet address to that of the transmitting interface, and destination
351a67857e9SMark Kavanagh  address to a dummy value (set during init). The user may specify a target destination Ethernet address via the 'eth-peer' or
352132a08b5SRami Rosen  'eth-peers-configfile' command-line options. It is not currently possible to specify a specific source Ethernet address.
353e76d7a76SJohn McNamara
354e76d7a76SJohn McNamara* ``macswap``: MAC swap forwarding mode.
355e76d7a76SJohn McNamara  Swaps the source and the destination Ethernet addresses of packets before forwarding them.
356e76d7a76SJohn McNamara
357e76d7a76SJohn McNamara* ``flowgen``: Multi-flow generation mode.
358e76d7a76SJohn McNamara  Originates a number of flows (with varying destination IP addresses), and terminate receive traffic.
359e76d7a76SJohn McNamara
360e76d7a76SJohn McNamara* ``rxonly``: Receives packets but doesn't transmit them.
361e76d7a76SJohn McNamara
362e76d7a76SJohn McNamara* ``txonly``: Generates and transmits packets without receiving any.
363e76d7a76SJohn McNamara
364e76d7a76SJohn McNamara* ``csum``: Changes the checksum field with hardware or software methods depending on the offload flags on the packet.
365e76d7a76SJohn McNamara
36610ad83d0SRami Rosen* ``icmpecho``: Receives a burst of packets, lookup for ICMP echo requests and, if any, send back ICMP echo replies.
367e76d7a76SJohn McNamara
368e2a94f9aSCiara Power* ``ieee1588``: Demonstrate L2 IEEE1588 V2 PTP timestamping for RX and TX.
369e76d7a76SJohn McNamara
370d629b7b5SJohn McNamara* ``noisy``: Noisy neighbor simulation.
3713c156061SJens Freimann  Simulate more realistic behavior of a guest machine engaged in receiving
3723c156061SJens Freimann  and sending packets performing Virtual Network Function (VNF).
3733c156061SJens Freimann
3742564abdaSShiri Kuzin* ``5tswap``: Swap the source and destination of L2,L3,L4 if they exist.
3752564abdaSShiri Kuzin
3762564abdaSShiri Kuzin  L2 swaps the source address and destination address of Ethernet, as same as ``macswap``.
3772564abdaSShiri Kuzin
3782564abdaSShiri Kuzin  L3 swaps the source address and destination address of IP (v4 and v6).
3792564abdaSShiri Kuzin
3802564abdaSShiri Kuzin  L4 swaps the source port and destination port of transport layer (TCP and UDP).
3812564abdaSShiri Kuzin
38259840375SXueming Li* ``shared-rxq``: Receive only for shared Rx queue.
38359840375SXueming Li  Resolve packet source port from mbuf and update stream statistics accordingly.
38459840375SXueming Li
3855fe42bc6SFeifei Wang* ``recycle_mbufs``:  Recycle Tx queue used mbufs for Rx queue mbuf ring.
3865fe42bc6SFeifei Wang  This mode uses fast path mbuf recycle feature and forwards packets in I/O mode.
3875fe42bc6SFeifei Wang
388e76d7a76SJohn McNamaraExample::
389e76d7a76SJohn McNamara
390e76d7a76SJohn McNamara   testpmd> set fwd rxonly
391e76d7a76SJohn McNamara
392e76d7a76SJohn McNamara   Set rxonly packet forwarding mode
393e76d7a76SJohn McNamara
394e76d7a76SJohn McNamara
39553324971SDavid Marchandshow fwd
39653324971SDavid Marchand~~~~~~~~
39753324971SDavid Marchand
39853324971SDavid MarchandWhen running, forwarding engines maintain statistics from the time they have been started.
39953324971SDavid MarchandExample for the io forwarding engine, with some packet drops on the tx side::
40053324971SDavid Marchand
40153324971SDavid Marchand   testpmd> show fwd stats all
40253324971SDavid Marchand
40353324971SDavid Marchand     ------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
40453324971SDavid Marchand     RX-packets: 274293770      TX-packets: 274293642      TX-dropped: 128
40553324971SDavid Marchand
40653324971SDavid Marchand     ------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
40753324971SDavid Marchand     RX-packets: 274301850      TX-packets: 274301850      TX-dropped: 0
40853324971SDavid Marchand
40953324971SDavid Marchand     ---------------------- Forward statistics for port 0  ----------------------
41053324971SDavid Marchand     RX-packets: 274293802      RX-dropped: 0             RX-total: 274293802
41153324971SDavid Marchand     TX-packets: 274301862      TX-dropped: 0             TX-total: 274301862
41253324971SDavid Marchand     ----------------------------------------------------------------------------
41353324971SDavid Marchand
41453324971SDavid Marchand     ---------------------- Forward statistics for port 1  ----------------------
41553324971SDavid Marchand     RX-packets: 274301894      RX-dropped: 0             RX-total: 274301894
41653324971SDavid Marchand     TX-packets: 274293706      TX-dropped: 128           TX-total: 274293834
41753324971SDavid Marchand     ----------------------------------------------------------------------------
41853324971SDavid Marchand
41953324971SDavid Marchand     +++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
42053324971SDavid Marchand     RX-packets: 548595696      RX-dropped: 0             RX-total: 548595696
42153324971SDavid Marchand     TX-packets: 548595568      TX-dropped: 128           TX-total: 548595696
42253324971SDavid Marchand     ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
42353324971SDavid Marchand
4246d249887SDharmik Thakkar
42553324971SDavid Marchandclear fwd
42653324971SDavid Marchand~~~~~~~~~
42753324971SDavid Marchand
42853324971SDavid MarchandClear the forwarding engines statistics::
42953324971SDavid Marchand
43053324971SDavid Marchand   testpmd> clear fwd stats all
43153324971SDavid Marchand
432ac718398SBernard Iremongerread rxd
433ac718398SBernard Iremonger~~~~~~~~
434ac718398SBernard Iremonger
435e76d7a76SJohn McNamaraDisplay an RX descriptor for a port RX queue::
436ac718398SBernard Iremonger
437e76d7a76SJohn McNamara   testpmd> read rxd (port_id) (queue_id) (rxd_id)
438ac718398SBernard Iremonger
439e76d7a76SJohn McNamaraFor example::
440ac718398SBernard Iremonger
441ac718398SBernard Iremonger   testpmd> read rxd 0 0 4
442ac718398SBernard Iremonger        0x0000000B - 0x001D0180 / 0x0000000B - 0x001D0180
443ac718398SBernard Iremonger
444ac718398SBernard Iremongerread txd
445ac718398SBernard Iremonger~~~~~~~~
446ac718398SBernard Iremonger
447e76d7a76SJohn McNamaraDisplay a TX descriptor for a port TX queue::
448ac718398SBernard Iremonger
449e76d7a76SJohn McNamara   testpmd> read txd (port_id) (queue_id) (txd_id)
450ac718398SBernard Iremonger
451e76d7a76SJohn McNamaraFor example::
452ac718398SBernard Iremonger
453ac718398SBernard Iremonger   testpmd> read txd 0 0 4
454ac718398SBernard Iremonger        0x00000001 - 0x24C3C440 / 0x000F0000 - 0x2330003C
455ac718398SBernard Iremonger
4568c32c192SQi Zhangshow vf stats
4578c32c192SQi Zhang~~~~~~~~~~~~~
4588c32c192SQi Zhang
4598c32c192SQi ZhangDisplay VF statistics::
4608c32c192SQi Zhang
4618c32c192SQi Zhang   testpmd> show vf stats (port_id) (vf_id)
4628c32c192SQi Zhang
4638c32c192SQi Zhangclear vf stats
4648c32c192SQi Zhang~~~~~~~~~~~~~~
4658c32c192SQi Zhang
4668c32c192SQi ZhangReset VF statistics::
4678c32c192SQi Zhang
4688c32c192SQi Zhang   testpmd> clear vf stats (port_id) (vf_id)
469e76d7a76SJohn McNamara
470c73a9071SWei Daishow rx offloading capabilities
471c73a9071SWei Dai~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
472c73a9071SWei Dai
473c73a9071SWei DaiList all per queue and per port Rx offloading capabilities of a port::
474c73a9071SWei Dai
475c73a9071SWei Dai   testpmd> show port (port_id) rx_offload capabilities
476c73a9071SWei Dai
477c73a9071SWei Daishow rx offloading configuration
478c73a9071SWei Dai~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
479c73a9071SWei Dai
480c73a9071SWei DaiList port level and all queue level Rx offloading configuration::
481c73a9071SWei Dai
482c73a9071SWei Dai   testpmd> show port (port_id) rx_offload configuration
483c73a9071SWei Dai
484c73a9071SWei Daishow tx offloading capabilities
485c73a9071SWei Dai~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
486c73a9071SWei Dai
487c73a9071SWei DaiList all per queue and per port Tx offloading capabilities of a port::
488c73a9071SWei Dai
489c73a9071SWei Dai   testpmd> show port (port_id) tx_offload capabilities
490c73a9071SWei Dai
491c73a9071SWei Daishow tx offloading configuration
492c73a9071SWei Dai~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
493c73a9071SWei Dai
494c73a9071SWei DaiList port level and all queue level Tx offloading configuration::
495c73a9071SWei Dai
496c73a9071SWei Dai   testpmd> show port (port_id) tx_offload configuration
497c73a9071SWei Dai
498c18feafaSDekel Peledshow tx metadata setting
499c18feafaSDekel Peled~~~~~~~~~~~~~~~~~~~~~~~~
500c18feafaSDekel Peled
501c18feafaSDekel PeledShow Tx metadata value set for a specific port::
502c18feafaSDekel Peled
503c18feafaSDekel Peled   testpmd> show port (port_id) tx_metadata
5045a4806d3SKirill Rybalchenko
5059e06e39bSVamsi Attunurushow port supported ptypes
5069e06e39bSVamsi Attunuru~~~~~~~~~~~~~~~~~~~~~~~~~~
5079e06e39bSVamsi Attunuru
5089e06e39bSVamsi AttunuruShow ptypes supported for a specific port::
5099e06e39bSVamsi Attunuru
5109e06e39bSVamsi Attunuru   testpmd> show port (port_id) ptypes
5119e06e39bSVamsi Attunuru
512e48491afSPavan Nikhileshset port supported ptypes
513e48491afSPavan Nikhilesh~~~~~~~~~~~~~~~~~~~~~~~~~
514e48491afSPavan Nikhilesh
515e48491afSPavan Nikhileshset packet types classification for a specific port::
516e48491afSPavan Nikhilesh
517e48491afSPavan Nikhilesh   testpmd> set port (port_id) ptypes_mask (mask)
518e48491afSPavan Nikhilesh
519e1d44d0aSKalesh APshow port mac addresses info
520e1d44d0aSKalesh AP~~~~~~~~~~~~~~~~~~~~~~~~~~~~
521e1d44d0aSKalesh AP
522e1d44d0aSKalesh APShow mac addresses added for a specific port::
523e1d44d0aSKalesh AP
524e1d44d0aSKalesh AP   testpmd> show port (port_id) macs
525e1d44d0aSKalesh AP
526e1d44d0aSKalesh AP
527e1d44d0aSKalesh APshow port multicast mac addresses info
528e1d44d0aSKalesh AP~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
529e1d44d0aSKalesh AP
530e1d44d0aSKalesh APShow multicast mac addresses added for a specific port::
531e1d44d0aSKalesh AP
532e1d44d0aSKalesh AP   testpmd> show port (port_id) mcast_macs
533e1d44d0aSKalesh AP
5342490bb89SIvan Malovshow flow transfer proxy port ID for the given port
5352490bb89SIvan Malov~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5362490bb89SIvan Malov
5372490bb89SIvan MalovShow proxy port ID to use as the 1st argument in commands to
5382490bb89SIvan Malovmanage ``transfer`` flows and their indirect components.
5392490bb89SIvan Malov::
5402490bb89SIvan Malov
5412490bb89SIvan Malov   testpmd> show port (port_id) flow transfer proxy
5422490bb89SIvan Malov
54355e51c96SNithin Dabilpuramshow device info
54455e51c96SNithin Dabilpuram~~~~~~~~~~~~~~~~
54555e51c96SNithin Dabilpuram
54655e51c96SNithin DabilpuramShow general information about devices probed::
54755e51c96SNithin Dabilpuram
54855e51c96SNithin Dabilpuram   testpmd> show device info (<identifier>|all)
54955e51c96SNithin Dabilpuram
55055e51c96SNithin DabilpuramFor example:
55155e51c96SNithin Dabilpuram
55255e51c96SNithin Dabilpuram.. code-block:: console
55355e51c96SNithin Dabilpuram
55455e51c96SNithin Dabilpuram    testpmd> show device info net_pcap0
55555e51c96SNithin Dabilpuram
55655e51c96SNithin Dabilpuram    ********************* Infos for device net_pcap0 *********************
55755e51c96SNithin Dabilpuram    Bus name: vdev
55855e51c96SNithin Dabilpuram    Driver name: net_pcap
55955e51c96SNithin Dabilpuram    Devargs: iface=enP2p6s0,phy_mac=1
56055e51c96SNithin Dabilpuram    Connect to socket: -1
56155e51c96SNithin Dabilpuram
56255e51c96SNithin Dabilpuram            Port id: 2
56355e51c96SNithin Dabilpuram            MAC address: 1E:37:93:28:04:B8
56455e51c96SNithin Dabilpuram            Device name: net_pcap0
56555e51c96SNithin Dabilpuram
566d82ee2ccSAgalya Babu RadhaKrishnandump physmem
567d82ee2ccSAgalya Babu RadhaKrishnan~~~~~~~~~~~~
568d82ee2ccSAgalya Babu RadhaKrishnan
569d82ee2ccSAgalya Babu RadhaKrishnanDumps all physical memory segment layouts::
570d82ee2ccSAgalya Babu RadhaKrishnan
571d82ee2ccSAgalya Babu RadhaKrishnan   testpmd> dump_physmem
572d82ee2ccSAgalya Babu RadhaKrishnan
573d82ee2ccSAgalya Babu RadhaKrishnandump memzone
574d82ee2ccSAgalya Babu RadhaKrishnan~~~~~~~~~~~~
575d82ee2ccSAgalya Babu RadhaKrishnan
576d82ee2ccSAgalya Babu RadhaKrishnanDumps the layout of all memory zones::
577d82ee2ccSAgalya Babu RadhaKrishnan
578d82ee2ccSAgalya Babu RadhaKrishnan   testpmd> dump_memzone
579d82ee2ccSAgalya Babu RadhaKrishnan
5809b1249d9SXueming Lidump socket memory
5819b1249d9SXueming Li~~~~~~~~~~~~~~~~~~
5829b1249d9SXueming Li
5839b1249d9SXueming LiDumps the memory usage of all sockets::
5849b1249d9SXueming Li
5859b1249d9SXueming Li   testpmd> dump_socket_mem
586d82ee2ccSAgalya Babu RadhaKrishnan
587d82ee2ccSAgalya Babu RadhaKrishnandump struct size
588d82ee2ccSAgalya Babu RadhaKrishnan~~~~~~~~~~~~~~~~
589d82ee2ccSAgalya Babu RadhaKrishnan
590d82ee2ccSAgalya Babu RadhaKrishnanDumps the size of all memory structures::
591d82ee2ccSAgalya Babu RadhaKrishnan
592d82ee2ccSAgalya Babu RadhaKrishnan   testpmd> dump_struct_sizes
593d82ee2ccSAgalya Babu RadhaKrishnan
594d82ee2ccSAgalya Babu RadhaKrishnandump ring
595d82ee2ccSAgalya Babu RadhaKrishnan~~~~~~~~~
596d82ee2ccSAgalya Babu RadhaKrishnan
597d82ee2ccSAgalya Babu RadhaKrishnanDumps the status of all or specific element in DPDK rings::
598d82ee2ccSAgalya Babu RadhaKrishnan
599d82ee2ccSAgalya Babu RadhaKrishnan   testpmd> dump_ring [ring_name]
600d82ee2ccSAgalya Babu RadhaKrishnan
601d82ee2ccSAgalya Babu RadhaKrishnandump mempool
602d82ee2ccSAgalya Babu RadhaKrishnan~~~~~~~~~~~~
603d82ee2ccSAgalya Babu RadhaKrishnan
604d82ee2ccSAgalya Babu RadhaKrishnanDumps the statistics of all or specific memory pool::
605d82ee2ccSAgalya Babu RadhaKrishnan
606d82ee2ccSAgalya Babu RadhaKrishnan   testpmd> dump_mempool [mempool_name]
607d82ee2ccSAgalya Babu RadhaKrishnan
608d82ee2ccSAgalya Babu RadhaKrishnandump devargs
609d82ee2ccSAgalya Babu RadhaKrishnan~~~~~~~~~~~~
610d82ee2ccSAgalya Babu RadhaKrishnan
611d82ee2ccSAgalya Babu RadhaKrishnanDumps the user device list::
612d82ee2ccSAgalya Babu RadhaKrishnan
613d82ee2ccSAgalya Babu RadhaKrishnan   testpmd> dump_devargs
614d82ee2ccSAgalya Babu RadhaKrishnan
615bc84182dSRobin Jarrydump lcores
616bc84182dSRobin Jarry~~~~~~~~~~~
617bc84182dSRobin Jarry
618bc84182dSRobin JarryDumps the logical cores list::
619bc84182dSRobin Jarry
620bc84182dSRobin Jarry   testpmd> dump_lcores
621bc84182dSRobin Jarry
62217401008SViacheslav Ovsiienkodump trace
62317401008SViacheslav Ovsiienko~~~~~~~~~~
62417401008SViacheslav Ovsiienko
62517401008SViacheslav OvsiienkoDumps the tracing data to the folder according to the current EAL settings::
62617401008SViacheslav Ovsiienko
62717401008SViacheslav Ovsiienko   testpmd> dump_trace
62817401008SViacheslav Ovsiienko
629d82ee2ccSAgalya Babu RadhaKrishnandump log types
630d82ee2ccSAgalya Babu RadhaKrishnan~~~~~~~~~~~~~~
631d82ee2ccSAgalya Babu RadhaKrishnan
632d82ee2ccSAgalya Babu RadhaKrishnanDumps the log level for all the dpdk modules::
633d82ee2ccSAgalya Babu RadhaKrishnan
634d82ee2ccSAgalya Babu RadhaKrishnan   testpmd> dump_log_types
635d82ee2ccSAgalya Babu RadhaKrishnan
636739e045bSXiaoyu Minshow (raw_encap|raw_decap)
637739e045bSXiaoyu Min~~~~~~~~~~~~~~~~~~~~~~~~~~
638739e045bSXiaoyu Min
639739e045bSXiaoyu MinDisplay content of raw_encap/raw_decap buffers in hex::
640739e045bSXiaoyu Min
641739e045bSXiaoyu Min  testpmd> show <raw_encap|raw_decap> <index>
642739e045bSXiaoyu Min  testpmd> show <raw_encap|raw_decap> all
643739e045bSXiaoyu Min
644739e045bSXiaoyu MinFor example::
645739e045bSXiaoyu Min
646739e045bSXiaoyu Min  testpmd> show raw_encap 6
647739e045bSXiaoyu Min
648739e045bSXiaoyu Min  index: 6 at [0x1c565b0], len=50
649739e045bSXiaoyu Min  00000000: 00 00 00 00 00 00 16 26 36 46 56 66 08 00 45 00 | .......&6FVf..E.
650739e045bSXiaoyu Min  00000010: 00 00 00 00 00 00 00 11 00 00 C0 A8 01 06 C0 A8 | ................
651739e045bSXiaoyu Min  00000020: 03 06 00 00 00 FA 00 00 00 00 08 00 00 00 00 00 | ................
652739e045bSXiaoyu Min  00000030: 06 00                                           | ..
653739e045bSXiaoyu Min
654b19da32eSMin Hu (Connor)show fec capabilities
655b19da32eSMin Hu (Connor)~~~~~~~~~~~~~~~~~~~~~
656b19da32eSMin Hu (Connor)
657b19da32eSMin Hu (Connor)Show fec capabilities of a port::
658b19da32eSMin Hu (Connor)
659b19da32eSMin Hu (Connor)  testpmd> show port (port_id) fec capabilities
660b19da32eSMin Hu (Connor)
661b19da32eSMin Hu (Connor)show fec mode
662b19da32eSMin Hu (Connor)~~~~~~~~~~~~~
663b19da32eSMin Hu (Connor)
664b19da32eSMin Hu (Connor)Show fec mode of a port::
665b19da32eSMin Hu (Connor)
666b19da32eSMin Hu (Connor)  testpmd> show port (port_id) fec_mode
667b19da32eSMin Hu (Connor)
668739e045bSXiaoyu Min
669ac718398SBernard IremongerConfiguration Functions
670ac718398SBernard Iremonger-----------------------
671ac718398SBernard Iremonger
672ac718398SBernard IremongerThe testpmd application can be configured from the runtime as well as from the command-line.
673ac718398SBernard Iremonger
674ac718398SBernard IremongerThis section details the available configuration functions that are available.
675ac718398SBernard Iremonger
676ac718398SBernard Iremonger.. note::
677ac718398SBernard Iremonger
678ac718398SBernard Iremonger   Configuration changes only become active when forwarding is started/restarted.
679ac718398SBernard Iremonger
680ac718398SBernard Iremongerset default
681ac718398SBernard Iremonger~~~~~~~~~~~
682ac718398SBernard Iremonger
683e76d7a76SJohn McNamaraReset forwarding to the default configuration::
684ac718398SBernard Iremonger
685e76d7a76SJohn McNamara   testpmd> set default
686ac718398SBernard Iremonger
687ac718398SBernard Iremongerset verbose
688ac718398SBernard Iremonger~~~~~~~~~~~
689ac718398SBernard Iremonger
690e76d7a76SJohn McNamaraSet the debug verbosity level::
691ac718398SBernard Iremonger
692e76d7a76SJohn McNamara   testpmd> set verbose (level)
693ac718398SBernard Iremonger
694b5b38ed8SRaslan DarawshehAvailable levels are as following:
695b5b38ed8SRaslan Darawsheh
696b5b38ed8SRaslan Darawsheh* ``0`` silent except for error.
697b5b38ed8SRaslan Darawsheh* ``1`` fully verbose except for Tx packets.
698b5b38ed8SRaslan Darawsheh* ``2`` fully verbose except for Rx packets.
699b5b38ed8SRaslan Darawsheh* ``> 2`` fully verbose.
700ac718398SBernard Iremonger
701c7217b9dSElza Mathewset log
702c7217b9dSElza Mathew~~~~~~~
703c7217b9dSElza Mathew
704c7217b9dSElza MathewSet the log level for a log type::
705c7217b9dSElza Mathew
706c7217b9dSElza Mathew	testpmd> set log global|(type) (level)
707c7217b9dSElza Mathew
708c7217b9dSElza MathewWhere:
709c7217b9dSElza Mathew
710c7217b9dSElza Mathew* ``type`` is the log name.
711c7217b9dSElza Mathew
712c7217b9dSElza Mathew* ``level`` is the log level.
713c7217b9dSElza Mathew
714c7217b9dSElza MathewFor example, to change the global log level::
7157fa1a2deSKevin Traynor
716c7217b9dSElza Mathew	testpmd> set log global (level)
717c7217b9dSElza Mathew
718c7217b9dSElza MathewRegexes can also be used for type. To change log level of user1, user2 and user3::
7197fa1a2deSKevin Traynor
720c7217b9dSElza Mathew	testpmd> set log user[1-3] (level)
721c7217b9dSElza Mathew
722ac718398SBernard Iremongerset nbport
723ac718398SBernard Iremonger~~~~~~~~~~
724ac718398SBernard Iremonger
725ac718398SBernard IremongerSet the number of ports used by the application:
726ac718398SBernard Iremonger
727ac718398SBernard Iremongerset nbport (num)
728ac718398SBernard Iremonger
729e76d7a76SJohn McNamaraThis is equivalent to the ``--nb-ports`` command-line option.
730ac718398SBernard Iremonger
731ac718398SBernard Iremongerset nbcore
732ac718398SBernard Iremonger~~~~~~~~~~
733ac718398SBernard Iremonger
734e76d7a76SJohn McNamaraSet the number of cores used by the application::
735ac718398SBernard Iremonger
736e76d7a76SJohn McNamara   testpmd> set nbcore (num)
737ac718398SBernard Iremonger
738e76d7a76SJohn McNamaraThis is equivalent to the ``--nb-cores`` command-line option.
739ac718398SBernard Iremonger
740ac718398SBernard Iremonger.. note::
741ac718398SBernard Iremonger
742ac718398SBernard Iremonger   The number of cores used must not be greater than number of ports used multiplied by the number of queues per port.
743ac718398SBernard Iremonger
744ac718398SBernard Iremongerset coremask
745ac718398SBernard Iremonger~~~~~~~~~~~~
746ac718398SBernard Iremonger
747e76d7a76SJohn McNamaraSet the forwarding cores hexadecimal mask::
748ac718398SBernard Iremonger
749e76d7a76SJohn McNamara   testpmd> set coremask (mask)
750ac718398SBernard Iremonger
751e76d7a76SJohn McNamaraThis is equivalent to the ``--coremask`` command-line option.
752ac718398SBernard Iremonger
753ac718398SBernard Iremonger.. note::
754ac718398SBernard Iremonger
755cb056611SStephen Hemminger   The main lcore is reserved for command line parsing only and cannot be masked on for packet forwarding.
756ac718398SBernard Iremonger
757ac718398SBernard Iremongerset portmask
758ac718398SBernard Iremonger~~~~~~~~~~~~
759ac718398SBernard Iremonger
760e76d7a76SJohn McNamaraSet the forwarding ports hexadecimal mask::
761ac718398SBernard Iremonger
762e76d7a76SJohn McNamara   testpmd> set portmask (mask)
763ac718398SBernard Iremonger
764e76d7a76SJohn McNamaraThis is equivalent to the ``--portmask`` command-line option.
765ac718398SBernard Iremonger
766bc700b67SDharmik Thakkarset record-core-cycles
767bc700b67SDharmik Thakkar~~~~~~~~~~~~~~~~~~~~~~
768bc700b67SDharmik Thakkar
769bc700b67SDharmik ThakkarSet the recording of CPU cycles::
770bc700b67SDharmik Thakkar
771bc700b67SDharmik Thakkar   testpmd> set record-core-cycles (on|off)
772bc700b67SDharmik Thakkar
773bc700b67SDharmik ThakkarWhere:
774bc700b67SDharmik Thakkar
775bc700b67SDharmik Thakkar* ``on`` enables measurement of CPU cycles per packet.
776bc700b67SDharmik Thakkar
777bc700b67SDharmik Thakkar* ``off`` disables measurement of CPU cycles per packet.
778bc700b67SDharmik Thakkar
779bc700b67SDharmik ThakkarThis is equivalent to the ``--record-core-cycles command-line`` option.
780bc700b67SDharmik Thakkar
7810e4b1963SDharmik Thakkarset record-burst-stats
7820e4b1963SDharmik Thakkar~~~~~~~~~~~~~~~~~~~~~~
7830e4b1963SDharmik Thakkar
7840e4b1963SDharmik ThakkarSet the displaying of RX and TX bursts::
7850e4b1963SDharmik Thakkar
7860e4b1963SDharmik Thakkar   testpmd> set record-burst-stats (on|off)
7870e4b1963SDharmik Thakkar
7880e4b1963SDharmik ThakkarWhere:
7890e4b1963SDharmik Thakkar
7900e4b1963SDharmik Thakkar* ``on`` enables display of RX and TX bursts.
7910e4b1963SDharmik Thakkar
7920e4b1963SDharmik Thakkar* ``off`` disables display of RX and TX bursts.
7930e4b1963SDharmik Thakkar
7940e4b1963SDharmik ThakkarThis is equivalent to the ``--record-burst-stats command-line`` option.
7950e4b1963SDharmik Thakkar
796ac718398SBernard Iremongerset burst
797ac718398SBernard Iremonger~~~~~~~~~
798ac718398SBernard Iremonger
799e76d7a76SJohn McNamaraSet number of packets per burst::
800ac718398SBernard Iremonger
801e76d7a76SJohn McNamara   testpmd> set burst (num)
802ac718398SBernard Iremonger
803e76d7a76SJohn McNamaraThis is equivalent to the ``--burst command-line`` option.
804ac718398SBernard Iremonger
805bf56fce1SZhihong WangWhen retry is enabled, the transmit delay time and number of retries can also be set::
806ac718398SBernard Iremonger
807bf56fce1SZhihong Wang   testpmd> set burst tx delay (microseconds) retry (num)
808ac718398SBernard Iremonger
80991c78e09SViacheslav Ovsiienkoset rxoffs
81091c78e09SViacheslav Ovsiienko~~~~~~~~~~
81191c78e09SViacheslav Ovsiienko
81291c78e09SViacheslav OvsiienkoSet the offsets of segments relating to the data buffer beginning on receiving
81391c78e09SViacheslav Ovsiienkoif split feature is engaged. Affects only the queues configured with split
81491c78e09SViacheslav Ovsiienkooffloads (currently BUFFER_SPLIT is supported only).
81591c78e09SViacheslav Ovsiienko
81691c78e09SViacheslav Ovsiienko   testpmd> set rxoffs (x[,y]*)
81791c78e09SViacheslav Ovsiienko
81891c78e09SViacheslav OvsiienkoWhere x[,y]* represents a CSV list of values, without white space. If the list
81991c78e09SViacheslav Ovsiienkoof offsets is shorter than the list of segments the zero offsets will be used
82091c78e09SViacheslav Ovsiienkofor the remaining segments.
82191c78e09SViacheslav Ovsiienko
8220f2096d7SViacheslav Ovsiienkoset rxpkts
8230f2096d7SViacheslav Ovsiienko~~~~~~~~~~
8240f2096d7SViacheslav Ovsiienko
8250f2096d7SViacheslav OvsiienkoSet the length of segments to scatter packets on receiving if split
8260f2096d7SViacheslav Ovsiienkofeature is engaged. Affects only the queues configured with split offloads
8270f2096d7SViacheslav Ovsiienko(currently BUFFER_SPLIT is supported only). Optionally the multiple memory
8280f2096d7SViacheslav Ovsiienkopools can be specified with --mbuf-size command line parameter and the mbufs
8290f2096d7SViacheslav Ovsiienkoto receive will be allocated sequentially from these extra memory pools (the
8300f2096d7SViacheslav Ovsiienkombuf for the first segment is allocated from the first pool, the second one
8310f2096d7SViacheslav Ovsiienkofrom the second pool, and so on, if segment number is greater then pool's the
8320f2096d7SViacheslav Ovsiienkombuf for remaining segments will be allocated from the last valid pool).
8330f2096d7SViacheslav Ovsiienko
8340f2096d7SViacheslav Ovsiienko   testpmd> set rxpkts (x[,y]*)
8350f2096d7SViacheslav Ovsiienko
8360f2096d7SViacheslav OvsiienkoWhere x[,y]* represents a CSV list of values, without white space. Zero value
8370f2096d7SViacheslav Ovsiienkomeans to use the corresponding memory pool data buffer size.
8380f2096d7SViacheslav Ovsiienko
83952e2e7edSYuan Wangset rxhdrs
84052e2e7edSYuan Wang~~~~~~~~~~
84152e2e7edSYuan Wang
84252e2e7edSYuan WangSet the protocol headers of segments to scatter packets on receiving
84352e2e7edSYuan Wangif split feature is engaged.
84452e2e7edSYuan WangAffects only the queues configured with split offloads
84552e2e7edSYuan Wang(currently BUFFER_SPLIT is supported only).
84652e2e7edSYuan Wang
84752e2e7edSYuan Wang   testpmd> set rxhdrs (eth[,ipv4]*)
84852e2e7edSYuan Wang
84952e2e7edSYuan WangWhere eth[,ipv4]* represents a CSV list of values, without white space.
85052e2e7edSYuan WangIf the list of offsets is shorter than the list of segments,
85152e2e7edSYuan Wangzero offsets will be used for the remaining segments.
85252e2e7edSYuan Wang
853ac718398SBernard Iremongerset txpkts
854ac718398SBernard Iremonger~~~~~~~~~~
855ac718398SBernard Iremonger
8562ebacaa7SMaciej CzekajSet the length of each segment of the TX-ONLY packets or length of packet for FLOWGEN mode::
857ac718398SBernard Iremonger
858e76d7a76SJohn McNamara   testpmd> set txpkts (x[,y]*)
859ac718398SBernard Iremonger
860ac718398SBernard IremongerWhere x[,y]* represents a CSV list of values, without white space.
861ac718398SBernard Iremonger
8624940344dSViacheslav Ovsiienkoset txtimes
8634940344dSViacheslav Ovsiienko~~~~~~~~~~~
8644940344dSViacheslav Ovsiienko
8654940344dSViacheslav OvsiienkoConfigure the timing burst pattern for Tx only mode. This command enables
8664940344dSViacheslav Ovsiienkothe packet send scheduling on dynamic timestamp mbuf field and configures
8674940344dSViacheslav Ovsiienkotiming pattern in Tx only mode. In this mode, if scheduling is enabled
8684940344dSViacheslav Ovsiienkoapplication provides timestamps in the packets being sent. It is possible
8694940344dSViacheslav Ovsiienkoto configure delay (in unspecified device clock units) between bursts
8704940344dSViacheslav Ovsiienkoand between the packets within the burst::
8714940344dSViacheslav Ovsiienko
8724940344dSViacheslav Ovsiienko   testpmd> set txtimes (inter),(intra)
8734940344dSViacheslav Ovsiienko
8744940344dSViacheslav Ovsiienkowhere:
8754940344dSViacheslav Ovsiienko
8764940344dSViacheslav Ovsiienko* ``inter``  is the delay between the bursts in the device clock units.
8774940344dSViacheslav Ovsiienko  If ``intra`` is zero, this is the time between the beginnings of the
8784940344dSViacheslav Ovsiienko  first packets in the neighbour bursts, if ``intra`` is not zero,
8794940344dSViacheslav Ovsiienko  ``inter`` specifies the time between the beginning of the first packet
8804940344dSViacheslav Ovsiienko  of the current burst and the beginning of the last packet of the
8814940344dSViacheslav Ovsiienko  previous burst. If ``inter`` parameter is zero the send scheduling
8824940344dSViacheslav Ovsiienko  on timestamps is disabled (default).
8834940344dSViacheslav Ovsiienko
8844940344dSViacheslav Ovsiienko* ``intra`` is the delay between the packets within the burst specified
8854940344dSViacheslav Ovsiienko  in the device clock units. The number of packets in the burst is defined
8864940344dSViacheslav Ovsiienko  by regular burst setting. If ``intra`` parameter is zero no timestamps
8874940344dSViacheslav Ovsiienko  provided in the packets excepting the first one in the burst.
8884940344dSViacheslav Ovsiienko
8894940344dSViacheslav OvsiienkoAs the result the bursts of packet will be transmitted with specific
8904940344dSViacheslav Ovsiienkodelays between the packets within the burst and specific delay between
8914940344dSViacheslav Ovsiienkothe bursts. The rte_eth_read_clock() must be supported by the device(s)
8924940344dSViacheslav Ovsiienkoand is supposed to be engaged to get the current device clock value
8934940344dSViacheslav Ovsiienkoand provide the reference for the timestamps. If there is no supported
8944940344dSViacheslav Ovsiienkorte_eth_read_clock() there will be no send scheduling provided on the port.
8954940344dSViacheslav Ovsiienko
89679bec05bSKonstantin Ananyevset txsplit
89779bec05bSKonstantin Ananyev~~~~~~~~~~~
89879bec05bSKonstantin Ananyev
89979bec05bSKonstantin AnanyevSet the split policy for the TX packets, applicable for TX-ONLY and CSUM forwarding modes::
90079bec05bSKonstantin Ananyev
90179bec05bSKonstantin Ananyev   testpmd> set txsplit (off|on|rand)
90279bec05bSKonstantin Ananyev
90379bec05bSKonstantin AnanyevWhere:
90479bec05bSKonstantin Ananyev
90579bec05bSKonstantin Ananyev* ``off`` disable packet copy & split for CSUM mode.
90679bec05bSKonstantin Ananyev
90779bec05bSKonstantin Ananyev* ``on`` split outgoing packet into multiple segments. Size of each segment
90879bec05bSKonstantin Ananyev  and number of segments per packet is determined by ``set txpkts`` command
90979bec05bSKonstantin Ananyev  (see above).
91079bec05bSKonstantin Ananyev
91179bec05bSKonstantin Ananyev* ``rand`` same as 'on', but number of segments per each packet is a random value between 1 and total number of segments.
91279bec05bSKonstantin Ananyev
913ac718398SBernard Iremongerset corelist
914ac718398SBernard Iremonger~~~~~~~~~~~~
915ac718398SBernard Iremonger
916e76d7a76SJohn McNamaraSet the list of forwarding cores::
917ac718398SBernard Iremonger
918e76d7a76SJohn McNamara   testpmd> set corelist (x[,y]*)
919ac718398SBernard Iremonger
920ac718398SBernard IremongerFor example, to change the forwarding cores:
921ac718398SBernard Iremonger
922ac718398SBernard Iremonger.. code-block:: console
923ac718398SBernard Iremonger
924ac718398SBernard Iremonger   testpmd> set corelist 3,1
925ac718398SBernard Iremonger   testpmd> show config fwd
926ac718398SBernard Iremonger
927ac718398SBernard Iremonger   io packet forwarding - ports=2 - cores=2 - streams=2 - NUMA support disabled
928ac718398SBernard Iremonger   Logical Core 3 (socket 0) forwards packets on 1 streams:
929ac718398SBernard Iremonger   RX P=0/Q=0 (socket 0) -> TX P=1/Q=0 (socket 0) peer=02:00:00:00:00:01
930ac718398SBernard Iremonger   Logical Core 1 (socket 0) forwards packets on 1 streams:
931ac718398SBernard Iremonger   RX P=1/Q=0 (socket 0) -> TX P=0/Q=0 (socket 0) peer=02:00:00:00:00:00
932ac718398SBernard Iremonger
933ac718398SBernard Iremonger.. note::
934ac718398SBernard Iremonger
935ac718398SBernard Iremonger   The cores are used in the same order as specified on the command line.
936ac718398SBernard Iremonger
937ac718398SBernard Iremongerset portlist
938ac718398SBernard Iremonger~~~~~~~~~~~~
939ac718398SBernard Iremonger
940e76d7a76SJohn McNamaraSet the list of forwarding ports::
941ac718398SBernard Iremonger
942e76d7a76SJohn McNamara   testpmd> set portlist (x[,y]*)
943ac718398SBernard Iremonger
944ac718398SBernard IremongerFor example, to change the port forwarding:
945ac718398SBernard Iremonger
946ac718398SBernard Iremonger.. code-block:: console
947ac718398SBernard Iremonger
948ac718398SBernard Iremonger   testpmd> set portlist 0,2,1,3
949ac718398SBernard Iremonger   testpmd> show config fwd
950ac718398SBernard Iremonger
951ac718398SBernard Iremonger   io packet forwarding - ports=4 - cores=1 - streams=4
952ac718398SBernard Iremonger   Logical Core 3 (socket 0) forwards packets on 4 streams:
953ac718398SBernard Iremonger   RX P=0/Q=0 (socket 0) -> TX P=2/Q=0 (socket 0) peer=02:00:00:00:00:01
954ac718398SBernard Iremonger   RX P=2/Q=0 (socket 0) -> TX P=0/Q=0 (socket 0) peer=02:00:00:00:00:00
955ac718398SBernard Iremonger   RX P=1/Q=0 (socket 0) -> TX P=3/Q=0 (socket 0) peer=02:00:00:00:00:03
956ac718398SBernard Iremonger   RX P=3/Q=0 (socket 0) -> TX P=1/Q=0 (socket 0) peer=02:00:00:00:00:02
957ac718398SBernard Iremonger
9584f1ed78eSThomas Monjalonset port setup on
9594f1ed78eSThomas Monjalon~~~~~~~~~~~~~~~~~
9604f1ed78eSThomas Monjalon
9614f1ed78eSThomas MonjalonSelect how to retrieve new ports created after "port attach" command::
9624f1ed78eSThomas Monjalon
9634f1ed78eSThomas Monjalon   testpmd> set port setup on (iterator|event)
9644f1ed78eSThomas Monjalon
9654f1ed78eSThomas MonjalonFor each new port, a setup is done.
9664f1ed78eSThomas MonjalonIt will find the probed ports via RTE_ETH_FOREACH_MATCHING_DEV loop
9674f1ed78eSThomas Monjalonin iterator mode, or via RTE_ETH_EVENT_NEW in event mode.
9684f1ed78eSThomas Monjalon
969425781ffSBernard Iremongerset tx loopback
970425781ffSBernard Iremonger~~~~~~~~~~~~~~~
971425781ffSBernard Iremonger
972425781ffSBernard IremongerEnable/disable tx loopback::
973425781ffSBernard Iremonger
974425781ffSBernard Iremonger   testpmd> set tx loopback (port_id) (on|off)
975425781ffSBernard Iremonger
976425781ffSBernard Iremongerset drop enable
977425781ffSBernard Iremonger~~~~~~~~~~~~~~~
978425781ffSBernard Iremonger
979425781ffSBernard Iremongerset drop enable bit for all queues::
980425781ffSBernard Iremonger
981425781ffSBernard Iremonger   testpmd> set all queues drop (port_id) (on|off)
982425781ffSBernard Iremonger
983425781ffSBernard Iremongerset mac antispoof (for VF)
984425781ffSBernard Iremonger~~~~~~~~~~~~~~~~~~~~~~~~~~
985425781ffSBernard Iremonger
986425781ffSBernard IremongerSet mac antispoof for a VF from the PF::
987425781ffSBernard Iremonger
988425781ffSBernard Iremonger   testpmd> set vf mac antispoof  (port_id) (vf_id) (on|off)
989425781ffSBernard Iremonger
990ac718398SBernard Iremongervlan set stripq
991ac718398SBernard Iremonger~~~~~~~~~~~~~~~
992ac718398SBernard Iremonger
993e76d7a76SJohn McNamaraSet the VLAN strip for a queue on a port::
994ac718398SBernard Iremonger
995e76d7a76SJohn McNamara   testpmd> vlan set stripq (on|off) (port_id,queue_id)
996ac718398SBernard Iremonger
997425781ffSBernard Iremongervlan set stripq (for VF)
998425781ffSBernard Iremonger~~~~~~~~~~~~~~~~~~~~~~~~
999425781ffSBernard Iremonger
1000425781ffSBernard IremongerSet VLAN strip for all queues in a pool for a VF from the PF::
1001425781ffSBernard Iremonger
1002425781ffSBernard Iremonger   testpmd> set vf vlan stripq (port_id) (vf_id) (on|off)
1003425781ffSBernard Iremonger
1004425781ffSBernard Iremongervlan set insert (for VF)
1005425781ffSBernard Iremonger~~~~~~~~~~~~~~~~~~~~~~~~
1006425781ffSBernard Iremonger
1007425781ffSBernard IremongerSet VLAN insert for a VF from the PF::
1008425781ffSBernard Iremonger
1009aaffc740SE. Scott Daniels   testpmd> set vf vlan insert (port_id) (vf_id) (vlan_id)
1010425781ffSBernard Iremonger
1011425781ffSBernard Iremongervlan set antispoof (for VF)
1012425781ffSBernard Iremonger~~~~~~~~~~~~~~~~~~~~~~~~~~~
1013425781ffSBernard Iremonger
1014425781ffSBernard IremongerSet VLAN antispoof for a VF from the PF::
1015425781ffSBernard Iremonger
1016425781ffSBernard Iremonger   testpmd> set vf vlan antispoof (port_id) (vf_id) (on|off)
1017425781ffSBernard Iremonger
10182a0b4198SVivek Sharmavlan set (strip|filter|qinq_strip|extend)
10192a0b4198SVivek Sharma~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10202a0b4198SVivek SharmaSet the VLAN strip/filter/QinQ strip/extend on for a port::
1021ac718398SBernard Iremonger
10222a0b4198SVivek Sharma   testpmd> vlan set (strip|filter|qinq_strip|extend) (on|off) (port_id)
1023ac718398SBernard Iremonger
1024ac718398SBernard Iremongervlan set tpid
1025ac718398SBernard Iremonger~~~~~~~~~~~~~
1026ac718398SBernard Iremonger
102719b16e2fSHelin ZhangSet the inner or outer VLAN TPID for packet filtering on a port::
1028ac718398SBernard Iremonger
102919b16e2fSHelin Zhang   testpmd> vlan set (inner|outer) tpid (value) (port_id)
1030ac718398SBernard Iremonger
1031ac718398SBernard Iremonger.. note::
1032ac718398SBernard Iremonger
1033ac718398SBernard Iremonger   TPID value must be a 16-bit number (value <= 65536).
1034ac718398SBernard Iremonger
1035ac718398SBernard Iremongerrx_vlan add
1036ac718398SBernard Iremonger~~~~~~~~~~~
1037ac718398SBernard Iremonger
1038e76d7a76SJohn McNamaraAdd a VLAN ID, or all identifiers, to the set of VLAN identifiers filtered by port ID::
1039ac718398SBernard Iremonger
1040e76d7a76SJohn McNamara   testpmd> rx_vlan add (vlan_id|all) (port_id)
1041ac718398SBernard Iremonger
1042ac718398SBernard Iremonger.. note::
1043ac718398SBernard Iremonger
1044ac718398SBernard Iremonger   VLAN filter must be set on that port. VLAN ID < 4096.
1045a7dde4ffSMichal Jastrzebski   Depending on the NIC used, number of vlan_ids may be limited to the maximum entries
1046a7dde4ffSMichal Jastrzebski   in VFTA table. This is important if enabling all vlan_ids.
1047ac718398SBernard Iremonger
1048ac718398SBernard Iremongerrx_vlan rm
1049ac718398SBernard Iremonger~~~~~~~~~~
1050ac718398SBernard Iremonger
1051e76d7a76SJohn McNamaraRemove a VLAN ID, or all identifiers, from the set of VLAN identifiers filtered by port ID::
1052ac718398SBernard Iremonger
1053e76d7a76SJohn McNamara   testpmd> rx_vlan rm (vlan_id|all) (port_id)
1054ac718398SBernard Iremonger
1055ac718398SBernard Iremongerrx_vlan add (for VF)
1056e76d7a76SJohn McNamara~~~~~~~~~~~~~~~~~~~~
1057ac718398SBernard Iremonger
1058e76d7a76SJohn McNamaraAdd a VLAN ID, to the set of VLAN identifiers filtered for VF(s) for port ID::
1059ac718398SBernard Iremonger
1060e76d7a76SJohn McNamara   testpmd> rx_vlan add (vlan_id) port (port_id) vf (vf_mask)
1061ac718398SBernard Iremonger
1062ac718398SBernard Iremongerrx_vlan rm (for VF)
1063e76d7a76SJohn McNamara~~~~~~~~~~~~~~~~~~~
1064ac718398SBernard Iremonger
1065e76d7a76SJohn McNamaraRemove a VLAN ID, from the set of VLAN identifiers filtered for VF(s) for port ID::
1066ac718398SBernard Iremonger
1067e76d7a76SJohn McNamara   testpmd> rx_vlan rm (vlan_id) port (port_id) vf (vf_mask)
1068ac718398SBernard Iremonger
10696fe5f2f7SPablo de Lararx_vxlan_port add
10706fe5f2f7SPablo de Lara~~~~~~~~~~~~~~~~~
10716fe5f2f7SPablo de Lara
1072e76d7a76SJohn McNamaraAdd an UDP port for VXLAN packet filter on a port::
10736fe5f2f7SPablo de Lara
1074e76d7a76SJohn McNamara   testpmd> rx_vxlan_port add (udp_port) (port_id)
10756fe5f2f7SPablo de Lara
10766fe5f2f7SPablo de Lararx_vxlan_port remove
10776fe5f2f7SPablo de Lara~~~~~~~~~~~~~~~~~~~~
10786fe5f2f7SPablo de Lara
1079e76d7a76SJohn McNamaraRemove an UDP port for VXLAN packet filter on a port::
10806fe5f2f7SPablo de Lara
1081e76d7a76SJohn McNamara   testpmd> rx_vxlan_port rm (udp_port) (port_id)
10826fe5f2f7SPablo de Lara
1083ac718398SBernard Iremongertx_vlan set
1084ac718398SBernard Iremonger~~~~~~~~~~~
1085ac718398SBernard Iremonger
1086e76d7a76SJohn McNamaraSet hardware insertion of VLAN IDs in packets sent on a port::
1087ac718398SBernard Iremonger
1088e76d7a76SJohn McNamara   testpmd> tx_vlan set (port_id) vlan_id[, vlan_id_outer]
108992ebda07SHelin Zhang
1090e76d7a76SJohn McNamaraFor example, set a single VLAN ID (5) insertion on port 0::
109192ebda07SHelin Zhang
109292ebda07SHelin Zhang   tx_vlan set 0 5
109392ebda07SHelin Zhang
1094e76d7a76SJohn McNamaraOr, set double VLAN ID (inner: 2, outer: 3) insertion on port 1::
109592ebda07SHelin Zhang
109692ebda07SHelin Zhang   tx_vlan set 1 2 3
1097ac718398SBernard Iremonger
1098e76d7a76SJohn McNamara
1099ac718398SBernard Iremongertx_vlan set pvid
1100ac718398SBernard Iremonger~~~~~~~~~~~~~~~~
1101ac718398SBernard Iremonger
1102e76d7a76SJohn McNamaraSet port based hardware insertion of VLAN ID in packets sent on a port::
1103ac718398SBernard Iremonger
1104e76d7a76SJohn McNamara   testpmd> tx_vlan set pvid (port_id) (vlan_id) (on|off)
1105ac718398SBernard Iremonger
1106ac718398SBernard Iremongertx_vlan reset
1107ac718398SBernard Iremonger~~~~~~~~~~~~~
1108ac718398SBernard Iremonger
1109e76d7a76SJohn McNamaraDisable hardware insertion of a VLAN header in packets sent on a port::
1110ac718398SBernard Iremonger
1111e76d7a76SJohn McNamara   testpmd> tx_vlan reset (port_id)
1112ac718398SBernard Iremonger
1113c22f2feeSOlivier Matzcsum set
1114c22f2feeSOlivier Matz~~~~~~~~
1115ac718398SBernard Iremonger
1116186e5586SPablo de LaraSelect hardware or software calculation of the checksum when
1117e76d7a76SJohn McNamaratransmitting a packet using the ``csum`` forwarding engine::
1118ac718398SBernard Iremonger
1119bf5618faSJerin Jacob   testpmd> csum set (ip|udp|tcp|sctp|outer-ip|outer-udp) (hw|sw) (port_id)
1120ac718398SBernard Iremonger
1121e76d7a76SJohn McNamaraWhere:
1122c22f2feeSOlivier Matz
1123e76d7a76SJohn McNamara* ``ip|udp|tcp|sctp`` always relate to  the inner layer.
1124e76d7a76SJohn McNamara
1125e76d7a76SJohn McNamara* ``outer-ip`` relates to the outer IP layer (only for IPv4) in the case where the packet is recognized
1126389fca75SGavin Li  as a tunnel packet by the forwarding engine (geneve, gre, gtp, ipip, vxlan and vxlan-gpe are
1127389fca75SGavin Li  supported). See also the ``csum parse-tunnel`` command.
1128ac718398SBernard Iremonger
1129bf5618faSJerin Jacob* ``outer-udp`` relates to the outer UDP layer in the case where the packet is recognized
1130389fca75SGavin Li  as a tunnel packet by the forwarding engine (geneve, gtp, vxlan and vxlan-gpe are
1131389fca75SGavin Li  supported). See also the ``csum parse-tunnel`` command.
1132bf5618faSJerin Jacob
1133ac718398SBernard Iremonger.. note::
1134ac718398SBernard Iremonger
1135ac718398SBernard Iremonger   Check the NIC Datasheet for hardware limits.
1136ac718398SBernard Iremonger
1137c22f2feeSOlivier Matzcsum parse-tunnel
1138c22f2feeSOlivier Matz~~~~~~~~~~~~~~~~~
1139c22f2feeSOlivier Matz
1140c22f2feeSOlivier MatzDefine how tunneled packets should be handled by the csum forward
1141e76d7a76SJohn McNamaraengine::
1142c22f2feeSOlivier Matz
1143e76d7a76SJohn McNamara   testpmd> csum parse-tunnel (on|off) (tx_port_id)
1144c22f2feeSOlivier Matz
1145c22f2feeSOlivier MatzIf enabled, the csum forward engine will try to recognize supported
1146389fca75SGavin Litunnel headers (geneve, gtp, gre, ipip, vxlan, vxlan-gpe).
1147c22f2feeSOlivier Matz
1148c22f2feeSOlivier MatzIf disabled, treat tunnel packets as non-tunneled packets (a inner
1149c22f2feeSOlivier Matzheader is handled as a packet payload).
1150c22f2feeSOlivier Matz
1151c22f2feeSOlivier Matz.. note::
1152c22f2feeSOlivier Matz
1153e76d7a76SJohn McNamara   The port argument is the TX port like in the ``csum set`` command.
1154c22f2feeSOlivier Matz
1155c22f2feeSOlivier MatzExample:
1156c22f2feeSOlivier Matz
1157e76d7a76SJohn McNamaraConsider a packet in packet like the following::
1158c22f2feeSOlivier Matz
1159e76d7a76SJohn McNamara   eth_out/ipv4_out/udp_out/vxlan/eth_in/ipv4_in/tcp_in
1160c22f2feeSOlivier Matz
1161e76d7a76SJohn McNamara* If parse-tunnel is enabled, the ``ip|udp|tcp|sctp`` parameters of ``csum set``
1162e76d7a76SJohn McNamara  command relate to the inner headers (here ``ipv4_in`` and ``tcp_in``), and the
1163bf5618faSJerin Jacob  ``outer-ip|outer-udp`` parameter relates to the outer headers (here ``ipv4_out`` and ``udp_out``).
1164e76d7a76SJohn McNamara
1165e76d7a76SJohn McNamara* If parse-tunnel is disabled, the ``ip|udp|tcp|sctp`` parameters of ``csum  set``
1166e76d7a76SJohn McNamara   command relate to the outer headers, here ``ipv4_out`` and ``udp_out``.
1167c22f2feeSOlivier Matz
1168c22f2feeSOlivier Matzcsum show
1169c22f2feeSOlivier Matz~~~~~~~~~
11706fe5f2f7SPablo de Lara
1171e76d7a76SJohn McNamaraDisplay tx checksum offload configuration::
11726fe5f2f7SPablo de Lara
1173e76d7a76SJohn McNamara   testpmd> csum show (port_id)
11746fe5f2f7SPablo de Lara
11756fe5f2f7SPablo de Laratso set
11766fe5f2f7SPablo de Lara~~~~~~~
11776fe5f2f7SPablo de Lara
1178e76d7a76SJohn McNamaraEnable TCP Segmentation Offload (TSO) in the ``csum`` forwarding engine::
11796fe5f2f7SPablo de Lara
1180e76d7a76SJohn McNamara   testpmd> tso set (segsize) (port_id)
11816fe5f2f7SPablo de Lara
11826fe5f2f7SPablo de Lara.. note::
1183c22f2feeSOlivier Matz
1184e76d7a76SJohn McNamara   Check the NIC datasheet for hardware limits.
11856fe5f2f7SPablo de Lara
11866fe5f2f7SPablo de Laratso show
11876fe5f2f7SPablo de Lara~~~~~~~~
11886fe5f2f7SPablo de Lara
1189e76d7a76SJohn McNamaraDisplay the status of TCP Segmentation Offload::
11906fe5f2f7SPablo de Lara
1191e76d7a76SJohn McNamara   testpmd> tso show (port_id)
1192ac718398SBernard Iremonger
1193d82ee2ccSAgalya Babu RadhaKrishnantunnel tso set
1194d82ee2ccSAgalya Babu RadhaKrishnan~~~~~~~~~~~~~~
1195d82ee2ccSAgalya Babu RadhaKrishnan
1196d82ee2ccSAgalya Babu RadhaKrishnanSet tso segment size of tunneled packets for a port in csum engine::
1197d82ee2ccSAgalya Babu RadhaKrishnan
1198d82ee2ccSAgalya Babu RadhaKrishnan   testpmd> tunnel_tso set (tso_segsz) (port_id)
1199d82ee2ccSAgalya Babu RadhaKrishnan
1200d82ee2ccSAgalya Babu RadhaKrishnantunnel tso show
1201d82ee2ccSAgalya Babu RadhaKrishnan~~~~~~~~~~~~~~~
1202d82ee2ccSAgalya Babu RadhaKrishnan
1203d82ee2ccSAgalya Babu RadhaKrishnanDisplay the status of tunneled TCP Segmentation Offload for a port::
1204d82ee2ccSAgalya Babu RadhaKrishnan
1205d82ee2ccSAgalya Babu RadhaKrishnan   testpmd> tunnel_tso show (port_id)
1206d82ee2ccSAgalya Babu RadhaKrishnan
1207b7091f1dSJiayu Huset port - gro
1208b7091f1dSJiayu Hu~~~~~~~~~~~~~~
1209b40f8d78SJiayu Hu
1210b40f8d78SJiayu HuEnable or disable GRO in ``csum`` forwarding engine::
1211b40f8d78SJiayu Hu
1212b7091f1dSJiayu Hu   testpmd> set port <port_id> gro on|off
1213b40f8d78SJiayu Hu
1214b40f8d78SJiayu HuIf enabled, the csum forwarding engine will perform GRO on the TCP/IPv4
1215b40f8d78SJiayu Hupackets received from the given port.
1216b40f8d78SJiayu Hu
1217b40f8d78SJiayu HuIf disabled, packets received from the given port won't be performed
1218b40f8d78SJiayu HuGRO. By default, GRO is disabled for all ports.
1219b40f8d78SJiayu Hu
1220b40f8d78SJiayu Hu.. note::
1221b40f8d78SJiayu Hu
1222b40f8d78SJiayu Hu   When enable GRO for a port, TCP/IPv4 packets received from the port
1223b7091f1dSJiayu Hu   will be performed GRO. After GRO, all merged packets have bad
1224b7091f1dSJiayu Hu   checksums, since the GRO library doesn't re-calculate checksums for
1225b7091f1dSJiayu Hu   the merged packets. Therefore, if users want the merged packets to
1226b7091f1dSJiayu Hu   have correct checksums, please select HW IP checksum calculation and
1227b7091f1dSJiayu Hu   HW TCP checksum calculation for the port which the merged packets are
1228b7091f1dSJiayu Hu   transmitted to.
1229b40f8d78SJiayu Hu
1230b7091f1dSJiayu Hushow port - gro
1231b7091f1dSJiayu Hu~~~~~~~~~~~~~~~
1232b40f8d78SJiayu Hu
1233b7091f1dSJiayu HuDisplay GRO configuration for a given port::
1234b40f8d78SJiayu Hu
1235b7091f1dSJiayu Hu   testpmd> show port <port_id> gro
1236b40f8d78SJiayu Hu
1237b7091f1dSJiayu Huset gro flush
1238b7091f1dSJiayu Hu~~~~~~~~~~~~~
1239b40f8d78SJiayu Hu
1240b7091f1dSJiayu HuSet the cycle to flush the GROed packets from reassembly tables::
1241b7091f1dSJiayu Hu
1242b7091f1dSJiayu Hu   testpmd> set gro flush <cycles>
1243b7091f1dSJiayu Hu
1244b7091f1dSJiayu HuWhen enable GRO, the csum forwarding engine performs GRO on received
1245b7091f1dSJiayu Hupackets, and the GROed packets are stored in reassembly tables. Users
1246b7091f1dSJiayu Hucan use this command to determine when the GROed packets are flushed
1247b7091f1dSJiayu Hufrom the reassembly tables.
1248b7091f1dSJiayu Hu
1249b7091f1dSJiayu HuThe ``cycles`` is measured in GRO operation times. The csum forwarding
1250b7091f1dSJiayu Huengine flushes the GROed packets from the tables every ``cycles`` GRO
1251b7091f1dSJiayu Huoperations.
1252b7091f1dSJiayu Hu
1253b7091f1dSJiayu HuBy default, the value of ``cycles`` is 1, which means flush GROed packets
1254b7091f1dSJiayu Hufrom the reassembly tables as soon as one GRO operation finishes. The value
1255b7091f1dSJiayu Huof ``cycles`` should be in the range of 1 to ``GRO_MAX_FLUSH_CYCLES``.
1256b7091f1dSJiayu Hu
1257b7091f1dSJiayu HuPlease note that the large value of ``cycles`` may cause the poor TCP/IP
1258b7091f1dSJiayu Hustack performance. Because the GROed packets are delayed to arrive the
1259b7091f1dSJiayu Hustack, thus causing more duplicated ACKs and TCP retransmissions.
1260b40f8d78SJiayu Hu
126152f38a20SJiayu Huset port - gso
126252f38a20SJiayu Hu~~~~~~~~~~~~~~
126352f38a20SJiayu Hu
126452f38a20SJiayu HuToggle per-port GSO support in ``csum`` forwarding engine::
126552f38a20SJiayu Hu
126652f38a20SJiayu Hu   testpmd> set port <port_id> gso on|off
126752f38a20SJiayu Hu
126852f38a20SJiayu HuIf enabled, the csum forwarding engine will perform GSO on supported IPv4
126952f38a20SJiayu Hupackets, transmitted on the given port.
127052f38a20SJiayu Hu
127152f38a20SJiayu HuIf disabled, packets transmitted on the given port will not undergo GSO.
127252f38a20SJiayu HuBy default, GSO is disabled for all ports.
127352f38a20SJiayu Hu
127452f38a20SJiayu Hu.. note::
127552f38a20SJiayu Hu
127652f38a20SJiayu Hu   When GSO is enabled on a port, supported IPv4 packets transmitted on that
127752f38a20SJiayu Hu   port undergo GSO. Afterwards, the segmented packets are represented by
127852f38a20SJiayu Hu   multi-segment mbufs; however, the csum forwarding engine doesn't calculation
127952f38a20SJiayu Hu   of checksums for GSO'd segments in SW. As a result, if users want correct
128052f38a20SJiayu Hu   checksums in GSO segments, they should enable HW checksum calculation for
128152f38a20SJiayu Hu   GSO-enabled ports.
128252f38a20SJiayu Hu
128352f38a20SJiayu Hu   For example, HW checksum calculation for VxLAN GSO'd packets may be enabled
128452f38a20SJiayu Hu   by setting the following options in the csum forwarding engine:
128552f38a20SJiayu Hu
128652f38a20SJiayu Hu   testpmd> csum set outer_ip hw <port_id>
128752f38a20SJiayu Hu
128852f38a20SJiayu Hu   testpmd> csum set ip hw <port_id>
128952f38a20SJiayu Hu
129052f38a20SJiayu Hu   testpmd> csum set tcp hw <port_id>
129152f38a20SJiayu Hu
1292250c9eb3SJiayu Hu   UDP GSO is the same as IP fragmentation, which treats the UDP header
1293250c9eb3SJiayu Hu   as the payload and does not modify it during segmentation. That is,
1294250c9eb3SJiayu Hu   after UDP GSO, only the first output fragment has the original UDP
1295250c9eb3SJiayu Hu   header. Therefore, users need to enable HW IP checksum calculation
1296250c9eb3SJiayu Hu   and SW UDP checksum calculation for GSO-enabled ports, if they want
1297250c9eb3SJiayu Hu   correct checksums for UDP/IPv4 packets.
1298250c9eb3SJiayu Hu
129952f38a20SJiayu Huset gso segsz
130052f38a20SJiayu Hu~~~~~~~~~~~~~
130152f38a20SJiayu Hu
130252f38a20SJiayu HuSet the maximum GSO segment size (measured in bytes), which includes the
130352f38a20SJiayu Hupacket header and the packet payload for GSO-enabled ports (global)::
130452f38a20SJiayu Hu
130552f38a20SJiayu Hu   testpmd> set gso segsz <length>
130652f38a20SJiayu Hu
130752f38a20SJiayu Hushow port - gso
130852f38a20SJiayu Hu~~~~~~~~~~~~~~~
130952f38a20SJiayu Hu
131052f38a20SJiayu HuDisplay the status of Generic Segmentation Offload for a given port::
131152f38a20SJiayu Hu
131252f38a20SJiayu Hu   testpmd> show port <port_id> gso
131352f38a20SJiayu Hu
1314ac718398SBernard Iremongermac_addr add
1315ac718398SBernard Iremonger~~~~~~~~~~~~
1316ac718398SBernard Iremonger
1317e76d7a76SJohn McNamaraAdd an alternative MAC address to a port::
1318ac718398SBernard Iremonger
1319e76d7a76SJohn McNamara   testpmd> mac_addr add (port_id) (XX:XX:XX:XX:XX:XX)
1320ac718398SBernard Iremonger
1321ac718398SBernard Iremongermac_addr remove
1322ac718398SBernard Iremonger~~~~~~~~~~~~~~~
1323ac718398SBernard Iremonger
1324e76d7a76SJohn McNamaraRemove a MAC address from a port::
1325ac718398SBernard Iremonger
1326e76d7a76SJohn McNamara   testpmd> mac_addr remove (port_id) (XX:XX:XX:XX:XX:XX)
1327ac718398SBernard Iremonger
1328d82ee2ccSAgalya Babu RadhaKrishnanmcast_addr add
1329d82ee2ccSAgalya Babu RadhaKrishnan~~~~~~~~~~~~~~
1330d82ee2ccSAgalya Babu RadhaKrishnan
1331d82ee2ccSAgalya Babu RadhaKrishnanTo add the multicast MAC address to/from the set of multicast addresses
1332d82ee2ccSAgalya Babu RadhaKrishnanfiltered by port::
1333d82ee2ccSAgalya Babu RadhaKrishnan
1334d82ee2ccSAgalya Babu RadhaKrishnan   testpmd> mcast_addr add (port_id) (mcast_addr)
1335d82ee2ccSAgalya Babu RadhaKrishnan
1336d82ee2ccSAgalya Babu RadhaKrishnanmcast_addr remove
1337d82ee2ccSAgalya Babu RadhaKrishnan~~~~~~~~~~~~~~~~~
1338d82ee2ccSAgalya Babu RadhaKrishnan
1339d82ee2ccSAgalya Babu RadhaKrishnanTo remove the multicast MAC address to/from the set of multicast addresses
1340d82ee2ccSAgalya Babu RadhaKrishnanfiltered by port::
1341d82ee2ccSAgalya Babu RadhaKrishnan
1342d82ee2ccSAgalya Babu RadhaKrishnan   testpmd> mcast_addr remove (port_id) (mcast_addr)
1343d82ee2ccSAgalya Babu RadhaKrishnan
1344ef8bd7d0SDengdui Huangmcast_addr flush
1345ef8bd7d0SDengdui Huang~~~~~~~~~~~~~~~~
1346ef8bd7d0SDengdui Huang
1347ef8bd7d0SDengdui HuangFlush all multicast MAC addresses on port_id::
1348ef8bd7d0SDengdui Huang
1349ef8bd7d0SDengdui Huang   testpmd> mcast_addr flush (port_id)
1350ef8bd7d0SDengdui Huang
1351ac718398SBernard Iremongermac_addr add (for VF)
1352425781ffSBernard Iremonger~~~~~~~~~~~~~~~~~~~~~
1353ac718398SBernard Iremonger
1354e76d7a76SJohn McNamaraAdd an alternative MAC address for a VF to a port::
1355ac718398SBernard Iremonger
1356e76d7a76SJohn McNamara   testpmd> mac_add add port (port_id) vf (vf_id) (XX:XX:XX:XX:XX:XX)
1357ac718398SBernard Iremonger
13585852bf6aSPascal Mazonmac_addr set
13595852bf6aSPascal Mazon~~~~~~~~~~~~
13605852bf6aSPascal Mazon
13615852bf6aSPascal MazonSet the default MAC address for a port::
13625852bf6aSPascal Mazon
13635852bf6aSPascal Mazon   testpmd> mac_addr set (port_id) (XX:XX:XX:XX:XX:XX)
13645852bf6aSPascal Mazon
1365425781ffSBernard Iremongermac_addr set (for VF)
1366425781ffSBernard Iremonger~~~~~~~~~~~~~~~~~~~~~
1367425781ffSBernard Iremonger
1368425781ffSBernard IremongerSet the MAC address for a VF from the PF::
1369425781ffSBernard Iremonger
1370425781ffSBernard Iremonger   testpmd> set vf mac addr (port_id) (vf_id) (XX:XX:XX:XX:XX:XX)
1371425781ffSBernard Iremonger
1372aac6f11fSWisam Jaddoset eth-peer
1373aac6f11fSWisam Jaddo~~~~~~~~~~~~
1374aac6f11fSWisam Jaddo
1375aac6f11fSWisam JaddoSet the forwarding peer address for certain port::
1376aac6f11fSWisam Jaddo
13773caef7e1SRami Rosen   testpmd> set eth-peer (port_id) (peer_addr)
1378aac6f11fSWisam Jaddo
1379aac6f11fSWisam JaddoThis is equivalent to the ``--eth-peer`` command-line option.
1380aac6f11fSWisam Jaddo
1381ac718398SBernard Iremongerset port-uta
1382ac718398SBernard Iremonger~~~~~~~~~~~~
1383ac718398SBernard Iremonger
1384e76d7a76SJohn McNamaraSet the unicast hash filter(s) on/off for a port::
1385ac718398SBernard Iremonger
1386e76d7a76SJohn McNamara   testpmd> set port (port_id) uta (XX:XX:XX:XX:XX:XX|all) (on|off)
1387ac718398SBernard Iremonger
1388ac718398SBernard Iremongerset promisc
1389ac718398SBernard Iremonger~~~~~~~~~~~
1390ac718398SBernard Iremonger
1391ac718398SBernard IremongerSet the promiscuous mode on for a port or for all ports.
1392e76d7a76SJohn McNamaraIn promiscuous mode packets are not dropped if they aren't for the specified MAC address::
1393ac718398SBernard Iremonger
1394e76d7a76SJohn McNamara   testpmd> set promisc (port_id|all) (on|off)
1395ac718398SBernard Iremonger
1396ac718398SBernard Iremongerset allmulti
1397ac718398SBernard Iremonger~~~~~~~~~~~~
1398ac718398SBernard Iremonger
1399e76d7a76SJohn McNamaraSet the allmulti mode for a port or for all ports::
1400ac718398SBernard Iremonger
1401e76d7a76SJohn McNamara   testpmd> set allmulti (port_id|all) (on|off)
1402ac718398SBernard Iremonger
1403ac718398SBernard IremongerSame as the ifconfig (8) option. Controls how multicast packets are handled.
1404ac718398SBernard Iremonger
1405ac718398SBernard Iremongerset flow_ctrl rx
1406ac718398SBernard Iremonger~~~~~~~~~~~~~~~~
1407ac718398SBernard Iremonger
1408e76d7a76SJohn McNamaraSet the link flow control parameter on a port::
1409ac718398SBernard Iremonger
1410e76d7a76SJohn McNamara   testpmd> set flow_ctrl rx (on|off) tx (on|off) (high_water) (low_water) \
1411e76d7a76SJohn McNamara            (pause_time) (send_xon) mac_ctrl_frame_fwd (on|off) \
1412e76d7a76SJohn McNamara	    autoneg (on|off) (port_id)
1413ac718398SBernard Iremonger
1414ac718398SBernard IremongerWhere:
1415ac718398SBernard Iremonger
1416e76d7a76SJohn McNamara* ``high_water`` (integer): High threshold value to trigger XOFF.
1417ac718398SBernard Iremonger
1418e76d7a76SJohn McNamara* ``low_water`` (integer): Low threshold value to trigger XON.
1419ac718398SBernard Iremonger
1420e76d7a76SJohn McNamara* ``pause_time`` (integer): Pause quota in the Pause frame.
1421ac718398SBernard Iremonger
1422e76d7a76SJohn McNamara* ``send_xon`` (0/1): Send XON frame.
1423ac718398SBernard Iremonger
1424e76d7a76SJohn McNamara* ``mac_ctrl_frame_fwd``: Enable receiving MAC control frames.
1425e76d7a76SJohn McNamara
14260e2db9d3SRami Rosen* ``autoneg``: Change the auto-negotiation parameter.
1427ac718398SBernard Iremonger
1428f4367c0bSHuisong Lishow flow control
1429f4367c0bSHuisong Li~~~~~~~~~~~~~~~~~
1430f4367c0bSHuisong Li
1431f4367c0bSHuisong Lishow the link flow control parameter on a port::
1432f4367c0bSHuisong Li
1433f4367c0bSHuisong Li   testpmd> show port <port_id> flow_ctrl
1434f4367c0bSHuisong Li
1435ac718398SBernard Iremongerset pfc_ctrl rx
1436ac718398SBernard Iremonger~~~~~~~~~~~~~~~
1437ac718398SBernard Iremonger
1438e76d7a76SJohn McNamaraSet the priority flow control parameter on a port::
1439ac718398SBernard Iremonger
1440e76d7a76SJohn McNamara   testpmd> set pfc_ctrl rx (on|off) tx (on|off) (high_water) (low_water) \
1441e76d7a76SJohn McNamara            (pause_time) (priority) (port_id)
1442ac718398SBernard Iremonger
1443ac718398SBernard IremongerWhere:
1444ac718398SBernard Iremonger
1445e76d7a76SJohn McNamara* ``high_water`` (integer): High threshold value.
1446e76d7a76SJohn McNamara
1447e76d7a76SJohn McNamara* ``low_water`` (integer): Low threshold value.
1448e76d7a76SJohn McNamara
1449e76d7a76SJohn McNamara* ``pause_time`` (integer): Pause quota in the Pause frame.
1450e76d7a76SJohn McNamara
1451e76d7a76SJohn McNamara* ``priority`` (0-7): VLAN User Priority.
1452ac718398SBernard Iremonger
1453a5e579f4SSunil Kumar Koriset pfc_queue_ctrl
1454a5e579f4SSunil Kumar Kori~~~~~~~~~~~~~~~~~~
1455a5e579f4SSunil Kumar Kori
1456a5e579f4SSunil Kumar KoriSet the priority flow control parameter on a given Rx and Tx queue of a port::
1457a5e579f4SSunil Kumar Kori
1458a5e579f4SSunil Kumar Kori   testpmd> set pfc_queue_ctrl <port_id> rx (on|off) <tx_qid> <tx_tc> \
1459a5e579f4SSunil Kumar Kori            tx (on|off) <rx_qid> <rx_tc> <pause_time>
1460a5e579f4SSunil Kumar Kori
1461a5e579f4SSunil Kumar KoriWhere:
1462a5e579f4SSunil Kumar Kori
1463a5e579f4SSunil Kumar Kori* ``tx_qid`` (integer): Tx qid for which ``tx_tc`` will be applied and traffic
1464a5e579f4SSunil Kumar Kori  will be paused when PFC frame is received with ``tx_tc`` enabled.
1465a5e579f4SSunil Kumar Kori
1466a5e579f4SSunil Kumar Kori* ``tx_tc`` (0-15): TC for which traffic is to be paused for xmit.
1467a5e579f4SSunil Kumar Kori
1468a5e579f4SSunil Kumar Kori* ``rx_qid`` (integer): Rx qid for which threshold will be applied and PFC
1469a5e579f4SSunil Kumar Kori  frame will be generated with ``tx_tc`` when exceeds the threshold.
1470a5e579f4SSunil Kumar Kori
1471a5e579f4SSunil Kumar Kori* ``rx_tc`` (0-15): TC filled in PFC frame for which remote Tx is to be paused.
1472a5e579f4SSunil Kumar Kori
1473a5e579f4SSunil Kumar Kori* ``pause_time`` (integer): Pause quanta filled in the PFC frame for which
1474a5e579f4SSunil Kumar Kori  interval, remote Tx will be paused. Valid only if Tx pause is on.
1475a5e579f4SSunil Kumar Kori
1476bc70e559SSpike DuSet Rx queue available descriptors threshold
1477bc70e559SSpike Du~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1478bc70e559SSpike Du
1479bc70e559SSpike DuSet available descriptors threshold for a specific Rx queue of port::
1480bc70e559SSpike Du
1481bc70e559SSpike Du  testpmd> set port (port_id) rxq (queue_id) avail_thresh (0..99)
1482bc70e559SSpike Du
1483bc70e559SSpike DuUse 0 value to disable the threshold and corresponding event.
1484bc70e559SSpike Du
1485ac718398SBernard Iremongerset stat_qmap
1486ac718398SBernard Iremonger~~~~~~~~~~~~~
1487ac718398SBernard Iremonger
1488e76d7a76SJohn McNamaraSet statistics mapping (qmapping 0..15) for RX/TX queue on port::
1489ac718398SBernard Iremonger
1490e76d7a76SJohn McNamara   testpmd> set stat_qmap (tx|rx) (port_id) (queue_id) (qmapping)
1491ac718398SBernard Iremonger
1492e76d7a76SJohn McNamaraFor example, to set rx queue 2 on port 0 to mapping 5::
1493ac718398SBernard Iremonger
1494ac718398SBernard Iremonger   testpmd>set stat_qmap rx 0 2 5
1495ac718398SBernard Iremonger
1496a4fd5eeeSElza Mathewset xstats-hide-zero
1497a4fd5eeeSElza Mathew~~~~~~~~~~~~~~~~~~~~
1498a4fd5eeeSElza Mathew
1499a4fd5eeeSElza MathewSet the option to hide zero values for xstats display::
1500a4fd5eeeSElza Mathew
1501a4fd5eeeSElza Mathew	testpmd> set xstats-hide-zero on|off
1502a4fd5eeeSElza Mathew
1503a4fd5eeeSElza Mathew.. note::
1504a4fd5eeeSElza Mathew
1505a4fd5eeeSElza Mathew	By default, the zero values are displayed for xstats.
1506a4fd5eeeSElza Mathew
1507ac718398SBernard Iremongerset port - rx/tx (for VF)
1508e76d7a76SJohn McNamara~~~~~~~~~~~~~~~~~~~~~~~~~
1509ac718398SBernard Iremonger
1510e76d7a76SJohn McNamaraSet VF receive/transmit from a port::
1511ac718398SBernard Iremonger
1512e76d7a76SJohn McNamara   testpmd> set port (port_id) vf (vf_id) (rx|tx) (on|off)
1513ac718398SBernard Iremonger
1514ac718398SBernard Iremongerset port - rx mode(for VF)
1515ac718398SBernard Iremonger~~~~~~~~~~~~~~~~~~~~~~~~~~
1516ac718398SBernard Iremonger
1517e76d7a76SJohn McNamaraSet the VF receive mode of a port::
1518ac718398SBernard Iremonger
1519e76d7a76SJohn McNamara   testpmd> set port (port_id) vf (vf_id) \
1520e76d7a76SJohn McNamara            rxmode (AUPE|ROPE|BAM|MPE) (on|off)
1521ac718398SBernard Iremonger
1522ac718398SBernard IremongerThe available receive modes are:
1523ac718398SBernard Iremonger
1524e76d7a76SJohn McNamara* ``AUPE``: Accepts untagged VLAN.
1525ac718398SBernard Iremonger
1526e76d7a76SJohn McNamara* ``ROPE``: Accepts unicast hash.
1527ac718398SBernard Iremonger
1528e76d7a76SJohn McNamara* ``BAM``: Accepts broadcast packets.
1529ac718398SBernard Iremonger
1530e76d7a76SJohn McNamara* ``MPE``: Accepts all multicast packets.
1531ac718398SBernard Iremonger
1532aa49f366SPablo de Laraset port - tx_rate (for Queue)
1533aa49f366SPablo de Lara~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1534aa49f366SPablo de Lara
1535e76d7a76SJohn McNamaraSet TX rate limitation for a queue on a port::
1536aa49f366SPablo de Lara
1537e76d7a76SJohn McNamara   testpmd> set port (port_id) queue (queue_id) rate (rate_value)
1538aa49f366SPablo de Lara
1539aa49f366SPablo de Laraset port - tx_rate (for VF)
1540aa49f366SPablo de Lara~~~~~~~~~~~~~~~~~~~~~~~~~~~
1541aa49f366SPablo de Lara
1542e76d7a76SJohn McNamaraSet TX rate limitation for queues in VF on a port::
1543aa49f366SPablo de Lara
1544e76d7a76SJohn McNamara   testpmd> set port (port_id) vf (vf_id) rate (rate_value) queue_mask (queue_mask)
1545aa49f366SPablo de Lara
1546ac718398SBernard Iremongerset flush_rx
1547ac718398SBernard Iremonger~~~~~~~~~~~~
1548ac718398SBernard Iremonger
1549e76d7a76SJohn McNamaraSet the flush on RX streams before forwarding.
1550e76d7a76SJohn McNamaraThe default is flush ``on``.
1551e76d7a76SJohn McNamaraMainly used with PCAP drivers to turn off the default behavior of flushing the first 512 packets on RX streams::
1552ac718398SBernard Iremonger
1553e76d7a76SJohn McNamara   testpmd> set flush_rx off
1554ac718398SBernard Iremonger
1555ac718398SBernard Iremongerset link up
1556ac718398SBernard Iremonger~~~~~~~~~~~
1557ac718398SBernard Iremonger
1558e76d7a76SJohn McNamaraSet link up for a port::
1559ac718398SBernard Iremonger
1560e76d7a76SJohn McNamara   testpmd> set link-up port (port id)
1561ac718398SBernard Iremonger
1562ac718398SBernard Iremongerset link down
1563ac718398SBernard Iremonger~~~~~~~~~~~~~
1564ac718398SBernard Iremonger
1565e76d7a76SJohn McNamaraSet link down for a port::
1566ac718398SBernard Iremonger
1567e76d7a76SJohn McNamara   testpmd> set link-down port (port id)
1568e76d7a76SJohn McNamara
15690eec728eSWenzhuo LuE-tag set
15700eec728eSWenzhuo Lu~~~~~~~~~
15710eec728eSWenzhuo Lu
15720eec728eSWenzhuo LuEnable E-tag insertion for a VF on a port::
15730eec728eSWenzhuo Lu
15740eec728eSWenzhuo Lu   testpmd> E-tag set insertion on port-tag-id (value) port (port_id) vf (vf_id)
15750eec728eSWenzhuo Lu
15760eec728eSWenzhuo LuDisable E-tag insertion for a VF on a port::
15770eec728eSWenzhuo Lu
15780eec728eSWenzhuo Lu   testpmd> E-tag set insertion off port (port_id) vf (vf_id)
15790eec728eSWenzhuo Lu
15800eec728eSWenzhuo LuEnable/disable E-tag stripping on a port::
15810eec728eSWenzhuo Lu
15820eec728eSWenzhuo Lu   testpmd> E-tag set stripping (on|off) port (port_id)
15830eec728eSWenzhuo Lu
15840eec728eSWenzhuo LuEnable/disable E-tag based forwarding on a port::
15850eec728eSWenzhuo Lu
15860eec728eSWenzhuo Lu   testpmd> E-tag set forwarding (on|off) port (port_id)
15870eec728eSWenzhuo Lu
1588c73a9071SWei Daiconfig per port Rx offloading
1589c73a9071SWei Dai~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1590c73a9071SWei Dai
15916280fe56SDengdui HuangEnable or disable port Rx offloading on all Rx queues of a port::
1592c73a9071SWei Dai
15936280fe56SDengdui Huang   testpmd> port config (port_id|all) rx_offload (offloading) on|off
1594c73a9071SWei Dai
1595c73a9071SWei Dai* ``offloading``: can be any of these offloading capability:
15968f6c2a12SChengwen Feng                  all, vlan_strip, ipv4_cksum, udp_cksum, tcp_cksum, tcp_lro,
1597c73a9071SWei Dai                  qinq_strip, outer_ipv4_cksum, macsec_strip,
1598020dbb4cSChengwen Feng                  vlan_filter, vlan_extend, scatter, timestamp, security,
1599020dbb4cSChengwen Feng                  keep_crc, rss_hash
1600c73a9071SWei Dai
1601c73a9071SWei DaiThis command should be run when the port is stopped, or else it will fail.
1602c73a9071SWei Dai
1603c73a9071SWei Daiconfig per queue Rx offloading
1604c73a9071SWei Dai~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1605c73a9071SWei Dai
1606c73a9071SWei DaiEnable or disable a per queue Rx offloading only on a specific Rx queue::
1607c73a9071SWei Dai
1608c73a9071SWei Dai   testpmd> port (port_id) rxq (queue_id) rx_offload (offloading) on|off
1609c73a9071SWei Dai
1610c73a9071SWei Dai* ``offloading``: can be any of these offloading capability:
16118f6c2a12SChengwen Feng                  all, vlan_strip, ipv4_cksum, udp_cksum, tcp_cksum, tcp_lro,
1612c73a9071SWei Dai                  qinq_strip, outer_ipv4_cksum, macsec_strip,
1613020dbb4cSChengwen Feng                  vlan_filter, vlan_extend, scatter, timestamp, security,
1614020dbb4cSChengwen Feng                  keep_crc
1615c73a9071SWei Dai
1616c73a9071SWei DaiThis command should be run when the port is stopped, or else it will fail.
1617c73a9071SWei Dai
1618c73a9071SWei Daiconfig per port Tx offloading
1619c73a9071SWei Dai~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1620c73a9071SWei Dai
16216280fe56SDengdui HuangEnable or disable port Tx offloading on all Tx queues of a port::
1622c73a9071SWei Dai
16236280fe56SDengdui Huang   testpmd> port config (port_id|all) tx_offload (offloading) on|off
1624c73a9071SWei Dai
1625c73a9071SWei Dai* ``offloading``: can be any of these offloading capability:
16268f6c2a12SChengwen Feng                  all, vlan_insert, ipv4_cksum, udp_cksum, tcp_cksum,
1627c73a9071SWei Dai                  sctp_cksum, tcp_tso, udp_tso, outer_ipv4_cksum,
1628c73a9071SWei Dai                  qinq_insert, vxlan_tnl_tso, gre_tnl_tso,
1629c73a9071SWei Dai                  ipip_tnl_tso, geneve_tnl_tso, macsec_insert,
1630d56ec3dcSDekel Peled                  mt_lockfree, multi_segs, mbuf_fast_free, security
1631c73a9071SWei Dai
1632c73a9071SWei DaiThis command should be run when the port is stopped, or else it will fail.
1633c73a9071SWei Dai
1634c73a9071SWei Daiconfig per queue Tx offloading
1635c73a9071SWei Dai~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1636c73a9071SWei Dai
1637c73a9071SWei DaiEnable or disable a per queue Tx offloading only on a specific Tx queue::
1638c73a9071SWei Dai
1639c73a9071SWei Dai   testpmd> port (port_id) txq (queue_id) tx_offload (offloading) on|off
1640c73a9071SWei Dai
1641c73a9071SWei Dai* ``offloading``: can be any of these offloading capability:
16428f6c2a12SChengwen Feng                  all, vlan_insert, ipv4_cksum, udp_cksum, tcp_cksum,
1643c73a9071SWei Dai                  sctp_cksum, tcp_tso, udp_tso, outer_ipv4_cksum,
1644c73a9071SWei Dai                  qinq_insert, vxlan_tnl_tso, gre_tnl_tso,
1645c73a9071SWei Dai                  ipip_tnl_tso, geneve_tnl_tso, macsec_insert,
1646e3386f9aSWei Dai                  mt_lockfree, multi_segs, mbuf_fast_free, security
1647c73a9071SWei Dai
1648c73a9071SWei DaiThis command should be run when the port is stopped, or else it will fail.
1649c73a9071SWei Dai
165006ea5479SJiawei Wangconfig per queue Tx affinity mapping
165106ea5479SJiawei Wang~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
165206ea5479SJiawei Wang
165306ea5479SJiawei WangMap a Tx queue with an aggregated port of the DPDK port (specified with port_id)::
165406ea5479SJiawei Wang
165506ea5479SJiawei Wang   testpmd> port (port_id) txq (queue_id) affinity (value)
165606ea5479SJiawei Wang
165706ea5479SJiawei Wang* ``affinity``: the number of the aggregated port.
165806ea5479SJiawei Wang                When multiple ports are aggregated into a single one,
165906ea5479SJiawei Wang                it allows to choose which port to use for Tx via a queue.
166006ea5479SJiawei Wang
166106ea5479SJiawei WangThis command should be run when the port is stopped, otherwise it fails.
166206ea5479SJiawei Wang
166306ea5479SJiawei Wang
16641960be7dSNelio LaranjeiroConfig VXLAN Encap outer layers
16651960be7dSNelio Laranjeiro~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16661960be7dSNelio Laranjeiro
16671960be7dSNelio LaranjeiroConfigure the outer layer to encapsulate a packet inside a VXLAN tunnel::
16681960be7dSNelio Laranjeiro
16691960be7dSNelio Laranjeiro set vxlan ip-version (ipv4|ipv6) vni (vni) udp-src (udp-src) \
16701960be7dSNelio Laranjeiro udp-dst (udp-dst) ip-src (ip-src) ip-dst (ip-dst) eth-src (eth-src) \
16711960be7dSNelio Laranjeiro eth-dst (eth-dst)
16721960be7dSNelio Laranjeiro
16731960be7dSNelio Laranjeiro set vxlan-with-vlan ip-version (ipv4|ipv6) vni (vni) udp-src (udp-src) \
16741960be7dSNelio Laranjeiro udp-dst (udp-dst) ip-src (ip-src) ip-dst (ip-dst) vlan-tci (vlan-tci) \
16751960be7dSNelio Laranjeiro eth-src (eth-src) eth-dst (eth-dst)
16761960be7dSNelio Laranjeiro
167762e8a5a8SViacheslav Ovsiienko set vxlan-tos-ttl ip-version (ipv4|ipv6) vni (vni) udp-src (udp-src) \
167862e8a5a8SViacheslav Ovsiienko udp-dst (udp-dst) ip-tos (ip-tos) ip-ttl (ip-ttl) ip-src (ip-src) \
167962e8a5a8SViacheslav Ovsiienko ip-dst (ip-dst) eth-src (eth-src) eth-dst (eth-dst)
168062e8a5a8SViacheslav Ovsiienko
1681205d9d3cSDekel PeledThese commands will set an internal configuration inside testpmd, any following
16821960be7dSNelio Laranjeiroflow rule using the action vxlan_encap will use the last configuration set.
16831960be7dSNelio LaranjeiroTo have a different encapsulation header, one of those commands must be called
16841960be7dSNelio Laranjeirobefore the flow rule creation.
1685c73a9071SWei Dai
1686dcd962fcSNelio LaranjeiroConfig NVGRE Encap outer layers
1687dcd962fcSNelio Laranjeiro~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1688dcd962fcSNelio Laranjeiro
1689dcd962fcSNelio LaranjeiroConfigure the outer layer to encapsulate a packet inside a NVGRE tunnel::
1690dcd962fcSNelio Laranjeiro
1691dcd962fcSNelio Laranjeiro set nvgre ip-version (ipv4|ipv6) tni (tni) ip-src (ip-src) ip-dst (ip-dst) \
1692dcd962fcSNelio Laranjeiro        eth-src (eth-src) eth-dst (eth-dst)
1693dcd962fcSNelio Laranjeiro set nvgre-with-vlan ip-version (ipv4|ipv6) tni (tni) ip-src (ip-src) \
1694dcd962fcSNelio Laranjeiro        ip-dst (ip-dst) vlan-tci (vlan-tci) eth-src (eth-src) eth-dst (eth-dst)
1695dcd962fcSNelio Laranjeiro
1696205d9d3cSDekel PeledThese commands will set an internal configuration inside testpmd, any following
1697dcd962fcSNelio Laranjeiroflow rule using the action nvgre_encap will use the last configuration set.
1698dcd962fcSNelio LaranjeiroTo have a different encapsulation header, one of those commands must be called
1699dcd962fcSNelio Laranjeirobefore the flow rule creation.
1700dcd962fcSNelio Laranjeiro
1701a1191d39SOri KamConfig L2 Encap
1702a1191d39SOri Kam~~~~~~~~~~~~~~~
1703a1191d39SOri Kam
1704a1191d39SOri KamConfigure the l2 to be used when encapsulating a packet with L2::
1705a1191d39SOri Kam
1706a1191d39SOri Kam set l2_encap ip-version (ipv4|ipv6) eth-src (eth-src) eth-dst (eth-dst)
1707a1191d39SOri Kam set l2_encap-with-vlan ip-version (ipv4|ipv6) vlan-tci (vlan-tci) \
1708a1191d39SOri Kam        eth-src (eth-src) eth-dst (eth-dst)
1709a1191d39SOri Kam
1710a1191d39SOri KamThose commands will set an internal configuration inside testpmd, any following
1711a1191d39SOri Kamflow rule using the action l2_encap will use the last configuration set.
1712a1191d39SOri KamTo have a different encapsulation header, one of those commands must be called
1713a1191d39SOri Kambefore the flow rule creation.
1714a1191d39SOri Kam
1715a1191d39SOri KamConfig L2 Decap
1716a1191d39SOri Kam~~~~~~~~~~~~~~~
1717a1191d39SOri Kam
1718a1191d39SOri KamConfigure the l2 to be removed when decapsulating a packet with L2::
1719a1191d39SOri Kam
1720a1191d39SOri Kam set l2_decap ip-version (ipv4|ipv6)
1721a1191d39SOri Kam set l2_decap-with-vlan ip-version (ipv4|ipv6)
1722a1191d39SOri Kam
1723a1191d39SOri KamThose commands will set an internal configuration inside testpmd, any following
1724a1191d39SOri Kamflow rule using the action l2_decap will use the last configuration set.
1725a1191d39SOri KamTo have a different encapsulation header, one of those commands must be called
1726a1191d39SOri Kambefore the flow rule creation.
1727a1191d39SOri Kam
17283e77031bSOri KamConfig MPLSoGRE Encap outer layers
17293e77031bSOri Kam~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17303e77031bSOri Kam
17313e77031bSOri KamConfigure the outer layer to encapsulate a packet inside a MPLSoGRE tunnel::
17323e77031bSOri Kam
17333e77031bSOri Kam set mplsogre_encap ip-version (ipv4|ipv6) label (label) \
17343e77031bSOri Kam        ip-src (ip-src) ip-dst (ip-dst) eth-src (eth-src) eth-dst (eth-dst)
17353e77031bSOri Kam set mplsogre_encap-with-vlan ip-version (ipv4|ipv6) label (label) \
17363e77031bSOri Kam        ip-src (ip-src) ip-dst (ip-dst) vlan-tci (vlan-tci) \
17373e77031bSOri Kam        eth-src (eth-src) eth-dst (eth-dst)
17383e77031bSOri Kam
1739205d9d3cSDekel PeledThese commands will set an internal configuration inside testpmd, any following
17403e77031bSOri Kamflow rule using the action mplsogre_encap will use the last configuration set.
17413e77031bSOri KamTo have a different encapsulation header, one of those commands must be called
17423e77031bSOri Kambefore the flow rule creation.
17433e77031bSOri Kam
17443e77031bSOri KamConfig MPLSoGRE Decap outer layers
17453e77031bSOri Kam~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17463e77031bSOri Kam
17473e77031bSOri KamConfigure the outer layer to decapsulate MPLSoGRE packet::
17483e77031bSOri Kam
17493e77031bSOri Kam set mplsogre_decap ip-version (ipv4|ipv6)
17503e77031bSOri Kam set mplsogre_decap-with-vlan ip-version (ipv4|ipv6)
17513e77031bSOri Kam
1752205d9d3cSDekel PeledThese commands will set an internal configuration inside testpmd, any following
17533e77031bSOri Kamflow rule using the action mplsogre_decap will use the last configuration set.
17543e77031bSOri KamTo have a different decapsulation header, one of those commands must be called
17553e77031bSOri Kambefore the flow rule creation.
17563e77031bSOri Kam
1757a1191d39SOri KamConfig MPLSoUDP Encap outer layers
1758a1191d39SOri Kam~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1759a1191d39SOri Kam
1760a1191d39SOri KamConfigure the outer layer to encapsulate a packet inside a MPLSoUDP tunnel::
1761a1191d39SOri Kam
1762a1191d39SOri Kam set mplsoudp_encap ip-version (ipv4|ipv6) label (label) udp-src (udp-src) \
1763a1191d39SOri Kam        udp-dst (udp-dst) ip-src (ip-src) ip-dst (ip-dst) \
1764a1191d39SOri Kam        eth-src (eth-src) eth-dst (eth-dst)
1765a1191d39SOri Kam set mplsoudp_encap-with-vlan ip-version (ipv4|ipv6) label (label) \
1766a1191d39SOri Kam        udp-src (udp-src) udp-dst (udp-dst) ip-src (ip-src) ip-dst (ip-dst) \
1767a1191d39SOri Kam        vlan-tci (vlan-tci) eth-src (eth-src) eth-dst (eth-dst)
1768a1191d39SOri Kam
1769205d9d3cSDekel PeledThese commands will set an internal configuration inside testpmd, any following
1770a1191d39SOri Kamflow rule using the action mplsoudp_encap will use the last configuration set.
1771a1191d39SOri KamTo have a different encapsulation header, one of those commands must be called
1772a1191d39SOri Kambefore the flow rule creation.
1773a1191d39SOri Kam
1774a1191d39SOri KamConfig MPLSoUDP Decap outer layers
1775a1191d39SOri Kam~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1776a1191d39SOri Kam
1777a1191d39SOri KamConfigure the outer layer to decapsulate MPLSoUDP packet::
1778a1191d39SOri Kam
1779a1191d39SOri Kam set mplsoudp_decap ip-version (ipv4|ipv6)
1780a1191d39SOri Kam set mplsoudp_decap-with-vlan ip-version (ipv4|ipv6)
1781a1191d39SOri Kam
1782205d9d3cSDekel PeledThese commands will set an internal configuration inside testpmd, any following
1783a1191d39SOri Kamflow rule using the action mplsoudp_decap will use the last configuration set.
1784a1191d39SOri KamTo have a different decapsulation header, one of those commands must be called
1785a1191d39SOri Kambefore the flow rule creation.
1786a1191d39SOri Kam
178730626defSXiaoyu MinConfig Raw Encapsulation
178830626defSXiaoyu Min~~~~~~~~~~~~~~~~~~~~~~~~~
178930626defSXiaoyu Min
179030626defSXiaoyu MinConfigure the raw data to be used when encapsulating a packet by
179130626defSXiaoyu Minrte_flow_action_raw_encap::
179230626defSXiaoyu Min
1793739e045bSXiaoyu Min set raw_encap {index} {item} [/ {item} [...]] / end_set
1794739e045bSXiaoyu Min
1795739e045bSXiaoyu MinThere are multiple global buffers for ``raw_encap``, this command will set one
1796739e045bSXiaoyu Mininternal buffer index by ``{index}``.
1797739e045bSXiaoyu MinIf there is no ``{index}`` specified::
1798739e045bSXiaoyu Min
179930626defSXiaoyu Min set raw_encap {item} [/ {item} [...]] / end_set
180030626defSXiaoyu Min
1801739e045bSXiaoyu Minthe default index ``0`` is used.
1802739e045bSXiaoyu MinIn order to use different encapsulating header, ``index`` must be specified
1803739e045bSXiaoyu Minduring the flow rule creation::
1804739e045bSXiaoyu Min
1805739e045bSXiaoyu Min testpmd> flow create 0 egress pattern eth / ipv4 / end actions
1806739e045bSXiaoyu Min        raw_encap index 2 / end
1807739e045bSXiaoyu Min
1808739e045bSXiaoyu MinOtherwise the default index ``0`` is used.
180930626defSXiaoyu Min
181030626defSXiaoyu MinConfig Raw Decapsulation
181130626defSXiaoyu Min~~~~~~~~~~~~~~~~~~~~~~~~
181230626defSXiaoyu Min
181330626defSXiaoyu MinConfigure the raw data to be used when decapsulating a packet by
181430626defSXiaoyu Minrte_flow_action_raw_decap::
181530626defSXiaoyu Min
1816739e045bSXiaoyu Min set raw_decap {index} {item} [/ {item} [...]] / end_set
1817739e045bSXiaoyu Min
1818739e045bSXiaoyu MinThere are multiple global buffers for ``raw_decap``, this command will set
1819739e045bSXiaoyu Minone internal buffer index by ``{index}``.
1820739e045bSXiaoyu MinIf there is no ``{index}`` specified::
1821739e045bSXiaoyu Min
182230626defSXiaoyu Min set raw_decap {item} [/ {item} [...]] / end_set
182330626defSXiaoyu Min
1824739e045bSXiaoyu Minthe default index ``0`` is used.
1825739e045bSXiaoyu MinIn order to use different decapsulating header, ``index`` must be specified
1826739e045bSXiaoyu Minduring the flow rule creation::
1827739e045bSXiaoyu Min
1828739e045bSXiaoyu Min testpmd> flow create 0 egress pattern eth / ipv4 / end actions
1829739e045bSXiaoyu Min          raw_encap index 3 / end
1830739e045bSXiaoyu Min
1831739e045bSXiaoyu MinOtherwise the default index ``0`` is used.
183230626defSXiaoyu Min
1833b19da32eSMin Hu (Connor)Set fec mode
1834b19da32eSMin Hu (Connor)~~~~~~~~~~~~
1835b19da32eSMin Hu (Connor)
1836b19da32eSMin Hu (Connor)Set fec mode for a specific port::
1837b19da32eSMin Hu (Connor)
1838e30aa525SJie Hai  testpmd> set port (port_id) fec_mode auto|off|rs|baser|llrs
1839b19da32eSMin Hu (Connor)
184001ee2e49SJiawei WangConfig Sample actions list
184101ee2e49SJiawei Wang~~~~~~~~~~~~~~~~~~~~~~~~~~
184201ee2e49SJiawei Wang
184301ee2e49SJiawei WangConfigure the sample actions list to be used when sampling a packet by
184401ee2e49SJiawei Wangrte_flow_action_sample::
184501ee2e49SJiawei Wang
184601ee2e49SJiawei Wang set sample_actions {index} {action} [/ {action} [...]] / end
184701ee2e49SJiawei Wang
184801ee2e49SJiawei WangThere are multiple global buffers for ``sample_actions``, this command will set
184901ee2e49SJiawei Wangone internal buffer index by ``{index}``.
185001ee2e49SJiawei Wang
185101ee2e49SJiawei WangIn order to use different sample actions list, ``index`` must be specified
185201ee2e49SJiawei Wangduring the flow rule creation::
185301ee2e49SJiawei Wang
185401ee2e49SJiawei Wang testpmd> flow create 0 ingress pattern eth / ipv4 / end actions
185501ee2e49SJiawei Wang        sample ratio 2 index 2 / end
185601ee2e49SJiawei Wang
185701ee2e49SJiawei WangOtherwise the default index ``0`` is used.
1858b19da32eSMin Hu (Connor)
1859*045e35aaSJames Hershawset port led
1860*045e35aaSJames Hershaw~~~~~~~~~~~~
1861*045e35aaSJames Hershaw
1862*045e35aaSJames HershawSet a controllable LED associated with a certain port on or off::
1863*045e35aaSJames Hershaw
1864*045e35aaSJames Hershaw   testpmd> set port (port_id) led (on|off)
1865*045e35aaSJames Hershaw
1866ac718398SBernard IremongerPort Functions
1867ac718398SBernard Iremonger--------------
1868ac718398SBernard Iremonger
1869ac718398SBernard IremongerThe following sections show functions for configuring ports.
1870ac718398SBernard Iremonger
1871ac718398SBernard Iremonger.. note::
1872ac718398SBernard Iremonger
1873ac718398SBernard Iremonger   Port configuration changes only become active when forwarding is started/restarted.
1874ac718398SBernard Iremonger
187585d9252eSMichael Baum.. _port_attach:
187685d9252eSMichael Baum
1877edab33b1STetsuya Mukawaport attach
1878edab33b1STetsuya Mukawa~~~~~~~~~~~
1879edab33b1STetsuya Mukawa
18804cd69cc8SPablo de LaraAttach a port specified by pci address or virtual device args::
18814cd69cc8SPablo de Lara
18824cd69cc8SPablo de Lara   testpmd> port attach (identifier)
1883edab33b1STetsuya Mukawa
1884edab33b1STetsuya MukawaTo attach a new pci device, the device should be recognized by kernel first.
1885edab33b1STetsuya MukawaThen it should be moved under DPDK management.
1886edab33b1STetsuya MukawaFinally the port can be attached to testpmd.
1887edab33b1STetsuya Mukawa
188881b97563SBernard IremongerFor example, to move a pci device using ixgbe under DPDK management:
1889edab33b1STetsuya Mukawa
1890edab33b1STetsuya Mukawa.. code-block:: console
1891edab33b1STetsuya Mukawa
1892e76d7a76SJohn McNamara   # Check the status of the available devices.
1893c6dab2a8SThomas Monjalon   ./usertools/dpdk-devbind.py --status
189481b97563SBernard Iremonger
189581b97563SBernard Iremonger   Network devices using DPDK-compatible driver
189681b97563SBernard Iremonger   ============================================
189781b97563SBernard Iremonger   <none>
189881b97563SBernard Iremonger
189981b97563SBernard Iremonger   Network devices using kernel driver
190081b97563SBernard Iremonger   ===================================
1901e76d7a76SJohn McNamara   0000:0a:00.0 '82599ES 10-Gigabit' if=eth2 drv=ixgbe unused=
190281b97563SBernard Iremonger
1903e76d7a76SJohn McNamara
1904e76d7a76SJohn McNamara   # Bind the device to igb_uio.
1905c6dab2a8SThomas Monjalon   sudo ./usertools/dpdk-devbind.py -b igb_uio 0000:0a:00.0
1906e76d7a76SJohn McNamara
1907e76d7a76SJohn McNamara
1908e76d7a76SJohn McNamara   # Recheck the status of the devices.
1909c6dab2a8SThomas Monjalon   ./usertools/dpdk-devbind.py --status
191081b97563SBernard Iremonger   Network devices using DPDK-compatible driver
191181b97563SBernard Iremonger   ============================================
1912e76d7a76SJohn McNamara   0000:0a:00.0 '82599ES 10-Gigabit' drv=igb_uio unused=
191381b97563SBernard Iremonger
191481b97563SBernard IremongerTo attach a port created by virtual device, above steps are not needed.
191581b97563SBernard Iremonger
191681b97563SBernard IremongerFor example, to attach a port whose pci address is 0000:0a:00.0.
191781b97563SBernard Iremonger
191881b97563SBernard Iremonger.. code-block:: console
191981b97563SBernard Iremonger
192081b97563SBernard Iremonger   testpmd> port attach 0000:0a:00.0
1921edab33b1STetsuya Mukawa   Attaching a new port...
192281b97563SBernard Iremonger   EAL: PCI device 0000:0a:00.0 on NUMA socket -1
192381b97563SBernard Iremonger   EAL:   probe driver: 8086:10fb rte_ixgbe_pmd
192481b97563SBernard Iremonger   EAL:   PCI memory mapped at 0x7f83bfa00000
192581b97563SBernard Iremonger   EAL:   PCI memory mapped at 0x7f83bfa80000
192681b97563SBernard Iremonger   PMD: eth_ixgbe_dev_init(): MAC: 2, PHY: 18, SFP+: 5
192781b97563SBernard Iremonger   PMD: eth_ixgbe_dev_init(): port 0 vendorID=0x8086 deviceID=0x10fb
1928edab33b1STetsuya Mukawa   Port 0 is attached. Now total ports is 1
1929edab33b1STetsuya Mukawa   Done
1930edab33b1STetsuya Mukawa
1931edab33b1STetsuya MukawaFor example, to attach a port created by pcap PMD.
1932edab33b1STetsuya Mukawa
1933edab33b1STetsuya Mukawa.. code-block:: console
1934edab33b1STetsuya Mukawa
193558c82067SThomas Monjalon   testpmd> port attach net_pcap0
1936edab33b1STetsuya Mukawa   Attaching a new port...
193758c82067SThomas Monjalon   PMD: Initializing pmd_pcap for net_pcap0
193881b97563SBernard Iremonger   PMD: Creating pcap-backed ethdev on numa socket 0
1939edab33b1STetsuya Mukawa   Port 0 is attached. Now total ports is 1
1940edab33b1STetsuya Mukawa   Done
1941edab33b1STetsuya Mukawa
194258c82067SThomas MonjalonIn this case, identifier is ``net_pcap0``.
1943e76d7a76SJohn McNamaraThis identifier format is the same as ``--vdev`` format of DPDK applications.
1944edab33b1STetsuya Mukawa
19454f840086SLong WuFor example, to re-attach a bonding port which has been previously detached,
1946ef97d308SBernard Iremongerthe mode and slave parameters must be given.
1947ef97d308SBernard Iremonger
1948ef97d308SBernard Iremonger.. code-block:: console
1949ef97d308SBernard Iremonger
195058c82067SThomas Monjalon   testpmd> port attach net_bond_0,mode=0,slave=1
1951ef97d308SBernard Iremonger   Attaching a new port...
195258c82067SThomas Monjalon   EAL: Initializing pmd_bond for net_bond_0
19534f840086SLong Wu   EAL: Create bonding device net_bond_0 on port 0 in mode 0 on socket 0.
1954ef97d308SBernard Iremonger   Port 0 is attached. Now total ports is 1
1955ef97d308SBernard Iremonger   Done
1956ef97d308SBernard Iremonger
1957ef97d308SBernard Iremonger
1958edab33b1STetsuya Mukawaport detach
1959edab33b1STetsuya Mukawa~~~~~~~~~~~
1960edab33b1STetsuya Mukawa
19614cd69cc8SPablo de LaraDetach a specific port::
1962edab33b1STetsuya Mukawa
1963e76d7a76SJohn McNamara   testpmd> port detach (port_id)
1964edab33b1STetsuya Mukawa
19654cd69cc8SPablo de LaraBefore detaching a port, the port should be stopped and closed.
19664cd69cc8SPablo de Lara
196781b97563SBernard IremongerFor example, to detach a pci device port 0.
1968edab33b1STetsuya Mukawa
1969edab33b1STetsuya Mukawa.. code-block:: console
1970edab33b1STetsuya Mukawa
19714cd69cc8SPablo de Lara   testpmd> port stop 0
19724cd69cc8SPablo de Lara   Stopping ports...
19734cd69cc8SPablo de Lara   Done
197481b97563SBernard Iremonger   testpmd> port close 0
197581b97563SBernard Iremonger   Closing ports...
197681b97563SBernard Iremonger   Done
1977e76d7a76SJohn McNamara
1978edab33b1STetsuya Mukawa   testpmd> port detach 0
1979edab33b1STetsuya Mukawa   Detaching a port...
198081b97563SBernard Iremonger   EAL: PCI device 0000:0a:00.0 on NUMA socket -1
198181b97563SBernard Iremonger   EAL:   remove driver: 8086:10fb rte_ixgbe_pmd
198281b97563SBernard Iremonger   EAL:   PCI memory unmapped at 0x7f83bfa00000
198381b97563SBernard Iremonger   EAL:   PCI memory unmapped at 0x7f83bfa80000
1984edab33b1STetsuya Mukawa   Done
1985e76d7a76SJohn McNamara
198681b97563SBernard Iremonger
198781b97563SBernard IremongerFor example, to detach a virtual device port 0.
198881b97563SBernard Iremonger
198981b97563SBernard Iremonger.. code-block:: console
199081b97563SBernard Iremonger
19914cd69cc8SPablo de Lara   testpmd> port stop 0
19924cd69cc8SPablo de Lara   Stopping ports...
19934cd69cc8SPablo de Lara   Done
199481b97563SBernard Iremonger   testpmd> port close 0
199581b97563SBernard Iremonger   Closing ports...
199681b97563SBernard Iremonger   Done
1997e76d7a76SJohn McNamara
199881b97563SBernard Iremonger   testpmd> port detach 0
199981b97563SBernard Iremonger   Detaching a port...
200081b97563SBernard Iremonger   PMD: Closing pcap ethdev on numa socket 0
200158c82067SThomas Monjalon   Port 'net_pcap0' is detached. Now total ports is 0
200281b97563SBernard Iremonger   Done
200381b97563SBernard Iremonger
200481b97563SBernard IremongerTo remove a pci device completely from the system, first detach the port from testpmd.
200581b97563SBernard IremongerThen the device should be moved under kernel management.
200681b97563SBernard IremongerFinally the device can be removed using kernel pci hotplug functionality.
200781b97563SBernard Iremonger
200881b97563SBernard IremongerFor example, to move a pci device under kernel management:
200981b97563SBernard Iremonger
201081b97563SBernard Iremonger.. code-block:: console
201181b97563SBernard Iremonger
2012c6dab2a8SThomas Monjalon   sudo ./usertools/dpdk-devbind.py -b ixgbe 0000:0a:00.0
2013e76d7a76SJohn McNamara
2014c6dab2a8SThomas Monjalon   ./usertools/dpdk-devbind.py --status
201581b97563SBernard Iremonger
201681b97563SBernard Iremonger   Network devices using DPDK-compatible driver
201781b97563SBernard Iremonger   ============================================
201881b97563SBernard Iremonger   <none>
201981b97563SBernard Iremonger
202081b97563SBernard Iremonger   Network devices using kernel driver
202181b97563SBernard Iremonger   ===================================
2022e76d7a76SJohn McNamara   0000:0a:00.0 '82599ES 10-Gigabit' if=eth2 drv=ixgbe unused=igb_uio
202381b97563SBernard Iremonger
202481b97563SBernard IremongerTo remove a port created by a virtual device, above steps are not needed.
2025edab33b1STetsuya Mukawa
2026ac718398SBernard Iremongerport start
2027ac718398SBernard Iremonger~~~~~~~~~~
2028ac718398SBernard Iremonger
2029e76d7a76SJohn McNamaraStart all ports or a specific port::
2030ac718398SBernard Iremonger
2031e76d7a76SJohn McNamara   testpmd> port start (port_id|all)
2032ac718398SBernard Iremonger
2033ac718398SBernard Iremongerport stop
2034ac718398SBernard Iremonger~~~~~~~~~
2035ac718398SBernard Iremonger
2036e76d7a76SJohn McNamaraStop all ports or a specific port::
2037ac718398SBernard Iremonger
2038e76d7a76SJohn McNamara   testpmd> port stop (port_id|all)
2039ac718398SBernard Iremonger
2040ac718398SBernard Iremongerport close
2041ac718398SBernard Iremonger~~~~~~~~~~
2042ac718398SBernard Iremonger
2043e76d7a76SJohn McNamaraClose all ports or a specific port::
2044ac718398SBernard Iremonger
2045e76d7a76SJohn McNamara   testpmd> port close (port_id|all)
2046ac718398SBernard Iremonger
20471cde1b9aSShougang Wangport reset
20481cde1b9aSShougang Wang~~~~~~~~~~
20491cde1b9aSShougang Wang
20501cde1b9aSShougang WangReset all ports or a specific port::
20511cde1b9aSShougang Wang
20521cde1b9aSShougang Wang   testpmd> port reset (port_id|all)
20531cde1b9aSShougang Wang
20541cde1b9aSShougang WangUser should stop port(s) before resetting and (re-)start after reset.
20551cde1b9aSShougang Wang
20561a77cffaSQi Zhangport config - queue ring size
20571a77cffaSQi Zhang~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20581a77cffaSQi Zhang
20591a77cffaSQi ZhangConfigure a rx/tx queue ring size::
20601a77cffaSQi Zhang
20617a30ea42SKevin Traynor   testpmd> port config (port_id) (rxq|txq) (queue_id) ring_size (value)
20621a77cffaSQi Zhang
20631a77cffaSQi ZhangOnly take effect after command that (re-)start the port or command that setup specific queue.
20641a77cffaSQi Zhang
20656fe5f2f7SPablo de Laraport start/stop queue
20666fe5f2f7SPablo de Lara~~~~~~~~~~~~~~~~~~~~~
20676fe5f2f7SPablo de Lara
2068e76d7a76SJohn McNamaraStart/stop a rx/tx queue on a specific port::
20696fe5f2f7SPablo de Lara
2070e76d7a76SJohn McNamara   testpmd> port (port_id) (rxq|txq) (queue_id) (start|stop)
20716fe5f2f7SPablo de Lara
2072d3a67720SIan Dolzhanskyport config - queue deferred start
2073d3a67720SIan Dolzhansky~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2074d3a67720SIan Dolzhansky
2075d3a67720SIan DolzhanskySwitch on/off deferred start of a specific port queue::
2076d3a67720SIan Dolzhansky
2077d3a67720SIan Dolzhansky   testpmd> port (port_id) (rxq|txq) (queue_id) deferred_start (on|off)
2078d3a67720SIan Dolzhansky
2079d326e671SQi Zhangport setup queue
2080d326e671SQi Zhang~~~~~~~~~~~~~~~~~~~~~
2081d326e671SQi Zhang
2082d326e671SQi ZhangSetup a rx/tx queue on a specific port::
2083d326e671SQi Zhang
2084d326e671SQi Zhang   testpmd> port (port_id) (rxq|txq) (queue_id) setup
2085d326e671SQi Zhang
20866fe5f2f7SPablo de LaraOnly take effect when port is started.
20876fe5f2f7SPablo de Lara
2088ac718398SBernard Iremongerport config - speed
2089ac718398SBernard Iremonger~~~~~~~~~~~~~~~~~~~
2090ac718398SBernard Iremonger
2091e76d7a76SJohn McNamaraSet the speed and duplex mode for all ports or a specific port::
2092ac718398SBernard Iremonger
2093d54c7f15SJulien Aube   testpmd> port config (port_id|all) speed (10|100|1000|2500|5000|10000|25000|40000|50000|100000|200000|400000|auto) \
2094e76d7a76SJohn McNamara            duplex (half|full|auto)
2095ac718398SBernard Iremonger
2096ac718398SBernard Iremongerport config - queues/descriptors
2097ac718398SBernard Iremonger~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2098ac718398SBernard Iremonger
2099e76d7a76SJohn McNamaraSet number of queues/descriptors for rxq, txq, rxd and txd::
2100ac718398SBernard Iremonger
2101e76d7a76SJohn McNamara   testpmd> port config all (rxq|txq|rxd|txd) (value)
2102ac718398SBernard Iremonger
2103e76d7a76SJohn McNamaraThis is equivalent to the ``--rxq``, ``--txq``, ``--rxd`` and ``--txd`` command-line options.
2104ac718398SBernard Iremonger
2105ac718398SBernard Iremongerport config - max-pkt-len
2106ac718398SBernard Iremonger~~~~~~~~~~~~~~~~~~~~~~~~~
2107ac718398SBernard Iremonger
2108e76d7a76SJohn McNamaraSet the maximum packet length::
2109ac718398SBernard Iremonger
2110e76d7a76SJohn McNamara   testpmd> port config all max-pkt-len (value)
2111ac718398SBernard Iremonger
2112e76d7a76SJohn McNamaraThis is equivalent to the ``--max-pkt-len`` command-line option.
2113ac718398SBernard Iremonger
21144a729092SDekel Peledport config - max-lro-pkt-size
21154a729092SDekel Peled~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21164a729092SDekel Peled
21174a729092SDekel PeledSet the maximum LRO aggregated packet size::
21184a729092SDekel Peled
21194a729092SDekel Peled   testpmd> port config all max-lro-pkt-size (value)
21204a729092SDekel Peled
21214a729092SDekel PeledThis is equivalent to the ``--max-lro-pkt-size`` command-line option.
21224a729092SDekel Peled
2123ac718398SBernard Iremongerport config - Drop Packets
2124ac718398SBernard Iremonger~~~~~~~~~~~~~~~~~~~~~~~~~~
2125ac718398SBernard Iremonger
2126e5db17a1SFlavia MusatescuEnable or disable packet drop on all RX queues of all ports when no receive buffers available::
2127ac718398SBernard Iremonger
2128e76d7a76SJohn McNamara   testpmd> port config all drop-en (on|off)
2129ac718398SBernard Iremonger
2130e5db17a1SFlavia MusatescuPacket dropping when no receive buffers available is off by default.
2131ac718398SBernard Iremonger
2132e76d7a76SJohn McNamaraThe ``on`` option is equivalent to the ``--enable-drop-en`` command-line option.
2133ac718398SBernard Iremonger
2134ac718398SBernard Iremongerport config - RSS
2135ac718398SBernard Iremonger~~~~~~~~~~~~~~~~~
2136ac718398SBernard Iremonger
2137e76d7a76SJohn McNamaraSet the RSS (Receive Side Scaling) mode on or off::
21389ad341b5SHuisong Li   testpmd> port config all rss (all|default|level-default|level-outer|level-inner| \
21399ad341b5SHuisong Li                                 ip|tcp|udp|sctp|tunnel|vlan|none| \
21409ad341b5SHuisong Li                                 ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other| \
21419ad341b5SHuisong Li                                 ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp| \
214242392190SAjit Khaparde                                 ipv6-other|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|ipv6-flow-label| \
21439ad341b5SHuisong Li                                 l2-payload|port|vxlan|geneve|nvgre|gtpu|eth|s-vlan|c-vlan| \
21449ad341b5SHuisong Li                                 esp|ah|l2tpv3|pfcp|pppoe|ecpri|mpls|ipv4-chksum|l4-chksum| \
21459ad341b5SHuisong Li                                 l2tpv2|l3-pre96|l3-pre64|l3-pre56|l3-pre48|l3-pre40|l3-pre32| \
21469ad341b5SHuisong Li                                 l2-dst-only|l2-src-only|l4-dst-only|l4-src-only|l3-dst-only|l3-src-only|<rsstype_id>)
2147ac718398SBernard Iremonger
2148ac718398SBernard IremongerRSS is on by default.
2149ac718398SBernard Iremonger
2150f840cf77SJie WangThe ``all`` option is equivalent to eth|vlan|ip|tcp|udp|sctp|ether|l2tpv3|esp|ah|pfcp|l2tpv2.
2151a8a54489SJeff Guo
2152d9aa619cSXueming LiThe ``default`` option enables all supported RSS types reported by device info.
2153a8a54489SJeff Guo
2154e76d7a76SJohn McNamaraThe ``none`` option is equivalent to the ``--disable-rss`` command-line option.
2155ac718398SBernard Iremonger
2156ac718398SBernard Iremongerport config - RSS Reta
2157ac718398SBernard Iremonger~~~~~~~~~~~~~~~~~~~~~~
2158ac718398SBernard Iremonger
2159e76d7a76SJohn McNamaraSet the RSS (Receive Side Scaling) redirection table::
2160ac718398SBernard Iremonger
2161e76d7a76SJohn McNamara   testpmd> port config all rss reta (hash,queue)[,(hash,queue)]
2162ac718398SBernard Iremonger
2163ac718398SBernard Iremongerport config - DCB
2164ac718398SBernard Iremonger~~~~~~~~~~~~~~~~~
2165ac718398SBernard Iremonger
2166e76d7a76SJohn McNamaraSet the DCB mode for an individual port::
2167ac718398SBernard Iremonger
2168e76d7a76SJohn McNamara   testpmd> port config (port_id) dcb vt (on|off) (traffic_class) pfc (on|off)
2169ac718398SBernard Iremonger
2170ac718398SBernard IremongerThe traffic class should be 4 or 8.
2171ac718398SBernard Iremonger
2172ac718398SBernard Iremongerport config - Burst
2173ac718398SBernard Iremonger~~~~~~~~~~~~~~~~~~~
2174ac718398SBernard Iremonger
2175e76d7a76SJohn McNamaraSet the number of packets per burst::
2176ac718398SBernard Iremonger
2177e76d7a76SJohn McNamara   testpmd> port config all burst (value)
2178ac718398SBernard Iremonger
2179e76d7a76SJohn McNamaraThis is equivalent to the ``--burst`` command-line option.
2180ac718398SBernard Iremonger
2181ac718398SBernard Iremongerport config - Threshold
2182ac718398SBernard Iremonger~~~~~~~~~~~~~~~~~~~~~~~
2183ac718398SBernard Iremonger
2184e76d7a76SJohn McNamaraSet thresholds for TX/RX queues::
2185ac718398SBernard Iremonger
2186e76d7a76SJohn McNamara   testpmd> port config all (threshold) (value)
2187ac718398SBernard Iremonger
2188ac718398SBernard IremongerWhere the threshold type can be:
2189ac718398SBernard Iremonger
2190e76d7a76SJohn McNamara* ``txpt:`` Set the prefetch threshold register of the TX rings, 0 <= value <= 255.
2191ac718398SBernard Iremonger
2192e76d7a76SJohn McNamara* ``txht:`` Set the host threshold register of the TX rings, 0 <= value <= 255.
2193ac718398SBernard Iremonger
2194e76d7a76SJohn McNamara* ``txwt:`` Set the write-back threshold register of the TX rings, 0 <= value <= 255.
2195ac718398SBernard Iremonger
2196e76d7a76SJohn McNamara* ``rxpt:`` Set the prefetch threshold register of the RX rings, 0 <= value <= 255.
2197ac718398SBernard Iremonger
2198e76d7a76SJohn McNamara* ``rxht:`` Set the host threshold register of the RX rings, 0 <= value <= 255.
2199ac718398SBernard Iremonger
2200e76d7a76SJohn McNamara* ``rxwt:`` Set the write-back threshold register of the RX rings, 0 <= value <= 255.
2201ac718398SBernard Iremonger
2202e76d7a76SJohn McNamara* ``txfreet:`` Set the transmit free threshold of the TX rings, 0 <= value <= txd.
2203ac718398SBernard Iremonger
2204e76d7a76SJohn McNamara* ``rxfreet:`` Set the transmit free threshold of the RX rings, 0 <= value <= rxd.
2205ac718398SBernard Iremonger
2206e76d7a76SJohn McNamara* ``txrst:`` Set the transmit RS bit threshold of TX rings, 0 <= value <= txd.
2207e76d7a76SJohn McNamara
2208ac718398SBernard IremongerThese threshold options are also available from the command-line.
2209ac718398SBernard Iremonger
22105a4806d3SKirill Rybalchenkoport config pctype mapping
22115a4806d3SKirill Rybalchenko~~~~~~~~~~~~~~~~~~~~~~~~~~
22125a4806d3SKirill Rybalchenko
22135a4806d3SKirill RybalchenkoReset pctype mapping table::
22145a4806d3SKirill Rybalchenko
22155a4806d3SKirill Rybalchenko   testpmd> port config (port_id) pctype mapping reset
22165a4806d3SKirill Rybalchenko
22175a4806d3SKirill RybalchenkoUpdate hardware defined pctype to software defined flow type mapping table::
22185a4806d3SKirill Rybalchenko
22195a4806d3SKirill Rybalchenko   testpmd> port config (port_id) pctype mapping update (pctype_id_0[,pctype_id_1]*) (flow_type_id)
22205a4806d3SKirill Rybalchenko
22215a4806d3SKirill Rybalchenkowhere:
22225a4806d3SKirill Rybalchenko
22235a4806d3SKirill Rybalchenko* ``pctype_id_x``: hardware pctype id as index of bit in bitmask value of the pctype mapping table.
22245a4806d3SKirill Rybalchenko
22255a4806d3SKirill Rybalchenko* ``flow_type_id``: software flow type id as the index of the pctype mapping table.
22265a4806d3SKirill Rybalchenko
2227e38ea44fSBeilei Xingport config input set
2228e38ea44fSBeilei Xing~~~~~~~~~~~~~~~~~~~~~
2229e38ea44fSBeilei Xing
2230e38ea44fSBeilei XingConfig RSS/FDIR/FDIR flexible payload input set for some pctype::
22317fa1a2deSKevin Traynor
2232e38ea44fSBeilei Xing   testpmd> port config (port_id) pctype (pctype_id) \
2233e38ea44fSBeilei Xing            (hash_inset|fdir_inset|fdir_flx_inset) \
2234e38ea44fSBeilei Xing	    (get|set|clear) field (field_idx)
2235e38ea44fSBeilei Xing
2236e38ea44fSBeilei XingClear RSS/FDIR/FDIR flexible payload input set for some pctype::
22377fa1a2deSKevin Traynor
2238e38ea44fSBeilei Xing   testpmd> port config (port_id) pctype (pctype_id) \
2239e38ea44fSBeilei Xing            (hash_inset|fdir_inset|fdir_flx_inset) clear all
2240e38ea44fSBeilei Xing
2241e38ea44fSBeilei Xingwhere:
2242e38ea44fSBeilei Xing
2243e38ea44fSBeilei Xing* ``pctype_id``: hardware packet classification types.
2244e38ea44fSBeilei Xing* ``field_idx``: hardware field index.
2245e76d7a76SJohn McNamara
224608e0b344SShahed Shaikhport config udp_tunnel_port
224708e0b344SShahed Shaikh~~~~~~~~~~~~~~~~~~~~~~~~~~~
224808e0b344SShahed Shaikh
224908e0b344SShahed ShaikhAdd/remove UDP tunnel port for VXLAN/GENEVE tunneling protocols::
22507fa1a2deSKevin Traynor
2251389fca75SGavin Li    testpmd> port config (port_id) udp_tunnel_port add|rm vxlan|geneve|vxlan-gpe|ecpri (udp_port)
225208e0b344SShahed Shaikh
2253c18feafaSDekel Peledport config tx_metadata
2254c18feafaSDekel Peled~~~~~~~~~~~~~~~~~~~~~~~
2255c18feafaSDekel Peled
2256c18feafaSDekel PeledSet Tx metadata value per port.
2257c18feafaSDekel Peledtestpmd will add this value to any Tx packet sent from this port::
2258c18feafaSDekel Peled
2259c18feafaSDekel Peled   testpmd> port config (port_id) tx_metadata (value)
2260c18feafaSDekel Peled
2261b57b66a9SOri Kamport config dynf
2262b57b66a9SOri Kam~~~~~~~~~~~~~~~~
2263b57b66a9SOri Kam
2264b57b66a9SOri KamSet/clear dynamic flag per port.
2265b57b66a9SOri Kamtestpmd will register this flag in the mbuf (same registration
2266b57b66a9SOri Kamfor both Tx and Rx). Then set/clear this flag for each Tx
2267b57b66a9SOri Kampacket sent from this port. The set bit only works for Tx packet::
2268b57b66a9SOri Kam
2269b57b66a9SOri Kam   testpmd> port config (port_id) dynf (name) (set|clear)
2270b57b66a9SOri Kam
2271d82ee2ccSAgalya Babu RadhaKrishnanport config mtu
2272d82ee2ccSAgalya Babu RadhaKrishnan~~~~~~~~~~~~~~~
2273d82ee2ccSAgalya Babu RadhaKrishnan
2274d82ee2ccSAgalya Babu RadhaKrishnanTo configure MTU(Maximum Transmission Unit) on devices using testpmd::
2275d82ee2ccSAgalya Babu RadhaKrishnan
2276d82ee2ccSAgalya Babu RadhaKrishnan   testpmd> port config mtu (port_id) (value)
2277d82ee2ccSAgalya Babu RadhaKrishnan
2278d82ee2ccSAgalya Babu RadhaKrishnanport config rss hash key
2279d82ee2ccSAgalya Babu RadhaKrishnan~~~~~~~~~~~~~~~~~~~~~~~~
2280d82ee2ccSAgalya Babu RadhaKrishnan
2281d82ee2ccSAgalya Babu RadhaKrishnanTo configure the RSS hash key used to compute the RSS
2282d82ee2ccSAgalya Babu RadhaKrishnanhash of input [IP] packets received on port::
2283d82ee2ccSAgalya Babu RadhaKrishnan
2284d82ee2ccSAgalya Babu RadhaKrishnan   testpmd> port config <port_id> rss-hash-key (ipv4|ipv4-frag|\
2285d82ee2ccSAgalya Babu RadhaKrishnan                     ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|\
2286d82ee2ccSAgalya Babu RadhaKrishnan                     ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|\
2287d82ee2ccSAgalya Babu RadhaKrishnan                     ipv6-other|l2-payload|ipv6-ex|ipv6-tcp-ex|\
2288d82ee2ccSAgalya Babu RadhaKrishnan                     ipv6-udp-ex <string of hex digits \
2289d82ee2ccSAgalya Babu RadhaKrishnan                     (variable length, NIC dependent)>)
2290d82ee2ccSAgalya Babu RadhaKrishnan
22913da59f30SJie Haiport config rss hash algorithm
22923da59f30SJie Hai~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22933da59f30SJie Hai
22943da59f30SJie HaiTo configure the RSS hash algorithm used to compute the RSS
22953da59f30SJie Haihash of input packets received on port::
22963da59f30SJie Hai
22973da59f30SJie Hai   testpmd> port config <port_id> rss-hash-algo (default|\
22983da59f30SJie Hai                     simple_xor|toeplitz|symmetric_toeplitz|\
22993da59f30SJie Hai                     symmetric_toeplitz_sort)
23003da59f30SJie Hai
2301bafe8a68SChengwen Fengport cleanup txq mbufs
2302bafe8a68SChengwen Feng~~~~~~~~~~~~~~~~~~~~~~
2303bafe8a68SChengwen Feng
2304bafe8a68SChengwen FengTo cleanup txq mbufs currently cached by driver::
2305bafe8a68SChengwen Feng
2306bafe8a68SChengwen Feng   testpmd> port cleanup (port_id) txq (queue_id) (free_cnt)
2307bafe8a68SChengwen Feng
2308bafe8a68SChengwen FengIf the value of ``free_cnt`` is 0, driver should free all cached mbufs.
2309bafe8a68SChengwen Feng
231055e51c96SNithin DabilpuramDevice Functions
231155e51c96SNithin Dabilpuram----------------
231255e51c96SNithin Dabilpuram
231355e51c96SNithin DabilpuramThe following sections show functions for device operations.
231455e51c96SNithin Dabilpuram
231555e51c96SNithin Dabilpuramdevice detach
231655e51c96SNithin Dabilpuram~~~~~~~~~~~~~
231755e51c96SNithin Dabilpuram
231855e51c96SNithin DabilpuramDetach a device specified by pci address or virtual device args::
231955e51c96SNithin Dabilpuram
232055e51c96SNithin Dabilpuram   testpmd> device detach (identifier)
232155e51c96SNithin Dabilpuram
232255e51c96SNithin DabilpuramBefore detaching a device associated with ports, the ports should be stopped and closed.
232355e51c96SNithin Dabilpuram
232455e51c96SNithin DabilpuramFor example, to detach a pci device whose address is 0002:03:00.0.
232555e51c96SNithin Dabilpuram
232655e51c96SNithin Dabilpuram.. code-block:: console
232755e51c96SNithin Dabilpuram
232855e51c96SNithin Dabilpuram    testpmd> device detach 0002:03:00.0
232955e51c96SNithin Dabilpuram    Removing a device...
233055e51c96SNithin Dabilpuram    Port 1 is now closed
233155e51c96SNithin Dabilpuram    EAL: Releasing pci mapped resource for 0002:03:00.0
233255e51c96SNithin Dabilpuram    EAL: Calling pci_unmap_resource for 0002:03:00.0 at 0x218a050000
233355e51c96SNithin Dabilpuram    EAL: Calling pci_unmap_resource for 0002:03:00.0 at 0x218c050000
233455e51c96SNithin Dabilpuram    Device 0002:03:00.0 is detached
233555e51c96SNithin Dabilpuram    Now total ports is 1
233655e51c96SNithin Dabilpuram
233755e51c96SNithin DabilpuramFor example, to detach a port created by pcap PMD.
233855e51c96SNithin Dabilpuram
233955e51c96SNithin Dabilpuram.. code-block:: console
234055e51c96SNithin Dabilpuram
234155e51c96SNithin Dabilpuram    testpmd> device detach net_pcap0
234255e51c96SNithin Dabilpuram    Removing a device...
234355e51c96SNithin Dabilpuram    Port 0 is now closed
234455e51c96SNithin Dabilpuram    Device net_pcap0 is detached
234555e51c96SNithin Dabilpuram    Now total ports is 0
234655e51c96SNithin Dabilpuram    Done
234755e51c96SNithin Dabilpuram
234855e51c96SNithin DabilpuramIn this case, identifier is ``net_pcap0``.
234955e51c96SNithin DabilpuramThis identifier format is the same as ``--vdev`` format of DPDK applications.
235055e51c96SNithin Dabilpuram
2351ac718398SBernard IremongerLink Bonding Functions
2352ac718398SBernard Iremonger----------------------
2353ac718398SBernard Iremonger
2354ac718398SBernard IremongerThe Link Bonding functions make it possible to dynamically create and
2355ac718398SBernard Iremongermanage link bonding devices from within testpmd interactive prompt.
2356ac718398SBernard Iremonger
2357703178f8SDavid MarchandSee :doc:`../prog_guide/link_bonding_poll_mode_drv_lib` for more information.
2358e76d7a76SJohn McNamara
2359f06125c0SJasvinder SinghTraffic Metering and Policing
2360f06125c0SJasvinder Singh-----------------------------
2361f06125c0SJasvinder Singh
2362f06125c0SJasvinder SinghThe following section shows functions for configuring traffic metering and
2363f06125c0SJasvinder Singhpolicing on the ethernet device through the use of generic ethdev API.
2364f06125c0SJasvinder Singh
2365f06125c0SJasvinder Singhshow port traffic management capability
2366f06125c0SJasvinder Singh~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2367f06125c0SJasvinder Singh
2368f06125c0SJasvinder SinghShow traffic metering and policing capability of the port::
2369f06125c0SJasvinder Singh
2370f06125c0SJasvinder Singh   testpmd> show port meter cap (port_id)
2371f06125c0SJasvinder Singh
2372f06125c0SJasvinder Singhadd port meter profile (srTCM rfc2967)
2373f06125c0SJasvinder Singh~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2374f06125c0SJasvinder Singh
2375f06125c0SJasvinder SinghAdd meter profile (srTCM rfc2697) to the ethernet device::
2376f06125c0SJasvinder Singh
2377f06125c0SJasvinder Singh   testpmd> add port meter profile srtcm_rfc2697 (port_id) (profile_id) \
2378c5a3860fSLi Zhang   (cir) (cbs) (ebs) (packet_mode)
2379f06125c0SJasvinder Singh
2380f06125c0SJasvinder Singhwhere:
2381f06125c0SJasvinder Singh
2382f06125c0SJasvinder Singh* ``profile_id``: ID for the meter profile.
2383c5a3860fSLi Zhang* ``cir``: Committed Information Rate (CIR) (bytes per second or packets per second).
2384c5a3860fSLi Zhang* ``cbs``: Committed Burst Size (CBS) (bytes or packets).
2385c5a3860fSLi Zhang* ``ebs``: Excess Burst Size (EBS) (bytes or packets).
2386c5a3860fSLi Zhang* ``packet_mode``: Packets mode for meter profile.
2387f06125c0SJasvinder Singh
2388f06125c0SJasvinder Singhadd port meter profile (trTCM rfc2968)
2389f06125c0SJasvinder Singh~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2390f06125c0SJasvinder Singh
2391f06125c0SJasvinder SinghAdd meter profile (srTCM rfc2698) to the ethernet device::
2392f06125c0SJasvinder Singh
2393f06125c0SJasvinder Singh   testpmd> add port meter profile trtcm_rfc2698 (port_id) (profile_id) \
2394c5a3860fSLi Zhang   (cir) (pir) (cbs) (pbs) (packet_mode)
2395f06125c0SJasvinder Singh
2396f06125c0SJasvinder Singhwhere:
2397f06125c0SJasvinder Singh
2398f06125c0SJasvinder Singh* ``profile_id``: ID for the meter profile.
2399c5a3860fSLi Zhang* ``cir``: Committed information rate (bytes per second or packets per second).
2400c5a3860fSLi Zhang* ``pir``: Peak information rate (bytes per second or packets per second).
2401c5a3860fSLi Zhang* ``cbs``: Committed burst size (bytes or packets).
2402c5a3860fSLi Zhang* ``pbs``: Peak burst size (bytes or packets).
2403c5a3860fSLi Zhang* ``packet_mode``: Packets mode for meter profile.
2404f06125c0SJasvinder Singh
2405f06125c0SJasvinder Singhadd port meter profile (trTCM rfc4115)
2406f06125c0SJasvinder Singh~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2407f06125c0SJasvinder Singh
2408f06125c0SJasvinder SinghAdd meter profile (trTCM rfc4115) to the ethernet device::
2409f06125c0SJasvinder Singh
2410f06125c0SJasvinder Singh   testpmd> add port meter profile trtcm_rfc4115 (port_id) (profile_id) \
2411c5a3860fSLi Zhang   (cir) (eir) (cbs) (ebs) (packet_mode)
2412f06125c0SJasvinder Singh
2413f06125c0SJasvinder Singhwhere:
2414f06125c0SJasvinder Singh
2415f06125c0SJasvinder Singh* ``profile_id``: ID for the meter profile.
2416c5a3860fSLi Zhang* ``cir``: Committed information rate (bytes per second or packets per second).
2417c5a3860fSLi Zhang* ``eir``: Excess information rate (bytes per second or packets per second).
2418c5a3860fSLi Zhang* ``cbs``: Committed burst size (bytes or packets).
2419c5a3860fSLi Zhang* ``ebs``: Excess burst size (bytes or packets).
2420c5a3860fSLi Zhang* ``packet_mode``: Packets mode for meter profile.
2421f06125c0SJasvinder Singh
2422f06125c0SJasvinder Singhdelete port meter profile
2423f06125c0SJasvinder Singh~~~~~~~~~~~~~~~~~~~~~~~~~
2424f06125c0SJasvinder Singh
2425f06125c0SJasvinder SinghDelete meter profile from the ethernet device::
2426f06125c0SJasvinder Singh
2427f06125c0SJasvinder Singh   testpmd> del port meter profile (port_id) (profile_id)
2428f06125c0SJasvinder Singh
2429f29fa2c5SHaifei Luocreate port policy
2430f29fa2c5SHaifei Luo~~~~~~~~~~~~~~~~~~
2431f29fa2c5SHaifei Luo
2432f29fa2c5SHaifei LuoCreate new policy object for the ethernet device::
2433f29fa2c5SHaifei Luo
2434f29fa2c5SHaifei Luo   testpmd> add port meter policy (port_id) (policy_id) g_actions \
2435f29fa2c5SHaifei Luo   {action} y_actions {action} r_actions {action}
2436f29fa2c5SHaifei Luo
2437f29fa2c5SHaifei Luowhere:
2438f29fa2c5SHaifei Luo
2439f29fa2c5SHaifei Luo* ``policy_id``: policy ID.
2440f29fa2c5SHaifei Luo* ``action``: action lists for green/yellow/red colors.
2441f29fa2c5SHaifei Luo
2442f29fa2c5SHaifei Luodelete port policy
2443f29fa2c5SHaifei Luo~~~~~~~~~~~~~~~~~~
2444f29fa2c5SHaifei Luo
2445f29fa2c5SHaifei LuoDelete policy object for the ethernet device::
2446f29fa2c5SHaifei Luo
2447f29fa2c5SHaifei Luo   testpmd> del port meter policy (port_id) (policy_id)
2448f29fa2c5SHaifei Luo
2449f29fa2c5SHaifei Luowhere:
2450f29fa2c5SHaifei Luo
2451f29fa2c5SHaifei Luo* ``policy_id``: policy ID.
2452f29fa2c5SHaifei Luo
2453f06125c0SJasvinder Singhcreate port meter
2454f06125c0SJasvinder Singh~~~~~~~~~~~~~~~~~
2455f06125c0SJasvinder Singh
2456f06125c0SJasvinder SinghCreate new meter object for the ethernet device::
2457f06125c0SJasvinder Singh
2458f06125c0SJasvinder Singh   testpmd> create port meter (port_id) (mtr_id) (profile_id) \
24599f5488e3SSunil Kumar Kori   (policy_id) (meter_enable) (stats_mask) (shared) (default_input_color) \
2460f06125c0SJasvinder Singh   (use_pre_meter_color) [(dscp_tbl_entry0) (dscp_tbl_entry1)...\
24619f5488e3SSunil Kumar Kori   (dscp_tbl_entry63)] [(vlan_tbl_entry0) (vlan_tbl_entry1) ... \
24629f5488e3SSunil Kumar Kori   (vlan_tbl_entry15)]
2463f06125c0SJasvinder Singh
2464f06125c0SJasvinder Singhwhere:
2465f06125c0SJasvinder Singh
2466f06125c0SJasvinder Singh* ``mtr_id``: meter object ID.
2467f06125c0SJasvinder Singh* ``profile_id``: ID for the meter profile.
2468f29fa2c5SHaifei Luo* ``policy_id``: ID for the policy.
2469f06125c0SJasvinder Singh* ``meter_enable``: When this parameter has a non-zero value, the meter object
2470f06125c0SJasvinder Singh  gets enabled at the time of creation, otherwise remains disabled.
2471f06125c0SJasvinder Singh* ``stats_mask``: Mask of statistics counter types to be enabled for the
2472f06125c0SJasvinder Singh  meter object.
2473f06125c0SJasvinder Singh* ``shared``:  When this parameter has a non-zero value, the meter object is
2474f06125c0SJasvinder Singh  shared by multiple flows. Otherwise, meter object is used by single flow.
24759f5488e3SSunil Kumar Kori* ``default_input_color``:  Default input color for incoming packets.
24769f5488e3SSunil Kumar Kori  If incoming packet misses DSCP or VLAN input color table then it will be used
24779f5488e3SSunil Kumar Kori  as input color.
2478f06125c0SJasvinder Singh* ``use_pre_meter_color``: When this parameter has a non-zero value, the
2479f06125c0SJasvinder Singh  input color for the current meter object is determined by the latest meter
2480f06125c0SJasvinder Singh  object in the same flow. Otherwise, the current meter object uses the
2481f06125c0SJasvinder Singh  *dscp_table* to determine the input color.
2482f06125c0SJasvinder Singh* ``dscp_tbl_entryx``: DSCP table entry x providing meter providing input
2483f06125c0SJasvinder Singh  color, 0 <= x <= 63.
24849f5488e3SSunil Kumar Kori* ``vlan_tbl_entryx``: VLAN table entry x providing meter input color,
24859f5488e3SSunil Kumar Kori  0 <= x <= 15.
2486f06125c0SJasvinder Singh
2487f06125c0SJasvinder Singhenable port meter
2488f06125c0SJasvinder Singh~~~~~~~~~~~~~~~~~
2489f06125c0SJasvinder Singh
2490f06125c0SJasvinder SinghEnable meter for the ethernet device::
2491f06125c0SJasvinder Singh
2492f06125c0SJasvinder Singh   testpmd> enable port meter (port_id) (mtr_id)
2493f06125c0SJasvinder Singh
2494f06125c0SJasvinder Singhdisable port meter
2495f06125c0SJasvinder Singh~~~~~~~~~~~~~~~~~~
2496f06125c0SJasvinder Singh
2497f06125c0SJasvinder SinghDisable meter for the ethernet device::
2498f06125c0SJasvinder Singh
2499f06125c0SJasvinder Singh   testpmd> disable port meter (port_id) (mtr_id)
2500f06125c0SJasvinder Singh
2501f06125c0SJasvinder Singhdelete port meter
2502f06125c0SJasvinder Singh~~~~~~~~~~~~~~~~~
2503f06125c0SJasvinder Singh
2504f06125c0SJasvinder SinghDelete meter for the ethernet device::
2505f06125c0SJasvinder Singh
2506f06125c0SJasvinder Singh   testpmd> del port meter (port_id) (mtr_id)
2507f06125c0SJasvinder Singh
2508f06125c0SJasvinder SinghSet port meter profile
2509f06125c0SJasvinder Singh~~~~~~~~~~~~~~~~~~~~~~
2510f06125c0SJasvinder Singh
2511f06125c0SJasvinder SinghSet meter profile for the ethernet device::
2512f06125c0SJasvinder Singh
2513f06125c0SJasvinder Singh   testpmd> set port meter profile (port_id) (mtr_id) (profile_id)
2514f06125c0SJasvinder Singh
2515f06125c0SJasvinder Singhset port meter dscp table
2516f06125c0SJasvinder Singh~~~~~~~~~~~~~~~~~~~~~~~~~
2517f06125c0SJasvinder Singh
2518f06125c0SJasvinder SinghSet meter dscp table for the ethernet device::
2519f06125c0SJasvinder Singh
2520204daeeaSSunil Kumar Kori   testpmd> set port meter dscp table (port_id) (mtr_id) (proto) \
2521204daeeaSSunil Kumar Kori   [(dscp_tbl_entry0) (dscp_tbl_entry1)...(dscp_tbl_entry63)]
2522f06125c0SJasvinder Singh
25239f5488e3SSunil Kumar Koriset port meter vlan table
25249f5488e3SSunil Kumar Kori~~~~~~~~~~~~~~~~~~~~~~~~~
25259f5488e3SSunil Kumar KoriSet meter VLAN table for the Ethernet device::
25269f5488e3SSunil Kumar Kori
2527204daeeaSSunil Kumar Kori   testpmd> set port meter vlan table (port_id) (mtr_id) (proto) \
2528204daeeaSSunil Kumar Kori   [(vlan_tbl_entry0) (vlan_tbl_entry1)...(vlan_tbl_entry15)]
25299f5488e3SSunil Kumar Kori
25309f5488e3SSunil Kumar Koriset port meter protocol
25319f5488e3SSunil Kumar Kori~~~~~~~~~~~~~~~~~~~~~~~
25329f5488e3SSunil Kumar KoriSet meter protocol and corresponding priority::
25339f5488e3SSunil Kumar Kori
25349f5488e3SSunil Kumar Kori   testpmd> set port meter proto (port_id) (mtr_id) (proto) (prio)
25359f5488e3SSunil Kumar Kori
25369f5488e3SSunil Kumar Koriget port meter protocol
25379f5488e3SSunil Kumar Kori~~~~~~~~~~~~~~~~~~~~~~~
25389f5488e3SSunil Kumar KoriGet meter protocol::
25399f5488e3SSunil Kumar Kori
25409f5488e3SSunil Kumar Kori   testpmd> get port meter proto (port_id) (mtr_id)
25419f5488e3SSunil Kumar Kori
25429f5488e3SSunil Kumar Koriget port meter protocol priority
25439f5488e3SSunil Kumar Kori~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
25449f5488e3SSunil Kumar KoriGet priority associated to meter protocol::
25459f5488e3SSunil Kumar Kori
25469f5488e3SSunil Kumar Kori   testpmd> get port meter proto_prio (port_id) (mtr_id) (proto)
25479f5488e3SSunil Kumar Kori
2548f06125c0SJasvinder Singhset port meter stats mask
2549f06125c0SJasvinder Singh~~~~~~~~~~~~~~~~~~~~~~~~~
2550f06125c0SJasvinder Singh
2551f06125c0SJasvinder SinghSet meter stats mask for the ethernet device::
2552f06125c0SJasvinder Singh
2553f06125c0SJasvinder Singh   testpmd> set port meter stats mask (port_id) (mtr_id) (stats_mask)
2554f06125c0SJasvinder Singh
2555f06125c0SJasvinder Singhwhere:
2556f06125c0SJasvinder Singh
2557f06125c0SJasvinder Singh* ``stats_mask``: Bit mask indicating statistics counter types to be enabled.
2558f06125c0SJasvinder Singh
2559f06125c0SJasvinder Singhshow port meter stats
2560f06125c0SJasvinder Singh~~~~~~~~~~~~~~~~~~~~~
2561f06125c0SJasvinder Singh
2562f06125c0SJasvinder SinghShow meter stats of the ethernet device::
2563f06125c0SJasvinder Singh
2564f06125c0SJasvinder Singh   testpmd> show port meter stats (port_id) (mtr_id) (clear)
2565f06125c0SJasvinder Singh
2566f06125c0SJasvinder Singhwhere:
2567f06125c0SJasvinder Singh
2568f06125c0SJasvinder Singh* ``clear``: Flag that indicates whether the statistics counters should
2569f06125c0SJasvinder Singh  be cleared (i.e. set to zero) immediately after they have been read or not.
2570e76d7a76SJohn McNamara
25715b590fbeSJasvinder SinghTraffic Management
25725b590fbeSJasvinder Singh------------------
25735b590fbeSJasvinder Singh
25745b590fbeSJasvinder SinghThe following section shows functions for configuring traffic management on
2575f43d3dbbSDavid Marchandthe ethernet device through the use of generic TM API.
25765b590fbeSJasvinder Singh
25775b590fbeSJasvinder Singhshow port traffic management capability
25785b590fbeSJasvinder Singh~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
25795b590fbeSJasvinder Singh
25805b590fbeSJasvinder SinghShow traffic management capability of the port::
25815b590fbeSJasvinder Singh
25825b590fbeSJasvinder Singh   testpmd> show port tm cap (port_id)
25835b590fbeSJasvinder Singh
25845b590fbeSJasvinder Singhshow port traffic management capability (hierarchy level)
25855b590fbeSJasvinder Singh~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
25865b590fbeSJasvinder Singh
25875b590fbeSJasvinder SinghShow traffic management hierarchy level capability of the port::
25885b590fbeSJasvinder Singh
25890bd797e9STomasz Duszynski   testpmd> show port tm level cap (port_id) (level_id)
25905b590fbeSJasvinder Singh
25915b590fbeSJasvinder Singhshow port traffic management capability (hierarchy node level)
25925b590fbeSJasvinder Singh~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
25935b590fbeSJasvinder Singh
25945b590fbeSJasvinder SinghShow the traffic management hierarchy node capability of the port::
25955b590fbeSJasvinder Singh
25960bd797e9STomasz Duszynski   testpmd> show port tm node cap (port_id) (node_id)
25975b590fbeSJasvinder Singh
25985b590fbeSJasvinder Singhshow port traffic management hierarchy node type
25995b590fbeSJasvinder Singh~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26005b590fbeSJasvinder Singh
26015b590fbeSJasvinder SinghShow the port traffic management hierarchy node type::
26025b590fbeSJasvinder Singh
26035b590fbeSJasvinder Singh   testpmd> show port tm node type (port_id) (node_id)
26045b590fbeSJasvinder Singh
26055b590fbeSJasvinder Singhshow port traffic management hierarchy node stats
26065b590fbeSJasvinder Singh~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26075b590fbeSJasvinder Singh
26085b590fbeSJasvinder SinghShow the port traffic management hierarchy node statistics::
26095b590fbeSJasvinder Singh
26105b590fbeSJasvinder Singh   testpmd> show port tm node stats (port_id) (node_id) (clear)
26115b590fbeSJasvinder Singh
26125b590fbeSJasvinder Singhwhere:
26135b590fbeSJasvinder Singh
26145b590fbeSJasvinder Singh* ``clear``: When this parameter has a non-zero value, the statistics counters
26155b590fbeSJasvinder Singh  are cleared (i.e. set to zero) immediately after they have been read,
26165b590fbeSJasvinder Singh  otherwise the statistics counters are left untouched.
26175b590fbeSJasvinder Singh
26185b590fbeSJasvinder SinghAdd port traffic management private shaper profile
26195b590fbeSJasvinder Singh~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26205b590fbeSJasvinder Singh
26215b590fbeSJasvinder SinghAdd the port traffic management private shaper profile::
26225b590fbeSJasvinder Singh
26235b590fbeSJasvinder Singh   testpmd> add port tm node shaper profile (port_id) (shaper_profile_id) \
2624c2c15f76SRosen Xu   (cmit_tb_rate) (cmit_tb_size) (peak_tb_rate) (peak_tb_size) \
2625bb52561eSNithin Dabilpuram   (packet_length_adjust) (packet_mode)
26265b590fbeSJasvinder Singh
26275b590fbeSJasvinder Singhwhere:
26285b590fbeSJasvinder Singh
26295b590fbeSJasvinder Singh* ``shaper_profile id``: Shaper profile ID for the new profile.
2630bb52561eSNithin Dabilpuram* ``cmit_tb_rate``: Committed token bucket rate (bytes per second or packets per second).
2631bb52561eSNithin Dabilpuram* ``cmit_tb_size``: Committed token bucket size (bytes or packets).
2632bb52561eSNithin Dabilpuram* ``peak_tb_rate``: Peak token bucket rate (bytes per second or packets per second).
2633bb52561eSNithin Dabilpuram* ``peak_tb_size``: Peak token bucket size (bytes or packets).
26345b590fbeSJasvinder Singh* ``packet_length_adjust``: The value (bytes) to be added to the length of
26355b590fbeSJasvinder Singh  each packet for the purpose of shaping. This parameter value can be used to
26365b590fbeSJasvinder Singh  correct the packet length with the framing overhead bytes that are consumed
26375b590fbeSJasvinder Singh  on the wire.
2638bb52561eSNithin Dabilpuram* ``packet_mode``: Shaper configured in packet mode. This parameter value if
2639bb52561eSNithin Dabilpuram  zero, configures shaper in byte mode and if non-zero configures it in packet
2640bb52561eSNithin Dabilpuram  mode.
26415b590fbeSJasvinder Singh
26425b590fbeSJasvinder SinghDelete port traffic management private shaper profile
26435b590fbeSJasvinder Singh~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26445b590fbeSJasvinder Singh
26455b590fbeSJasvinder SinghDelete the port traffic management private shaper::
26465b590fbeSJasvinder Singh
26475b590fbeSJasvinder Singh   testpmd> del port tm node shaper profile (port_id) (shaper_profile_id)
26485b590fbeSJasvinder Singh
26495b590fbeSJasvinder Singhwhere:
26505b590fbeSJasvinder Singh
26515b590fbeSJasvinder Singh* ``shaper_profile id``: Shaper profile ID that needs to be deleted.
26525b590fbeSJasvinder Singh
26535b590fbeSJasvinder SinghAdd port traffic management shared shaper
26545b590fbeSJasvinder Singh~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26555b590fbeSJasvinder Singh
26565b590fbeSJasvinder SinghCreate the port traffic management shared shaper::
26575b590fbeSJasvinder Singh
26585b590fbeSJasvinder Singh   testpmd> add port tm node shared shaper (port_id) (shared_shaper_id) \
26595b590fbeSJasvinder Singh   (shaper_profile_id)
26605b590fbeSJasvinder Singh
26615b590fbeSJasvinder Singhwhere:
26625b590fbeSJasvinder Singh
26635b590fbeSJasvinder Singh* ``shared_shaper_id``: Shared shaper ID to be created.
26645b590fbeSJasvinder Singh* ``shaper_profile id``: Shaper profile ID for shared shaper.
26655b590fbeSJasvinder Singh
26665b590fbeSJasvinder SinghSet port traffic management shared shaper
26675b590fbeSJasvinder Singh~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26685b590fbeSJasvinder Singh
26695b590fbeSJasvinder SinghUpdate the port traffic management shared shaper::
26705b590fbeSJasvinder Singh
26715b590fbeSJasvinder Singh   testpmd> set port tm node shared shaper (port_id) (shared_shaper_id) \
26725b590fbeSJasvinder Singh   (shaper_profile_id)
26735b590fbeSJasvinder Singh
26745b590fbeSJasvinder Singhwhere:
26755b590fbeSJasvinder Singh
26765b590fbeSJasvinder Singh* ``shared_shaper_id``: Shared shaper ID to be update.
26775b590fbeSJasvinder Singh* ``shaper_profile id``: Shaper profile ID for shared shaper.
26785b590fbeSJasvinder Singh
26795b590fbeSJasvinder SinghDelete port traffic management shared shaper
26805b590fbeSJasvinder Singh~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26815b590fbeSJasvinder Singh
26825b590fbeSJasvinder SinghDelete the port traffic management shared shaper::
26835b590fbeSJasvinder Singh
26845b590fbeSJasvinder Singh   testpmd> del port tm node shared shaper (port_id) (shared_shaper_id)
26855b590fbeSJasvinder Singh
26865b590fbeSJasvinder Singhwhere:
26875b590fbeSJasvinder Singh
26885b590fbeSJasvinder Singh* ``shared_shaper_id``: Shared shaper ID to be deleted.
26895b590fbeSJasvinder Singh
2690d629b7b5SJohn McNamaraSet port traffic management hierarchy node private shaper
2691d629b7b5SJohn McNamara~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26925b590fbeSJasvinder Singh
26935b590fbeSJasvinder Singhset the port traffic management hierarchy node private shaper::
26945b590fbeSJasvinder Singh
26955b590fbeSJasvinder Singh   testpmd> set port tm node shaper profile (port_id) (node_id) \
26965b590fbeSJasvinder Singh   (shaper_profile_id)
26975b590fbeSJasvinder Singh
26985b590fbeSJasvinder Singhwhere:
26995b590fbeSJasvinder Singh
27005b590fbeSJasvinder Singh* ``shaper_profile id``: Private shaper profile ID to be enabled on the
27015b590fbeSJasvinder Singh  hierarchy node.
27025b590fbeSJasvinder Singh
27035b590fbeSJasvinder SinghAdd port traffic management WRED profile
27045b590fbeSJasvinder Singh~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27055b590fbeSJasvinder Singh
27065b590fbeSJasvinder SinghCreate a new WRED profile::
27075b590fbeSJasvinder Singh
27085b590fbeSJasvinder Singh   testpmd> add port tm node wred profile (port_id) (wred_profile_id) \
27095b590fbeSJasvinder Singh   (color_g) (min_th_g) (max_th_g) (maxp_inv_g) (wq_log2_g) \
27105b590fbeSJasvinder Singh   (color_y) (min_th_y) (max_th_y) (maxp_inv_y) (wq_log2_y) \
27115b590fbeSJasvinder Singh   (color_r) (min_th_r) (max_th_r) (maxp_inv_r) (wq_log2_r)
27125b590fbeSJasvinder Singh
27135b590fbeSJasvinder Singhwhere:
27145b590fbeSJasvinder Singh
27155b590fbeSJasvinder Singh* ``wred_profile id``: Identifier for the newly create WRED profile
27165b590fbeSJasvinder Singh* ``color_g``: Packet color (green)
27175b590fbeSJasvinder Singh* ``min_th_g``: Minimum queue threshold for packet with green color
27185b590fbeSJasvinder Singh* ``max_th_g``: Minimum queue threshold for packet with green color
27195b590fbeSJasvinder Singh* ``maxp_inv_g``: Inverse of packet marking probability maximum value (maxp)
27205b590fbeSJasvinder Singh* ``wq_log2_g``: Negated log2 of queue weight (wq)
27215b590fbeSJasvinder Singh* ``color_y``: Packet color (yellow)
27225b590fbeSJasvinder Singh* ``min_th_y``: Minimum queue threshold for packet with yellow color
27235b590fbeSJasvinder Singh* ``max_th_y``: Minimum queue threshold for packet with yellow color
27245b590fbeSJasvinder Singh* ``maxp_inv_y``: Inverse of packet marking probability maximum value (maxp)
27255b590fbeSJasvinder Singh* ``wq_log2_y``: Negated log2 of queue weight (wq)
27265b590fbeSJasvinder Singh* ``color_r``: Packet color (red)
27275b590fbeSJasvinder Singh* ``min_th_r``: Minimum queue threshold for packet with yellow color
27285b590fbeSJasvinder Singh* ``max_th_r``: Minimum queue threshold for packet with yellow color
27295b590fbeSJasvinder Singh* ``maxp_inv_r``: Inverse of packet marking probability maximum value (maxp)
27305b590fbeSJasvinder Singh* ``wq_log2_r``: Negated log2 of queue weight (wq)
27315b590fbeSJasvinder Singh
27325b590fbeSJasvinder SinghDelete port traffic management WRED profile
27335b590fbeSJasvinder Singh~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27345b590fbeSJasvinder Singh
27355b590fbeSJasvinder SinghDelete the WRED profile::
27365b590fbeSJasvinder Singh
27375b590fbeSJasvinder Singh   testpmd> del port tm node wred profile (port_id) (wred_profile_id)
27385b590fbeSJasvinder Singh
27395b590fbeSJasvinder SinghAdd port traffic management hierarchy nonleaf node
27405b590fbeSJasvinder Singh~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27415b590fbeSJasvinder Singh
2742d629b7b5SJohn McNamaraAdd nonleaf node to port traffic management hierarchy::
27435b590fbeSJasvinder Singh
27445b590fbeSJasvinder Singh   testpmd> add port tm nonleaf node (port_id) (node_id) (parent_node_id) \
27455b590fbeSJasvinder Singh   (priority) (weight) (level_id) (shaper_profile_id) \
2746448c2332SJasvinder Singh   (n_sp_priorities) (stats_mask) (n_shared_shapers) \
2747448c2332SJasvinder Singh   [(shared_shaper_0) (shared_shaper_1) ...] \
27485b590fbeSJasvinder Singh
27495b590fbeSJasvinder Singhwhere:
27505b590fbeSJasvinder Singh
27515b590fbeSJasvinder Singh* ``parent_node_id``: Node ID of the parent.
27525b590fbeSJasvinder Singh* ``priority``: Node priority (highest node priority is zero). This is used by
27535b590fbeSJasvinder Singh  the SP algorithm running on the parent node for scheduling this node.
27545b590fbeSJasvinder Singh* ``weight``: Node weight (lowest weight is one). The node weight is relative
27555b590fbeSJasvinder Singh  to the weight sum of all siblings that have the same priority. It is used by
27565b590fbeSJasvinder Singh  the WFQ algorithm running on the parent node for scheduling this node.
2757d629b7b5SJohn McNamara* ``level_id``: Hierarchy level of the node.
27585b590fbeSJasvinder Singh* ``shaper_profile_id``: Shaper profile ID of the private shaper to be used by
27595b590fbeSJasvinder Singh  the node.
27605b590fbeSJasvinder Singh* ``n_sp_priorities``: Number of strict priorities.
27615b590fbeSJasvinder Singh* ``stats_mask``: Mask of statistics counter types to be enabled for this node.
2762448c2332SJasvinder Singh* ``n_shared_shapers``: Number of shared shapers.
2763448c2332SJasvinder Singh* ``shared_shaper_id``: Shared shaper id.
27645b590fbeSJasvinder Singh
2765bb52561eSNithin DabilpuramAdd port traffic management hierarchy nonleaf node with packet mode
2766bb52561eSNithin Dabilpuram~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2767bb52561eSNithin Dabilpuram
2768bb52561eSNithin DabilpuramAdd nonleaf node with packet mode to port traffic management hierarchy::
2769bb52561eSNithin Dabilpuram
2770bb52561eSNithin Dabilpuram   testpmd> add port tm nonleaf node pktmode (port_id) (node_id) (parent_node_id) \
2771bb52561eSNithin Dabilpuram   (priority) (weight) (level_id) (shaper_profile_id) \
2772bb52561eSNithin Dabilpuram   (n_sp_priorities) (stats_mask) (n_shared_shapers) \
2773bb52561eSNithin Dabilpuram   [(shared_shaper_0) (shared_shaper_1) ...] \
2774bb52561eSNithin Dabilpuram
2775bb52561eSNithin Dabilpuramwhere:
2776bb52561eSNithin Dabilpuram
2777bb52561eSNithin Dabilpuram* ``parent_node_id``: Node ID of the parent.
2778bb52561eSNithin Dabilpuram* ``priority``: Node priority (highest node priority is zero). This is used by
2779bb52561eSNithin Dabilpuram  the SP algorithm running on the parent node for scheduling this node.
2780bb52561eSNithin Dabilpuram* ``weight``: Node weight (lowest weight is one). The node weight is relative
2781bb52561eSNithin Dabilpuram  to the weight sum of all siblings that have the same priority. It is used by
2782bb52561eSNithin Dabilpuram  the WFQ algorithm running on the parent node for scheduling this node.
2783bb52561eSNithin Dabilpuram* ``level_id``: Hierarchy level of the node.
2784bb52561eSNithin Dabilpuram* ``shaper_profile_id``: Shaper profile ID of the private shaper to be used by
2785bb52561eSNithin Dabilpuram  the node.
2786bb52561eSNithin Dabilpuram* ``n_sp_priorities``: Number of strict priorities. Packet mode is enabled on
2787bb52561eSNithin Dabilpuram  all of them.
2788bb52561eSNithin Dabilpuram* ``stats_mask``: Mask of statistics counter types to be enabled for this node.
2789bb52561eSNithin Dabilpuram* ``n_shared_shapers``: Number of shared shapers.
2790bb52561eSNithin Dabilpuram* ``shared_shaper_id``: Shared shaper id.
2791bb52561eSNithin Dabilpuram
27925b590fbeSJasvinder SinghAdd port traffic management hierarchy leaf node
27935b590fbeSJasvinder Singh~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27945b590fbeSJasvinder Singh
2795d629b7b5SJohn McNamaraAdd leaf node to port traffic management hierarchy::
27965b590fbeSJasvinder Singh
27975b590fbeSJasvinder Singh   testpmd> add port tm leaf node (port_id) (node_id) (parent_node_id) \
27985b590fbeSJasvinder Singh   (priority) (weight) (level_id) (shaper_profile_id) \
2799448c2332SJasvinder Singh   (cman_mode) (wred_profile_id) (stats_mask) (n_shared_shapers) \
2800448c2332SJasvinder Singh   [(shared_shaper_id) (shared_shaper_id) ...] \
28015b590fbeSJasvinder Singh
28025b590fbeSJasvinder Singhwhere:
28035b590fbeSJasvinder Singh
28045b590fbeSJasvinder Singh* ``parent_node_id``: Node ID of the parent.
28055b590fbeSJasvinder Singh* ``priority``: Node priority (highest node priority is zero). This is used by
28065b590fbeSJasvinder Singh  the SP algorithm running on the parent node for scheduling this node.
28075b590fbeSJasvinder Singh* ``weight``: Node weight (lowest weight is one). The node weight is relative
28085b590fbeSJasvinder Singh  to the weight sum of all siblings that have the same priority. It is used by
28095b590fbeSJasvinder Singh  the WFQ algorithm running on the parent node for scheduling this node.
2810d629b7b5SJohn McNamara* ``level_id``: Hierarchy level of the node.
28115b590fbeSJasvinder Singh* ``shaper_profile_id``: Shaper profile ID of the private shaper to be used by
28125b590fbeSJasvinder Singh  the node.
28135b590fbeSJasvinder Singh* ``cman_mode``: Congestion management mode to be enabled for this node.
28145b590fbeSJasvinder Singh* ``wred_profile_id``: WRED profile id to be enabled for this node.
28155b590fbeSJasvinder Singh* ``stats_mask``: Mask of statistics counter types to be enabled for this node.
2816448c2332SJasvinder Singh* ``n_shared_shapers``: Number of shared shapers.
2817448c2332SJasvinder Singh* ``shared_shaper_id``: Shared shaper id.
28185b590fbeSJasvinder Singh
281925a2a0dcSBruce RichardsonQuery port traffic management hierarchy node
282025a2a0dcSBruce Richardson~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
282125a2a0dcSBruce Richardson
282225a2a0dcSBruce RichardsonAn added traffic management hierarchy node, whether leaf of non-leaf,
282325a2a0dcSBruce Richardsoncan be queried using::
282425a2a0dcSBruce Richardson
282525a2a0dcSBruce Richardson    testpmd> show port tm node (port_id) (node_id)
282625a2a0dcSBruce Richardson
282725a2a0dcSBruce Richardsonwhere ``port_id`` and ``node_id`` are the numeric identifiers of the ethernet port
282825a2a0dcSBruce Richardsonand the previously added traffic management node, respectively.
282925a2a0dcSBruce RichardsonThe output of this command are the parameters previously provided to the add call,
283025a2a0dcSBruce Richardsonprinted with appropriate labels.
283125a2a0dcSBruce RichardsonFor example::
283225a2a0dcSBruce Richardson
283325a2a0dcSBruce Richardson   testpmd> show port tm node 0 90
283425a2a0dcSBruce Richardson   Port 0 TM Node 90
283525a2a0dcSBruce Richardson     Parent Node ID: 100
283625a2a0dcSBruce Richardson     Level ID: 1
283725a2a0dcSBruce Richardson     Priority: 0
283825a2a0dcSBruce Richardson     Weight: 1
283925a2a0dcSBruce Richardson     Shaper Profile ID: <none>
284025a2a0dcSBruce Richardson     Shared Shaper IDs: <none>
284125a2a0dcSBruce Richardson     Stats Mask: 0
284225a2a0dcSBruce Richardson     Nonleaf Node Parameters
284325a2a0dcSBruce Richardson       Num Strict Priorities: 1
284425a2a0dcSBruce Richardson       WFQ Weights Mode: WFQ
284525a2a0dcSBruce Richardson
28465b590fbeSJasvinder SinghDelete port traffic management hierarchy node
28475b590fbeSJasvinder Singh~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
28485b590fbeSJasvinder Singh
2849d629b7b5SJohn McNamaraDelete node from port traffic management hierarchy::
28505b590fbeSJasvinder Singh
28515b590fbeSJasvinder Singh   testpmd> del port tm node (port_id) (node_id)
28525b590fbeSJasvinder Singh
28535b590fbeSJasvinder SinghUpdate port traffic management hierarchy parent node
28545b590fbeSJasvinder Singh~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
28555b590fbeSJasvinder Singh
28565b590fbeSJasvinder SinghUpdate port traffic management hierarchy parent node::
28575b590fbeSJasvinder Singh
28585b590fbeSJasvinder Singh   testpmd> set port tm node parent (port_id) (node_id) (parent_node_id) \
28595b590fbeSJasvinder Singh   (priority) (weight)
28605b590fbeSJasvinder Singh
28615b590fbeSJasvinder SinghThis function can only be called after the hierarchy commit invocation. Its
28625b590fbeSJasvinder Singhsuccess depends on the port support for this operation, as advertised through
28635b590fbeSJasvinder Singhthe port capability set. This function is valid for all nodes of the traffic
28645b590fbeSJasvinder Singhmanagement hierarchy except root node.
28655b590fbeSJasvinder Singh
2866079dcbb8STomasz DuszynskiSuspend port traffic management hierarchy node
2867079dcbb8STomasz Duszynski~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2868079dcbb8STomasz Duszynski
2869079dcbb8STomasz Duszynski   testpmd> suspend port tm node (port_id) (node_id)
2870079dcbb8STomasz Duszynski
287112f76f52STomasz DuszynskiResume port traffic management hierarchy node
287212f76f52STomasz Duszynski~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
287312f76f52STomasz Duszynski
287412f76f52STomasz Duszynski   testpmd> resume port tm node (port_id) (node_id)
287512f76f52STomasz Duszynski
28765b590fbeSJasvinder SinghCommit port traffic management hierarchy
28775b590fbeSJasvinder Singh~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
28785b590fbeSJasvinder Singh
28795b590fbeSJasvinder SinghCommit the traffic management hierarchy on the port::
28805b590fbeSJasvinder Singh
28815b590fbeSJasvinder Singh   testpmd> port tm hierarchy commit (port_id) (clean_on_fail)
28825b590fbeSJasvinder Singh
28835b590fbeSJasvinder Singhwhere:
28845b590fbeSJasvinder Singh
28855b590fbeSJasvinder Singh* ``clean_on_fail``: When set to non-zero, hierarchy is cleared on function
28865b590fbeSJasvinder Singh  call failure. On the other hand, hierarchy is preserved when this parameter
28875b590fbeSJasvinder Singh  is equal to zero.
28885b590fbeSJasvinder Singh
28896673fe0cSKrzysztof KanasSet port traffic management mark VLAN dei
28906673fe0cSKrzysztof Kanas~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
28916673fe0cSKrzysztof Kanas
28926673fe0cSKrzysztof KanasEnables/Disables the traffic management marking on the port for VLAN packets::
28936673fe0cSKrzysztof Kanas
28946673fe0cSKrzysztof Kanas   testpmd> set port tm mark vlan_dei <port_id> <green> <yellow> <red>
28956673fe0cSKrzysztof Kanas
28966673fe0cSKrzysztof Kanaswhere:
28976673fe0cSKrzysztof Kanas
28986673fe0cSKrzysztof Kanas* ``port_id``: The port which on which VLAN packets marked as ``green`` or
28996673fe0cSKrzysztof Kanas  ``yellow`` or ``red`` will have dei bit enabled
29006673fe0cSKrzysztof Kanas
29016673fe0cSKrzysztof Kanas* ``green`` enable 1, disable 0 marking for dei bit of VLAN packets marked as green
29026673fe0cSKrzysztof Kanas
29036673fe0cSKrzysztof Kanas* ``yellow`` enable 1, disable 0 marking for dei bit of VLAN packets marked as yellow
29046673fe0cSKrzysztof Kanas
29056673fe0cSKrzysztof Kanas* ``red`` enable 1, disable 0 marking for dei bit of VLAN packets marked as red
29066673fe0cSKrzysztof Kanas
29076673fe0cSKrzysztof KanasSet port traffic management mark IP dscp
29086673fe0cSKrzysztof Kanas~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29096673fe0cSKrzysztof Kanas
29106673fe0cSKrzysztof KanasEnables/Disables the traffic management marking on the port for IP dscp packets::
29116673fe0cSKrzysztof Kanas
29126673fe0cSKrzysztof Kanas   testpmd> set port tm mark ip_dscp <port_id> <green> <yellow> <red>
29136673fe0cSKrzysztof Kanas
29146673fe0cSKrzysztof Kanaswhere:
29156673fe0cSKrzysztof Kanas
29166673fe0cSKrzysztof Kanas* ``port_id``: The port which on which IP packets marked as ``green`` or
29176673fe0cSKrzysztof Kanas  ``yellow`` or ``red`` will have IP dscp bits updated
29186673fe0cSKrzysztof Kanas
29196673fe0cSKrzysztof Kanas* ``green`` enable 1, disable 0 marking IP dscp to low drop precedence for green packets
29206673fe0cSKrzysztof Kanas
29216673fe0cSKrzysztof Kanas* ``yellow`` enable 1, disable 0 marking IP dscp to medium drop precedence for yellow packets
29226673fe0cSKrzysztof Kanas
29236673fe0cSKrzysztof Kanas* ``red`` enable 1, disable 0 marking IP dscp to high drop precedence for red packets
29246673fe0cSKrzysztof Kanas
29256673fe0cSKrzysztof KanasSet port traffic management mark IP ecn
29266673fe0cSKrzysztof Kanas~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29276673fe0cSKrzysztof Kanas
29286673fe0cSKrzysztof KanasEnables/Disables the traffic management marking on the port for IP ecn packets::
29296673fe0cSKrzysztof Kanas
29306673fe0cSKrzysztof Kanas   testpmd> set port tm mark ip_ecn <port_id> <green> <yellow> <red>
29316673fe0cSKrzysztof Kanas
29326673fe0cSKrzysztof Kanaswhere:
29336673fe0cSKrzysztof Kanas
29346673fe0cSKrzysztof Kanas* ``port_id``: The port which on which IP packets marked as ``green`` or
29356673fe0cSKrzysztof Kanas  ``yellow`` or ``red`` will have IP ecn bits updated
29366673fe0cSKrzysztof Kanas
29376673fe0cSKrzysztof Kanas* ``green`` enable 1, disable 0 marking IP ecn for green marked packets with ecn of 2'b01  or 2'b10
29386673fe0cSKrzysztof Kanas  to ecn of 2'b11 when IP is caring TCP or SCTP
29396673fe0cSKrzysztof Kanas
29406673fe0cSKrzysztof Kanas* ``yellow`` enable 1, disable 0 marking IP ecn for yellow marked packets with ecn of 2'b01  or 2'b10
29416673fe0cSKrzysztof Kanas  to ecn of 2'b11 when IP is caring TCP or SCTP
29426673fe0cSKrzysztof Kanas
29436673fe0cSKrzysztof Kanas* ``red`` enable 1, disable 0 marking IP ecn for yellow marked packets with ecn of 2'b01  or 2'b10
29446673fe0cSKrzysztof Kanas  to ecn of 2'b11 when IP is caring TCP or SCTP
29456673fe0cSKrzysztof Kanas
294640aec524SSunil Kumar KoriCongestion Management
294740aec524SSunil Kumar Kori---------------------
294840aec524SSunil Kumar Kori
294940aec524SSunil Kumar KoriGet capabilities
295040aec524SSunil Kumar Kori~~~~~~~~~~~~~~~~
295140aec524SSunil Kumar Kori
295240aec524SSunil Kumar KoriRetrieve congestion management capabilities supported by driver for given port.
295340aec524SSunil Kumar KoriBelow example command retrieves capabilities for port 0::
295440aec524SSunil Kumar Kori
295540aec524SSunil Kumar Kori   testpmd> show port cman capa 0
295640aec524SSunil Kumar Kori
295740aec524SSunil Kumar KoriGet configuration
295840aec524SSunil Kumar Kori~~~~~~~~~~~~~~~~~
295940aec524SSunil Kumar Kori
296040aec524SSunil Kumar KoriRetrieve congestion management configuration for given port.
296140aec524SSunil Kumar KoriBelow example command retrieves configuration for port 0::
296240aec524SSunil Kumar Kori
296340aec524SSunil Kumar Kori   testpmd> show port cman config 0
296440aec524SSunil Kumar Kori
296540aec524SSunil Kumar KoriSet configuration
296640aec524SSunil Kumar Kori~~~~~~~~~~~~~~~~~
296740aec524SSunil Kumar Kori
296840aec524SSunil Kumar KoriConfigures congestion management settings on given queue
296940aec524SSunil Kumar Korior mempool associated with queue.
297040aec524SSunil Kumar KoriBelow example command configures RED as congestion management algorithm
297140aec524SSunil Kumar Korifor port 0 and queue 0::
297240aec524SSunil Kumar Kori
297340aec524SSunil Kumar Kori   testpmd> set port cman config 0 0 obj queue mode red 10 100 1
297440aec524SSunil Kumar Kori
2975a997a33bSAdrien Mazarguil.. _testpmd_rte_flow:
2976a997a33bSAdrien Mazarguil
2977a997a33bSAdrien MazarguilFlow rules management
2978a997a33bSAdrien Mazarguil---------------------
2979a997a33bSAdrien Mazarguil
2980a997a33bSAdrien MazarguilControl of the generic flow API (*rte_flow*) is fully exposed through the
29819ad3a41aSAlexander Kozyrev``flow`` command (configuration, validation, creation, destruction, queries
29829ad3a41aSAlexander Kozyrevand operation modes).
2983a997a33bSAdrien Mazarguil
2984a997a33bSAdrien Mazarguil``flow`` syntax
2985a997a33bSAdrien Mazarguil~~~~~~~~~~~~~~~
2986a997a33bSAdrien Mazarguil
2987a997a33bSAdrien MazarguilBecause the ``flow`` command uses dynamic tokens to handle the large number
2988a997a33bSAdrien Mazarguilof possible flow rules combinations, its behavior differs slightly from
2989a997a33bSAdrien Mazarguilother commands, in particular:
2990a997a33bSAdrien Mazarguil
2991a997a33bSAdrien Mazarguil- Pressing *?* or the *<tab>* key displays contextual help for the current
2992a997a33bSAdrien Mazarguil  token, not that of the entire command.
2993a997a33bSAdrien Mazarguil
2994a997a33bSAdrien Mazarguil- Optional and repeated parameters are supported (provided they are listed
2995a997a33bSAdrien Mazarguil  in the contextual help).
2996a997a33bSAdrien Mazarguil
2997a997a33bSAdrien MazarguilThe first parameter stands for the operation mode. Possible operations and
2998a997a33bSAdrien Mazarguiltheir general syntax are described below. They are covered in detail in the
2999a997a33bSAdrien Mazarguilfollowing sections.
3000a997a33bSAdrien Mazarguil
30019ad3a41aSAlexander Kozyrev- Get info about flow engine::
30029ad3a41aSAlexander Kozyrev
30039ad3a41aSAlexander Kozyrev   flow info {port_id}
30049ad3a41aSAlexander Kozyrev
30059ad3a41aSAlexander Kozyrev- Configure flow engine::
30069ad3a41aSAlexander Kozyrev
30079ad3a41aSAlexander Kozyrev   flow configure {port_id}
30089ad3a41aSAlexander Kozyrev       [queues_number {number}] [queues_size {size}]
30099ad3a41aSAlexander Kozyrev       [counters_number {number}]
30109ad3a41aSAlexander Kozyrev       [aging_counters_number {number}]
3011dcc9a80cSMichael Baum       [meters_number {number}] [flags {number}]
30129ad3a41aSAlexander Kozyrev
301304cc665fSAlexander Kozyrev- Create a pattern template::
3014d252801dSMichael Baum
301504cc665fSAlexander Kozyrev   flow pattern_template {port_id} create [pattern_template_id {id}]
301604cc665fSAlexander Kozyrev       [relaxed {boolean}] [ingress] [egress] [transfer]
301704cc665fSAlexander Kozyrev       template {item} [/ {item} [...]] / end
301804cc665fSAlexander Kozyrev
301904cc665fSAlexander Kozyrev- Destroy a pattern template::
302004cc665fSAlexander Kozyrev
302104cc665fSAlexander Kozyrev   flow pattern_template {port_id} destroy pattern_template {id} [...]
302204cc665fSAlexander Kozyrev
302304cc665fSAlexander Kozyrev- Create an actions template::
302404cc665fSAlexander Kozyrev
302504cc665fSAlexander Kozyrev   flow actions_template {port_id} create [actions_template_id {id}]
302604cc665fSAlexander Kozyrev       [ingress] [egress] [transfer]
302704cc665fSAlexander Kozyrev       template {action} [/ {action} [...]] / end
302804cc665fSAlexander Kozyrev       mask {action} [/ {action} [...]] / end
302904cc665fSAlexander Kozyrev
303004cc665fSAlexander Kozyrev- Destroy an actions template::
303104cc665fSAlexander Kozyrev
303204cc665fSAlexander Kozyrev   flow actions_template {port_id} destroy actions_template {id} [...]
303304cc665fSAlexander Kozyrev
3034c4b38873SAlexander Kozyrev- Create a table::
3035c4b38873SAlexander Kozyrev
3036c4b38873SAlexander Kozyrev   flow table {port_id} create
303799231e48SGregory Etelson       [table_id {id}] [resizable]
3038c4b38873SAlexander Kozyrev       [group {group_id}] [priority {level}] [ingress] [egress] [transfer]
3039c4b38873SAlexander Kozyrev       rules_number {number}
3040c4b38873SAlexander Kozyrev       pattern_template {pattern_template_id}
3041c4b38873SAlexander Kozyrev       actions_template {actions_template_id}
3042c4b38873SAlexander Kozyrev
304399231e48SGregory Etelson- Resize a table::
304499231e48SGregory Etelson
304599231e48SGregory Etelson   flow template_table {port_id} resize
304699231e48SGregory Etelson       table_resize_id {id} table_resize_rules_num {number}
304799231e48SGregory Etelson
304899231e48SGregory Etelson- Complete table resize::
304999231e48SGregory Etelson
305099231e48SGregory Etelson   flow template_table {port_id} resize_complete table {table_id}
305199231e48SGregory Etelson
3052c4b38873SAlexander Kozyrev- Destroy a table::
3053c4b38873SAlexander Kozyrev
3054c4b38873SAlexander Kozyrev   flow table {port_id} destroy table {id} [...]
3055c4b38873SAlexander Kozyrev
3056a997a33bSAdrien Mazarguil- Check whether a flow rule can be created::
3057a997a33bSAdrien Mazarguil
3058a997a33bSAdrien Mazarguil   flow validate {port_id}
305976e9a55bSAdrien Mazarguil       [group {group_id}] [priority {level}] [ingress] [egress] [transfer]
3060a997a33bSAdrien Mazarguil       pattern {item} [/ {item} [...]] / end
3061a997a33bSAdrien Mazarguil       actions {action} [/ {action} [...]] / end
3062a997a33bSAdrien Mazarguil
3063ecdc927bSAlexander Kozyrev- Enqueue creation of a flow rule::
3064ecdc927bSAlexander Kozyrev
3065ecdc927bSAlexander Kozyrev   flow queue {port_id} create {queue_id}
3066ecdc927bSAlexander Kozyrev       [postpone {boolean}] template_table {table_id}
3067ecdc927bSAlexander Kozyrev       pattern_template {pattern_template_index}
3068ecdc927bSAlexander Kozyrev       actions_template {actions_template_index}
3069ecdc927bSAlexander Kozyrev       pattern {item} [/ {item} [...]] / end
3070ecdc927bSAlexander Kozyrev       actions {action} [/ {action} [...]] / end
3071ecdc927bSAlexander Kozyrev
307299231e48SGregory Etelson- Enqueue flow update following table resize::
307399231e48SGregory Etelson
307499231e48SGregory Etelson   flow queue {port_id} update_resized {table_id} rule {rule_id}
307599231e48SGregory Etelson
3076ecdc927bSAlexander Kozyrev- Enqueue destruction of specific flow rules::
3077ecdc927bSAlexander Kozyrev
3078ecdc927bSAlexander Kozyrev   flow queue {port_id} destroy {queue_id}
3079ecdc927bSAlexander Kozyrev       [postpone {boolean}] rule {rule_id} [...]
3080ecdc927bSAlexander Kozyrev
30819cbbee14SAlexander Kozyrev- Push enqueued operations::
30829cbbee14SAlexander Kozyrev
30839cbbee14SAlexander Kozyrev   flow push {port_id} queue {queue_id}
30849cbbee14SAlexander Kozyrev
3085f9bf7dffSAlexander Kozyrev- Pull all operations results from a queue::
3086f9bf7dffSAlexander Kozyrev
3087f9bf7dffSAlexander Kozyrev   flow pull {port_id} queue {queue_id}
3088f9bf7dffSAlexander Kozyrev
3089a997a33bSAdrien Mazarguil- Create a flow rule::
3090a997a33bSAdrien Mazarguil
3091a997a33bSAdrien Mazarguil   flow create {port_id}
30928ac3a1cdSEli Britstein       [group {group_id}] [priority {level}] [ingress] [egress]
30938ac3a1cdSEli Britstein       [transfer] [tunnel_set {tunnel_id}] [tunnel_match {tunnel_id}]
30948ac3a1cdSEli Britstein       [user_id {user_id}] pattern {item} [/ {item} [...]] / end
3095a997a33bSAdrien Mazarguil       actions {action} [/ {action} [...]] / end
3096a997a33bSAdrien Mazarguil
3097a997a33bSAdrien Mazarguil- Destroy specific flow rules::
3098a997a33bSAdrien Mazarguil
30998ac3a1cdSEli Britstein   flow destroy {port_id} rule {rule_id} [...] [user_id]
3100a997a33bSAdrien Mazarguil
31012d9c7e56SOleksandr Kolomeiets- Update a flow rule with new actions::
31022d9c7e56SOleksandr Kolomeiets
31032d9c7e56SOleksandr Kolomeiets   flow update {port_id} {rule_id}
31042d9c7e56SOleksandr Kolomeiets       actions {action} [/ {action} [...]] / end [user_id]
31052d9c7e56SOleksandr Kolomeiets
3106a997a33bSAdrien Mazarguil- Destroy all flow rules::
3107a997a33bSAdrien Mazarguil
3108a997a33bSAdrien Mazarguil   flow flush {port_id}
3109a997a33bSAdrien Mazarguil
3110a997a33bSAdrien Mazarguil- Query an existing flow rule::
3111a997a33bSAdrien Mazarguil
31128ac3a1cdSEli Britstein   flow query {port_id} {rule_id} {action} [user_id]
3113a997a33bSAdrien Mazarguil
3114a997a33bSAdrien Mazarguil- List existing flow rules sorted by priority, filtered by group
3115a997a33bSAdrien Mazarguil  identifiers::
3116a997a33bSAdrien Mazarguil
3117a997a33bSAdrien Mazarguil   flow list {port_id} [group {group_id}] [...]
3118a997a33bSAdrien Mazarguil
3119323f811aSAdrien Mazarguil- Restrict ingress traffic to the defined flow rules::
3120323f811aSAdrien Mazarguil
3121323f811aSAdrien Mazarguil   flow isolate {port_id} {boolean}
3122323f811aSAdrien Mazarguil
3123a69c335dSXiaoyu Min- Dump internal representation information of all flows in hardware::
3124a69c335dSXiaoyu Min
31258ac3a1cdSEli Britstein   flow dump {port_id} all {output_file} [user_id]
3126bf085dcbSHaifei Luo
3127bf085dcbSHaifei Luo  for one flow::
3128bf085dcbSHaifei Luo
31298ac3a1cdSEli Britstein   flow dump {port_id} rule {rule_id} {output_file} [user_id]
3130a69c335dSXiaoyu Min
31310e459ffaSDong Zhou- List and destroy aged flow rules::
31320e459ffaSDong Zhou
31330e459ffaSDong Zhou   flow aged {port_id} [destroy]
31340e459ffaSDong Zhou
3135966eb55eSMichael Baum- Enqueue list and destroy aged flow rules::
3136966eb55eSMichael Baum
3137966eb55eSMichael Baum   flow queue {port_id} aged {queue_id} [destroy]
3138966eb55eSMichael Baum
31391b9f2746SGregory Etelson- Tunnel offload - create a tunnel stub::
31401b9f2746SGregory Etelson
31411b9f2746SGregory Etelson   flow tunnel create {port_id} type {tunnel_type}
31421b9f2746SGregory Etelson
31431b9f2746SGregory Etelson- Tunnel offload - destroy a tunnel stub::
31441b9f2746SGregory Etelson
31451b9f2746SGregory Etelson   flow tunnel destroy {port_id} id {tunnel_id}
31461b9f2746SGregory Etelson
31471b9f2746SGregory Etelson- Tunnel offload - list port tunnel stubs::
31481b9f2746SGregory Etelson
31491b9f2746SGregory Etelson   flow tunnel list {port_id}
31501b9f2746SGregory Etelson
31519ad3a41aSAlexander KozyrevRetrieving info about flow management engine
31529ad3a41aSAlexander Kozyrev~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
31539ad3a41aSAlexander Kozyrev
31549ad3a41aSAlexander Kozyrev``flow info`` retrieves info on pre-configurable resources in the underlying
31559ad3a41aSAlexander Kozyrevdevice to give a hint of possible values for flow engine configuration.
31569ad3a41aSAlexander Kozyrev
31579ad3a41aSAlexander Kozyrev``rte_flow_info_get()``::
31589ad3a41aSAlexander Kozyrev
31599ad3a41aSAlexander Kozyrev   flow info {port_id}
31609ad3a41aSAlexander Kozyrev
31619ad3a41aSAlexander KozyrevIf successful, it will show::
31629ad3a41aSAlexander Kozyrev
31639ad3a41aSAlexander Kozyrev   Flow engine resources on port #[...]:
31649ad3a41aSAlexander Kozyrev   Number of queues: #[...]
31659ad3a41aSAlexander Kozyrev   Size of queues: #[...]
31669ad3a41aSAlexander Kozyrev   Number of counters: #[...]
31679ad3a41aSAlexander Kozyrev   Number of aging objects: #[...]
31689ad3a41aSAlexander Kozyrev   Number of meters: #[...]
31699ad3a41aSAlexander Kozyrev
31709ad3a41aSAlexander KozyrevOtherwise it will show an error message of the form::
31719ad3a41aSAlexander Kozyrev
31729ad3a41aSAlexander Kozyrev   Caught error type [...] ([...]): [...]
31739ad3a41aSAlexander Kozyrev
31749ad3a41aSAlexander KozyrevConfiguring flow management engine
31759ad3a41aSAlexander Kozyrev~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
31769ad3a41aSAlexander Kozyrev
31779ad3a41aSAlexander Kozyrev``flow configure`` pre-allocates all the needed resources in the underlying
31789ad3a41aSAlexander Kozyrevdevice to be used later at the flow creation. Flow queues are allocated as well
31799ad3a41aSAlexander Kozyrevfor asynchronous flow creation/destruction operations. It is bound to
31809ad3a41aSAlexander Kozyrev``rte_flow_configure()``::
31819ad3a41aSAlexander Kozyrev
31829ad3a41aSAlexander Kozyrev   flow configure {port_id}
31839ad3a41aSAlexander Kozyrev       [queues_number {number}] [queues_size {size}]
31849ad3a41aSAlexander Kozyrev       [counters_number {number}]
31859ad3a41aSAlexander Kozyrev       [aging_counters_number {number}]
3186f5b2846dSViacheslav Ovsiienko       [host_port {number}]
3187f5b2846dSViacheslav Ovsiienko       [meters_number {number}]
3188f5b2846dSViacheslav Ovsiienko       [flags {number}]
31899ad3a41aSAlexander Kozyrev
31909ad3a41aSAlexander KozyrevIf successful, it will show::
31919ad3a41aSAlexander Kozyrev
31929ad3a41aSAlexander Kozyrev   Configure flows on port #[...]: number of queues #[...] with #[...] elements
31939ad3a41aSAlexander Kozyrev
31949ad3a41aSAlexander KozyrevOtherwise it will show an error message of the form::
31959ad3a41aSAlexander Kozyrev
31969ad3a41aSAlexander Kozyrev   Caught error type [...] ([...]): [...]
31979ad3a41aSAlexander Kozyrev
319804cc665fSAlexander KozyrevCreating pattern templates
319904cc665fSAlexander Kozyrev~~~~~~~~~~~~~~~~~~~~~~~~~~
320004cc665fSAlexander Kozyrev
320104cc665fSAlexander Kozyrev``flow pattern_template create`` creates the specified pattern template.
320204cc665fSAlexander KozyrevIt is bound to ``rte_flow_pattern_template_create()``::
320304cc665fSAlexander Kozyrev
320404cc665fSAlexander Kozyrev   flow pattern_template {port_id} create [pattern_template_id {id}]
320504cc665fSAlexander Kozyrev       [relaxed {boolean}] [ingress] [egress] [transfer]
320604cc665fSAlexander Kozyrev	   template {item} [/ {item} [...]] / end
320704cc665fSAlexander Kozyrev
320804cc665fSAlexander KozyrevIf successful, it will show::
320904cc665fSAlexander Kozyrev
321004cc665fSAlexander Kozyrev   Pattern template #[...] created
321104cc665fSAlexander Kozyrev
321204cc665fSAlexander KozyrevOtherwise it will show an error message of the form::
321304cc665fSAlexander Kozyrev
321404cc665fSAlexander Kozyrev   Caught error type [...] ([...]): [...]
321504cc665fSAlexander Kozyrev
321604cc665fSAlexander KozyrevThis command uses the same pattern items as ``flow create``,
321704cc665fSAlexander Kozyrevtheir format is described in `Creating flow rules`_.
321804cc665fSAlexander Kozyrev
321904cc665fSAlexander KozyrevDestroying pattern templates
322004cc665fSAlexander Kozyrev~~~~~~~~~~~~~~~~~~~~~~~~~~~~
322104cc665fSAlexander Kozyrev
322204cc665fSAlexander Kozyrev``flow pattern_template destroy`` destroys one or more pattern templates
322304cc665fSAlexander Kozyrevfrom their template ID (as returned by ``flow pattern_template create``),
322404cc665fSAlexander Kozyrevthis command calls ``rte_flow_pattern_template_destroy()`` as many
322504cc665fSAlexander Kozyrevtimes as necessary::
322604cc665fSAlexander Kozyrev
322704cc665fSAlexander Kozyrev   flow pattern_template {port_id} destroy pattern_template {id} [...]
322804cc665fSAlexander Kozyrev
322904cc665fSAlexander KozyrevIf successful, it will show::
323004cc665fSAlexander Kozyrev
323104cc665fSAlexander Kozyrev   Pattern template #[...] destroyed
323204cc665fSAlexander Kozyrev
323304cc665fSAlexander KozyrevIt does not report anything for pattern template IDs that do not exist.
323404cc665fSAlexander KozyrevThe usual error message is shown when a pattern template cannot be destroyed::
323504cc665fSAlexander Kozyrev
323604cc665fSAlexander Kozyrev   Caught error type [...] ([...]): [...]
323704cc665fSAlexander Kozyrev
323804cc665fSAlexander KozyrevCreating actions templates
323904cc665fSAlexander Kozyrev~~~~~~~~~~~~~~~~~~~~~~~~~~
324004cc665fSAlexander Kozyrev
324104cc665fSAlexander Kozyrev``flow actions_template create`` creates the specified actions template.
324204cc665fSAlexander KozyrevIt is bound to ``rte_flow_actions_template_create()``::
324304cc665fSAlexander Kozyrev
324404cc665fSAlexander Kozyrev   flow actions_template {port_id} create [actions_template_id {id}]
324504cc665fSAlexander Kozyrev       [ingress] [egress] [transfer]
324604cc665fSAlexander Kozyrev	   template {action} [/ {action} [...]] / end
324704cc665fSAlexander Kozyrev       mask {action} [/ {action} [...]] / end
324804cc665fSAlexander Kozyrev
324904cc665fSAlexander KozyrevIf successful, it will show::
325004cc665fSAlexander Kozyrev
325104cc665fSAlexander Kozyrev   Actions template #[...] created
325204cc665fSAlexander Kozyrev
325304cc665fSAlexander KozyrevOtherwise it will show an error message of the form::
325404cc665fSAlexander Kozyrev
325504cc665fSAlexander Kozyrev   Caught error type [...] ([...]): [...]
325604cc665fSAlexander Kozyrev
325704cc665fSAlexander KozyrevThis command uses the same actions as ``flow create``,
325804cc665fSAlexander Kozyrevtheir format is described in `Creating flow rules`_.
325904cc665fSAlexander Kozyrev
326004cc665fSAlexander KozyrevDestroying actions templates
326104cc665fSAlexander Kozyrev~~~~~~~~~~~~~~~~~~~~~~~~~~~~
326204cc665fSAlexander Kozyrev
326304cc665fSAlexander Kozyrev``flow actions_template destroy`` destroys one or more actions templates
326404cc665fSAlexander Kozyrevfrom their template ID (as returned by ``flow actions_template create``),
326504cc665fSAlexander Kozyrevthis command calls ``rte_flow_actions_template_destroy()`` as many
326604cc665fSAlexander Kozyrevtimes as necessary::
326704cc665fSAlexander Kozyrev
326804cc665fSAlexander Kozyrev   flow actions_template {port_id} destroy actions_template {id} [...]
326904cc665fSAlexander Kozyrev
327004cc665fSAlexander KozyrevIf successful, it will show::
327104cc665fSAlexander Kozyrev
327204cc665fSAlexander Kozyrev   Actions template #[...] destroyed
327304cc665fSAlexander Kozyrev
327404cc665fSAlexander KozyrevIt does not report anything for actions template IDs that do not exist.
327504cc665fSAlexander KozyrevThe usual error message is shown when an actions template cannot be destroyed::
327604cc665fSAlexander Kozyrev
327704cc665fSAlexander Kozyrev   Caught error type [...] ([...]): [...]
327804cc665fSAlexander Kozyrev
3279c4b38873SAlexander KozyrevCreating template table
3280c4b38873SAlexander Kozyrev~~~~~~~~~~~~~~~~~~~~~~~
3281c4b38873SAlexander Kozyrev
3282c4b38873SAlexander Kozyrev``flow template_table create`` creates the specified template table.
3283c4b38873SAlexander KozyrevIt is bound to ``rte_flow_template_table_create()``::
3284c4b38873SAlexander Kozyrev
3285c4b38873SAlexander Kozyrev   flow template_table {port_id} create
3286c4b38873SAlexander Kozyrev       [table_id {id}] [group {group_id}]
32874aa10e5dSRongwei Liu       [priority {level}] [ingress] [egress]
32884aa10e5dSRongwei Liu       [transfer [vport_orig] [wire_orig]]
3289c4b38873SAlexander Kozyrev       rules_number {number}
3290c4b38873SAlexander Kozyrev       pattern_template {pattern_template_id}
3291c4b38873SAlexander Kozyrev       actions_template {actions_template_id}
3292c4b38873SAlexander Kozyrev
3293c4b38873SAlexander KozyrevIf successful, it will show::
3294c4b38873SAlexander Kozyrev
3295c4b38873SAlexander Kozyrev   Template table #[...] created
3296c4b38873SAlexander Kozyrev
3297c4b38873SAlexander KozyrevOtherwise it will show an error message of the form::
3298c4b38873SAlexander Kozyrev
3299c4b38873SAlexander Kozyrev   Caught error type [...] ([...]): [...]
3300c4b38873SAlexander Kozyrev
3301c4b38873SAlexander KozyrevDestroying flow table
3302c4b38873SAlexander Kozyrev~~~~~~~~~~~~~~~~~~~~~
3303c4b38873SAlexander Kozyrev
3304c4b38873SAlexander Kozyrev``flow template_table destroy`` destroys one or more template tables
3305c4b38873SAlexander Kozyrevfrom their table ID (as returned by ``flow template_table create``),
3306c4b38873SAlexander Kozyrevthis command calls ``rte_flow_template_table_destroy()`` as many
3307c4b38873SAlexander Kozyrevtimes as necessary::
3308c4b38873SAlexander Kozyrev
3309c4b38873SAlexander Kozyrev   flow template_table {port_id} destroy table {id} [...]
3310c4b38873SAlexander Kozyrev
3311c4b38873SAlexander KozyrevIf successful, it will show::
3312c4b38873SAlexander Kozyrev
3313c4b38873SAlexander Kozyrev   Template table #[...] destroyed
3314c4b38873SAlexander Kozyrev
3315c4b38873SAlexander KozyrevIt does not report anything for table IDs that do not exist.
3316c4b38873SAlexander KozyrevThe usual error message is shown when a table cannot be destroyed::
3317c4b38873SAlexander Kozyrev
3318c4b38873SAlexander Kozyrev   Caught error type [...] ([...]): [...]
3319c4b38873SAlexander Kozyrev
33209cbbee14SAlexander KozyrevPushing enqueued operations
33219cbbee14SAlexander Kozyrev~~~~~~~~~~~~~~~~~~~~~~~~~~~
33229cbbee14SAlexander Kozyrev
33239cbbee14SAlexander Kozyrev``flow push`` pushes all the outstanding enqueued operations
33249cbbee14SAlexander Kozyrevto the underlying device immediately.
33259cbbee14SAlexander KozyrevIt is bound to ``rte_flow_push()``::
33269cbbee14SAlexander Kozyrev
33279cbbee14SAlexander Kozyrev   flow push {port_id} queue {queue_id}
33289cbbee14SAlexander Kozyrev
33299cbbee14SAlexander KozyrevIf successful, it will show::
33309cbbee14SAlexander Kozyrev
33319cbbee14SAlexander Kozyrev   Queue #[...] operations pushed
33329cbbee14SAlexander Kozyrev
33339cbbee14SAlexander KozyrevThe usual error message is shown when operations cannot be pushed::
33349cbbee14SAlexander Kozyrev
33359cbbee14SAlexander Kozyrev   Caught error type [...] ([...]): [...]
33369cbbee14SAlexander Kozyrev
3337f9bf7dffSAlexander KozyrevPulling flow operations results
3338f9bf7dffSAlexander Kozyrev~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3339f9bf7dffSAlexander Kozyrev
3340f9bf7dffSAlexander Kozyrev``flow pull`` asks the underlying device about flow queue operations
3341f9bf7dffSAlexander Kozyrevresults and return all the processed (successfully or not) operations.
3342f9bf7dffSAlexander KozyrevIt is bound to ``rte_flow_pull()``::
3343f9bf7dffSAlexander Kozyrev
3344f9bf7dffSAlexander Kozyrev   flow pull {port_id} queue {queue_id}
3345f9bf7dffSAlexander Kozyrev
3346f9bf7dffSAlexander KozyrevIf successful, it will show::
3347f9bf7dffSAlexander Kozyrev
3348f9bf7dffSAlexander Kozyrev   Queue #[...] pulled #[...] operations (#[...] failed, #[...] succeeded)
3349f9bf7dffSAlexander Kozyrev
3350f9bf7dffSAlexander KozyrevThe usual error message is shown when operations results cannot be pulled::
3351f9bf7dffSAlexander Kozyrev
3352f9bf7dffSAlexander Kozyrev   Caught error type [...] ([...]): [...]
3353f9bf7dffSAlexander Kozyrev
3354ffe18b05SOri KamCalculating hash
3355ffe18b05SOri Kam~~~~~~~~~~~~~~~~
3356ffe18b05SOri Kam
33579733f099SOri Kam``flow hash {port_id} template_table`` calculates the hash for a given pattern.
3358ffe18b05SOri KamIt is bound to ``rte_flow_calc_table_hash()``::
3359ffe18b05SOri Kam
3360ffe18b05SOri Kam   flow hash {port_id} template_table {table_id}
3361ffe18b05SOri Kam       pattern_template {pattern_template_index}
3362ffe18b05SOri Kam       actions_template {actions_template_index}
3363ffe18b05SOri Kam       pattern {item} [/ {item} [...]] / end
3364ffe18b05SOri Kam
3365ffe18b05SOri KamIf successful, it will show the calculated hash result as seen below::
3366ffe18b05SOri Kam
3367ffe18b05SOri Kam   Hash results 0x[...]
3368ffe18b05SOri Kam
3369ffe18b05SOri KamOtherwise, it will show an error message of the form::
3370ffe18b05SOri Kam
3371ffe18b05SOri Kam   Caught error type [...] ([...]): [...]
3372ffe18b05SOri Kam
3373ffe18b05SOri KamThis command uses the same pattern items as ``flow create``,
3374ffe18b05SOri Kamtheir format is described in `Creating flow rules`_.
3375ffe18b05SOri Kam
33769733f099SOri KamSimulate encap hash calculation
33779733f099SOri Kam~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33789733f099SOri Kam
33799733f099SOri Kam``flow hash {port_id} encap`` adds hash query, that returns the hash value
33809733f099SOri Kamthat the HW will calculate when encapsulating a packet::
33819733f099SOri Kam
33829733f099SOri Kam   flow hash {port_id} encap {target field} pattern {item} [/ {item} [...]] / end
33839733f099SOri Kam
33849733f099SOri KamIf successful, it will show::
33859733f099SOri Kam
33869733f099SOri Kam   encap hash result #[...]
33879733f099SOri Kam
33889733f099SOri KamThe value will be shown as uint16_t without endian conversion.
33899733f099SOri Kam
33909733f099SOri KamOtherwise it will show an error message of the form::
33919733f099SOri Kam
33929733f099SOri Kam   Failed to calculate encap hash - [...]
33939733f099SOri Kam
33941b9f2746SGregory EtelsonCreating a tunnel stub for offload
33951b9f2746SGregory Etelson~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33961b9f2746SGregory Etelson
33971b9f2746SGregory Etelson``flow tunnel create`` setup a tunnel stub for tunnel offload flow rules::
33981b9f2746SGregory Etelson
33991b9f2746SGregory Etelson   flow tunnel create {port_id} type {tunnel_type}
34001b9f2746SGregory Etelson
34011b9f2746SGregory EtelsonIf successful, it will return a tunnel stub ID usable with other commands::
34021b9f2746SGregory Etelson
34031b9f2746SGregory Etelson   port [...]: flow tunnel #[...] type [...]
34041b9f2746SGregory Etelson
34051b9f2746SGregory EtelsonTunnel stub ID is relative to a port.
34061b9f2746SGregory Etelson
34071b9f2746SGregory EtelsonDestroying tunnel offload stub
34081b9f2746SGregory Etelson~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
34091b9f2746SGregory Etelson
34101b9f2746SGregory Etelson``flow tunnel destroy`` destroy port tunnel stub::
34111b9f2746SGregory Etelson
34121b9f2746SGregory Etelson   flow tunnel destroy {port_id} id {tunnel_id}
34131b9f2746SGregory Etelson
34141b9f2746SGregory EtelsonListing tunnel offload stubs
34151b9f2746SGregory Etelson~~~~~~~~~~~~~~~~~~~~~~~~~~~~
34161b9f2746SGregory Etelson
34171b9f2746SGregory Etelson``flow tunnel list`` list port tunnel offload stubs::
34181b9f2746SGregory Etelson
34191b9f2746SGregory Etelson   flow tunnel list {port_id}
34201b9f2746SGregory Etelson
3421a997a33bSAdrien MazarguilValidating flow rules
3422a997a33bSAdrien Mazarguil~~~~~~~~~~~~~~~~~~~~~
3423a997a33bSAdrien Mazarguil
3424a997a33bSAdrien Mazarguil``flow validate`` reports whether a flow rule would be accepted by the
3425a997a33bSAdrien Mazarguilunderlying device in its current state but stops short of creating it. It is
3426a997a33bSAdrien Mazarguilbound to ``rte_flow_validate()``::
3427a997a33bSAdrien Mazarguil
3428a997a33bSAdrien Mazarguil   flow validate {port_id}
342976e9a55bSAdrien Mazarguil      [group {group_id}] [priority {level}] [ingress] [egress] [transfer]
3430a997a33bSAdrien Mazarguil      pattern {item} [/ {item} [...]] / end
3431a997a33bSAdrien Mazarguil      actions {action} [/ {action} [...]] / end
3432a997a33bSAdrien Mazarguil
3433a997a33bSAdrien MazarguilIf successful, it will show::
3434a997a33bSAdrien Mazarguil
3435a997a33bSAdrien Mazarguil   Flow rule validated
3436a997a33bSAdrien Mazarguil
3437a997a33bSAdrien MazarguilOtherwise it will show an error message of the form::
3438a997a33bSAdrien Mazarguil
3439a997a33bSAdrien Mazarguil   Caught error type [...] ([...]): [...]
3440a997a33bSAdrien Mazarguil
3441a997a33bSAdrien MazarguilThis command uses the same parameters as ``flow create``, their format is
3442a997a33bSAdrien Mazarguildescribed in `Creating flow rules`_.
3443a997a33bSAdrien Mazarguil
3444a997a33bSAdrien MazarguilCheck whether redirecting any Ethernet packet received on port 0 to RX queue
3445a997a33bSAdrien Mazarguilindex 6 is supported::
3446a997a33bSAdrien Mazarguil
3447a997a33bSAdrien Mazarguil   testpmd> flow validate 0 ingress pattern eth / end
3448a997a33bSAdrien Mazarguil      actions queue index 6 / end
3449a997a33bSAdrien Mazarguil   Flow rule validated
3450a997a33bSAdrien Mazarguil   testpmd>
3451a997a33bSAdrien Mazarguil
3452a997a33bSAdrien MazarguilPort 0 does not support TCPv6 rules::
3453a997a33bSAdrien Mazarguil
3454a997a33bSAdrien Mazarguil   testpmd> flow validate 0 ingress pattern eth / ipv6 / tcp / end
3455a997a33bSAdrien Mazarguil      actions drop / end
3456a997a33bSAdrien Mazarguil   Caught error type 9 (specific pattern item): Invalid argument
3457a997a33bSAdrien Mazarguil   testpmd>
3458a997a33bSAdrien Mazarguil
3459a997a33bSAdrien MazarguilCreating flow rules
3460a997a33bSAdrien Mazarguil~~~~~~~~~~~~~~~~~~~
3461a997a33bSAdrien Mazarguil
3462a997a33bSAdrien Mazarguil``flow create`` validates and creates the specified flow rule. It is bound
3463a997a33bSAdrien Mazarguilto ``rte_flow_create()``::
3464a997a33bSAdrien Mazarguil
3465a997a33bSAdrien Mazarguil   flow create {port_id}
346676e9a55bSAdrien Mazarguil      [group {group_id}] [priority {level}] [ingress] [egress] [transfer]
34671b9f2746SGregory Etelson      [tunnel_set {tunnel_id}] [tunnel_match {tunnel_id}]
34688ac3a1cdSEli Britstein      [user_id {user_id}] pattern {item} [/ {item} [...]] / end
3469a997a33bSAdrien Mazarguil      actions {action} [/ {action} [...]] / end
3470a997a33bSAdrien Mazarguil
3471a997a33bSAdrien MazarguilIf successful, it will return a flow rule ID usable with other commands::
3472a997a33bSAdrien Mazarguil
3473a997a33bSAdrien Mazarguil   Flow rule #[...] created
3474a997a33bSAdrien Mazarguil
34758ac3a1cdSEli BritsteinOr if ``user_id`` is provided::
34768ac3a1cdSEli Britstein
34778ac3a1cdSEli Britstein   Flow rule #[...] created, user-id [...]
34788ac3a1cdSEli Britstein
3479a997a33bSAdrien MazarguilOtherwise it will show an error message of the form::
3480a997a33bSAdrien Mazarguil
3481a997a33bSAdrien Mazarguil   Caught error type [...] ([...]): [...]
3482a997a33bSAdrien Mazarguil
3483a997a33bSAdrien MazarguilParameters describe in the following order:
3484a997a33bSAdrien Mazarguil
348576e9a55bSAdrien Mazarguil- Attributes (*group*, *priority*, *ingress*, *egress*, *transfer* tokens).
34861b9f2746SGregory Etelson- Tunnel offload specification (tunnel_set, tunnel_match)
34878ac3a1cdSEli Britstein- User identifier for the flow.
3488a997a33bSAdrien Mazarguil- A matching pattern, starting with the *pattern* token and terminated by an
3489a997a33bSAdrien Mazarguil  *end* pattern item.
3490a997a33bSAdrien Mazarguil- Actions, starting with the *actions* token and terminated by an *end*
3491a997a33bSAdrien Mazarguil  action.
3492a997a33bSAdrien Mazarguil
3493a997a33bSAdrien MazarguilThese translate directly to *rte_flow* objects provided as-is to the
3494a997a33bSAdrien Mazarguilunderlying functions.
3495a997a33bSAdrien Mazarguil
3496a997a33bSAdrien MazarguilThe shortest valid definition only comprises mandatory tokens::
3497a997a33bSAdrien Mazarguil
3498a997a33bSAdrien Mazarguil   testpmd> flow create 0 pattern end actions end
3499a997a33bSAdrien Mazarguil
3500a997a33bSAdrien MazarguilNote that PMDs may refuse rules that essentially do nothing such as this
3501a997a33bSAdrien Mazarguilone.
3502a997a33bSAdrien Mazarguil
3503a997a33bSAdrien Mazarguil**All unspecified object values are automatically initialized to 0.**
3504a997a33bSAdrien Mazarguil
3505ecdc927bSAlexander KozyrevEnqueueing creation of flow rules
3506ecdc927bSAlexander Kozyrev~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3507ecdc927bSAlexander Kozyrev
3508ecdc927bSAlexander Kozyrev``flow queue create`` adds creation operation of a flow rule to a queue.
3509ecdc927bSAlexander KozyrevIt is bound to ``rte_flow_async_create()``::
3510ecdc927bSAlexander Kozyrev
3511ecdc927bSAlexander Kozyrev   flow queue {port_id} create {queue_id}
3512ecdc927bSAlexander Kozyrev       [postpone {boolean}] template_table {table_id}
3513ecdc927bSAlexander Kozyrev       pattern_template {pattern_template_index}
3514ecdc927bSAlexander Kozyrev       actions_template {actions_template_index}
3515ecdc927bSAlexander Kozyrev       pattern {item} [/ {item} [...]] / end
3516ecdc927bSAlexander Kozyrev       actions {action} [/ {action} [...]] / end
3517ecdc927bSAlexander Kozyrev
3518ecdc927bSAlexander KozyrevIf successful, it will return a flow rule ID usable with other commands::
3519ecdc927bSAlexander Kozyrev
3520ecdc927bSAlexander Kozyrev   Flow rule #[...] creaion enqueued
3521ecdc927bSAlexander Kozyrev
3522ecdc927bSAlexander KozyrevOtherwise it will show an error message of the form::
3523ecdc927bSAlexander Kozyrev
3524ecdc927bSAlexander Kozyrev   Caught error type [...] ([...]): [...]
3525ecdc927bSAlexander Kozyrev
3526ecdc927bSAlexander KozyrevThis command uses the same pattern items and actions as ``flow create``,
3527ecdc927bSAlexander Kozyrevtheir format is described in `Creating flow rules`_.
3528ecdc927bSAlexander Kozyrev
3529f9bf7dffSAlexander Kozyrev``flow queue pull`` must be called to retrieve the operation status.
3530f9bf7dffSAlexander Kozyrev
3531a997a33bSAdrien MazarguilAttributes
3532a997a33bSAdrien Mazarguil^^^^^^^^^^
3533a997a33bSAdrien Mazarguil
3534a997a33bSAdrien MazarguilThese tokens affect flow rule attributes (``struct rte_flow_attr``) and are
3535a997a33bSAdrien Mazarguilspecified before the ``pattern`` token.
3536a997a33bSAdrien Mazarguil
3537a997a33bSAdrien Mazarguil- ``group {group id}``: priority group.
3538a997a33bSAdrien Mazarguil- ``priority {level}``: priority level within group.
3539a997a33bSAdrien Mazarguil- ``ingress``: rule applies to ingress traffic.
3540a997a33bSAdrien Mazarguil- ``egress``: rule applies to egress traffic.
354176e9a55bSAdrien Mazarguil- ``transfer``: apply rule directly to endpoints found in pattern.
3542a997a33bSAdrien Mazarguil
35432490bb89SIvan MalovPlease note that use of ``transfer`` attribute requires that the flow and
35442490bb89SIvan Malovits indirect components be managed via so-called ``transfer`` proxy port.
35452490bb89SIvan MalovSee `show flow transfer proxy port ID for the given port`_ for details.
35462490bb89SIvan Malov
3547a997a33bSAdrien MazarguilEach instance of an attribute specified several times overrides the previous
3548a997a33bSAdrien Mazarguilvalue as shown below (group 4 is used)::
3549a997a33bSAdrien Mazarguil
3550a997a33bSAdrien Mazarguil   testpmd> flow create 0 group 42 group 24 group 4 [...]
3551a997a33bSAdrien Mazarguil
3552a997a33bSAdrien MazarguilNote that once enabled, ``ingress`` and ``egress`` cannot be disabled.
3553a997a33bSAdrien Mazarguil
3554a997a33bSAdrien MazarguilWhile not specifying a direction is an error, some rules may allow both
3555a997a33bSAdrien Mazarguilsimultaneously.
3556a997a33bSAdrien Mazarguil
3557a997a33bSAdrien MazarguilMost rules affect RX therefore contain the ``ingress`` token::
3558a997a33bSAdrien Mazarguil
3559a997a33bSAdrien Mazarguil   testpmd> flow create 0 ingress pattern [...]
3560a997a33bSAdrien Mazarguil
35611b9f2746SGregory EtelsonTunnel offload
35621b9f2746SGregory Etelson^^^^^^^^^^^^^^
35631b9f2746SGregory Etelson
35641b9f2746SGregory EtelsonIndicate tunnel offload rule type
35651b9f2746SGregory Etelson
35661b9f2746SGregory Etelson- ``tunnel_set {tunnel_id}``: mark rule as tunnel offload decap_set type.
35677be78d02SJosh Soref- ``tunnel_match {tunnel_id}``:  mark rule as tunnel offload match type.
35681b9f2746SGregory Etelson
3569a997a33bSAdrien MazarguilMatching pattern
3570a997a33bSAdrien Mazarguil^^^^^^^^^^^^^^^^
3571a997a33bSAdrien Mazarguil
3572a997a33bSAdrien MazarguilA matching pattern starts after the ``pattern`` token. It is made of pattern
3573a997a33bSAdrien Mazarguilitems and is terminated by a mandatory ``end`` item.
3574a997a33bSAdrien Mazarguil
3575a997a33bSAdrien MazarguilItems are named after their type (*RTE_FLOW_ITEM_TYPE_* from ``enum
3576a997a33bSAdrien Mazarguilrte_flow_item_type``).
3577a997a33bSAdrien Mazarguil
3578a997a33bSAdrien MazarguilThe ``/`` token is used as a separator between pattern items as shown
3579a997a33bSAdrien Mazarguilbelow::
3580a997a33bSAdrien Mazarguil
3581a997a33bSAdrien Mazarguil   testpmd> flow create 0 ingress pattern eth / ipv4 / udp / end [...]
3582a997a33bSAdrien Mazarguil
3583a997a33bSAdrien MazarguilNote that protocol items like these must be stacked from lowest to highest
3584a997a33bSAdrien Mazarguillayer to make sense. For instance, the following rule is either invalid or
3585a997a33bSAdrien Mazarguilunlikely to match any packet::
3586a997a33bSAdrien Mazarguil
3587a997a33bSAdrien Mazarguil   testpmd> flow create 0 ingress pattern eth / udp / ipv4 / end [...]
3588a997a33bSAdrien Mazarguil
3589a997a33bSAdrien MazarguilMore information on these restrictions can be found in the *rte_flow*
3590a997a33bSAdrien Mazarguildocumentation.
3591a997a33bSAdrien Mazarguil
3592a997a33bSAdrien MazarguilSeveral items support additional specification structures, for example
3593a997a33bSAdrien Mazarguil``ipv4`` allows specifying source and destination addresses as follows::
3594a997a33bSAdrien Mazarguil
3595a997a33bSAdrien Mazarguil   testpmd> flow create 0 ingress pattern eth / ipv4 src is 10.1.1.1
3596a997a33bSAdrien Mazarguil      dst is 10.2.0.0 / end [...]
3597a997a33bSAdrien Mazarguil
3598a997a33bSAdrien MazarguilThis rule matches all IPv4 traffic with the specified properties.
3599a997a33bSAdrien Mazarguil
3600a997a33bSAdrien MazarguilIn this example, ``src`` and ``dst`` are field names of the underlying
3601a997a33bSAdrien Mazarguil``struct rte_flow_item_ipv4`` object. All item properties can be specified
3602a997a33bSAdrien Mazarguilin a similar fashion.
3603a997a33bSAdrien Mazarguil
3604a997a33bSAdrien MazarguilThe ``is`` token means that the subsequent value must be matched exactly,
3605a997a33bSAdrien Mazarguiland assigns ``spec`` and ``mask`` fields in ``struct rte_flow_item``
3606a997a33bSAdrien Mazarguilaccordingly. Possible assignment tokens are:
3607a997a33bSAdrien Mazarguil
3608a997a33bSAdrien Mazarguil- ``is``: match value perfectly (with full bit-mask).
3609a997a33bSAdrien Mazarguil- ``spec``: match value according to configured bit-mask.
3610a997a33bSAdrien Mazarguil- ``last``: specify upper bound to establish a range.
3611a997a33bSAdrien Mazarguil- ``mask``: specify bit-mask with relevant bits set to one.
3612892cfaddSDekel Peled- ``prefix``: generate bit-mask with <prefix-length> most-significant bits set to one.
3613a997a33bSAdrien Mazarguil
3614a997a33bSAdrien MazarguilThese yield identical results::
3615a997a33bSAdrien Mazarguil
3616a997a33bSAdrien Mazarguil   ipv4 src is 10.1.1.1
3617a997a33bSAdrien Mazarguil
3618a997a33bSAdrien Mazarguil::
3619a997a33bSAdrien Mazarguil
3620a997a33bSAdrien Mazarguil   ipv4 src spec 10.1.1.1 src mask 255.255.255.255
3621a997a33bSAdrien Mazarguil
3622a997a33bSAdrien Mazarguil::
3623a997a33bSAdrien Mazarguil
3624a997a33bSAdrien Mazarguil   ipv4 src spec 10.1.1.1 src prefix 32
3625a997a33bSAdrien Mazarguil
3626a997a33bSAdrien Mazarguil::
3627a997a33bSAdrien Mazarguil
3628a997a33bSAdrien Mazarguil   ipv4 src is 10.1.1.1 src last 10.1.1.1 # range with a single value
3629a997a33bSAdrien Mazarguil
3630a997a33bSAdrien Mazarguil::
3631a997a33bSAdrien Mazarguil
3632a997a33bSAdrien Mazarguil   ipv4 src is 10.1.1.1 src last 0 # 0 disables range
3633a997a33bSAdrien Mazarguil
3634a997a33bSAdrien MazarguilInclusive ranges can be defined with ``last``::
3635a997a33bSAdrien Mazarguil
3636a997a33bSAdrien Mazarguil   ipv4 src is 10.1.1.1 src last 10.2.3.4 # 10.1.1.1 to 10.2.3.4
3637a997a33bSAdrien Mazarguil
3638a997a33bSAdrien MazarguilNote that ``mask`` affects both ``spec`` and ``last``::
3639a997a33bSAdrien Mazarguil
3640a997a33bSAdrien Mazarguil   ipv4 src is 10.1.1.1 src last 10.2.3.4 src mask 255.255.0.0
3641a997a33bSAdrien Mazarguil      # matches 10.1.0.0 to 10.2.255.255
3642a997a33bSAdrien Mazarguil
3643a997a33bSAdrien MazarguilProperties can be modified multiple times::
3644a997a33bSAdrien Mazarguil
3645a997a33bSAdrien Mazarguil   ipv4 src is 10.1.1.1 src is 10.1.2.3 src is 10.2.3.4 # matches 10.2.3.4
3646a997a33bSAdrien Mazarguil
3647a997a33bSAdrien Mazarguil::
3648a997a33bSAdrien Mazarguil
3649a997a33bSAdrien Mazarguil   ipv4 src is 10.1.1.1 src prefix 24 src prefix 16 # matches 10.1.0.0/16
3650a997a33bSAdrien Mazarguil
3651a997a33bSAdrien MazarguilPattern items
3652a997a33bSAdrien Mazarguil^^^^^^^^^^^^^
3653a997a33bSAdrien Mazarguil
3654a997a33bSAdrien MazarguilThis section lists supported pattern items and their attributes, if any.
3655a997a33bSAdrien Mazarguil
3656a997a33bSAdrien Mazarguil- ``end``: end list of pattern items.
3657a997a33bSAdrien Mazarguil
3658a997a33bSAdrien Mazarguil- ``void``: no-op pattern item.
3659a997a33bSAdrien Mazarguil
3660a997a33bSAdrien Mazarguil- ``invert``: perform actions when pattern does not match.
3661a997a33bSAdrien Mazarguil
3662a997a33bSAdrien Mazarguil- ``any``: match any protocol for the current layer.
3663a997a33bSAdrien Mazarguil
3664a997a33bSAdrien Mazarguil  - ``num {unsigned}``: number of layers covered.
3665a997a33bSAdrien Mazarguil
3666fc6bbb3fSAdrien Mazarguil- ``port_id``: match traffic from/to a given DPDK port ID.
3667fc6bbb3fSAdrien Mazarguil
3668fc6bbb3fSAdrien Mazarguil  - ``id {unsigned}``: DPDK port ID.
3669fc6bbb3fSAdrien Mazarguil
3670e05419b3SDeclan Doherty- ``mark``: match value set in previously matched flow rule using the mark action.
3671e05419b3SDeclan Doherty
3672e05419b3SDeclan Doherty  - ``id {unsigned}``: arbitrary integer value.
3673e05419b3SDeclan Doherty
3674a997a33bSAdrien Mazarguil- ``raw``: match an arbitrary byte string.
3675a997a33bSAdrien Mazarguil
3676a997a33bSAdrien Mazarguil  - ``relative {boolean}``: look for pattern after the previous item.
3677a997a33bSAdrien Mazarguil  - ``search {boolean}``: search pattern from offset (see also limit).
3678a997a33bSAdrien Mazarguil  - ``offset {integer}``: absolute or relative offset for pattern.
3679a997a33bSAdrien Mazarguil  - ``limit {unsigned}``: search area limit for start of pattern.
3680a997a33bSAdrien Mazarguil  - ``pattern {string}``: byte string to look for.
3681cb43641eSNipun Gupta  - ``pattern_hex {string}``: byte string (provided in hexadecimal) to look for.
3682a997a33bSAdrien Mazarguil
3683a997a33bSAdrien Mazarguil- ``eth``: match Ethernet header.
3684a997a33bSAdrien Mazarguil
3685a997a33bSAdrien Mazarguil  - ``dst {MAC-48}``: destination MAC.
3686a997a33bSAdrien Mazarguil  - ``src {MAC-48}``: source MAC.
3687e58638c3SAdrien Mazarguil  - ``type {unsigned}``: EtherType or TPID.
3688a997a33bSAdrien Mazarguil
3689a997a33bSAdrien Mazarguil- ``vlan``: match 802.1Q/ad VLAN tag.
3690a997a33bSAdrien Mazarguil
3691a997a33bSAdrien Mazarguil  - ``tci {unsigned}``: tag control information.
36921419fd5aSAdrien Mazarguil  - ``pcp {unsigned}``: priority code point.
36931419fd5aSAdrien Mazarguil  - ``dei {unsigned}``: drop eligible indicator.
36941419fd5aSAdrien Mazarguil  - ``vid {unsigned}``: VLAN identifier.
3695e58638c3SAdrien Mazarguil  - ``inner_type {unsigned}``: inner EtherType or TPID.
3696a997a33bSAdrien Mazarguil
3697a997a33bSAdrien Mazarguil- ``ipv4``: match IPv4 header.
3698a997a33bSAdrien Mazarguil
3699730bf066SGregory Etelson  - ``version_ihl {unsigned}``: IPv4 version and IP header length.
37001419fd5aSAdrien Mazarguil  - ``tos {unsigned}``: type of service.
37011419fd5aSAdrien Mazarguil  - ``ttl {unsigned}``: time to live.
37021419fd5aSAdrien Mazarguil  - ``proto {unsigned}``: next protocol ID.
3703a997a33bSAdrien Mazarguil  - ``src {ipv4 address}``: source address.
3704a997a33bSAdrien Mazarguil  - ``dst {ipv4 address}``: destination address.
3705a997a33bSAdrien Mazarguil
3706a997a33bSAdrien Mazarguil- ``ipv6``: match IPv6 header.
3707a997a33bSAdrien Mazarguil
37081419fd5aSAdrien Mazarguil  - ``tc {unsigned}``: traffic class.
37091419fd5aSAdrien Mazarguil  - ``flow {unsigned}``: flow label.
37101419fd5aSAdrien Mazarguil  - ``proto {unsigned}``: protocol (next header).
37111419fd5aSAdrien Mazarguil  - ``hop {unsigned}``: hop limit.
3712a997a33bSAdrien Mazarguil  - ``src {ipv6 address}``: source address.
3713a997a33bSAdrien Mazarguil  - ``dst {ipv6 address}``: destination address.
3714a997a33bSAdrien Mazarguil
3715a997a33bSAdrien Mazarguil- ``icmp``: match ICMP header.
3716a997a33bSAdrien Mazarguil
3717a997a33bSAdrien Mazarguil  - ``type {unsigned}``: ICMP packet type.
3718a997a33bSAdrien Mazarguil  - ``code {unsigned}``: ICMP packet code.
3719a997a33bSAdrien Mazarguil
3720a997a33bSAdrien Mazarguil- ``udp``: match UDP header.
3721a997a33bSAdrien Mazarguil
3722a997a33bSAdrien Mazarguil  - ``src {unsigned}``: UDP source port.
3723a997a33bSAdrien Mazarguil  - ``dst {unsigned}``: UDP destination port.
3724a997a33bSAdrien Mazarguil
3725a997a33bSAdrien Mazarguil- ``tcp``: match TCP header.
3726a997a33bSAdrien Mazarguil
3727a997a33bSAdrien Mazarguil  - ``src {unsigned}``: TCP source port.
3728a997a33bSAdrien Mazarguil  - ``dst {unsigned}``: TCP destination port.
3729a997a33bSAdrien Mazarguil
3730a997a33bSAdrien Mazarguil- ``sctp``: match SCTP header.
3731a997a33bSAdrien Mazarguil
3732a997a33bSAdrien Mazarguil  - ``src {unsigned}``: SCTP source port.
3733a997a33bSAdrien Mazarguil  - ``dst {unsigned}``: SCTP destination port.
37341419fd5aSAdrien Mazarguil  - ``tag {unsigned}``: validation tag.
37351419fd5aSAdrien Mazarguil  - ``cksum {unsigned}``: checksum.
3736a997a33bSAdrien Mazarguil
3737a997a33bSAdrien Mazarguil- ``vxlan``: match VXLAN header.
3738a997a33bSAdrien Mazarguil
3739a997a33bSAdrien Mazarguil  - ``vni {unsigned}``: VXLAN identifier.
3740da118115SGavin Li  - ``flag_g {unsigned}``: VXLAN flag GBP bit.
3741da118115SGavin Li  - ``flag_ver {unsigned}``: VXLAN flag GPE version.
3742da118115SGavin Li  - ``flag_i {unsigned}``: VXLAN flag Instance bit.
3743da118115SGavin Li  - ``flag_p {unsigned}``: VXLAN flag GPE Next Protocol bit.
3744da118115SGavin Li  - ``flag_b {unsigned}``: VXLAN flag GPE Ingress-Replicated BUM.
3745da118115SGavin Li  - ``flag_o {unsigned}``: VXLAN flag GPE OAM Packet bit.
3746da118115SGavin Li  - ``flag_d {unsigned}``: VXLAN flag GBP Don't Learn bit.
3747da118115SGavin Li  - ``flag_a {unsigned}``: VXLAN flag GBP Applied bit.
3748da118115SGavin Li  - ``group_policy_id {unsigned}``: VXLAN GBP Group Policy ID.
3749da118115SGavin Li  - ``protocol {unsigned}`` : VXLAN GPE next protocol.
3750da118115SGavin Li  - ``first_rsvd {unsigned}`` : VXLAN rsvd0 first byte.
3751da118115SGavin Li  - ``secnd_rsvd {unsigned}`` : VXLAN rsvd0 second byte.
3752da118115SGavin Li  - ``third_rsvd {unsigned}`` : VXLAN rsvd0 third byte.
3753da118115SGavin Li  - ``last_rsvd {unsigned}``: VXLAN last reserved byte.
3754a997a33bSAdrien Mazarguil
3755e4840ef2SAdrien Mazarguil- ``e_tag``: match IEEE 802.1BR E-Tag header.
3756e4840ef2SAdrien Mazarguil
3757e4840ef2SAdrien Mazarguil  - ``grp_ecid_b {unsigned}``: GRP and E-CID base.
3758e4840ef2SAdrien Mazarguil
3759e4840ef2SAdrien Mazarguil- ``nvgre``: match NVGRE header.
3760e4840ef2SAdrien Mazarguil
3761e4840ef2SAdrien Mazarguil  - ``tni {unsigned}``: virtual subnet ID.
3762e4840ef2SAdrien Mazarguil
37631315219aSBeilei Xing- ``mpls``: match MPLS header.
37641315219aSBeilei Xing
37651315219aSBeilei Xing  - ``label {unsigned}``: MPLS label.
37661315219aSBeilei Xing
37671315219aSBeilei Xing- ``gre``: match GRE header.
37681315219aSBeilei Xing
37691315219aSBeilei Xing  - ``protocol {unsigned}``: protocol type.
37701315219aSBeilei Xing
3771c6ef1454SXiaoyu Min- ``gre_key``: match GRE optional key field.
3772c6ef1454SXiaoyu Min
3773c6ef1454SXiaoyu Min  - ``value {unsigned}``: key value.
3774c6ef1454SXiaoyu Min
377526b7259aSSean Zhang- ``gre_option``: match GRE optional fields(checksum/key/sequence).
377626b7259aSSean Zhang
377726b7259aSSean Zhang  - ``checksum {unsigned}``: checksum value.
377826b7259aSSean Zhang  - ``key {unsigned}``: key value.
377926b7259aSSean Zhang  - ``sequence {unsigned}``: sequence number value.
378026b7259aSSean Zhang
3781a3a2e2c8SQi Zhang- ``fuzzy``: fuzzy pattern match, expect faster than default.
3782a3a2e2c8SQi Zhang
3783a3a2e2c8SQi Zhang  - ``thresh {unsigned}``: accuracy threshold.
3784a3a2e2c8SQi Zhang
3785576f459eSBeilei Xing- ``gtp``, ``gtpc``, ``gtpu``: match GTPv1 header.
3786576f459eSBeilei Xing
3787576f459eSBeilei Xing  - ``teid {unsigned}``: tunnel endpoint identifier.
3788576f459eSBeilei Xing
37890f4203feSRoman Zhukov- ``geneve``: match GENEVE header.
37900f4203feSRoman Zhukov
37910f4203feSRoman Zhukov  - ``vni {unsigned}``: virtual network identifier.
37920f4203feSRoman Zhukov  - ``protocol {unsigned}``: protocol type.
37930f4203feSRoman Zhukov
379455c074f3SViacheslav Ovsiienko- ``geneve-opt``: match GENEVE header option.
379555c074f3SViacheslav Ovsiienko
379655c074f3SViacheslav Ovsiienko  - ``class {unsigned}``: GENEVE option class.
379755c074f3SViacheslav Ovsiienko  - ``type {unsigned}``: GENEVE option type.
379855c074f3SViacheslav Ovsiienko  - ``length {unsigned}``: GENEVE option length in 32-bit words.
379955c074f3SViacheslav Ovsiienko  - ``data {hex string}``: GENEVE option data, the length is defined by
380055c074f3SViacheslav Ovsiienko    ``length`` field.
380155c074f3SViacheslav Ovsiienko
3802389fca75SGavin Li- ``vxlan-gpe``: match VXLAN-GPE header.
3803389fca75SGavin Li
3804389fca75SGavin Li  - ``vni {unsigned}``: VXLAN-GPE identifier.
3805389fca75SGavin Li  - ``flags {unsigned}``: VXLAN-GPE flags.
3806389fca75SGavin Li  - ``protocol {unsigned}`` : VXLAN-GPE next protocol.
3807389fca75SGavin Li  - ``rsvd0 {unsigned}``: VXLAN-GPE reserved field 0.
3808389fca75SGavin Li  - ``rsvd1 {unsigned}``: VXLAN-GPE reserved field 1.
3809389fca75SGavin Li
3810a903c049SQi Zhang- ``arp_eth_ipv4``: match ARP header for Ethernet/IPv4.
3811a903c049SQi Zhang
3812a903c049SQi Zhang  - ``sha {MAC-48}``: sender hardware address.
3813a903c049SQi Zhang  - ``spa {ipv4 address}``: sender IPv4 address.
3814a903c049SQi Zhang  - ``tha {MAC-48}``: target hardware address.
3815a903c049SQi Zhang  - ``tpa {ipv4 address}``: target IPv4 address.
3816a903c049SQi Zhang
3817a903c049SQi Zhang- ``ipv6_ext``: match presence of any IPv6 extension header.
3818a903c049SQi Zhang
3819a903c049SQi Zhang  - ``next_hdr {unsigned}``: next header.
3820a903c049SQi Zhang
3821a903c049SQi Zhang- ``icmp6``: match any ICMPv6 header.
3822a903c049SQi Zhang
3823a903c049SQi Zhang  - ``type {unsigned}``: ICMPv6 type.
3824a903c049SQi Zhang  - ``code {unsigned}``: ICMPv6 code.
3825a903c049SQi Zhang
3826750ee81dSLeo Xu- ``icmp6_echo_request``: match ICMPv6 echo request.
3827750ee81dSLeo Xu
3828750ee81dSLeo Xu  - ``ident {unsigned}``: ICMPv6 echo request identifier.
3829750ee81dSLeo Xu  - ``seq {unsigned}``: ICMPv6 echo request sequence number.
3830750ee81dSLeo Xu
3831750ee81dSLeo Xu- ``icmp6_echo_reply``: match ICMPv6 echo reply.
3832750ee81dSLeo Xu
3833750ee81dSLeo Xu  - ``ident {unsigned}``: ICMPv6 echo reply identifier.
3834750ee81dSLeo Xu  - ``seq {unsigned}``: ICMPv6 echo reply sequence number.
3835750ee81dSLeo Xu
3836a903c049SQi Zhang- ``icmp6_nd_ns``: match ICMPv6 neighbor discovery solicitation.
3837a903c049SQi Zhang
3838a903c049SQi Zhang  - ``target_addr {ipv6 address}``: target address.
3839a903c049SQi Zhang
3840a903c049SQi Zhang- ``icmp6_nd_na``: match ICMPv6 neighbor discovery advertisement.
3841a903c049SQi Zhang
3842a903c049SQi Zhang  - ``target_addr {ipv6 address}``: target address.
3843a903c049SQi Zhang
3844a903c049SQi Zhang- ``icmp6_nd_opt``: match presence of any ICMPv6 neighbor discovery option.
3845a903c049SQi Zhang
3846a903c049SQi Zhang  - ``type {unsigned}``: ND option type.
3847a903c049SQi Zhang
3848a903c049SQi Zhang- ``icmp6_nd_opt_sla_eth``: match ICMPv6 neighbor discovery source Ethernet
3849a903c049SQi Zhang  link-layer address option.
3850a903c049SQi Zhang
3851a903c049SQi Zhang  - ``sla {MAC-48}``: source Ethernet LLA.
3852a903c049SQi Zhang
3853205d9d3cSDekel Peled- ``icmp6_nd_opt_tla_eth``: match ICMPv6 neighbor discovery target Ethernet
3854a903c049SQi Zhang  link-layer address option.
3855a903c049SQi Zhang
3856a903c049SQi Zhang  - ``tla {MAC-48}``: target Ethernet LLA.
3857a903c049SQi Zhang
3858c18feafaSDekel Peled- ``meta``: match application specific metadata.
3859c18feafaSDekel Peled
3860c18feafaSDekel Peled  - ``data {unsigned}``: metadata value.
3861c18feafaSDekel Peled
3862738ef8f7SMichael Baum- ``random``: match application specific random value.
3863738ef8f7SMichael Baum
3864738ef8f7SMichael Baum  - ``value {unsigned}``: random value.
3865738ef8f7SMichael Baum
3866346553dbSYing A Wang- ``gtp_psc``: match GTP PDU extension header with type 0x85.
3867346553dbSYing A Wang
3868346553dbSYing A Wang  - ``pdu_type {unsigned}``: PDU type.
38697d96f571SRaslan Darawsheh
387016b8e92dSRaslan Darawsheh  - ``qfi {unsigned}``: QoS flow identifier.
3871346553dbSYing A Wang
3872226c6e60SYing A Wang- ``pppoes``, ``pppoed``: match PPPoE header.
3873226c6e60SYing A Wang
3874226c6e60SYing A Wang  - ``session_id {unsigned}``: session identifier.
3875226c6e60SYing A Wang
3876226c6e60SYing A Wang- ``pppoe_proto_id``: match PPPoE session protocol identifier.
3877226c6e60SYing A Wang
3878226c6e60SYing A Wang  - ``proto_id {unsigned}``: PPP protocol identifier.
3879226c6e60SYing A Wang
388065388f4cSRory Sexton- ``l2tpv3oip``: match L2TPv3 over IP header.
388165388f4cSRory Sexton
388265388f4cSRory Sexton  - ``session_id {unsigned}``: L2TPv3 over IP session identifier.
388365388f4cSRory Sexton
3884573ef95dSXiao Zhang- ``ah``: match AH header.
3885573ef95dSXiao Zhang
3886573ef95dSXiao Zhang  - ``spi {unsigned}``: security parameters index.
3887573ef95dSXiao Zhang
3888ecbc8570SXiao Zhang- ``pfcp``: match PFCP header.
3889ecbc8570SXiao Zhang
3890ecbc8570SXiao Zhang  - ``s_field {unsigned}``: S field.
3891ecbc8570SXiao Zhang  - ``seid {unsigned}``: session endpoint identifier.
3892ecbc8570SXiao Zhang
38930797fa6cSOri Kam- ``integrity``: match packet integrity.
38940797fa6cSOri Kam
38950797fa6cSOri Kam   - ``level {unsigned}``: Packet encapsulation level the item should
38960797fa6cSOri Kam     apply to. See rte_flow_action_rss for details.
38970797fa6cSOri Kam   - ``value {unsigned}``: A bitmask that specify what packet elements
38980797fa6cSOri Kam     must be matched for integrity.
38990797fa6cSOri Kam
39004d07cbefSBing Zhao- ``conntrack``: match conntrack state.
39014d07cbefSBing Zhao
3902081e42daSIvan Malov- ``port_representor``: match traffic entering the embedded switch from the given ethdev
3903081e42daSIvan Malov
3904081e42daSIvan Malov  - ``port_id {unsigned}``: ethdev port ID
3905081e42daSIvan Malov
390649863ae2SIvan Malov- ``represented_port``: match traffic entering the embedded switch from
390749863ae2SIvan Malov  the entity represented by the given ethdev
390849863ae2SIvan Malov
390949863ae2SIvan Malov  - ``ethdev_port_id {unsigned}``: ethdev port ID
391049863ae2SIvan Malov
3911748530f0SJie Wang- ``l2tpv2``: match L2TPv2 header.
3912748530f0SJie Wang
3913748530f0SJie Wang  - ``length {unsigned}``: L2TPv2 option length.
3914748530f0SJie Wang  - ``tunnel_id {unsigned}``: L2TPv2 tunnel identifier.
3915748530f0SJie Wang  - ``session_id {unsigned}``: L2TPv2 session identifier.
3916748530f0SJie Wang  - ``ns {unsigned}``: L2TPv2 option ns.
3917748530f0SJie Wang  - ``nr {unsigned}``: L2TPv2 option nr.
3918988cd040SJie Wang  - ``offset_size {unsigned}``: L2TPv2 option offset.
3919748530f0SJie Wang
3920748530f0SJie Wang- ``ppp``: match PPP header.
3921748530f0SJie Wang
3922748530f0SJie Wang  - ``addr {unsigned}``: PPP address.
3923748530f0SJie Wang  - ``ctrl {unsigned}``: PPP control.
3924748530f0SJie Wang  - ``proto_id {unsigned}``: PPP protocol identifier.
3925748530f0SJie Wang
3926e9b8532eSDong Zhou- ``ib_bth``: match InfiniBand BTH(base transport header).
3927e9b8532eSDong Zhou
3928e9b8532eSDong Zhou  - ``opcode {unsigned}``: Opcode.
3929e9b8532eSDong Zhou  - ``pkey {unsigned}``: Partition key.
3930e9b8532eSDong Zhou  - ``dst_qp {unsigned}``: Destination Queue Pair.
3931e9b8532eSDong Zhou  - ``psn {unsigned}``: Packet Sequence Number.
3932e9b8532eSDong Zhou
39333af7a4afSAlexander Kozyrev- ``meter``: match meter color.
39343af7a4afSAlexander Kozyrev
39353af7a4afSAlexander Kozyrev  - ``color {value}``: meter color value (green/yellow/red).
39363af7a4afSAlexander Kozyrev
39378ebc396bSJiawei Wang- ``aggr_affinity``: match aggregated port.
39388ebc396bSJiawei Wang
39398ebc396bSJiawei Wang  - ``affinity {value}``: aggregated port (starts from 1).
39408ebc396bSJiawei Wang
394141f6bdc7SKiran Kumar K- ``tx_queue``: match Tx queue of sent packet.
394241f6bdc7SKiran Kumar K
394341f6bdc7SKiran Kumar K  - ``tx_queue {value}``: send queue value (starts from 0).
394441f6bdc7SKiran Kumar K
39456838dd4bSMichael Savisko- ``send_to_kernel``: send packets to kernel.
39466838dd4bSMichael Savisko
3947a3d2c697SAlexander Kozyrev- ``ptype``: match the packet type (L2/L3/L4 and tunnel information).
3948a3d2c697SAlexander Kozyrev
3949a3d2c697SAlexander Kozyrev        - ``packet_type {unsigned}``: packet type.
3950a3d2c697SAlexander Kozyrev
395158143b7bSSuanming Mou- ``compare``: match the comparison result between packet fields or value.
395258143b7bSSuanming Mou
395358143b7bSSuanming Mou        - ``op {string}``: comparison operation type.
395458143b7bSSuanming Mou        - ``a_type {string}``: compared field.
395558143b7bSSuanming Mou        - ``b_type {string}``: comparator field.
395658143b7bSSuanming Mou        - ``width {unsigned}``: comparison width.
395758143b7bSSuanming Mou
39586838dd4bSMichael Savisko
3959a997a33bSAdrien MazarguilActions list
3960a997a33bSAdrien Mazarguil^^^^^^^^^^^^
3961a997a33bSAdrien Mazarguil
3962a997a33bSAdrien MazarguilA list of actions starts after the ``actions`` token in the same fashion as
3963a997a33bSAdrien Mazarguil`Matching pattern`_; actions are separated by ``/`` tokens and the list is
3964a997a33bSAdrien Mazarguilterminated by a mandatory ``end`` action.
3965a997a33bSAdrien Mazarguil
3966a997a33bSAdrien MazarguilActions are named after their type (*RTE_FLOW_ACTION_TYPE_* from ``enum
3967a997a33bSAdrien Mazarguilrte_flow_action_type``).
3968a997a33bSAdrien Mazarguil
3969a997a33bSAdrien MazarguilDropping all incoming UDPv4 packets can be expressed as follows::
3970a997a33bSAdrien Mazarguil
3971a997a33bSAdrien Mazarguil   testpmd> flow create 0 ingress pattern eth / ipv4 / udp / end
3972a997a33bSAdrien Mazarguil      actions drop / end
3973a997a33bSAdrien Mazarguil
3974a997a33bSAdrien MazarguilSeveral actions have configurable properties which must be specified when
3975a997a33bSAdrien Mazarguilthere is no valid default value. For example, ``queue`` requires a target
3976a997a33bSAdrien Mazarguilqueue index.
3977a997a33bSAdrien Mazarguil
3978a997a33bSAdrien MazarguilThis rule redirects incoming UDPv4 traffic to queue index 6::
3979a997a33bSAdrien Mazarguil
3980a997a33bSAdrien Mazarguil   testpmd> flow create 0 ingress pattern eth / ipv4 / udp / end
3981a997a33bSAdrien Mazarguil      actions queue index 6 / end
3982a997a33bSAdrien Mazarguil
3983a997a33bSAdrien MazarguilWhile this one could be rejected by PMDs (unspecified queue index)::
3984a997a33bSAdrien Mazarguil
3985a997a33bSAdrien Mazarguil   testpmd> flow create 0 ingress pattern eth / ipv4 / udp / end
3986a997a33bSAdrien Mazarguil      actions queue / end
3987a997a33bSAdrien Mazarguil
3988a997a33bSAdrien MazarguilAs defined by *rte_flow*, the list is not ordered, all actions of a given
3989a997a33bSAdrien Mazarguilrule are performed simultaneously. These are equivalent::
3990a997a33bSAdrien Mazarguil
3991a997a33bSAdrien Mazarguil   queue index 6 / void / mark id 42 / end
3992a997a33bSAdrien Mazarguil
3993a997a33bSAdrien Mazarguil::
3994a997a33bSAdrien Mazarguil
3995a997a33bSAdrien Mazarguil   void / mark id 42 / queue index 6 / end
3996a997a33bSAdrien Mazarguil
3997a997a33bSAdrien MazarguilAll actions in a list should have different types, otherwise only the last
3998a997a33bSAdrien Mazarguilaction of a given type is taken into account::
3999a997a33bSAdrien Mazarguil
4000a997a33bSAdrien Mazarguil   queue index 4 / queue index 5 / queue index 6 / end # will use queue 6
4001a997a33bSAdrien Mazarguil
4002a997a33bSAdrien Mazarguil::
4003a997a33bSAdrien Mazarguil
4004a997a33bSAdrien Mazarguil   drop / drop / drop / end # drop is performed only once
4005a997a33bSAdrien Mazarguil
4006a997a33bSAdrien Mazarguil::
4007a997a33bSAdrien Mazarguil
4008a997a33bSAdrien Mazarguil   mark id 42 / queue index 3 / mark id 24 / end # mark will be 24
4009a997a33bSAdrien Mazarguil
4010a997a33bSAdrien MazarguilConsidering they are performed simultaneously, opposite and overlapping
4011a997a33bSAdrien Mazarguilactions can sometimes be combined when the end result is unambiguous::
4012a997a33bSAdrien Mazarguil
4013a997a33bSAdrien Mazarguil   drop / queue index 6 / end # drop has no effect
4014a997a33bSAdrien Mazarguil
4015a997a33bSAdrien Mazarguil::
4016a997a33bSAdrien Mazarguil
4017a997a33bSAdrien Mazarguil   queue index 6 / rss queues 6 7 8 / end # queue has no effect
4018a997a33bSAdrien Mazarguil
4019a997a33bSAdrien Mazarguil::
4020a997a33bSAdrien Mazarguil
4021a997a33bSAdrien Mazarguil   drop / passthru / end # drop has no effect
4022a997a33bSAdrien Mazarguil
4023a997a33bSAdrien MazarguilNote that PMDs may still refuse such combinations.
4024a997a33bSAdrien Mazarguil
4025a997a33bSAdrien MazarguilActions
4026a997a33bSAdrien Mazarguil^^^^^^^
4027a997a33bSAdrien Mazarguil
4028a997a33bSAdrien MazarguilThis section lists supported actions and their attributes, if any.
4029a997a33bSAdrien Mazarguil
4030a997a33bSAdrien Mazarguil- ``end``: end list of actions.
4031a997a33bSAdrien Mazarguil
4032a997a33bSAdrien Mazarguil- ``void``: no-op action.
4033a997a33bSAdrien Mazarguil
4034a997a33bSAdrien Mazarguil- ``passthru``: let subsequent rule process matched packets.
4035a997a33bSAdrien Mazarguil
40362f82d143SDeclan Doherty- ``jump``: redirect traffic to group on device.
40372f82d143SDeclan Doherty
40382f82d143SDeclan Doherty  - ``group {unsigned}``: group to redirect to.
40392f82d143SDeclan Doherty
4040a997a33bSAdrien Mazarguil- ``mark``: attach 32 bit value to packets.
4041a997a33bSAdrien Mazarguil
4042a997a33bSAdrien Mazarguil  - ``id {unsigned}``: 32 bit value to return with packets.
4043a997a33bSAdrien Mazarguil
4044a997a33bSAdrien Mazarguil- ``flag``: flag packets.
4045a997a33bSAdrien Mazarguil
4046a997a33bSAdrien Mazarguil- ``queue``: assign packets to a given queue index.
4047a997a33bSAdrien Mazarguil
4048a997a33bSAdrien Mazarguil  - ``index {unsigned}``: queue index to use.
4049a997a33bSAdrien Mazarguil
4050a997a33bSAdrien Mazarguil- ``drop``: drop packets (note: passthru has priority).
4051a997a33bSAdrien Mazarguil
4052a997a33bSAdrien Mazarguil- ``count``: enable counters for this rule.
4053a997a33bSAdrien Mazarguil
4054a997a33bSAdrien Mazarguil- ``rss``: spread packets among several queues.
4055a997a33bSAdrien Mazarguil
4056929e3319SAdrien Mazarguil  - ``func {hash function}``: RSS hash function to apply, allowed tokens are
405781db321dSAndrew Rybchenko    ``toeplitz``, ``simple_xor``, ``symmetric_toeplitz`` and ``default``.
4058929e3319SAdrien Mazarguil
405918aee286SAdrien Mazarguil  - ``level {unsigned}``: encapsulation level for ``types``.
406018aee286SAdrien Mazarguil
406181db321dSAndrew Rybchenko  - ``types [{RSS hash type} [...]] end``: specific RSS hash types.
406281db321dSAndrew Rybchenko    Note that an empty list does not disable RSS but instead requests
406381db321dSAndrew Rybchenko    unspecified "best-effort" settings.
4064f4d623f9SAdrien Mazarguil
4065f4d623f9SAdrien Mazarguil  - ``key {string}``: RSS hash key, overrides ``key_len``.
4066f4d623f9SAdrien Mazarguil
4067f4d623f9SAdrien Mazarguil  - ``key_len {unsigned}``: RSS hash key length in bytes, can be used in
4068f4d623f9SAdrien Mazarguil    conjunction with ``key`` to pad or truncate it.
4069f4d623f9SAdrien Mazarguil
4070a997a33bSAdrien Mazarguil  - ``queues [{unsigned} [...]] end``: queue indices to use.
4071a997a33bSAdrien Mazarguil
407239b8dda7SAdrien Mazarguil- ``pf``: direct traffic to physical function.
4073a997a33bSAdrien Mazarguil
407439b8dda7SAdrien Mazarguil- ``vf``: direct traffic to a virtual function ID.
4075a997a33bSAdrien Mazarguil
4076a997a33bSAdrien Mazarguil  - ``original {boolean}``: use original VF ID if possible.
407739b8dda7SAdrien Mazarguil  - ``id {unsigned}``: VF ID.
4078a997a33bSAdrien Mazarguil
4079fc6bbb3fSAdrien Mazarguil- ``port_id``: direct matching traffic to a given DPDK port ID.
4080fc6bbb3fSAdrien Mazarguil
4081fc6bbb3fSAdrien Mazarguil  - ``original {boolean}``: use original DPDK port ID if possible.
4082fc6bbb3fSAdrien Mazarguil  - ``id {unsigned}``: DPDK port ID.
4083fc6bbb3fSAdrien Mazarguil
40841c54c938SQi Zhang- ``of_set_mpls_ttl``: OpenFlow's ``OFPAT_SET_MPLS_TTL``.
40851c54c938SQi Zhang
40861c54c938SQi Zhang  - ``mpls_ttl``: MPLS TTL.
40871c54c938SQi Zhang
40881c54c938SQi Zhang- ``of_dec_mpls_ttl``: OpenFlow's ``OFPAT_DEC_MPLS_TTL``.
40891c54c938SQi Zhang
40901c54c938SQi Zhang- ``of_set_nw_ttl``: OpenFlow's ``OFPAT_SET_NW_TTL``.
40911c54c938SQi Zhang
40921c54c938SQi Zhang  - ``nw_ttl``: IP TTL.
40931c54c938SQi Zhang
40941c54c938SQi Zhang- ``of_dec_nw_ttl``: OpenFlow's ``OFPAT_DEC_NW_TTL``.
40951c54c938SQi Zhang
40961c54c938SQi Zhang- ``of_copy_ttl_out``: OpenFlow's ``OFPAT_COPY_TTL_OUT``.
40971c54c938SQi Zhang
40981c54c938SQi Zhang- ``of_copy_ttl_in``: OpenFlow's ``OFPAT_COPY_TTL_IN``.
40991c54c938SQi Zhang
41007e3389b1SQi Zhang- ``of_pop_vlan``: OpenFlow's ``OFPAT_POP_VLAN``.
41017e3389b1SQi Zhang
41027e3389b1SQi Zhang- ``of_push_vlan``: OpenFlow's ``OFPAT_PUSH_VLAN``.
41037e3389b1SQi Zhang
41047e3389b1SQi Zhang  - ``ethertype``: Ethertype.
41057e3389b1SQi Zhang
41067e3389b1SQi Zhang- ``of_set_vlan_vid``: OpenFlow's ``OFPAT_SET_VLAN_VID``.
41077e3389b1SQi Zhang
41087e3389b1SQi Zhang  - ``vlan_vid``: VLAN id.
41097e3389b1SQi Zhang
41107e3389b1SQi Zhang- ``of_set_vlan_pcp``: OpenFlow's ``OFPAT_SET_VLAN_PCP``.
41117e3389b1SQi Zhang
41127e3389b1SQi Zhang  - ``vlan_pcp``: VLAN priority.
41137e3389b1SQi Zhang
41147e3389b1SQi Zhang- ``of_pop_mpls``: OpenFlow's ``OFPAT_POP_MPLS``.
41157e3389b1SQi Zhang
41167e3389b1SQi Zhang  - ``ethertype``: Ethertype.
41177e3389b1SQi Zhang
41187e3389b1SQi Zhang- ``of_push_mpls``: OpenFlow's ``OFPAT_PUSH_MPLS``.
41197e3389b1SQi Zhang
41207e3389b1SQi Zhang  - ``ethertype``: Ethertype.
41217e3389b1SQi Zhang
41221960be7dSNelio Laranjeiro- ``vxlan_encap``: Performs a VXLAN encapsulation, outer layer configuration
41231960be7dSNelio Laranjeiro  is done through `Config VXLAN Encap outer layers`_.
41241960be7dSNelio Laranjeiro
41251960be7dSNelio Laranjeiro- ``vxlan_decap``: Performs a decapsulation action by stripping all headers of
41261960be7dSNelio Laranjeiro  the VXLAN tunnel network overlay from the matched flow.
41271960be7dSNelio Laranjeiro
4128dcd962fcSNelio Laranjeiro- ``nvgre_encap``: Performs a NVGRE encapsulation, outer layer configuration
4129dcd962fcSNelio Laranjeiro  is done through `Config NVGRE Encap outer layers`_.
4130dcd962fcSNelio Laranjeiro
4131dcd962fcSNelio Laranjeiro- ``nvgre_decap``: Performs a decapsulation action by stripping all headers of
4132dcd962fcSNelio Laranjeiro  the NVGRE tunnel network overlay from the matched flow.
4133dcd962fcSNelio Laranjeiro
4134a1191d39SOri Kam- ``l2_encap``: Performs a L2 encapsulation, L2 configuration
4135a1191d39SOri Kam  is done through `Config L2 Encap`_.
4136a1191d39SOri Kam
4137a1191d39SOri Kam- ``l2_decap``: Performs a L2 decapsulation, L2 configuration
4138a1191d39SOri Kam  is done through `Config L2 Decap`_.
4139a1191d39SOri Kam
41403e77031bSOri Kam- ``mplsogre_encap``: Performs a MPLSoGRE encapsulation, outer layer
41413e77031bSOri Kam  configuration is done through `Config MPLSoGRE Encap outer layers`_.
41423e77031bSOri Kam
41433e77031bSOri Kam- ``mplsogre_decap``: Performs a MPLSoGRE decapsulation, outer layer
41443e77031bSOri Kam  configuration is done through `Config MPLSoGRE Decap outer layers`_.
41453e77031bSOri Kam
4146a1191d39SOri Kam- ``mplsoudp_encap``: Performs a MPLSoUDP encapsulation, outer layer
4147a1191d39SOri Kam  configuration is done through `Config MPLSoUDP Encap outer layers`_.
4148a1191d39SOri Kam
4149a1191d39SOri Kam- ``mplsoudp_decap``: Performs a MPLSoUDP decapsulation, outer layer
4150a1191d39SOri Kam  configuration is done through `Config MPLSoUDP Decap outer layers`_.
4151a1191d39SOri Kam
41520517eea7SRahul Lakkireddy- ``set_ipv4_src``: Set a new IPv4 source address in the outermost IPv4 header.
41530517eea7SRahul Lakkireddy
41540517eea7SRahul Lakkireddy  - ``ipv4_addr``: New IPv4 source address.
41550517eea7SRahul Lakkireddy
41560517eea7SRahul Lakkireddy- ``set_ipv4_dst``: Set a new IPv4 destination address in the outermost IPv4
41570517eea7SRahul Lakkireddy  header.
41580517eea7SRahul Lakkireddy
41590517eea7SRahul Lakkireddy  - ``ipv4_addr``: New IPv4 destination address.
41600517eea7SRahul Lakkireddy
41610517eea7SRahul Lakkireddy- ``set_ipv6_src``: Set a new IPv6 source address in the outermost IPv6 header.
41620517eea7SRahul Lakkireddy
41630517eea7SRahul Lakkireddy  - ``ipv6_addr``: New IPv6 source address.
41640517eea7SRahul Lakkireddy
41650517eea7SRahul Lakkireddy- ``set_ipv6_dst``: Set a new IPv6 destination address in the outermost IPv6
41660517eea7SRahul Lakkireddy  header.
41670517eea7SRahul Lakkireddy
41680517eea7SRahul Lakkireddy  - ``ipv6_addr``: New IPv6 destination address.
41690517eea7SRahul Lakkireddy
417047182a79SDekel Peled- ``set_tp_src``: Set a new source port number in the outermost TCP/UDP
41719ccc9491SRahul Lakkireddy  header.
41729ccc9491SRahul Lakkireddy
41739ccc9491SRahul Lakkireddy  - ``port``: New TCP/UDP source port number.
41749ccc9491SRahul Lakkireddy
417547182a79SDekel Peled- ``set_tp_dst``: Set a new destination port number in the outermost TCP/UDP
41769ccc9491SRahul Lakkireddy  header.
41779ccc9491SRahul Lakkireddy
41789ccc9491SRahul Lakkireddy  - ``port``: New TCP/UDP destination port number.
41799ccc9491SRahul Lakkireddy
418082875970SRahul Lakkireddy- ``mac_swap``: Swap the source and destination MAC addresses in the outermost
418182875970SRahul Lakkireddy  Ethernet header.
418282875970SRahul Lakkireddy
4183708d0bcbSXiaoyu Min- ``dec_ttl``: Performs a decrease TTL value action
4184708d0bcbSXiaoyu Min
4185d629b7b5SJohn McNamara- ``set_ttl``: Set TTL value with specified value
4186708d0bcbSXiaoyu Min  - ``ttl_value {unsigned}``: The new TTL value to be set
4187708d0bcbSXiaoyu Min
41884dff9e29SXiaoyu Min- ``set_mac_src``: set source MAC address
41894dff9e29SXiaoyu Min
41904dff9e29SXiaoyu Min  - ``mac_addr {MAC-48}``: new source MAC address
41914dff9e29SXiaoyu Min
41924dff9e29SXiaoyu Min- ``set_mac_dst``: set destination MAC address
41934dff9e29SXiaoyu Min
41944dff9e29SXiaoyu Min  - ``mac_addr {MAC-48}``: new destination MAC address
41954dff9e29SXiaoyu Min
419627a2c126SDekel Peled- ``inc_tcp_seq``: Increase sequence number in the outermost TCP header.
419727a2c126SDekel Peled
419827a2c126SDekel Peled  - ``value {unsigned}``: Value to increase TCP sequence number by.
419927a2c126SDekel Peled
420027a2c126SDekel Peled- ``dec_tcp_seq``: Decrease sequence number in the outermost TCP header.
420127a2c126SDekel Peled
420227a2c126SDekel Peled  - ``value {unsigned}``: Value to decrease TCP sequence number by.
420327a2c126SDekel Peled
420427a2c126SDekel Peled- ``inc_tcp_ack``: Increase acknowledgment number in the outermost TCP header.
420527a2c126SDekel Peled
420627a2c126SDekel Peled  - ``value {unsigned}``: Value to increase TCP acknowledgment number by.
420727a2c126SDekel Peled
420827a2c126SDekel Peled- ``dec_tcp_ack``: Decrease acknowledgment number in the outermost TCP header.
420927a2c126SDekel Peled
421027a2c126SDekel Peled  - ``value {unsigned}``: Value to decrease TCP acknowledgment number by.
421127a2c126SDekel Peled
42128482ffe4SSuanming Mou- ``set_ipv4_dscp``: Set IPv4 DSCP value with specified value
42138482ffe4SSuanming Mou
42148482ffe4SSuanming Mou  - ``dscp_value {unsigned}``: The new DSCP value to be set
42158482ffe4SSuanming Mou
42168482ffe4SSuanming Mou- ``set_ipv6_dscp``: Set IPv6 DSCP value with specified value
42178482ffe4SSuanming Mou
42188482ffe4SSuanming Mou  - ``dscp_value {unsigned}``: The new DSCP value to be set
42198482ffe4SSuanming Mou
42204b61b877SBing Zhao- ``indirect``: Use indirect action created via
42214b61b877SBing Zhao  ``flow indirect_action {port_id} create``
422255509e3aSAndrey Vesnovaty
42234b61b877SBing Zhao  - ``indirect_action_id {unsigned}``: Indirect action ID to use
422455509e3aSAndrey Vesnovaty
4225c5c50710SHaifei Luo- ``color``: Color the packet to reflect the meter color result
4226c5c50710SHaifei Luo
4227c5c50710SHaifei Luo  - ``type {value}``: Set color type with specified value(green/yellow/red)
4228c5c50710SHaifei Luo
42298edb6bc0SIvan Malov- ``port_representor``: at embedded switch level, send matching traffic to
42308edb6bc0SIvan Malov  the given ethdev
42318edb6bc0SIvan Malov
42328edb6bc0SIvan Malov  - ``port_id {unsigned}``: ethdev port ID
42338edb6bc0SIvan Malov
423488caad25SIvan Malov- ``represented_port``: at embedded switch level, send matching traffic to
423588caad25SIvan Malov  the entity represented by the given ethdev
423688caad25SIvan Malov
423788caad25SIvan Malov  - ``ethdev_port_id {unsigned}``: ethdev port ID
423888caad25SIvan Malov
42399c4a0c18SAlexander Kozyrev- ``meter_mark``:  meter the directed packets using profile and policy
42409c4a0c18SAlexander Kozyrev
42419c4a0c18SAlexander Kozyrev  - ``mtr_profile {unsigned}``: meter profile ID to use
42429c4a0c18SAlexander Kozyrev  - ``mtr_policy {unsigned}``: meter policy ID to use
42439c4a0c18SAlexander Kozyrev  - ``mtr_color_mode {unsigned}``: meter color-awareness mode (blind/aware)
42449c4a0c18SAlexander Kozyrev  - ``mtr_init_color {value}``: initial color value (green/yellow/red)
42459c4a0c18SAlexander Kozyrev  - ``mtr_state {unsigned}``: meter state (disabled/enabled)
42469c4a0c18SAlexander Kozyrev
4247676a21f9SSuanming Mou- ``modify_field``:  Modify packet field
4248676a21f9SSuanming Mou
4249676a21f9SSuanming Mou  - ``op``: modify operation (set/add/sub)
4250676a21f9SSuanming Mou  - ``dst_type``: the destination field to be modified, the supported fields as
4251676a21f9SSuanming Mou    ``enum rte_flow_field_id`` listed.
4252676a21f9SSuanming Mou  - ``dst_level``: destination field level.
4253676a21f9SSuanming Mou  - ``dst_tag_index``: destination field tag array.
4254676a21f9SSuanming Mou  - ``dst_type_id``: destination field type ID.
4255676a21f9SSuanming Mou  - ``dst_class``: destination field class ID.
4256676a21f9SSuanming Mou  - ``dst_offset``: destination field bit offset.
4257676a21f9SSuanming Mou  - ``src_type``: the modify source field, the supported fields as
4258676a21f9SSuanming Mou    ``enum rte_flow_field_id`` listed.
4259676a21f9SSuanming Mou  - ``src_level``: source field level.
4260676a21f9SSuanming Mou  - ``src_tag_index``: source field tag array.
4261676a21f9SSuanming Mou  - ``src_type_id``: source field type ID.
4262676a21f9SSuanming Mou  - ``src_class``: source field class ID.
4263676a21f9SSuanming Mou  - ``src_offset``: source field bit offset.
4264676a21f9SSuanming Mou  - ``src_value``: source immediate value.
4265676a21f9SSuanming Mou  - ``src_ptr``: pointer to source immediate value.
4266676a21f9SSuanming Mou  - ``width``: number of bits to copy.
4267676a21f9SSuanming Mou
4268eb704df7SBing Zhao- ``nat64``: NAT64 IP headers translation
4269eb704df7SBing Zhao
4270eb704df7SBing Zhao  - ``type {unsigned}``: NAT64 translation type
4271eb704df7SBing Zhao
4272a997a33bSAdrien MazarguilDestroying flow rules
4273a997a33bSAdrien Mazarguil~~~~~~~~~~~~~~~~~~~~~
4274a997a33bSAdrien Mazarguil
4275a997a33bSAdrien Mazarguil``flow destroy`` destroys one or more rules from their rule ID (as returned
4276a997a33bSAdrien Mazarguilby ``flow create``), this command calls ``rte_flow_destroy()`` as many
4277a997a33bSAdrien Mazarguiltimes as necessary::
4278a997a33bSAdrien Mazarguil
42798ac3a1cdSEli Britstein   flow destroy {port_id} rule {rule_id} [...] [user_id]
4280a997a33bSAdrien Mazarguil
4281a997a33bSAdrien MazarguilIf successful, it will show::
4282a997a33bSAdrien Mazarguil
4283a997a33bSAdrien Mazarguil   Flow rule #[...] destroyed
4284a997a33bSAdrien Mazarguil
42858ac3a1cdSEli BritsteinOr if ``user_id`` flag is provided::
42868ac3a1cdSEli Britstein
42878ac3a1cdSEli Britstein   Flow rule #[...] destroyed, user-id [...]
42888ac3a1cdSEli Britstein
42898ac3a1cdSEli BritsteinOptional ``user_id`` is a flag that signifies the rule ID
42908ac3a1cdSEli Britsteinis the one provided by the user at creation.
4291a997a33bSAdrien MazarguilIt does not report anything for rule IDs that do not exist. The usual error
4292a997a33bSAdrien Mazarguilmessage is shown when a rule cannot be destroyed::
4293a997a33bSAdrien Mazarguil
4294a997a33bSAdrien Mazarguil   Caught error type [...] ([...]): [...]
4295a997a33bSAdrien Mazarguil
4296a997a33bSAdrien Mazarguil``flow flush`` destroys all rules on a device and does not take extra
4297a997a33bSAdrien Mazarguilarguments. It is bound to ``rte_flow_flush()``::
4298a997a33bSAdrien Mazarguil
4299a997a33bSAdrien Mazarguil   flow flush {port_id}
4300a997a33bSAdrien Mazarguil
4301a997a33bSAdrien MazarguilAny errors are reported as above.
4302a997a33bSAdrien Mazarguil
4303a997a33bSAdrien MazarguilCreating several rules and destroying them::
4304a997a33bSAdrien Mazarguil
4305a997a33bSAdrien Mazarguil   testpmd> flow create 0 ingress pattern eth / ipv6 / end
4306a997a33bSAdrien Mazarguil      actions queue index 2 / end
4307a997a33bSAdrien Mazarguil   Flow rule #0 created
4308a997a33bSAdrien Mazarguil   testpmd> flow create 0 ingress pattern eth / ipv4 / end
4309a997a33bSAdrien Mazarguil      actions queue index 3 / end
4310a997a33bSAdrien Mazarguil   Flow rule #1 created
4311a997a33bSAdrien Mazarguil   testpmd> flow destroy 0 rule 0 rule 1
4312a997a33bSAdrien Mazarguil   Flow rule #1 destroyed
4313a997a33bSAdrien Mazarguil   Flow rule #0 destroyed
4314a997a33bSAdrien Mazarguil   testpmd>
4315a997a33bSAdrien Mazarguil
4316a997a33bSAdrien MazarguilThe same result can be achieved using ``flow flush``::
4317a997a33bSAdrien Mazarguil
4318a997a33bSAdrien Mazarguil   testpmd> flow create 0 ingress pattern eth / ipv6 / end
4319a997a33bSAdrien Mazarguil      actions queue index 2 / end
4320a997a33bSAdrien Mazarguil   Flow rule #0 created
4321a997a33bSAdrien Mazarguil   testpmd> flow create 0 ingress pattern eth / ipv4 / end
4322a997a33bSAdrien Mazarguil      actions queue index 3 / end
4323a997a33bSAdrien Mazarguil   Flow rule #1 created
4324a997a33bSAdrien Mazarguil   testpmd> flow flush 0
4325a997a33bSAdrien Mazarguil   testpmd>
4326a997a33bSAdrien Mazarguil
4327a997a33bSAdrien MazarguilNon-existent rule IDs are ignored::
4328a997a33bSAdrien Mazarguil
4329a997a33bSAdrien Mazarguil   testpmd> flow create 0 ingress pattern eth / ipv6 / end
4330a997a33bSAdrien Mazarguil      actions queue index 2 / end
4331a997a33bSAdrien Mazarguil   Flow rule #0 created
4332a997a33bSAdrien Mazarguil   testpmd> flow create 0 ingress pattern eth / ipv4 / end
4333a997a33bSAdrien Mazarguil      actions queue index 3 / end
4334a997a33bSAdrien Mazarguil   Flow rule #1 created
4335a997a33bSAdrien Mazarguil   testpmd> flow destroy 0 rule 42 rule 10 rule 2
4336a997a33bSAdrien Mazarguil   testpmd>
4337a997a33bSAdrien Mazarguil   testpmd> flow destroy 0 rule 0
4338a997a33bSAdrien Mazarguil   Flow rule #0 destroyed
4339a997a33bSAdrien Mazarguil   testpmd>
4340a997a33bSAdrien Mazarguil
43412d9c7e56SOleksandr KolomeietsUpdating flow rules with new actions
43422d9c7e56SOleksandr Kolomeiets~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43432d9c7e56SOleksandr Kolomeiets
43442d9c7e56SOleksandr Kolomeiets``flow update`` updates a flow rule specified by a rule ID with a new action
43452d9c7e56SOleksandr Kolomeietslist by making a call to ``rte_flow_actions_update()``::
43462d9c7e56SOleksandr Kolomeiets
43472d9c7e56SOleksandr Kolomeiets   flow update {port_id} {rule_id}
43482d9c7e56SOleksandr Kolomeiets       actions {action} [/ {action} [...]] / end [user_id]
43492d9c7e56SOleksandr Kolomeiets
43502d9c7e56SOleksandr KolomeietsIf successful, it will show::
43512d9c7e56SOleksandr Kolomeiets
43522d9c7e56SOleksandr Kolomeiets   Flow rule #[...] updated with new actions
43532d9c7e56SOleksandr Kolomeiets
43542d9c7e56SOleksandr KolomeietsOr if ``user_id`` flag is provided::
43552d9c7e56SOleksandr Kolomeiets
43562d9c7e56SOleksandr Kolomeiets   Flow rule #[...] updated with new actions, user-id [...]
43572d9c7e56SOleksandr Kolomeiets
43582d9c7e56SOleksandr KolomeietsIf a flow rule can not be found::
43592d9c7e56SOleksandr Kolomeiets
43602d9c7e56SOleksandr Kolomeiets   Failed to find flow [...]
43612d9c7e56SOleksandr Kolomeiets
43622d9c7e56SOleksandr KolomeietsOtherwise it will show the usual error message of the form::
43632d9c7e56SOleksandr Kolomeiets
43642d9c7e56SOleksandr Kolomeiets   Caught error type [...] ([...]): [...]
43652d9c7e56SOleksandr Kolomeiets
43662d9c7e56SOleksandr KolomeietsOptional ``user_id`` is a flag that signifies the rule ID is the one provided
43672d9c7e56SOleksandr Kolomeietsby the user at creation.
43682d9c7e56SOleksandr Kolomeiets
43692d9c7e56SOleksandr KolomeietsAction list is identical to the one described for the ``flow create``.
43702d9c7e56SOleksandr Kolomeiets
43712d9c7e56SOleksandr KolomeietsCreating, updating and destroying a flow rule::
43722d9c7e56SOleksandr Kolomeiets
43732d9c7e56SOleksandr Kolomeiets   testpmd> flow create 0 group 1 pattern eth / end actions drop / end
43742d9c7e56SOleksandr Kolomeiets   Flow rule #0 created
43752d9c7e56SOleksandr Kolomeiets   testpmd> flow update 0 0 actions queue index 1 / end
43762d9c7e56SOleksandr Kolomeiets   Flow rule #0 updated with new actions
43772d9c7e56SOleksandr Kolomeiets   testpmd> flow destroy 0 rule 0
43782d9c7e56SOleksandr Kolomeiets   Flow rule #0 destroyed
43792d9c7e56SOleksandr Kolomeiets
4380ecdc927bSAlexander KozyrevEnqueueing destruction of flow rules
4381ecdc927bSAlexander Kozyrev~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4382ecdc927bSAlexander Kozyrev
4383ecdc927bSAlexander Kozyrev``flow queue destroy`` adds destruction operations to destroy one or more rules
4384ecdc927bSAlexander Kozyrevfrom their rule ID (as returned by ``flow queue create``) to a queue,
4385ecdc927bSAlexander Kozyrevthis command calls ``rte_flow_async_destroy()`` as many times as necessary::
4386ecdc927bSAlexander Kozyrev
4387ecdc927bSAlexander Kozyrev   flow queue {port_id} destroy {queue_id}
4388ecdc927bSAlexander Kozyrev        [postpone {boolean}] rule {rule_id} [...]
4389ecdc927bSAlexander Kozyrev
4390ecdc927bSAlexander KozyrevIf successful, it will show::
4391ecdc927bSAlexander Kozyrev
4392ecdc927bSAlexander Kozyrev   Flow rule #[...] destruction enqueued
4393ecdc927bSAlexander Kozyrev
4394ecdc927bSAlexander KozyrevIt does not report anything for rule IDs that do not exist. The usual error
4395ecdc927bSAlexander Kozyrevmessage is shown when a rule cannot be destroyed::
4396ecdc927bSAlexander Kozyrev
4397ecdc927bSAlexander Kozyrev   Caught error type [...] ([...]): [...]
4398ecdc927bSAlexander Kozyrev
4399f9bf7dffSAlexander Kozyrev``flow queue pull`` must be called to retrieve the operation status.
4400f9bf7dffSAlexander Kozyrev
4401a997a33bSAdrien MazarguilQuerying flow rules
4402a997a33bSAdrien Mazarguil~~~~~~~~~~~~~~~~~~~
4403a997a33bSAdrien Mazarguil
4404a997a33bSAdrien Mazarguil``flow query`` queries a specific action of a flow rule having that
4405a997a33bSAdrien Mazarguilability. Such actions collect information that can be reported using this
4406a997a33bSAdrien Mazarguilcommand. It is bound to ``rte_flow_query()``::
4407a997a33bSAdrien Mazarguil
44088ac3a1cdSEli Britstein   flow query {port_id} {rule_id} {action} [user_id]
4409a997a33bSAdrien Mazarguil
44108ac3a1cdSEli BritsteinOptional ``user_id`` is a flag that signifies the rule ID
44118ac3a1cdSEli Britsteinis the one provided by the user at creation.
4412a997a33bSAdrien MazarguilIf successful, it will display either the retrieved data for known actions
4413a997a33bSAdrien Mazarguilor the following message::
4414a997a33bSAdrien Mazarguil
4415a997a33bSAdrien Mazarguil   Cannot display result for action type [...] ([...])
4416a997a33bSAdrien Mazarguil
4417a997a33bSAdrien MazarguilOtherwise, it will complain either that the rule does not exist or that some
4418a997a33bSAdrien Mazarguilerror occurred::
4419a997a33bSAdrien Mazarguil
4420a997a33bSAdrien Mazarguil   Flow rule #[...] not found
4421a997a33bSAdrien Mazarguil
4422a997a33bSAdrien Mazarguil::
4423a997a33bSAdrien Mazarguil
4424a997a33bSAdrien Mazarguil   Caught error type [...] ([...]): [...]
4425a997a33bSAdrien Mazarguil
4426a997a33bSAdrien MazarguilCurrently only the ``count`` action is supported. This action reports the
4427a997a33bSAdrien Mazarguilnumber of packets that hit the flow rule and the total number of bytes. Its
4428a997a33bSAdrien Mazarguiloutput has the following format::
4429a997a33bSAdrien Mazarguil
4430a997a33bSAdrien Mazarguil   count:
4431a997a33bSAdrien Mazarguil    hits_set: [...] # whether "hits" contains a valid value
4432a997a33bSAdrien Mazarguil    bytes_set: [...] # whether "bytes" contains a valid value
4433a997a33bSAdrien Mazarguil    hits: [...] # number of packets
4434a997a33bSAdrien Mazarguil    bytes: [...] # number of bytes
4435a997a33bSAdrien Mazarguil
4436a997a33bSAdrien MazarguilQuerying counters for TCPv6 packets redirected to queue 6::
4437a997a33bSAdrien Mazarguil
4438a997a33bSAdrien Mazarguil   testpmd> flow create 0 ingress pattern eth / ipv6 / tcp / end
4439a997a33bSAdrien Mazarguil      actions queue index 6 / count / end
4440a997a33bSAdrien Mazarguil   Flow rule #4 created
4441a997a33bSAdrien Mazarguil   testpmd> flow query 0 4 count
4442a997a33bSAdrien Mazarguil   count:
4443a997a33bSAdrien Mazarguil    hits_set: 1
4444a997a33bSAdrien Mazarguil    bytes_set: 0
4445a997a33bSAdrien Mazarguil    hits: 386446
4446a997a33bSAdrien Mazarguil    bytes: 0
4447a997a33bSAdrien Mazarguil   testpmd>
4448a997a33bSAdrien Mazarguil
4449a997a33bSAdrien MazarguilListing flow rules
4450a997a33bSAdrien Mazarguil~~~~~~~~~~~~~~~~~~
4451a997a33bSAdrien Mazarguil
4452a997a33bSAdrien Mazarguil``flow list`` lists existing flow rules sorted by priority and optionally
4453a997a33bSAdrien Mazarguilfiltered by group identifiers::
4454a997a33bSAdrien Mazarguil
4455a997a33bSAdrien Mazarguil   flow list {port_id} [group {group_id}] [...]
4456a997a33bSAdrien Mazarguil
4457a997a33bSAdrien MazarguilThis command only fails with the following message if the device does not
4458a997a33bSAdrien Mazarguilexist::
4459a997a33bSAdrien Mazarguil
4460a997a33bSAdrien Mazarguil   Invalid port [...]
4461a997a33bSAdrien Mazarguil
4462a997a33bSAdrien MazarguilOutput consists of a header line followed by a short description of each
4463a997a33bSAdrien Mazarguilflow rule, one per line. There is no output at all when no flow rules are
4464a997a33bSAdrien Mazarguilconfigured on the device::
4465a997a33bSAdrien Mazarguil
4466a997a33bSAdrien Mazarguil   ID      Group   Prio    Attr    Rule
4467a997a33bSAdrien Mazarguil   [...]   [...]   [...]   [...]   [...]
4468a997a33bSAdrien Mazarguil
4469a997a33bSAdrien Mazarguil``Attr`` column flags:
4470a997a33bSAdrien Mazarguil
4471a997a33bSAdrien Mazarguil- ``i`` for ``ingress``.
4472a997a33bSAdrien Mazarguil- ``e`` for ``egress``.
4473a997a33bSAdrien Mazarguil
4474a997a33bSAdrien MazarguilCreating several flow rules and listing them::
4475a997a33bSAdrien Mazarguil
4476a997a33bSAdrien Mazarguil   testpmd> flow create 0 ingress pattern eth / ipv4 / end
4477a997a33bSAdrien Mazarguil      actions queue index 6 / end
4478a997a33bSAdrien Mazarguil   Flow rule #0 created
4479a997a33bSAdrien Mazarguil   testpmd> flow create 0 ingress pattern eth / ipv6 / end
4480a997a33bSAdrien Mazarguil      actions queue index 2 / end
4481a997a33bSAdrien Mazarguil   Flow rule #1 created
4482a997a33bSAdrien Mazarguil   testpmd> flow create 0 priority 5 ingress pattern eth / ipv4 / udp / end
4483a997a33bSAdrien Mazarguil      actions rss queues 6 7 8 end / end
4484a997a33bSAdrien Mazarguil   Flow rule #2 created
4485a997a33bSAdrien Mazarguil   testpmd> flow list 0
4486a997a33bSAdrien Mazarguil   ID      Group   Prio    Attr    Rule
4487a997a33bSAdrien Mazarguil   0       0       0       i-      ETH IPV4 => QUEUE
4488a997a33bSAdrien Mazarguil   1       0       0       i-      ETH IPV6 => QUEUE
4489a997a33bSAdrien Mazarguil   2       0       5       i-      ETH IPV4 UDP => RSS
4490a997a33bSAdrien Mazarguil   testpmd>
4491a997a33bSAdrien Mazarguil
4492a997a33bSAdrien MazarguilRules are sorted by priority (i.e. group ID first, then priority level)::
4493a997a33bSAdrien Mazarguil
4494a997a33bSAdrien Mazarguil   testpmd> flow list 1
4495a997a33bSAdrien Mazarguil   ID      Group   Prio    Attr    Rule
4496a997a33bSAdrien Mazarguil   0       0       0       i-      ETH => COUNT
4497a997a33bSAdrien Mazarguil   6       0       500     i-      ETH IPV6 TCP => DROP COUNT
4498a997a33bSAdrien Mazarguil   5       0       1000    i-      ETH IPV6 ICMP => QUEUE
4499a997a33bSAdrien Mazarguil   1       24      0       i-      ETH IPV4 UDP => QUEUE
4500a997a33bSAdrien Mazarguil   4       24      10      i-      ETH IPV4 TCP => DROP
4501a997a33bSAdrien Mazarguil   3       24      20      i-      ETH IPV4 => DROP
4502a997a33bSAdrien Mazarguil   2       24      42      i-      ETH IPV4 UDP => QUEUE
4503a997a33bSAdrien Mazarguil   7       63      0       i-      ETH IPV6 UDP VXLAN => MARK QUEUE
4504a997a33bSAdrien Mazarguil   testpmd>
4505a997a33bSAdrien Mazarguil
4506a997a33bSAdrien MazarguilOutput can be limited to specific groups::
4507a997a33bSAdrien Mazarguil
4508a997a33bSAdrien Mazarguil   testpmd> flow list 1 group 0 group 63
4509a997a33bSAdrien Mazarguil   ID      Group   Prio    Attr    Rule
4510a997a33bSAdrien Mazarguil   0       0       0       i-      ETH => COUNT
4511a997a33bSAdrien Mazarguil   6       0       500     i-      ETH IPV6 TCP => DROP COUNT
4512a997a33bSAdrien Mazarguil   5       0       1000    i-      ETH IPV6 ICMP => QUEUE
4513a997a33bSAdrien Mazarguil   7       63      0       i-      ETH IPV6 UDP VXLAN => MARK QUEUE
4514a997a33bSAdrien Mazarguil   testpmd>
45155a1affd8SBernard Iremonger
4516323f811aSAdrien MazarguilToggling isolated mode
4517323f811aSAdrien Mazarguil~~~~~~~~~~~~~~~~~~~~~~
4518323f811aSAdrien Mazarguil
4519323f811aSAdrien Mazarguil``flow isolate`` can be used to tell the underlying PMD that ingress traffic
4520323f811aSAdrien Mazarguilmust only be injected from the defined flow rules; that no default traffic
4521323f811aSAdrien Mazarguilis expected outside those rules and the driver is free to assign more
4522323f811aSAdrien Mazarguilresources to handle them. It is bound to ``rte_flow_isolate()``::
4523323f811aSAdrien Mazarguil
4524323f811aSAdrien Mazarguil flow isolate {port_id} {boolean}
4525323f811aSAdrien Mazarguil
4526323f811aSAdrien MazarguilIf successful, enabling or disabling isolated mode shows either::
4527323f811aSAdrien Mazarguil
4528323f811aSAdrien Mazarguil Ingress traffic on port [...]
4529323f811aSAdrien Mazarguil    is now restricted to the defined flow rules
4530323f811aSAdrien Mazarguil
4531323f811aSAdrien MazarguilOr::
4532323f811aSAdrien Mazarguil
4533323f811aSAdrien Mazarguil Ingress traffic on port [...]
4534323f811aSAdrien Mazarguil    is not restricted anymore to the defined flow rules
4535323f811aSAdrien Mazarguil
4536323f811aSAdrien MazarguilOtherwise, in case of error::
4537323f811aSAdrien Mazarguil
4538323f811aSAdrien Mazarguil   Caught error type [...] ([...]): [...]
4539323f811aSAdrien Mazarguil
4540323f811aSAdrien MazarguilMainly due to its side effects, PMDs supporting this mode may not have the
4541323f811aSAdrien Mazarguilability to toggle it more than once without reinitializing affected ports
4542323f811aSAdrien Mazarguilfirst (e.g. by exiting testpmd).
4543323f811aSAdrien Mazarguil
4544323f811aSAdrien MazarguilEnabling isolated mode::
4545323f811aSAdrien Mazarguil
4546323f811aSAdrien Mazarguil testpmd> flow isolate 0 true
4547323f811aSAdrien Mazarguil Ingress traffic on port 0 is now restricted to the defined flow rules
4548323f811aSAdrien Mazarguil testpmd>
4549323f811aSAdrien Mazarguil
4550323f811aSAdrien MazarguilDisabling isolated mode::
4551323f811aSAdrien Mazarguil
4552323f811aSAdrien Mazarguil testpmd> flow isolate 0 false
4553323f811aSAdrien Mazarguil Ingress traffic on port 0 is not restricted anymore to the defined flow rules
4554323f811aSAdrien Mazarguil testpmd>
4555323f811aSAdrien Mazarguil
4556a69c335dSXiaoyu MinDumping HW internal information
4557fb360c75SMichael Baum~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4558a69c335dSXiaoyu Min
4559a69c335dSXiaoyu Min``flow dump`` dumps the hardware's internal representation information of
4560a69c335dSXiaoyu Minall flows. It is bound to ``rte_flow_dev_dump()``::
4561a69c335dSXiaoyu Min
45628ac3a1cdSEli Britstein   flow dump {port_id} {output_file} [user_id]
4563a69c335dSXiaoyu Min
4564a69c335dSXiaoyu MinIf successful, it will show::
4565a69c335dSXiaoyu Min
4566a69c335dSXiaoyu Min   Flow dump finished
4567a69c335dSXiaoyu Min
4568a69c335dSXiaoyu MinOtherwise, it will complain error occurred::
4569a69c335dSXiaoyu Min
4570a69c335dSXiaoyu Min   Caught error type [...] ([...]): [...]
4571a69c335dSXiaoyu Min
45728ac3a1cdSEli BritsteinOptional ``user_id`` is a flag that signifies the rule ID
45738ac3a1cdSEli Britsteinis the one provided by the user at creation.
45748ac3a1cdSEli Britstein
45750e459ffaSDong ZhouListing and destroying aged flow rules
4576fb360c75SMichael Baum~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
45770e459ffaSDong Zhou
45780e459ffaSDong Zhou``flow aged`` simply lists aged flow rules be get from api ``rte_flow_get_aged_flows``,
4579ea30023eSMichael Baumand ``destroy`` parameter can be used to destroy those flow rules in PMD::
45800e459ffaSDong Zhou
45810e459ffaSDong Zhou   flow aged {port_id} [destroy]
45820e459ffaSDong Zhou
45830e459ffaSDong ZhouListing current aged flow rules::
45840e459ffaSDong Zhou
45850e459ffaSDong Zhou   testpmd> flow aged 0
45860e459ffaSDong Zhou   Port 0 total aged flows: 0
45870e459ffaSDong Zhou   testpmd> flow create 0 ingress pattern eth / ipv4 src is 2.2.2.14 / end
45880e459ffaSDong Zhou      actions age timeout 5 / queue index 0 /  end
45890e459ffaSDong Zhou   Flow rule #0 created
45900e459ffaSDong Zhou   testpmd> flow create 0 ingress pattern eth / ipv4 src is 2.2.2.15 / end
45910e459ffaSDong Zhou      actions age timeout 4 / queue index 0 /  end
45920e459ffaSDong Zhou   Flow rule #1 created
45930e459ffaSDong Zhou   testpmd> flow create 0 ingress pattern eth / ipv4 src is 2.2.2.16 / end
45940e459ffaSDong Zhou      actions age timeout 2 / queue index 0 /  end
45950e459ffaSDong Zhou   Flow rule #2 created
45960e459ffaSDong Zhou   testpmd> flow create 0 ingress pattern eth / ipv4 src is 2.2.2.17 / end
45970e459ffaSDong Zhou      actions age timeout 3 / queue index 0 /  end
45980e459ffaSDong Zhou   Flow rule #3 created
45990e459ffaSDong Zhou
46000e459ffaSDong Zhou
46010e459ffaSDong ZhouAged Rules are simply list as command ``flow list {port_id}``, but strip the detail rule
46020e459ffaSDong Zhouinformation, all the aged flows are sorted by the longest timeout time. For example, if
46030e459ffaSDong Zhouthose rules be configured in the same time, ID 2 will be the first aged out rule, the next
46040e459ffaSDong Zhouwill be ID 3, ID 1, ID 0::
46050e459ffaSDong Zhou
46060e459ffaSDong Zhou   testpmd> flow aged 0
46070e459ffaSDong Zhou   Port 0 total aged flows: 4
46080e459ffaSDong Zhou   ID      Group   Prio    Attr
46090e459ffaSDong Zhou   2       0       0       i--
46100e459ffaSDong Zhou   3       0       0       i--
46110e459ffaSDong Zhou   1       0       0       i--
46120e459ffaSDong Zhou   0       0       0       i--
46130e459ffaSDong Zhou
4614ea30023eSMichael BaumIf attach ``destroy`` parameter, the command will destroy all the list aged flow rules::
46150e459ffaSDong Zhou
46160e459ffaSDong Zhou   testpmd> flow aged 0 destroy
46170e459ffaSDong Zhou   Port 0 total aged flows: 4
46180e459ffaSDong Zhou   ID      Group   Prio    Attr
46190e459ffaSDong Zhou   2       0       0       i--
46200e459ffaSDong Zhou   3       0       0       i--
46210e459ffaSDong Zhou   1       0       0       i--
46220e459ffaSDong Zhou   0       0       0       i--
46230e459ffaSDong Zhou
46240e459ffaSDong Zhou   Flow rule #2 destroyed
46250e459ffaSDong Zhou   Flow rule #3 destroyed
46260e459ffaSDong Zhou   Flow rule #1 destroyed
46270e459ffaSDong Zhou   Flow rule #0 destroyed
46280e459ffaSDong Zhou   4 flows be destroyed
46290e459ffaSDong Zhou   testpmd> flow aged 0
46300e459ffaSDong Zhou   Port 0 total aged flows: 0
46310e459ffaSDong Zhou
4632966eb55eSMichael Baum
4633966eb55eSMichael BaumEnqueueing listing and destroying aged flow rules
4634966eb55eSMichael Baum~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4635966eb55eSMichael Baum
4636966eb55eSMichael Baum``flow queue aged`` simply lists aged flow rules be get from
4637966eb55eSMichael Baum``rte_flow_get_q_aged_flows`` API, and ``destroy`` parameter can be used to
4638966eb55eSMichael Baumdestroy those flow rules in PMD::
4639966eb55eSMichael Baum
4640966eb55eSMichael Baum   flow queue {port_id} aged {queue_id} [destroy]
4641966eb55eSMichael Baum
4642966eb55eSMichael BaumListing current aged flow rules::
4643966eb55eSMichael Baum
4644966eb55eSMichael Baum   testpmd> flow queue 0 aged 0
4645966eb55eSMichael Baum   Port 0 queue 0 total aged flows: 0
4646966eb55eSMichael Baum   testpmd> flow queue 0 create 0 ingress tanle 0 item_template 0 action_template 0
4647966eb55eSMichael Baum      pattern eth / ipv4 src is 2.2.2.14 / end
4648966eb55eSMichael Baum      actions age timeout 5 / queue index 0 /  end
4649966eb55eSMichael Baum   Flow rule #0 creation enqueued
4650966eb55eSMichael Baum   testpmd> flow queue 0 create 0 ingress tanle 0 item_template 0 action_template 0
4651966eb55eSMichael Baum      pattern eth / ipv4 src is 2.2.2.15 / end
4652966eb55eSMichael Baum      actions age timeout 4 / queue index 0 /  end
4653966eb55eSMichael Baum   Flow rule #1 creation enqueued
4654966eb55eSMichael Baum   testpmd> flow queue 0 create 0 ingress tanle 0 item_template 0 action_template 0
4655966eb55eSMichael Baum      pattern eth / ipv4 src is 2.2.2.16 / end
4656966eb55eSMichael Baum      actions age timeout 4 / queue index 0 /  end
4657966eb55eSMichael Baum   Flow rule #2 creation enqueued
4658966eb55eSMichael Baum   testpmd> flow queue 0 create 0 ingress tanle 0 item_template 0 action_template 0
4659966eb55eSMichael Baum      pattern eth / ipv4 src is 2.2.2.17 / end
4660966eb55eSMichael Baum      actions age timeout 4 / queue index 0 /  end
4661966eb55eSMichael Baum   Flow rule #3 creation enqueued
4662966eb55eSMichael Baum   testpmd> flow pull 0 queue 0
4663966eb55eSMichael Baum   Queue #0 pulled 4 operations (0 failed, 4 succeeded)
4664966eb55eSMichael Baum
4665966eb55eSMichael BaumAged Rules are simply list as command ``flow queue {port_id} list {queue_id}``,
4666966eb55eSMichael Baumbut strip the detail rule information, all the aged flows are sorted by the
4667966eb55eSMichael Baumlongest timeout time. For example, if those rules is configured in the same time,
4668966eb55eSMichael BaumID 2 will be the first aged out rule, the next will be ID 3, ID 1, ID 0::
4669966eb55eSMichael Baum
4670966eb55eSMichael Baum   testpmd> flow queue 0 aged 0
4671966eb55eSMichael Baum   Port 0 queue 0 total aged flows: 4
4672966eb55eSMichael Baum   ID      Group   Prio    Attr
4673966eb55eSMichael Baum   2       0       0       ---
4674966eb55eSMichael Baum   3       0       0       ---
4675966eb55eSMichael Baum   1       0       0       ---
4676966eb55eSMichael Baum   0       0       0       ---
4677966eb55eSMichael Baum
4678966eb55eSMichael Baum   0 flows destroyed
4679966eb55eSMichael Baum
4680966eb55eSMichael BaumIf attach ``destroy`` parameter, the command will destroy all the list aged flow rules::
4681966eb55eSMichael Baum
4682966eb55eSMichael Baum   testpmd> flow queue 0 aged 0 destroy
4683966eb55eSMichael Baum   Port 0 queue 0 total aged flows: 4
4684966eb55eSMichael Baum   ID      Group   Prio    Attr
4685966eb55eSMichael Baum   2       0       0       ---
4686966eb55eSMichael Baum   3       0       0       ---
4687966eb55eSMichael Baum   1       0       0       ---
4688966eb55eSMichael Baum   0       0       0       ---
4689966eb55eSMichael Baum   Flow rule #2 destruction enqueued
4690966eb55eSMichael Baum   Flow rule #3 destruction enqueued
4691966eb55eSMichael Baum   Flow rule #1 destruction enqueued
4692966eb55eSMichael Baum   Flow rule #0 destruction enqueued
4693966eb55eSMichael Baum
4694966eb55eSMichael Baum   4 flows destroyed
4695966eb55eSMichael Baum   testpmd> flow queue 0 aged 0
4696966eb55eSMichael Baum   Port 0 total aged flows: 0
4697966eb55eSMichael Baum
4698966eb55eSMichael Baum.. note::
4699966eb55eSMichael Baum
4700966eb55eSMichael Baum   The queue must be empty before attaching ``destroy`` parameter.
4701966eb55eSMichael Baum
4702966eb55eSMichael Baum
47034b61b877SBing ZhaoCreating indirect actions
47044b61b877SBing Zhao~~~~~~~~~~~~~~~~~~~~~~~~~
470555509e3aSAndrey Vesnovaty
47064b61b877SBing Zhao``flow indirect_action {port_id} create`` creates indirect action with optional
47074b61b877SBing Zhaoindirect action ID. It is bound to ``rte_flow_action_handle_create()``::
47084b61b877SBing Zhao
47094b61b877SBing Zhao   flow indirect_action {port_id} create [action_id {indirect_action_id}]
4710f1a6a986SIvan Malov      [ingress] [egress] [transfer] action {action} / end
471155509e3aSAndrey Vesnovaty
471255509e3aSAndrey VesnovatyIf successful, it will show::
471355509e3aSAndrey Vesnovaty
47144b61b877SBing Zhao   Indirect action #[...] created
471555509e3aSAndrey Vesnovaty
47164b61b877SBing ZhaoOtherwise, it will complain either that indirect action already exists or that
471755509e3aSAndrey Vesnovatysome error occurred::
471855509e3aSAndrey Vesnovaty
47194b61b877SBing Zhao   Indirect action #[...] is already assigned, delete it first
472055509e3aSAndrey Vesnovaty
472155509e3aSAndrey Vesnovaty::
472255509e3aSAndrey Vesnovaty
472355509e3aSAndrey Vesnovaty   Caught error type [...] ([...]): [...]
472455509e3aSAndrey Vesnovaty
47254b61b877SBing ZhaoCreate indirect rss action with id 100 to queues 1 and 2 on port 0::
472655509e3aSAndrey Vesnovaty
47274b61b877SBing Zhao   testpmd> flow indirect_action 0 create action_id 100 \
472855509e3aSAndrey Vesnovaty      ingress action rss queues 1 2 end / end
472955509e3aSAndrey Vesnovaty
47304b61b877SBing ZhaoCreate indirect rss action with id assigned by testpmd to queues 1 and 2 on
473155509e3aSAndrey Vesnovatyport 0::
473255509e3aSAndrey Vesnovaty
47334b61b877SBing Zhao	testpmd> flow indirect_action 0 create action_id \
473455509e3aSAndrey Vesnovaty		ingress action rss queues 0 1 end / end
473555509e3aSAndrey Vesnovaty
4736d906fff5SAlexander KozyrevEnqueueing creation of indirect actions
4737d906fff5SAlexander Kozyrev~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4738d906fff5SAlexander Kozyrev
4739d906fff5SAlexander Kozyrev``flow queue indirect_action create`` adds creation operation of an indirect
4740d906fff5SAlexander Kozyrevaction to a queue. It is bound to ``rte_flow_async_action_handle_create()``::
4741d906fff5SAlexander Kozyrev
4742d906fff5SAlexander Kozyrev   flow queue {port_id} create {queue_id} [postpone {boolean}]
4743d906fff5SAlexander Kozyrev       table {table_id} item_template {item_template_id}
4744d906fff5SAlexander Kozyrev       action_template {action_template_id}
4745d906fff5SAlexander Kozyrev       pattern {item} [/ {item} [...]] / end
4746d906fff5SAlexander Kozyrev       actions {action} [/ {action} [...]] / end
4747d906fff5SAlexander Kozyrev
4748d906fff5SAlexander KozyrevIf successful, it will show::
4749d906fff5SAlexander Kozyrev
4750d906fff5SAlexander Kozyrev   Indirect action #[...] creation queued
4751d906fff5SAlexander Kozyrev
4752d906fff5SAlexander KozyrevOtherwise it will show an error message of the form::
4753d906fff5SAlexander Kozyrev
4754d906fff5SAlexander Kozyrev   Caught error type [...] ([...]): [...]
4755d906fff5SAlexander Kozyrev
4756d906fff5SAlexander KozyrevThis command uses the same parameters as  ``flow indirect_action create``,
4757d906fff5SAlexander Kozyrevdescribed in `Creating indirect actions`_.
4758d906fff5SAlexander Kozyrev
4759d906fff5SAlexander Kozyrev``flow queue pull`` must be called to retrieve the operation status.
4760d906fff5SAlexander Kozyrev
47614b61b877SBing ZhaoUpdating indirect actions
47624b61b877SBing Zhao~~~~~~~~~~~~~~~~~~~~~~~~~
476355509e3aSAndrey Vesnovaty
47644b61b877SBing Zhao``flow indirect_action {port_id} update`` updates configuration of the indirect
47654b61b877SBing Zhaoaction from its indirect action ID (as returned by
47664b61b877SBing Zhao``flow indirect_action {port_id} create``). It is bound to
47674b61b877SBing Zhao``rte_flow_action_handle_update()``::
47684b61b877SBing Zhao
47694b61b877SBing Zhao   flow indirect_action {port_id} update {indirect_action_id}
477055509e3aSAndrey Vesnovaty      action {action} / end
477155509e3aSAndrey Vesnovaty
477255509e3aSAndrey VesnovatyIf successful, it will show::
477355509e3aSAndrey Vesnovaty
47744b61b877SBing Zhao   Indirect action #[...] updated
477555509e3aSAndrey Vesnovaty
47764b61b877SBing ZhaoOtherwise, it will complain either that indirect action not found or that some
477755509e3aSAndrey Vesnovatyerror occurred::
477855509e3aSAndrey Vesnovaty
47794b61b877SBing Zhao   Failed to find indirect action #[...] on port [...]
478055509e3aSAndrey Vesnovaty
478155509e3aSAndrey Vesnovaty::
478255509e3aSAndrey Vesnovaty
478355509e3aSAndrey Vesnovaty   Caught error type [...] ([...]): [...]
478455509e3aSAndrey Vesnovaty
47854b61b877SBing ZhaoUpdate indirect rss action having id 100 on port 0 with rss to queues 0 and 3
478655509e3aSAndrey Vesnovaty(in create example above rss queues were 1 and 2)::
478755509e3aSAndrey Vesnovaty
47884b61b877SBing Zhao   testpmd> flow indirect_action 0 update 100 action rss queues 0 3 end / end
478955509e3aSAndrey Vesnovaty
4790d906fff5SAlexander KozyrevEnqueueing update of indirect actions
4791d906fff5SAlexander Kozyrev~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4792d906fff5SAlexander Kozyrev
4793d906fff5SAlexander Kozyrev``flow queue indirect_action update`` adds update operation for an indirect
4794d906fff5SAlexander Kozyrevaction to a queue. It is bound to ``rte_flow_async_action_handle_update()``::
4795d906fff5SAlexander Kozyrev
4796d906fff5SAlexander Kozyrev   flow queue {port_id} indirect_action {queue_id} update
4797d906fff5SAlexander Kozyrev      {indirect_action_id} [postpone {boolean}] action {action} / end
4798d906fff5SAlexander Kozyrev
4799d906fff5SAlexander KozyrevIf successful, it will show::
4800d906fff5SAlexander Kozyrev
4801d906fff5SAlexander Kozyrev   Indirect action #[...] update queued
4802d906fff5SAlexander Kozyrev
4803d906fff5SAlexander KozyrevOtherwise it will show an error message of the form::
4804d906fff5SAlexander Kozyrev
4805d906fff5SAlexander Kozyrev   Caught error type [...] ([...]): [...]
4806d906fff5SAlexander Kozyrev
4807d906fff5SAlexander Kozyrev``flow queue pull`` must be called to retrieve the operation status.
4808d906fff5SAlexander Kozyrev
48094b61b877SBing ZhaoDestroying indirect actions
48104b61b877SBing Zhao~~~~~~~~~~~~~~~~~~~~~~~~~~~
481155509e3aSAndrey Vesnovaty
48124b61b877SBing Zhao``flow indirect_action {port_id} destroy`` destroys one or more indirect actions
48134b61b877SBing Zhaofrom their indirect action IDs (as returned by
48144b61b877SBing Zhao``flow indirect_action {port_id} create``). It is bound to
48154b61b877SBing Zhao``rte_flow_action_handle_destroy()``::
48164b61b877SBing Zhao
48174b61b877SBing Zhao   flow indirect_action {port_id} destroy action_id {indirect_action_id} [...]
481855509e3aSAndrey Vesnovaty
481955509e3aSAndrey VesnovatyIf successful, it will show::
482055509e3aSAndrey Vesnovaty
48214b61b877SBing Zhao   Indirect action #[...] destroyed
482255509e3aSAndrey Vesnovaty
48234b61b877SBing ZhaoIt does not report anything for indirect action IDs that do not exist.
48244b61b877SBing ZhaoThe usual error message is shown when a indirect action cannot be destroyed::
482555509e3aSAndrey Vesnovaty
482655509e3aSAndrey Vesnovaty   Caught error type [...] ([...]): [...]
482755509e3aSAndrey Vesnovaty
48284b61b877SBing ZhaoDestroy indirect actions having id 100 & 101::
482955509e3aSAndrey Vesnovaty
48304b61b877SBing Zhao   testpmd> flow indirect_action 0 destroy action_id 100 action_id 101
483155509e3aSAndrey Vesnovaty
4832d906fff5SAlexander KozyrevEnqueueing destruction of indirect actions
4833d906fff5SAlexander Kozyrev~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4834d906fff5SAlexander Kozyrev
4835d906fff5SAlexander Kozyrev``flow queue indirect_action destroy`` adds destruction operation to destroy
4836d906fff5SAlexander Kozyrevone or more indirect actions from their indirect action IDs (as returned by
4837d906fff5SAlexander Kozyrev``flow queue {port_id} indirect_action {queue_id} create``) to a queue.
4838d906fff5SAlexander KozyrevIt is bound to ``rte_flow_async_action_handle_destroy()``::
4839d906fff5SAlexander Kozyrev
4840d906fff5SAlexander Kozyrev   flow queue {port_id} indirect_action {queue_id} destroy
4841d906fff5SAlexander Kozyrev      [postpone {boolean}] action_id {indirect_action_id} [...]
4842d906fff5SAlexander Kozyrev
4843d906fff5SAlexander KozyrevIf successful, it will show::
4844d906fff5SAlexander Kozyrev
4845d906fff5SAlexander Kozyrev   Indirect action #[...] destruction queued
4846d906fff5SAlexander Kozyrev
4847d906fff5SAlexander KozyrevOtherwise it will show an error message of the form::
4848d906fff5SAlexander Kozyrev
4849d906fff5SAlexander Kozyrev   Caught error type [...] ([...]): [...]
4850d906fff5SAlexander Kozyrev
4851d906fff5SAlexander Kozyrev``flow queue pull`` must be called to retrieve the operation status.
4852d906fff5SAlexander Kozyrev
48534b61b877SBing ZhaoQuery indirect actions
48544b61b877SBing Zhao~~~~~~~~~~~~~~~~~~~~~~
485555509e3aSAndrey Vesnovaty
48564b61b877SBing Zhao``flow indirect_action {port_id} query`` queries the indirect action from its
48574b61b877SBing Zhaoindirect action ID (as returned by ``flow indirect_action {port_id} create``).
48584b61b877SBing ZhaoIt is bound to ``rte_flow_action_handle_query()``::
485955509e3aSAndrey Vesnovaty
48604b61b877SBing Zhao  flow indirect_action {port_id} query {indirect_action_id}
486155509e3aSAndrey Vesnovaty
48624b61b877SBing ZhaoCurrently only rss indirect action supported. If successful, it will show::
48634b61b877SBing Zhao
48644b61b877SBing Zhao   Indirect RSS action:
486555509e3aSAndrey Vesnovaty      refs:[...]
486655509e3aSAndrey Vesnovaty
48674b61b877SBing ZhaoOtherwise, it will complain either that indirect action not found or that some
486855509e3aSAndrey Vesnovatyerror occurred::
486955509e3aSAndrey Vesnovaty
48704b61b877SBing Zhao   Failed to find indirect action #[...] on port [...]
487155509e3aSAndrey Vesnovaty
487255509e3aSAndrey Vesnovaty::
487355509e3aSAndrey Vesnovaty
487455509e3aSAndrey Vesnovaty   Caught error type [...] ([...]): [...]
487555509e3aSAndrey Vesnovaty
48764b61b877SBing ZhaoQuery indirect action having id 100::
487755509e3aSAndrey Vesnovaty
48784b61b877SBing Zhao   testpmd> flow indirect_action 0 query 100
48790e459ffaSDong Zhou
4880c9dc0384SSuanming MouEnqueueing query of indirect actions
4881c9dc0384SSuanming Mou~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4882c9dc0384SSuanming Mou
4883c9dc0384SSuanming Mou``flow queue indirect_action query`` adds query operation for an indirect
4884c9dc0384SSuanming Mouaction to a queue. It is bound to ``rte_flow_async_action_handle_query()``::
4885c9dc0384SSuanming Mou
4886c9dc0384SSuanming Mou   flow queue {port_id} indirect_action {queue_id} query
4887c9dc0384SSuanming Mou      {indirect_action_id} [postpone {boolean}]
4888c9dc0384SSuanming Mou
4889c9dc0384SSuanming MouIf successful, it will show::
4890c9dc0384SSuanming Mou
4891c9dc0384SSuanming Mou   Indirect action #[...] query queued
4892c9dc0384SSuanming Mou
4893c9dc0384SSuanming MouOtherwise it will show an error message of the form::
4894c9dc0384SSuanming Mou
4895c9dc0384SSuanming Mou   Caught error type [...] ([...]): [...]
4896c9dc0384SSuanming Mou
4897c9dc0384SSuanming Mou``flow queue pull`` must be called to retrieve the operation status.
4898c9dc0384SSuanming Mou
48995a1affd8SBernard IremongerSample QinQ flow rules
49005a1affd8SBernard Iremonger~~~~~~~~~~~~~~~~~~~~~~
49015a1affd8SBernard Iremonger
4902bef3bfe7SBernard IremongerBefore creating QinQ rule(s) the following commands should be issued to enable QinQ::
4903bef3bfe7SBernard Iremonger
4904bef3bfe7SBernard Iremonger   testpmd> port stop 0
4905836cdce4SBernard Iremonger   testpmd> vlan set extend on 0
4906bef3bfe7SBernard Iremonger
4907bef3bfe7SBernard IremongerThe above command sets the inner and outer TPID's to 0x8100.
4908bef3bfe7SBernard Iremonger
4909bef3bfe7SBernard IremongerTo change the TPID's the following commands should be used::
4910bef3bfe7SBernard Iremonger
4911836cdce4SBernard Iremonger   testpmd> vlan set outer tpid 0x88A8 0
4912836cdce4SBernard Iremonger   testpmd> vlan set inner tpid 0x8100 0
4913bef3bfe7SBernard Iremonger   testpmd> port start 0
4914bef3bfe7SBernard Iremonger
49155a1affd8SBernard IremongerValidate and create a QinQ rule on port 0 to steer traffic to a VF queue in a VM.
49165a1affd8SBernard Iremonger
49175a1affd8SBernard Iremonger::
49185a1affd8SBernard Iremonger
4919bef3bfe7SBernard Iremonger   testpmd> flow validate 0 ingress pattern eth / vlan tci is 123 /
4920bef3bfe7SBernard Iremonger       vlan tci is 456 / end actions vf id 1 / queue index 0 / end
49215a1affd8SBernard Iremonger   Flow rule #0 validated
49225a1affd8SBernard Iremonger
4923bef3bfe7SBernard Iremonger   testpmd> flow create 0 ingress pattern eth / vlan tci is 4 /
4924bef3bfe7SBernard Iremonger       vlan tci is 456 / end actions vf id 123 / queue index 0 / end
49255a1affd8SBernard Iremonger   Flow rule #0 created
49265a1affd8SBernard Iremonger
49275a1affd8SBernard Iremonger   testpmd> flow list 0
49285a1affd8SBernard Iremonger   ID      Group   Prio    Attr    Rule
49295a1affd8SBernard Iremonger   0       0       0       i-      ETH VLAN VLAN=>VF QUEUE
49305a1affd8SBernard Iremonger
49315a1affd8SBernard IremongerValidate and create a QinQ rule on port 0 to steer traffic to a queue on the host.
49325a1affd8SBernard Iremonger
49335a1affd8SBernard Iremonger::
49345a1affd8SBernard Iremonger
4935bef3bfe7SBernard Iremonger   testpmd> flow validate 0 ingress pattern eth / vlan tci is 321 /
4936bef3bfe7SBernard Iremonger        vlan tci is 654 / end actions pf / queue index 0 / end
49375a1affd8SBernard Iremonger   Flow rule #1 validated
49385a1affd8SBernard Iremonger
4939bef3bfe7SBernard Iremonger   testpmd> flow create 0 ingress pattern eth / vlan tci is 321 /
4940bef3bfe7SBernard Iremonger        vlan tci is 654 / end actions pf / queue index 1 / end
49415a1affd8SBernard Iremonger   Flow rule #1 created
49425a1affd8SBernard Iremonger
49435a1affd8SBernard Iremonger   testpmd> flow list 0
49445a1affd8SBernard Iremonger   ID      Group   Prio    Attr    Rule
49455a1affd8SBernard Iremonger   0       0       0       i-      ETH VLAN VLAN=>VF QUEUE
49465a1affd8SBernard Iremonger   1       0       0       i-      ETH VLAN VLAN=>PF QUEUE
4947e977e419SKonstantin Ananyev
4948079981e9SXiaoyun LiSample VXLAN flow rules
4949079981e9SXiaoyun Li~~~~~~~~~~~~~~~~~~~~~~~
4950079981e9SXiaoyun Li
4951079981e9SXiaoyun LiBefore creating VXLAN rule(s), the UDP port should be added for VXLAN packet
4952079981e9SXiaoyun Lifilter on a port::
4953079981e9SXiaoyun Li
4954079981e9SXiaoyun Li  testpmd> rx_vxlan_port add 4789 0
4955079981e9SXiaoyun Li
4956079981e9SXiaoyun LiCreate VXLAN rules on port 0 to steer traffic to PF queues.
4957079981e9SXiaoyun Li
4958079981e9SXiaoyun Li::
4959079981e9SXiaoyun Li
4960079981e9SXiaoyun Li  testpmd> flow create 0 ingress pattern eth / ipv4 / udp / vxlan /
4961079981e9SXiaoyun Li         eth dst is 00:11:22:33:44:55 / end actions pf / queue index 1 / end
4962079981e9SXiaoyun Li  Flow rule #0 created
4963079981e9SXiaoyun Li
4964079981e9SXiaoyun Li  testpmd> flow create 0 ingress pattern eth / ipv4 / udp / vxlan vni is 3 /
4965079981e9SXiaoyun Li         eth dst is 00:11:22:33:44:55 / end actions pf / queue index 2 / end
4966079981e9SXiaoyun Li  Flow rule #1 created
4967079981e9SXiaoyun Li
4968079981e9SXiaoyun Li  testpmd> flow create 0 ingress pattern eth / ipv4 / udp / vxlan /
4969079981e9SXiaoyun Li         eth dst is 00:11:22:33:44:55 / vlan tci is 10 / end actions pf /
4970079981e9SXiaoyun Li         queue index 3 / end
4971079981e9SXiaoyun Li  Flow rule #2 created
4972079981e9SXiaoyun Li
4973079981e9SXiaoyun Li  testpmd> flow create 0 ingress pattern eth / ipv4 / udp / vxlan vni is 5 /
4974079981e9SXiaoyun Li         eth dst is 00:11:22:33:44:55 / vlan tci is 20 / end actions pf /
4975079981e9SXiaoyun Li         queue index 4 / end
4976079981e9SXiaoyun Li  Flow rule #3 created
4977079981e9SXiaoyun Li
4978079981e9SXiaoyun Li  testpmd> flow create 0 ingress pattern eth dst is 00:00:00:00:01:00 / ipv4 /
4979079981e9SXiaoyun Li         udp / vxlan vni is 6 /  eth dst is 00:11:22:33:44:55 / end actions pf /
4980079981e9SXiaoyun Li         queue index 5 / end
4981079981e9SXiaoyun Li  Flow rule #4 created
4982079981e9SXiaoyun Li
4983079981e9SXiaoyun Li  testpmd> flow list 0
4984079981e9SXiaoyun Li  ID      Group   Prio    Attr    Rule
4985079981e9SXiaoyun Li  0       0       0       i-      ETH IPV4 UDP VXLAN ETH => QUEUE
4986079981e9SXiaoyun Li  1       0       0       i-      ETH IPV4 UDP VXLAN ETH => QUEUE
4987079981e9SXiaoyun Li  2       0       0       i-      ETH IPV4 UDP VXLAN ETH VLAN => QUEUE
4988079981e9SXiaoyun Li  3       0       0       i-      ETH IPV4 UDP VXLAN ETH VLAN => QUEUE
4989079981e9SXiaoyun Li  4       0       0       i-      ETH IPV4 UDP VXLAN ETH => QUEUE
4990079981e9SXiaoyun Li
49911960be7dSNelio LaranjeiroSample VXLAN encapsulation rule
49921960be7dSNelio Laranjeiro~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
49931960be7dSNelio Laranjeiro
49941960be7dSNelio LaranjeiroVXLAN encapsulation outer layer has default value pre-configured in testpmd
49951960be7dSNelio Laranjeirosource code, those can be changed by using the following commands
49961960be7dSNelio Laranjeiro
49971960be7dSNelio LaranjeiroIPv4 VXLAN outer header::
49981960be7dSNelio Laranjeiro
49991960be7dSNelio Laranjeiro testpmd> set vxlan ip-version ipv4 vni 4 udp-src 4 udp-dst 4 ip-src 127.0.0.1
50001960be7dSNelio Laranjeiro        ip-dst 128.0.0.1 eth-src 11:11:11:11:11:11 eth-dst 22:22:22:22:22:22
50011960be7dSNelio Laranjeiro testpmd> flow create 0 ingress pattern end actions vxlan_encap /
50021960be7dSNelio Laranjeiro        queue index 0 / end
50031960be7dSNelio Laranjeiro
50041960be7dSNelio Laranjeiro testpmd> set vxlan-with-vlan ip-version ipv4 vni 4 udp-src 4 udp-dst 4 ip-src
50051960be7dSNelio Laranjeiro         127.0.0.1 ip-dst 128.0.0.1 vlan-tci 34 eth-src 11:11:11:11:11:11
50061960be7dSNelio Laranjeiro         eth-dst 22:22:22:22:22:22
50071960be7dSNelio Laranjeiro testpmd> flow create 0 ingress pattern end actions vxlan_encap /
50081960be7dSNelio Laranjeiro         queue index 0 / end
50091960be7dSNelio Laranjeiro
501062e8a5a8SViacheslav Ovsiienko testpmd> set vxlan-tos-ttl ip-version ipv4 vni 4 udp-src 4 udp-dst 4 ip-tos 0
501162e8a5a8SViacheslav Ovsiienko         ip-ttl 255 ip-src 127.0.0.1 ip-dst 128.0.0.1 eth-src 11:11:11:11:11:11
501262e8a5a8SViacheslav Ovsiienko         eth-dst 22:22:22:22:22:22
501362e8a5a8SViacheslav Ovsiienko testpmd> flow create 0 ingress pattern end actions vxlan_encap /
501462e8a5a8SViacheslav Ovsiienko         queue index 0 / end
501562e8a5a8SViacheslav Ovsiienko
50161960be7dSNelio LaranjeiroIPv6 VXLAN outer header::
50171960be7dSNelio Laranjeiro
50181960be7dSNelio Laranjeiro testpmd> set vxlan ip-version ipv6 vni 4 udp-src 4 udp-dst 4 ip-src ::1
50191960be7dSNelio Laranjeiro        ip-dst ::2222 eth-src 11:11:11:11:11:11 eth-dst 22:22:22:22:22:22
50201960be7dSNelio Laranjeiro testpmd> flow create 0 ingress pattern end actions vxlan_encap /
50211960be7dSNelio Laranjeiro         queue index 0 / end
50221960be7dSNelio Laranjeiro
50231960be7dSNelio Laranjeiro testpmd> set vxlan-with-vlan ip-version ipv6 vni 4 udp-src 4 udp-dst 4
50241960be7dSNelio Laranjeiro         ip-src ::1 ip-dst ::2222 vlan-tci 34 eth-src 11:11:11:11:11:11
50251960be7dSNelio Laranjeiro         eth-dst 22:22:22:22:22:22
50261960be7dSNelio Laranjeiro testpmd> flow create 0 ingress pattern end actions vxlan_encap /
50271960be7dSNelio Laranjeiro         queue index 0 / end
50281960be7dSNelio Laranjeiro
502962e8a5a8SViacheslav Ovsiienko testpmd> set vxlan-tos-ttl ip-version ipv6 vni 4 udp-src 4 udp-dst 4
503062e8a5a8SViacheslav Ovsiienko         ip-tos 0 ip-ttl 255 ::1 ip-dst ::2222 eth-src 11:11:11:11:11:11
503162e8a5a8SViacheslav Ovsiienko         eth-dst 22:22:22:22:22:22
503262e8a5a8SViacheslav Ovsiienko testpmd> flow create 0 ingress pattern end actions vxlan_encap /
503362e8a5a8SViacheslav Ovsiienko         queue index 0 / end
503462e8a5a8SViacheslav Ovsiienko
5035dcd962fcSNelio LaranjeiroSample NVGRE encapsulation rule
5036dcd962fcSNelio Laranjeiro~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5037dcd962fcSNelio Laranjeiro
5038dcd962fcSNelio LaranjeiroNVGRE encapsulation outer layer has default value pre-configured in testpmd
5039dcd962fcSNelio Laranjeirosource code, those can be changed by using the following commands
5040dcd962fcSNelio Laranjeiro
5041dcd962fcSNelio LaranjeiroIPv4 NVGRE outer header::
5042dcd962fcSNelio Laranjeiro
5043dcd962fcSNelio Laranjeiro testpmd> set nvgre ip-version ipv4 tni 4 ip-src 127.0.0.1 ip-dst 128.0.0.1
5044dcd962fcSNelio Laranjeiro        eth-src 11:11:11:11:11:11 eth-dst 22:22:22:22:22:22
5045dcd962fcSNelio Laranjeiro testpmd> flow create 0 ingress pattern end actions nvgre_encap /
5046dcd962fcSNelio Laranjeiro        queue index 0 / end
5047dcd962fcSNelio Laranjeiro
5048dcd962fcSNelio Laranjeiro testpmd> set nvgre-with-vlan ip-version ipv4 tni 4 ip-src 127.0.0.1
5049dcd962fcSNelio Laranjeiro         ip-dst 128.0.0.1 vlan-tci 34 eth-src 11:11:11:11:11:11
5050dcd962fcSNelio Laranjeiro         eth-dst 22:22:22:22:22:22
5051dcd962fcSNelio Laranjeiro testpmd> flow create 0 ingress pattern end actions nvgre_encap /
5052dcd962fcSNelio Laranjeiro         queue index 0 / end
5053dcd962fcSNelio Laranjeiro
5054dcd962fcSNelio LaranjeiroIPv6 NVGRE outer header::
5055dcd962fcSNelio Laranjeiro
5056dcd962fcSNelio Laranjeiro testpmd> set nvgre ip-version ipv6 tni 4 ip-src ::1 ip-dst ::2222
5057dcd962fcSNelio Laranjeiro        eth-src 11:11:11:11:11:11 eth-dst 22:22:22:22:22:22
5058dcd962fcSNelio Laranjeiro testpmd> flow create 0 ingress pattern end actions nvgre_encap /
5059dcd962fcSNelio Laranjeiro        queue index 0 / end
5060dcd962fcSNelio Laranjeiro
5061dcd962fcSNelio Laranjeiro testpmd> set nvgre-with-vlan ip-version ipv6 tni 4 ip-src ::1 ip-dst ::2222
5062dcd962fcSNelio Laranjeiro        vlan-tci 34 eth-src 11:11:11:11:11:11 eth-dst 22:22:22:22:22:22
5063dcd962fcSNelio Laranjeiro testpmd> flow create 0 ingress pattern end actions nvgre_encap /
5064dcd962fcSNelio Laranjeiro        queue index 0 / end
5065dcd962fcSNelio Laranjeiro
5066a1191d39SOri KamSample L2 encapsulation rule
5067a1191d39SOri Kam~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5068a1191d39SOri Kam
5069a1191d39SOri KamL2 encapsulation has default value pre-configured in testpmd
5070a1191d39SOri Kamsource code, those can be changed by using the following commands
5071a1191d39SOri Kam
5072a1191d39SOri KamL2 header::
5073a1191d39SOri Kam
5074a1191d39SOri Kam testpmd> set l2_encap ip-version ipv4
5075a1191d39SOri Kam        eth-src 11:11:11:11:11:11 eth-dst 22:22:22:22:22:22
5076a1191d39SOri Kam testpmd> flow create 0 ingress pattern eth / ipv4 / udp / mpls / end actions
5077a1191d39SOri Kam        mplsoudp_decap / l2_encap / end
5078a1191d39SOri Kam
5079a1191d39SOri KamL2 with VXLAN header::
5080a1191d39SOri Kam
5081a1191d39SOri Kam testpmd> set l2_encap-with-vlan ip-version ipv4 vlan-tci 34
5082a1191d39SOri Kam         eth-src 11:11:11:11:11:11 eth-dst 22:22:22:22:22:22
5083a1191d39SOri Kam testpmd> flow create 0 ingress pattern eth / ipv4 / udp / mpls / end actions
5084a1191d39SOri Kam        mplsoudp_decap / l2_encap / end
5085a1191d39SOri Kam
5086a1191d39SOri KamSample L2 decapsulation rule
5087a1191d39SOri Kam~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5088a1191d39SOri Kam
5089a1191d39SOri KamL2 decapsulation has default value pre-configured in testpmd
5090a1191d39SOri Kamsource code, those can be changed by using the following commands
5091a1191d39SOri Kam
5092a1191d39SOri KamL2 header::
5093a1191d39SOri Kam
5094a1191d39SOri Kam testpmd> set l2_decap
5095a1191d39SOri Kam testpmd> flow create 0 egress pattern eth / end actions l2_decap / mplsoudp_encap /
5096a1191d39SOri Kam        queue index 0 / end
5097a1191d39SOri Kam
5098a1191d39SOri KamL2 with VXLAN header::
5099a1191d39SOri Kam
5100a1191d39SOri Kam testpmd> set l2_encap-with-vlan
5101a1191d39SOri Kam testpmd> flow create 0 egress pattern eth / end actions l2_encap / mplsoudp_encap /
5102a1191d39SOri Kam         queue index 0 / end
5103a1191d39SOri Kam
51043e77031bSOri KamSample MPLSoGRE encapsulation rule
51053e77031bSOri Kam~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
51063e77031bSOri Kam
51073e77031bSOri KamMPLSoGRE encapsulation outer layer has default value pre-configured in testpmd
51083e77031bSOri Kamsource code, those can be changed by using the following commands
51093e77031bSOri Kam
51103e77031bSOri KamIPv4 MPLSoGRE outer header::
51113e77031bSOri Kam
51123e77031bSOri Kam testpmd> set mplsogre_encap ip-version ipv4 label 4
51133e77031bSOri Kam        ip-src 127.0.0.1 ip-dst 128.0.0.1 eth-src 11:11:11:11:11:11
51143e77031bSOri Kam        eth-dst 22:22:22:22:22:22
51153e77031bSOri Kam testpmd> flow create 0 egress pattern eth / end actions l2_decap /
51163e77031bSOri Kam        mplsogre_encap / end
51173e77031bSOri Kam
51183e77031bSOri KamIPv4 MPLSoGRE with VLAN outer header::
51193e77031bSOri Kam
51203e77031bSOri Kam testpmd> set mplsogre_encap-with-vlan ip-version ipv4 label 4
51213e77031bSOri Kam        ip-src 127.0.0.1 ip-dst 128.0.0.1 vlan-tci 34
51223e77031bSOri Kam        eth-src 11:11:11:11:11:11 eth-dst 22:22:22:22:22:22
51233e77031bSOri Kam testpmd> flow create 0 egress pattern eth / end actions l2_decap /
51243e77031bSOri Kam        mplsogre_encap / end
51253e77031bSOri Kam
51263e77031bSOri KamIPv6 MPLSoGRE outer header::
51273e77031bSOri Kam
51283e77031bSOri Kam testpmd> set mplsogre_encap ip-version ipv6 mask 4
51293e77031bSOri Kam        ip-src ::1 ip-dst ::2222 eth-src 11:11:11:11:11:11
51303e77031bSOri Kam        eth-dst 22:22:22:22:22:22
51313e77031bSOri Kam testpmd> flow create 0 egress pattern eth / end actions l2_decap /
51323e77031bSOri Kam        mplsogre_encap / end
51333e77031bSOri Kam
51343e77031bSOri KamIPv6 MPLSoGRE with VLAN outer header::
51353e77031bSOri Kam
51363e77031bSOri Kam testpmd> set mplsogre_encap-with-vlan ip-version ipv6 mask 4
51373e77031bSOri Kam        ip-src ::1 ip-dst ::2222 vlan-tci 34
51383e77031bSOri Kam        eth-src 11:11:11:11:11:11 eth-dst 22:22:22:22:22:22
51393e77031bSOri Kam testpmd> flow create 0 egress pattern eth / end actions l2_decap /
51403e77031bSOri Kam        mplsogre_encap / end
51413e77031bSOri Kam
51423e77031bSOri KamSample MPLSoGRE decapsulation rule
51433e77031bSOri Kam~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
51443e77031bSOri Kam
51453e77031bSOri KamMPLSoGRE decapsulation outer layer has default value pre-configured in testpmd
51463e77031bSOri Kamsource code, those can be changed by using the following commands
51473e77031bSOri Kam
51483e77031bSOri KamIPv4 MPLSoGRE outer header::
51493e77031bSOri Kam
51503e77031bSOri Kam testpmd> set mplsogre_decap ip-version ipv4
51513e77031bSOri Kam testpmd> flow create 0 ingress pattern eth / ipv4 / gre / mpls / end actions
51523e77031bSOri Kam        mplsogre_decap / l2_encap / end
51533e77031bSOri Kam
51543e77031bSOri KamIPv4 MPLSoGRE with VLAN outer header::
51553e77031bSOri Kam
51563e77031bSOri Kam testpmd> set mplsogre_decap-with-vlan ip-version ipv4
51573e77031bSOri Kam testpmd> flow create 0 ingress pattern eth / vlan / ipv4 / gre / mpls / end
51583e77031bSOri Kam        actions mplsogre_decap / l2_encap / end
51593e77031bSOri Kam
51603e77031bSOri KamIPv6 MPLSoGRE outer header::
51613e77031bSOri Kam
51623e77031bSOri Kam testpmd> set mplsogre_decap ip-version ipv6
51633e77031bSOri Kam testpmd> flow create 0 ingress pattern eth / ipv6 / gre / mpls / end
51643e77031bSOri Kam        actions mplsogre_decap / l2_encap / end
51653e77031bSOri Kam
51663e77031bSOri KamIPv6 MPLSoGRE with VLAN outer header::
51673e77031bSOri Kam
51683e77031bSOri Kam testpmd> set mplsogre_decap-with-vlan ip-version ipv6
51693e77031bSOri Kam testpmd> flow create 0 ingress pattern eth / vlan / ipv6 / gre / mpls / end
51703e77031bSOri Kam        actions mplsogre_decap / l2_encap / end
51713e77031bSOri Kam
5172a1191d39SOri KamSample MPLSoUDP encapsulation rule
5173a1191d39SOri Kam~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5174a1191d39SOri Kam
5175a1191d39SOri KamMPLSoUDP encapsulation outer layer has default value pre-configured in testpmd
5176a1191d39SOri Kamsource code, those can be changed by using the following commands
5177a1191d39SOri Kam
5178a1191d39SOri KamIPv4 MPLSoUDP outer header::
5179a1191d39SOri Kam
5180a1191d39SOri Kam testpmd> set mplsoudp_encap ip-version ipv4 label 4 udp-src 5 udp-dst 10
5181a1191d39SOri Kam        ip-src 127.0.0.1 ip-dst 128.0.0.1 eth-src 11:11:11:11:11:11
5182a1191d39SOri Kam        eth-dst 22:22:22:22:22:22
5183a1191d39SOri Kam testpmd> flow create 0 egress pattern eth / end actions l2_decap /
5184a1191d39SOri Kam        mplsoudp_encap / end
5185a1191d39SOri Kam
5186a1191d39SOri KamIPv4 MPLSoUDP with VLAN outer header::
5187a1191d39SOri Kam
5188a1191d39SOri Kam testpmd> set mplsoudp_encap-with-vlan ip-version ipv4 label 4 udp-src 5
5189a1191d39SOri Kam        udp-dst 10 ip-src 127.0.0.1 ip-dst 128.0.0.1 vlan-tci 34
5190a1191d39SOri Kam        eth-src 11:11:11:11:11:11 eth-dst 22:22:22:22:22:22
5191a1191d39SOri Kam testpmd> flow create 0 egress pattern eth / end actions l2_decap /
5192a1191d39SOri Kam        mplsoudp_encap / end
5193a1191d39SOri Kam
5194a1191d39SOri KamIPv6 MPLSoUDP outer header::
5195a1191d39SOri Kam
5196a1191d39SOri Kam testpmd> set mplsoudp_encap ip-version ipv6 mask 4 udp-src 5 udp-dst 10
5197a1191d39SOri Kam        ip-src ::1 ip-dst ::2222 eth-src 11:11:11:11:11:11
5198a1191d39SOri Kam        eth-dst 22:22:22:22:22:22
5199a1191d39SOri Kam testpmd> flow create 0 egress pattern eth / end actions l2_decap /
5200a1191d39SOri Kam        mplsoudp_encap / end
5201a1191d39SOri Kam
5202a1191d39SOri KamIPv6 MPLSoUDP with VLAN outer header::
5203a1191d39SOri Kam
5204a1191d39SOri Kam testpmd> set mplsoudp_encap-with-vlan ip-version ipv6 mask 4 udp-src 5
5205a1191d39SOri Kam        udp-dst 10 ip-src ::1 ip-dst ::2222 vlan-tci 34
5206a1191d39SOri Kam        eth-src 11:11:11:11:11:11 eth-dst 22:22:22:22:22:22
5207a1191d39SOri Kam testpmd> flow create 0 egress pattern eth / end actions l2_decap /
5208a1191d39SOri Kam        mplsoudp_encap / end
5209a1191d39SOri Kam
5210a1191d39SOri KamSample MPLSoUDP decapsulation rule
5211a1191d39SOri Kam~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5212a1191d39SOri Kam
5213a1191d39SOri KamMPLSoUDP decapsulation outer layer has default value pre-configured in testpmd
5214a1191d39SOri Kamsource code, those can be changed by using the following commands
5215a1191d39SOri Kam
5216a1191d39SOri KamIPv4 MPLSoUDP outer header::
5217a1191d39SOri Kam
5218a1191d39SOri Kam testpmd> set mplsoudp_decap ip-version ipv4
5219a1191d39SOri Kam testpmd> flow create 0 ingress pattern eth / ipv4 / udp / mpls / end actions
5220a1191d39SOri Kam        mplsoudp_decap / l2_encap / end
5221a1191d39SOri Kam
5222a1191d39SOri KamIPv4 MPLSoUDP with VLAN outer header::
5223a1191d39SOri Kam
5224a1191d39SOri Kam testpmd> set mplsoudp_decap-with-vlan ip-version ipv4
5225a1191d39SOri Kam testpmd> flow create 0 ingress pattern eth / vlan / ipv4 / udp / mpls / end
5226a1191d39SOri Kam        actions mplsoudp_decap / l2_encap / end
5227a1191d39SOri Kam
5228a1191d39SOri KamIPv6 MPLSoUDP outer header::
5229a1191d39SOri Kam
5230a1191d39SOri Kam testpmd> set mplsoudp_decap ip-version ipv6
5231a1191d39SOri Kam testpmd> flow create 0 ingress pattern eth / ipv6 / udp / mpls / end
5232a1191d39SOri Kam        actions mplsoudp_decap / l2_encap / end
5233a1191d39SOri Kam
5234a1191d39SOri KamIPv6 MPLSoUDP with VLAN outer header::
5235a1191d39SOri Kam
5236a1191d39SOri Kam testpmd> set mplsoudp_decap-with-vlan ip-version ipv6
5237a1191d39SOri Kam testpmd> flow create 0 ingress pattern eth / vlan / ipv6 / udp / mpls / end
5238a1191d39SOri Kam        actions mplsoudp_decap / l2_encap / end
5239a1191d39SOri Kam
524030626defSXiaoyu MinSample Raw encapsulation rule
524130626defSXiaoyu Min~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
524230626defSXiaoyu Min
524330626defSXiaoyu MinRaw encapsulation configuration can be set by the following commands
524430626defSXiaoyu Min
52459c30a6f3SHenry NadeauEncapsulating VxLAN::
524630626defSXiaoyu Min
5247739e045bSXiaoyu Min testpmd> set raw_encap 4 eth src is 10:11:22:33:44:55 / vlan tci is 1
524830626defSXiaoyu Min        inner_type is 0x0800 / ipv4 / udp dst is 4789 / vxlan vni
524930626defSXiaoyu Min        is 2 / end_set
525030626defSXiaoyu Min testpmd> flow create 0 egress pattern eth / ipv4 / end actions
5251739e045bSXiaoyu Min        raw_encap index 4 / end
525230626defSXiaoyu Min
525330626defSXiaoyu MinSample Raw decapsulation rule
525430626defSXiaoyu Min~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
525530626defSXiaoyu Min
525630626defSXiaoyu MinRaw decapsulation configuration can be set by the following commands
525730626defSXiaoyu Min
525830626defSXiaoyu MinDecapsulating VxLAN::
525930626defSXiaoyu Min
526030626defSXiaoyu Min testpmd> set raw_decap eth / ipv4 / udp / vxlan / end_set
526130626defSXiaoyu Min testpmd> flow create 0 ingress pattern eth / ipv4 / udp / vxlan / eth / ipv4 /
526230626defSXiaoyu Min        end actions raw_decap / queue index 0 / end
526330626defSXiaoyu Min
52646a42e7efSBernard IremongerSample ESP rules
52656a42e7efSBernard Iremonger~~~~~~~~~~~~~~~~
52666a42e7efSBernard Iremonger
52676a42e7efSBernard IremongerESP rules can be created by the following commands::
52686a42e7efSBernard Iremonger
52696a42e7efSBernard Iremonger testpmd> flow create 0 ingress pattern eth / ipv4 / esp spi is 1 / end actions
52706a42e7efSBernard Iremonger        queue index 3 / end
52716a42e7efSBernard Iremonger testpmd> flow create 0 ingress pattern eth / ipv4 / udp / esp spi is 1 / end
52726a42e7efSBernard Iremonger        actions queue index 3 / end
52736a42e7efSBernard Iremonger testpmd> flow create 0 ingress pattern eth / ipv6 / esp spi is 1 / end actions
52746a42e7efSBernard Iremonger        queue index 3 / end
52756a42e7efSBernard Iremonger testpmd> flow create 0 ingress pattern eth / ipv6 / udp / esp spi is 1 / end
52766a42e7efSBernard Iremonger        actions queue index 3 / end
52776a42e7efSBernard Iremonger
5278573ef95dSXiao ZhangSample AH rules
5279573ef95dSXiao Zhang~~~~~~~~~~~~~~~~
5280573ef95dSXiao Zhang
5281573ef95dSXiao ZhangAH rules can be created by the following commands::
5282573ef95dSXiao Zhang
5283573ef95dSXiao Zhang testpmd> flow create 0 ingress pattern eth / ipv4 / ah spi is 1 / end actions
5284573ef95dSXiao Zhang        queue index 3 / end
5285573ef95dSXiao Zhang testpmd> flow create 0 ingress pattern eth / ipv4 / udp / ah spi is 1 / end
5286573ef95dSXiao Zhang        actions queue index 3 / end
5287573ef95dSXiao Zhang testpmd> flow create 0 ingress pattern eth / ipv6 / ah spi is 1 / end actions
5288573ef95dSXiao Zhang        queue index 3 / end
5289573ef95dSXiao Zhang testpmd> flow create 0 ingress pattern eth / ipv6 / udp / ah spi is 1 / end
5290573ef95dSXiao Zhang        actions queue index 3 / end
5291573ef95dSXiao Zhang
5292ecbc8570SXiao ZhangSample PFCP rules
5293ecbc8570SXiao Zhang~~~~~~~~~~~~~~~~~
5294ecbc8570SXiao Zhang
5295ecbc8570SXiao ZhangPFCP rules can be created by the following commands(s_field need to be 1
5296ecbc8570SXiao Zhangif seid is set)::
5297ecbc8570SXiao Zhang
5298ecbc8570SXiao Zhang testpmd> flow create 0 ingress pattern eth / ipv4 / pfcp s_field is 0 / end
5299ecbc8570SXiao Zhang        actions queue index 3 / end
5300ecbc8570SXiao Zhang testpmd> flow create 0 ingress pattern eth / ipv4 / pfcp s_field is 1
5301ecbc8570SXiao Zhang        seid is 1 / end actions queue index 3 / end
5302ecbc8570SXiao Zhang testpmd> flow create 0 ingress pattern eth / ipv6 / pfcp s_field is 0 / end
5303ecbc8570SXiao Zhang        actions queue index 3 / end
5304ecbc8570SXiao Zhang testpmd> flow create 0 ingress pattern eth / ipv6 / pfcp s_field is 1
5305ecbc8570SXiao Zhang        seid is 1 / end actions queue index 3 / end
5306ecbc8570SXiao Zhang
530701ee2e49SJiawei WangSample Sampling/Mirroring rules
530801ee2e49SJiawei Wang~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
530901ee2e49SJiawei Wang
531001ee2e49SJiawei WangSample/Mirroring rules can be set by the following commands
531101ee2e49SJiawei Wang
531201ee2e49SJiawei WangNIC-RX Sampling rule, the matched ingress packets and sent to the queue 1,
531301ee2e49SJiawei Wangand 50% packets are duplicated and marked with 0x1234 and sent to queue 0.
531401ee2e49SJiawei Wang
531501ee2e49SJiawei Wang::
531601ee2e49SJiawei Wang
531701ee2e49SJiawei Wang testpmd> set sample_actions 0 mark id  0x1234 / queue index 0 / end
531801ee2e49SJiawei Wang testpmd> flow create 0 ingress group 1 pattern eth / end actions
531901ee2e49SJiawei Wang        sample ratio 2 index 0 / queue index 1 / end
532001ee2e49SJiawei Wang
5321ce88d5daSIvan MalovMatch packets coming from a VM which is referred to by means of
5322ce88d5daSIvan Malovits representor ethdev (port 1), mirror 50% of them to the
5323ce88d5daSIvan Malovsaid representor (for bookkeeping) as well as encapsulate
5324ce88d5daSIvan Malovall the packets and steer them to the physical port:
532501ee2e49SJiawei Wang
532601ee2e49SJiawei Wang::
532701ee2e49SJiawei Wang
5328ce88d5daSIvan Malov   testpmd> set sample_actions 0 port_representor ethdev_port_id 1 / end
532901ee2e49SJiawei Wang
5330ce88d5daSIvan Malov   testpmd> set vxlan ip-version ipv4 vni 4 udp-src 32 udp-dst 4789 ip-src 127.0.0.1
5331ce88d5daSIvan Malov      ip-dst 127.0.0.2 eth-src 11:11:11:11:11:11 eth-dst 22:22:22:22:22:22
533201ee2e49SJiawei Wang
5333ce88d5daSIvan Malov   testpmd> flow create 0 transfer pattern represented_port ethdev_port_id is 1 / end
5334ce88d5daSIvan Malov      actions sample ratio 2 index 0 / vxlan_encap /
5335ce88d5daSIvan Malov      represented_port ethdev_port_id 0 / end
533601ee2e49SJiawei Wang
5337ce88d5daSIvan MalovThe rule is inserted via port 0 (assumed to have "transfer" privilege).
53383b622711SSalem Sol
53390797fa6cSOri KamSample integrity rules
53400797fa6cSOri Kam~~~~~~~~~~~~~~~~~~~~~~
53410797fa6cSOri Kam
53420797fa6cSOri KamIntegrity rules can be created by the following commands:
53430797fa6cSOri Kam
53440797fa6cSOri KamIntegrity rule that forwards valid TCP packets to group 1.
53450797fa6cSOri KamTCP packet integrity is matched with the ``l4_ok`` bit 3.
53460797fa6cSOri Kam
53470797fa6cSOri Kam::
53480797fa6cSOri Kam
53490797fa6cSOri Kam testpmd> flow create 0 ingress
53500797fa6cSOri Kam            pattern eth / ipv4 / tcp / integrity value mask 8 value spec 8 / end
53510797fa6cSOri Kam            actions jump group 1 / end
53520797fa6cSOri Kam
53530797fa6cSOri KamIntegrity rule that forwards invalid packets to application.
53540797fa6cSOri KamGeneral packet integrity is matched with the ``packet_ok`` bit 0.
53550797fa6cSOri Kam
53560797fa6cSOri Kam::
53570797fa6cSOri Kam
53580797fa6cSOri Kam testpmd> flow create 0 ingress pattern integrity value mask 1 value spec 0 / end actions queue index 0 / end
53590797fa6cSOri Kam
53604d07cbefSBing ZhaoSample conntrack rules
53614d07cbefSBing Zhao~~~~~~~~~~~~~~~~~~~~~~
53624d07cbefSBing Zhao
53634d07cbefSBing ZhaoConntrack rules can be set by the following commands
53644d07cbefSBing Zhao
53654d07cbefSBing ZhaoNeed to construct the connection context with provided information.
53664d07cbefSBing ZhaoIn the first table, create a flow rule by using conntrack action and jump to
53674d07cbefSBing Zhaothe next table. In the next table, create a rule to check the state.
53684d07cbefSBing Zhao
53694d07cbefSBing Zhao::
53704d07cbefSBing Zhao
53714d07cbefSBing Zhao testpmd> set conntrack com peer 1 is_orig 1 enable 1 live 1 sack 1 cack 0
53724d07cbefSBing Zhao        last_dir 0 liberal 0 state 1 max_ack_win 7 r_lim 5 last_win 510
53734d07cbefSBing Zhao        last_seq 2632987379 last_ack 2532480967 last_end 2632987379
53744d07cbefSBing Zhao        last_index 0x8
53754d07cbefSBing Zhao testpmd> set conntrack orig scale 7 fin 0 acked 1 unack_data 0
53764d07cbefSBing Zhao        sent_end 2632987379 reply_end 2633016339 max_win 28960
53774d07cbefSBing Zhao        max_ack 2632987379
53784d07cbefSBing Zhao testpmd> set conntrack rply scale 7 fin 0 acked 1 unack_data 0
53794d07cbefSBing Zhao        sent_end 2532480967 reply_end 2532546247 max_win 65280
53804d07cbefSBing Zhao        max_ack 2532480967
53814d07cbefSBing Zhao testpmd> flow indirect_action 0 create ingress action conntrack / end
53824d07cbefSBing Zhao testpmd> flow create 0 group 3 ingress pattern eth / ipv4 / tcp / end actions indirect 0 / jump group 5 / end
53834d07cbefSBing Zhao testpmd> flow create 0 group 5 ingress pattern eth / ipv4 / tcp / conntrack is 1 / end actions queue index 5 / end
53844d07cbefSBing Zhao
53854d07cbefSBing ZhaoConstruct the conntrack again with only "is_orig" set to 0 (other fields are
53864d07cbefSBing Zhaoignored), then use "update" interface to update the direction. Create flow
53874d07cbefSBing Zhaorules like above for the peer port.
53884d07cbefSBing Zhao
53894d07cbefSBing Zhao::
53904d07cbefSBing Zhao
53914d07cbefSBing Zhao testpmd> flow indirect_action 0 update 0 action conntrack_update dir / end
53924d07cbefSBing Zhao
5393c5c50710SHaifei LuoSample meter with policy rules
5394c5c50710SHaifei Luo~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5395c5c50710SHaifei Luo
5396c5c50710SHaifei LuoMeter with policy rules can be created by the following commands:
5397c5c50710SHaifei Luo
5398c5c50710SHaifei LuoNeed to create policy first and actions are set for green/yellow/red colors.
5399c5c50710SHaifei LuoCreate meter with policy id. Create flow with meter id.
5400c5c50710SHaifei Luo
5401c5c50710SHaifei LuoExample for policy with meter color action. The purpose is to color the packet
5402c5c50710SHaifei Luoto reflect the meter color result.
5403c5c50710SHaifei LuoThe meter policy action list: ``green -> green, yellow -> yellow, red -> red``.
5404c5c50710SHaifei Luo
5405c5c50710SHaifei Luo::
5406c5c50710SHaifei Luo
5407c5c50710SHaifei Luo   testpmd> add port meter profile srtcm_rfc2697 0 13 21504 2688 0 0
5408c5c50710SHaifei Luo   testpmd> add port meter policy 0 1 g_actions color type green / end y_actions color type yellow / end
5409c5c50710SHaifei Luo            r_actions color type red / end
5410c5c50710SHaifei Luo   testpmd> create port meter 0 1 13 1 yes 0xffff 0 0
5411c5c50710SHaifei Luo   testpmd> flow create 0 priority 0 ingress group 1 pattern eth / end actions meter mtr_id 1 / end
5412c5c50710SHaifei Luo
5413988cd040SJie WangSample L2TPv2 RSS rules
5414988cd040SJie Wang~~~~~~~~~~~~~~~~~~~~~~~
5415748530f0SJie Wang
5416988cd040SJie WangL2TPv2 RSS rules can be created by the following commands::
5417748530f0SJie Wang
5418988cd040SJie Wang   testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 type control
5419988cd040SJie Wang            / end actions rss types l2tpv2 end queues end / end
5420988cd040SJie Wang   testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 / end
5421988cd040SJie Wang            actions rss types eth l2-src-only end queues end / end
5422988cd040SJie Wang   testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 / ppp / end
5423988cd040SJie Wang            actions rss types l2tpv2 end queues end / end
5424748530f0SJie Wang   testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 / ppp / ipv4
5425748530f0SJie Wang            / end actions rss types ipv4 end queues end / end
5426748530f0SJie Wang   testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 / ppp / ipv6
5427748530f0SJie Wang            / udp / end actions rss types ipv6-udp end queues end / end
5428748530f0SJie Wang   testpmd> flow create 0 ingress pattern eth / ipv6 / udp / l2tpv2 / ppp / ipv4
5429748530f0SJie Wang            / tcp / end actions rss types ipv4-tcp end queues end / end
5430748530f0SJie Wang   testpmd> flow create 0 ingress pattern eth / ipv6 / udp / l2tpv2 / ppp / ipv6
5431748530f0SJie Wang            / end actions rss types ipv6 end queues end / end
5432748530f0SJie Wang
5433988cd040SJie WangSample L2TPv2 FDIR rules
5434988cd040SJie Wang~~~~~~~~~~~~~~~~~~~~~~~~
5435988cd040SJie Wang
5436988cd040SJie WangL2TPv2 FDIR rules can be created by the following commands::
5437988cd040SJie Wang
5438988cd040SJie Wang   testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 type control
5439988cd040SJie Wang            session_id is 0x1111 / end actions queue index 3 / end
5440988cd040SJie Wang   testpmd> flow create 0 ingress pattern eth src is 00:00:00:00:00:01 / ipv4
5441988cd040SJie Wang            / udp / l2tpv2 type data / end actions queue index 3 / end
5442988cd040SJie Wang   testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 type data
5443988cd040SJie Wang            session_id is 0x1111 / ppp / end actions queue index 3 / end
5444988cd040SJie Wang   testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 / ppp / ipv4
5445988cd040SJie Wang            src is 10.0.0.1 / end actions queue index 3 / end
5446988cd040SJie Wang   testpmd> flow create 0 ingress pattern eth / ipv6 / udp / l2tpv2 / ppp / ipv6
5447988cd040SJie Wang            dst is ABAB:910B:6666:3457:8295:3333:1800:2929 / end actions queue index 3 / end
5448988cd040SJie Wang   testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 / ppp / ipv4
5449988cd040SJie Wang            / udp src is 22 / end actions queue index 3 / end
5450988cd040SJie Wang   testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 / ppp / ipv4
5451988cd040SJie Wang            / tcp dst is 23 / end actions queue index 3 / end
5452988cd040SJie Wang
5453cb43641eSNipun GuptaSample RAW rule
5454cb43641eSNipun Gupta~~~~~~~~~~~~~~~
5455cb43641eSNipun Gupta
5456cb43641eSNipun GuptaA RAW rule can be created as following using ``pattern_hex`` key and mask.
5457cb43641eSNipun Gupta
5458cb43641eSNipun Gupta::
5459cb43641eSNipun Gupta
5460cb43641eSNipun Gupta    testpmd> flow create 0 group 0 priority 1 ingress pattern raw relative is 0 search is 0 offset
5461cb43641eSNipun Gupta             is 0 limit is 0 pattern_hex spec 00000000000000000000000000000000000000000000000000000a0a0a0a
5462cb43641eSNipun Gupta             pattern_hex mask 0000000000000000000000000000000000000000000000000000ffffffff / end actions
5463cb43641eSNipun Gupta             queue index 4 / end
5464cb43641eSNipun Gupta
546558143b7bSSuanming MouSample match with comparison rule
546658143b7bSSuanming Mou~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
546758143b7bSSuanming Mou
546858143b7bSSuanming MouMatch with comparison rule can be created as following using ``compare``.
546958143b7bSSuanming Mou
547058143b7bSSuanming Mou::
547158143b7bSSuanming Mou
547258143b7bSSuanming Mou    testpmd> flow pattern_template 0 create ingress pattern_template_id 1 template compare op mask le
547358143b7bSSuanming Mou             a_type mask tag a_tag_index mask 1 b_type mask tag b_tag_index mask 2 width mask 0xffffffff / end
547458143b7bSSuanming Mou    testpmd> flow actions_template 0 create ingress actions_template_id 1 template count / drop / end
547558143b7bSSuanming Mou             mask count / drop  / end
547658143b7bSSuanming Mou    testpmd> flow template_table 0 create table_id 1 group 2 priority 1  ingress rules_number 1
547758143b7bSSuanming Mou             pattern_template 1 actions_template 1
547858143b7bSSuanming Mou    testpmd> flow queue 0 create 0 template_table 1 pattern_template 0 actions_template 0 postpone no
547958143b7bSSuanming Mou             pattern compare op is le a_type is tag a_tag_index is 1 b_type is tag b_tag_index is 2 width is 32 / end
548058143b7bSSuanming Mou	     actions count / drop / end
548158143b7bSSuanming Mou
5482e977e419SKonstantin AnanyevBPF Functions
5483e977e419SKonstantin Ananyev--------------
5484e977e419SKonstantin Ananyev
5485e977e419SKonstantin AnanyevThe following sections show functions to load/unload eBPF based filters.
5486e977e419SKonstantin Ananyev
5487e977e419SKonstantin Ananyevbpf-load
5488e977e419SKonstantin Ananyev~~~~~~~~
5489e977e419SKonstantin Ananyev
5490d629b7b5SJohn McNamaraLoad an eBPF program as a callback for particular RX/TX queue::
5491e977e419SKonstantin Ananyev
5492e977e419SKonstantin Ananyev   testpmd> bpf-load rx|tx (portid) (queueid) (load-flags) (bpf-prog-filename)
5493e977e419SKonstantin Ananyev
5494e977e419SKonstantin AnanyevThe available load-flags are:
5495e977e419SKonstantin Ananyev
5496e977e419SKonstantin Ananyev* ``J``: use JIT generated native code, otherwise BPF interpreter will be used.
5497e977e419SKonstantin Ananyev
5498e977e419SKonstantin Ananyev* ``M``: assume input parameter is a pointer to rte_mbuf, otherwise assume it is a pointer to first segment's data.
5499e977e419SKonstantin Ananyev
5500e977e419SKonstantin Ananyev* ``-``: none.
5501e977e419SKonstantin Ananyev
5502e977e419SKonstantin Ananyev.. note::
5503e977e419SKonstantin Ananyev
5504e977e419SKonstantin Ananyev   You'll need clang v3.7 or above to build bpf program you'd like to load
5505e977e419SKonstantin Ananyev
5506e977e419SKonstantin AnanyevFor example:
5507e977e419SKonstantin Ananyev
5508e977e419SKonstantin Ananyev.. code-block:: console
5509e977e419SKonstantin Ananyev
551025d11a86SBruce Richardson   cd examples/bpf
5511e977e419SKonstantin Ananyev   clang -O2 -target bpf -c t1.c
5512e977e419SKonstantin Ananyev
55137fa1a2deSKevin TraynorThen to load (and JIT compile) t1.o at RX queue 0, port 1:
5514e977e419SKonstantin Ananyev
5515e977e419SKonstantin Ananyev.. code-block:: console
5516e977e419SKonstantin Ananyev
551725d11a86SBruce Richardson   testpmd> bpf-load rx 1 0 J ./dpdk.org/examples/bpf/t1.o
5518e977e419SKonstantin Ananyev
55197fa1a2deSKevin TraynorTo load (not JITed) t1.o at TX queue 0, port 0:
5520e977e419SKonstantin Ananyev
5521e977e419SKonstantin Ananyev.. code-block:: console
5522e977e419SKonstantin Ananyev
552325d11a86SBruce Richardson   testpmd> bpf-load tx 0 0 - ./dpdk.org/examples/bpf/t1.o
5524e977e419SKonstantin Ananyev
5525e977e419SKonstantin Ananyevbpf-unload
5526e977e419SKonstantin Ananyev~~~~~~~~~~
5527e977e419SKonstantin Ananyev
5528d629b7b5SJohn McNamaraUnload previously loaded eBPF program for particular RX/TX queue::
5529e977e419SKonstantin Ananyev
5530e977e419SKonstantin Ananyev   testpmd> bpf-unload rx|tx (portid) (queueid)
5531e977e419SKonstantin Ananyev
5532e977e419SKonstantin AnanyevFor example to unload BPF filter from TX queue 0, port 0:
5533e977e419SKonstantin Ananyev
5534e977e419SKonstantin Ananyev.. code-block:: console
5535e977e419SKonstantin Ananyev
553625d11a86SBruce Richardson   testpmd> bpf-unload tx 0 0
553759f3a8acSGregory Etelson
553859f3a8acSGregory EtelsonFlex Item Functions
553959f3a8acSGregory Etelson-------------------
554059f3a8acSGregory Etelson
554159f3a8acSGregory EtelsonThe following sections show functions that configure and create flex item object,
554259f3a8acSGregory Etelsoncreate flex pattern and use it in a flow rule.
554359f3a8acSGregory EtelsonThe commands will use 20 bytes IPv4 header for examples:
554459f3a8acSGregory Etelson
554559f3a8acSGregory Etelson::
554659f3a8acSGregory Etelson
554759f3a8acSGregory Etelson   0                   1                   2                   3
554859f3a8acSGregory Etelson   0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
554959f3a8acSGregory Etelson   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
555059f3a8acSGregory Etelson   |  ver  |  IHL  |     TOS       |        length                 | +0
555159f3a8acSGregory Etelson   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
555259f3a8acSGregory Etelson   |       identification          | flg |    frag. offset         | +4
555359f3a8acSGregory Etelson   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
555459f3a8acSGregory Etelson   |       TTL     |  protocol     |        checksum               | +8
555559f3a8acSGregory Etelson   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
555659f3a8acSGregory Etelson   |               source IP address                               | +12
555759f3a8acSGregory Etelson   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
555859f3a8acSGregory Etelson   |              destination IP address                           | +16
555959f3a8acSGregory Etelson   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
556059f3a8acSGregory Etelson
556159f3a8acSGregory Etelson
556259f3a8acSGregory EtelsonCreate flex item
556359f3a8acSGregory Etelson~~~~~~~~~~~~~~~~
556459f3a8acSGregory Etelson
556559f3a8acSGregory EtelsonFlex item object is created by PMD according to a new header configuration. The
556659f3a8acSGregory Etelsonheader configuration is compiled by the testpmd and stored in
556759f3a8acSGregory Etelson``rte_flow_item_flex_conf`` type variable.
556859f3a8acSGregory Etelson
556959f3a8acSGregory Etelson::
557059f3a8acSGregory Etelson
557159f3a8acSGregory Etelson   # flow flex_item create <port> <flex id> <configuration file>
557259f3a8acSGregory Etelson   testpmd> flow flex_item init 0 3 ipv4_flex_config.json
557359f3a8acSGregory Etelson   port-0: created flex item #3
557459f3a8acSGregory Etelson
557559f3a8acSGregory EtelsonFlex item configuration is kept in external JSON file.
557659f3a8acSGregory EtelsonIt describes the following header elements:
557759f3a8acSGregory Etelson
557859f3a8acSGregory Etelson**New header length.**
557959f3a8acSGregory Etelson
558059f3a8acSGregory EtelsonSpecify whether the new header has fixed or variable length and the basic/minimal
558159f3a8acSGregory Etelsonheader length value.
558259f3a8acSGregory Etelson
558359f3a8acSGregory EtelsonIf header length is not fixed, header location with a value that completes header
558459f3a8acSGregory Etelsonlength calculation and scale/offset function must be added.
558559f3a8acSGregory Etelson
558659f3a8acSGregory EtelsonScale function depends on port hardware.
558759f3a8acSGregory Etelson
558859f3a8acSGregory Etelson**Next protocol.**
558959f3a8acSGregory Etelson
559059f3a8acSGregory EtelsonDescribes location in the new header that specify following network header type.
559159f3a8acSGregory Etelson
559259f3a8acSGregory Etelson**Flow match samples.**
559359f3a8acSGregory Etelson
559459f3a8acSGregory EtelsonDescribes locations in the new header that will be used in flow rules.
559559f3a8acSGregory Etelson
559659f3a8acSGregory EtelsonNumber of flow samples and sample maximal length depend of port hardware.
559759f3a8acSGregory Etelson
559859f3a8acSGregory Etelson**Input trigger.**
559959f3a8acSGregory Etelson
560059f3a8acSGregory EtelsonDescribes preceding network header configuration.
560159f3a8acSGregory Etelson
560259f3a8acSGregory Etelson**Output trigger.**
560359f3a8acSGregory Etelson
560459f3a8acSGregory EtelsonDescribes conditions that trigger transfer to following network header
560559f3a8acSGregory Etelson
560659f3a8acSGregory Etelson.. code-block:: json
560759f3a8acSGregory Etelson
560859f3a8acSGregory Etelson   {
560959f3a8acSGregory Etelson      "next_header": { "field_mode": "FIELD_MODE_FIXED", "field_size": 20},
561059f3a8acSGregory Etelson      "next_protocol": {"field_size": 8, "field_base": 72},
561159f3a8acSGregory Etelson      "sample_data": [
561259f3a8acSGregory Etelson         { "field_mode": "FIELD_MODE_FIXED", "field_size": 32, "field_base": 0},
561359f3a8acSGregory Etelson         { "field_mode": "FIELD_MODE_FIXED", "field_size": 32, "field_base": 32},
561459f3a8acSGregory Etelson         { "field_mode": "FIELD_MODE_FIXED", "field_size": 32, "field_base": 64},
561559f3a8acSGregory Etelson         { "field_mode": "FIELD_MODE_FIXED", "field_size": 32, "field_base": 96}
561659f3a8acSGregory Etelson      ],
561759f3a8acSGregory Etelson      "input_link": [
561859f3a8acSGregory Etelson         {"item": "eth type is 0x0800"},
561959f3a8acSGregory Etelson         {"item": "vlan inner_type is 0x0800"}
562059f3a8acSGregory Etelson      ],
562159f3a8acSGregory Etelson      "output_link": [
562259f3a8acSGregory Etelson         {"item": "udp", "next": 17},
562359f3a8acSGregory Etelson         {"item": "tcp", "next": 6},
562459f3a8acSGregory Etelson         {"item": "icmp", "next": 1}
562559f3a8acSGregory Etelson      ]
562659f3a8acSGregory Etelson   }
562759f3a8acSGregory Etelson
562859f3a8acSGregory Etelson
562959f3a8acSGregory EtelsonFlex pattern and flow rules
563059f3a8acSGregory Etelson~~~~~~~~~~~~~~~~~~~~~~~~~~~
563159f3a8acSGregory Etelson
563259f3a8acSGregory EtelsonFlex pattern describe parts of network header that will trigger flex flow item hit in a flow rule.
563359f3a8acSGregory EtelsonFlex pattern directly related to flex item samples configuration.
563459f3a8acSGregory EtelsonFlex pattern can be shared between ports.
563559f3a8acSGregory Etelson
563659f3a8acSGregory Etelson**Flex pattern and flow rule to match IPv4 version and 20 bytes length**
563759f3a8acSGregory Etelson
563859f3a8acSGregory Etelson::
563959f3a8acSGregory Etelson
564059f3a8acSGregory Etelson   # set flex_pattern <pattern_id> is <hex bytes sequence>
564159f3a8acSGregory Etelson   testpmd> flow flex_item pattern 5 is 45FF
564259f3a8acSGregory Etelson   created pattern #5
564359f3a8acSGregory Etelson
564459f3a8acSGregory Etelson   testpmd> flow create 0 ingress pattern eth / ipv4 / udp / flex item is 3 pattern is 5 / end actions mark id 1 / queue index 0 / end
564559f3a8acSGregory Etelson   Flow rule #0 created
564659f3a8acSGregory Etelson
564759f3a8acSGregory Etelson**Flex pattern and flow rule to match packets with source address 1.2.3.4**
564859f3a8acSGregory Etelson
564959f3a8acSGregory Etelson::
565059f3a8acSGregory Etelson
565159f3a8acSGregory Etelson   testpmd> flow flex_item pattern 2 spec 45000000000000000000000001020304 mask FF0000000000000000000000FFFFFFFF
565259f3a8acSGregory Etelson   created pattern #2
565359f3a8acSGregory Etelson
565459f3a8acSGregory Etelson   testpmd> flow create 0 ingress pattern eth / ipv4 / udp / flex item is 3 pattern is 2 / end actions mark id 1 / queue index 0 / end
565559f3a8acSGregory Etelson   Flow rule #0 created
5656592ab76fSDavid Marchand
5657592ab76fSDavid MarchandDriver specific commands
5658592ab76fSDavid Marchand------------------------
5659592ab76fSDavid Marchand
5660592ab76fSDavid MarchandSome drivers provide specific features.
5661592ab76fSDavid MarchandSee:
5662703178f8SDavid Marchand
5663703178f8SDavid Marchand- :ref:`net/bonding testpmd driver specific commands <bonding_testpmd_commands>`
566494b3c1a7SDavid Marchand- :ref:`net/i40e testpmd driver specific commands <net_i40e_testpmd_commands>`
56650100a038SDavid Marchand- :ref:`net/ixgbe testpmd driver specific commands <net_ixgbe_testpmd_commands>`
5666