app/testpmd: add retry option
[dpdk.git] / doc / guides / testpmd_app_ug / testpmd_funcs.rst
index b74819b..d812989 100644 (file)
@@ -50,10 +50,10 @@ If you type a partial command and hit ``<TAB>`` you get a list of the available
 
    testpmd> show port <TAB>
 
-       info [Mul-choice STRING]: show|clear port info|stats|fdir|stat_qmap X
-       info [Mul-choice STRING]: show|clear port info|stats|fdir|stat_qmap all
-       stats [Mul-choice STRING]: show|clear port info|stats|fdir|stat_qmap X
-       stats [Mul-choice STRING]: show|clear port info|stats|fdir|stat_qmap all
+       info [Mul-choice STRING]: show|clear port info|stats|fdir|stat_qmap|dcb_tc X
+       info [Mul-choice STRING]: show|clear port info|stats|fdir|stat_qmap|dcb_tc all
+       stats [Mul-choice STRING]: show|clear port info|stats|fdir|stat_qmap|dcb_tc X
+       stats [Mul-choice STRING]: show|clear port info|stats|fdir|stat_qmap|dcb_tc all
        ...
 
 
@@ -128,7 +128,7 @@ show port
 
 Display information for a given port or all ports::
 
-   testpmd> show port (info|stats|fdir|stat_qmap) (port_id|all)
+   testpmd> show port (info|stats|fdir|stat_qmap|dcb_tc) (port_id|all)
 
 The available information categories are:
 
@@ -140,6 +140,8 @@ The available information categories are:
 
 * ``stat_qmap``: Queue statistics mapping.
 
+* ``dcb_tc``: DCB information such as TC mapping.
+
 For example:
 
 .. code-block:: console
@@ -203,13 +205,20 @@ For example::
 
    testpmd> clear port stats all
 
+show (rxq|txq)
+~~~~~~~~~~~~~~
+
+Display information for a given port's RX/TX queue::
+
+   testpmd> show (rxq|txq) info (port_id) (queue_id)
+
 show config
 ~~~~~~~~~~~
 
 Displays the configuration of the application.
 The configuration comes from the command-line, the runtime or the application defaults::
 
-   testpmd> show config (rxtx|cores|fwd)
+   testpmd> show config (rxtx|cores|fwd|txpkts)
 
 The available information categories are:
 
@@ -219,6 +228,8 @@ The available information categories are:
 
 * ``fwd``: Packet forwarding configuration.
 
+* ``txpkts``: Packets to TX configuration.
+
 For example:
 
 .. code-block:: console
@@ -238,8 +249,10 @@ set fwd
 
 Set the packet forwarding mode::
 
-   testpmd> set fwd (io|mac|mac_retry|macswap|flowgen| \
-                     rxonly|txonly|csum|icmpecho)
+   testpmd> set fwd (io|mac|macswap|flowgen| \
+                     rxonly|txonly|csum|icmpecho) (""|retry)
+
+``retry`` can be specified for forwarding engines except ``rx_only``.
 
 The available information categories are:
 
@@ -249,8 +262,6 @@ The available information categories are:
 
 * ``mac``: Changes the source and the destination Ethernet addresses of packets before forwarding them.
 
-* ``mac_retry``: Same as "mac" forwarding mode, but includes retries if the destination queue is full.
-
 * ``macswap``: MAC swap forwarding mode.
   Swaps the source and the destination Ethernet addresses of packets before forwarding them.
 
@@ -381,9 +392,9 @@ Set number of packets per burst::
 
 This is equivalent to the ``--burst command-line`` option.
 
-In ``mac_retry`` forwarding mode, the transmit delay time and number of retries can also be set::
+When retry is enabled, the transmit delay time and number of retries can also be set::
 
-   testpmd> set burst tx delay (micrseconds) retry (num)
+   testpmd> set burst tx delay (microseconds) retry (num)
 
 set txpkts
 ~~~~~~~~~~
@@ -394,6 +405,23 @@ Set the length of each segment of the TX-ONLY packets::
 
 Where x[,y]* represents a CSV list of values, without white space.
 
+set txsplit
+~~~~~~~~~~~
+
+Set the split policy for the TX packets, applicable for TX-ONLY and CSUM forwarding modes::
+
+   testpmd> set txsplit (off|on|rand)
+
+Where:
+
+* ``off`` disable packet copy & split for CSUM mode.
+
+* ``on`` split outgoing packet into multiple segments. Size of each segment
+  and number of segments per packet is determined by ``set txpkts`` command
+  (see above).
+
+* ``rand`` same as 'on', but number of segments per each packet is a random value between 1 and total number of segments.
+
 set corelist
 ~~~~~~~~~~~~
 
@@ -470,9 +498,9 @@ Set the VLAN QinQ (extended queue in queue) on for a port::
 vlan set tpid
 ~~~~~~~~~~~~~
 
-Set the outer VLAN TPID for packet filtering on a port::
+Set the inner or outer VLAN TPID for packet filtering on a port::
 
-   testpmd> vlan set tpid (value) (port_id)
+   testpmd> vlan set (inner|outer) tpid (value) (port_id)
 
 .. note::
 
@@ -512,20 +540,43 @@ Remove a VLAN ID, from the set of VLAN identifiers filtered for VF(s) for port I
 
    testpmd> rx_vlan rm (vlan_id) port (port_id) vf (vf_mask)
 
-rx_vlan set tpid
-~~~~~~~~~~~~~~~~
-
-Set the outer VLAN TPID for packet filtering on a port::
-
-   testpmd> rx_vlan set tpid (value) (port_id)
-
 tunnel_filter add
 ~~~~~~~~~~~~~~~~~
 
 Add a tunnel filter on a port::
 
    testpmd> tunnel_filter add (port_id) (outer_mac) (inner_mac) (ip_addr) \
-            (inner_vlan) (tunnel_type) (filter_type) (tenant_id) (queue_id)
+            (inner_vlan) (vxlan|nvgre|ipingre) (imac-ivlan|imac-ivlan-tenid|\
+            imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) (queue_id)
+
+The available information categories are:
+
+* ``vxlan``: Set tunnel type as VXLAN.
+
+* ``nvgre``: Set tunnel type as NVGRE.
+
+* ``ipingre``: Set tunnel type as IP-in-GRE.
+
+* ``imac-ivlan``: Set filter type as Inner MAC and VLAN.
+
+* ``imac-ivlan-tenid``: Set filter type as Inner MAC, VLAN and tenant ID.
+
+* ``imac-tenid``: Set filter type as Inner MAC and tenant ID.
+
+* ``imac``: Set filter type as Inner MAC.
+
+* ``omac-imac-tenid``: Set filter type as Outer MAC, Inner MAC and tenant ID.
+
+* ``oip``: Set filter type as Outer IP.
+
+* ``iip``: Set filter type as Inner IP.
+
+Example::
+
+   testpmd> tunnel_filter add 0 68:05:CA:28:09:82 00:00:00:00:00:00 \
+            192.168.2.2 0 ipingre oip 1 1
+
+   Set an IP-in-GRE tunnel on port 0, and the filter type is Outer IP.
 
 tunnel_filter remove
 ~~~~~~~~~~~~~~~~~~~~
@@ -533,7 +584,8 @@ tunnel_filter remove
 Remove a tunnel filter on a port::
 
    testpmd> tunnel_filter rm (port_id) (outer_mac) (inner_mac) (ip_addr) \
-            (inner_vlan) (tunnel_type) (filter_type) (tenant_id) (queue_id)
+            (inner_vlan) (vxlan|nvgre|ipingre) (imac-ivlan|imac-ivlan-tenid|\
+            imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) (queue_id)
 
 rx_vxlan_port add
 ~~~~~~~~~~~~~~~~~
@@ -889,6 +941,32 @@ Set link down for a port::
 
    testpmd> set link-down port (port id)
 
+E-tag set
+~~~~~~~~~
+
+Enable E-tag insertion for a VF on a port::
+
+   testpmd> E-tag set insertion on port-tag-id (value) port (port_id) vf (vf_id)
+
+Disable E-tag insertion for a VF on a port::
+
+   testpmd> E-tag set insertion off port (port_id) vf (vf_id)
+
+Enable/disable E-tag stripping on a port::
+
+   testpmd> E-tag set stripping (on|off) port (port_id)
+
+Enable/disable E-tag based forwarding on a port::
+
+   testpmd> E-tag set forwarding (on|off) port (port_id)
+
+Add an E-tag forwarding filter on a port::
+
+   testpmd> E-tag set filter add e-tag-id (value) dst-pool (pool_id) port (port_id)
+
+Delete an E-tag forwarding filter on a port::
+   testpmd> E-tag set filter del e-tag-id (value) port (port_id)
+
 
 Port Functions
 --------------
@@ -902,7 +980,9 @@ The following sections show functions for configuring ports.
 port attach
 ~~~~~~~~~~~
 
-Attach a port specified by pci address or virtual device args.
+Attach a port specified by pci address or virtual device args::
+
+   testpmd> port attach (identifier)
 
 To attach a new pci device, the device should be recognized by kernel first.
 Then it should be moved under DPDK management.
@@ -936,8 +1016,6 @@ For example, to move a pci device using ixgbe under DPDK management:
 
 To attach a port created by virtual device, above steps are not needed.
 
-port attach (identifier)
-
 For example, to attach a port whose pci address is 0000:0a:00.0.
 
 .. code-block:: console
@@ -983,16 +1061,19 @@ the mode and slave parameters must be given.
 port detach
 ~~~~~~~~~~~
 
-Detach a specific port.
-
-Before detaching a port, the port should be closed::
+Detach a specific port::
 
    testpmd> port detach (port_id)
 
+Before detaching a port, the port should be stopped and closed.
+
 For example, to detach a pci device port 0.
 
 .. code-block:: console
 
+   testpmd> port stop 0
+   Stopping ports...
+   Done
    testpmd> port close 0
    Closing ports...
    Done
@@ -1010,6 +1091,9 @@ For example, to detach a virtual device port 0.
 
 .. code-block:: console
 
+   testpmd> port stop 0
+   Stopping ports...
+   Done
    testpmd> port close 0
    Closing ports...
    Done
@@ -1077,7 +1161,7 @@ port config - speed
 
 Set the speed and duplex mode for all ports or a specific port::
 
-   testpmd> port config (port_id|all) speed (10|100|1000|10000|auto) \
+   testpmd> port config (port_id|all) speed (10|100|1000|10000|40000|100000|auto) \
             duplex (half|full|auto)
 
 port config - queues/descriptors
@@ -1109,6 +1193,26 @@ CRC stripping is off by default.
 
 The ``on`` option is equivalent to the ``--crc-strip`` command-line option.
 
+port config - scatter
+~~~~~~~~~~~~~~~~~~~~~~~
+
+Set RX scatter mode on or off for all ports::
+
+   testpmd> port config all scatter (on|off)
+
+RX scatter mode is off by default.
+
+The ``on`` option is equivalent to the ``--enable-scatter`` command-line option.
+
+port config - TX queue flags
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set a hexadecimal bitmap of TX queue flags for all ports::
+
+   testpmd> port config all txqflags value
+
+This command is equivalent to the ``--txqflags`` command-line option.
+
 port config - RX Checksum
 ~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -1240,6 +1344,17 @@ Where the threshold type can be:
 
 These threshold options are also available from the command-line.
 
+port config - E-tag
+~~~~~~~~~~~~~~~~~~~
+
+Set the value of ether-type for E-tag::
+
+   testpmd> port config (port_id|all) l2-tunnel E-tag ether-type (value)
+
+Enable/disable the E-tag support::
+
+   testpmd> port config (port_id|all) l2-tunnel E-tag (enable|disable)
+
 
 Link Bonding Functions
 ----------------------
@@ -1621,15 +1736,24 @@ flow_director_filter
 
 The Flow Director works in receive mode to identify specific flows or sets of flows and route them to specific queues.
 
-Two types of filtering are supported which are referred to as Perfect Match and Signature filters, the match mode
-is set by the ``--pkt-filter-mode`` command-line parameter:
+Four types of filtering are supported which are referred to as Perfect Match, Signature, Perfect-mac-vlan and
+Perfect-tunnel filters, the match mode is set by the ``--pkt-filter-mode`` command-line parameter:
 
 * Perfect match filters.
   The hardware checks a match between the masked fields of the received packets and the programmed filters.
+  The masked fields are for IP flow.
 
 * Signature filters.
   The hardware checks a match between a hash-based signature of the masked fields of the received packet.
 
+* Perfect-mac-vlan match filters.
+  The hardware checks a match between the masked fields of the received packets and the programmed filters.
+  The masked fields are for MAC VLAN flow.
+
+* Perfect-tunnel match filters.
+  The hardware checks a match between the masked fields of the received packets and the programmed filters.
+  The masked fields are for tunnel flow.
+
 The Flow Director filters can match the different fields for different type of packet: flow type, specific input set
 per flow type and the flexible payload.
 
@@ -1640,40 +1764,59 @@ Different NICs may have different capabilities, command show port fdir (port_id)
 
 # Commands to add flow director filters of different flow types::
 
-   flow_director_filter (port_id) (add|del|update) \
-                        flow (ipv4-other|ipv4-frag|ipv6-other|ipv6-frag)
+   flow_director_filter (port_id) mode IP (add|del|update) \
+                        flow (ipv4-other|ipv4-frag|ipv6-other|ipv6-frag) \
                         src (src_ip_address) dst (dst_ip_address) \
+                        tos (tos_value) proto (proto_value) ttl (ttl_value) \
                         vlan (vlan_value) flexbytes (flexbytes_value) \
-                        (drop|fwd) queue (queue_id) fd_id (fd_id_value)
+                        (drop|fwd) pf|vf(vf_id) queue (queue_id) \
+                        fd_id (fd_id_value)
 
-   flow_director_filter (port_id) (add|del|update) \
+   flow_director_filter (port_id) mode IP (add|del|update) \
                         flow (ipv4-tcp|ipv4-udp|ipv6-tcp|ipv6-udp) \
                         src (src_ip_address) (src_port) \
                         dst (dst_ip_address) (dst_port) \
+                        tos (tos_value) ttl (ttl_value) \
                         vlan (vlan_value) flexbytes (flexbytes_value) \
-                        (drop|fwd) queue (queue_id) fd_id (fd_id_value)
+                        (drop|fwd) queue pf|vf(vf_id) (queue_id) \
+                        fd_id (fd_id_value)
 
-   flow_director_filter (port_id) (add|del|update) \
+   flow_director_filter (port_id) mode IP (add|del|update) \
                         flow (ipv4-sctp|ipv6-sctp) \
                         src (src_ip_address) (src_port) \
-                        dst (dst_ip_address) (dst_port)
+                        dst (dst_ip_address) (dst_port) \
+                        tos (tos_value) ttl (ttl_value) \
                         tag (verification_tag) vlan (vlan_value) \
                         flexbytes (flexbytes_value) (drop|fwd) \
-                        queue (queue_id) fd_id (fd_id_value)
+                        pf|vf(vf_id) queue (queue_id) fd_id (fd_id_value)
 
-   flow_director_filter (port_id) (add|del|update) flow l2_payload \
+   flow_director_filter (port_id) mode IP (add|del|update) flow l2_payload \
                         ether (ethertype) flexbytes (flexbytes_value) \
-                        (drop|fwd) queue (queue_id) fd_id (fd_id_value)
+                        (drop|fwd) pf|vf(vf_id) queue (queue_id)
+                        fd_id (fd_id_value)
+
+   flow_director_filter (port_id) mode MAC-VLAN (add|del|update) \
+                        mac (mac_address) vlan (vlan_value) \
+                        flexbytes (flexbytes_value) (drop|fwd) \
+                        queue (queue_id) fd_id (fd_id_value)
+
+   flow_director_filter (port_id) mode Tunnel (add|del|update) \
+                        mac (mac_address) vlan (vlan_value) \
+                        tunnel (NVGRE|VxLAN) tunnel-id (tunnel_id_value) \
+                        flexbytes (flexbytes_value) (drop|fwd) \
+                        queue (queue_id) fd_id (fd_id_value)
 
 For example, to add an ipv4-udp flow type filter::
 
-   testpmd> flow_director_filter 0 add flow ipv4-udp src 2.2.2.3 32 \
-            dst 2.2.2.5 33 vlan 0x1 flexbytes (0x88,0x48) fwd queue 1 fd_id 1
+   testpmd> flow_director_filter 0 mode IP add flow ipv4-udp src 2.2.2.3 32 \
+            dst 2.2.2.5 33 tos 2 ttl 40 vlan 0x1 flexbytes (0x88,0x48) \
+            fwd pf queue 1 fd_id 1
 
 For example, add an ipv4-other flow type filter::
 
-   testpmd> flow_director_filter 0 add flow ipv4-other src 2.2.2.3 \
-             dst 2.2.2.5 vlan 0x1 flexbytes (0x88,0x48) fwd queue 1 fd_id 1
+   testpmd> flow_director_filter 0 mode IP add flow ipv4-other src 2.2.2.3 \
+             dst 2.2.2.5 tos 2 proto 20 ttl 40 vlan 0x1 \
+             flexbytes (0x88,0x48) fwd pf queue 1 fd_id 1
 
 flush_flow_director
 ~~~~~~~~~~~~~~~~~~~
@@ -1691,13 +1834,20 @@ flow_director_mask
 
 Set flow director's input masks::
 
-   flow_director_mask (port_id) vlan (vlan_value) \
+   flow_director_mask (port_id) mode IP vlan (vlan_value) \
                       src_mask (ipv4_src) (ipv6_src) (src_port) \
                       dst_mask (ipv4_dst) (ipv6_dst) (dst_port)
 
+   flow_director_mask (port_id) mode MAC-VLAN vlan (vlan_value) \
+                      mac (mac_value)
+
+   flow_director_mask (port_id) mode Tunnel vlan (vlan_value) \
+                      mac (mac_value) tunnel-type (tunnel_type_value) \
+                      tunnel-id (tunnel_id_value)
+
 Example, to set flow director mask on port 0::
 
-   testpmd> flow_director_mask 0 vlan 0xefff \
+   testpmd> flow_director_mask 0 mode IP vlan 0xefff \
             src_mask 255.255.255.255 \
                 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF 0xFFFF \
             dst_mask 255.255.255.255 \
@@ -1777,3 +1927,50 @@ Set the global configurations of hash filters::
 For example, to enable simple_xor for flow type of ipv6 on port 2::
 
    testpmd> set_hash_global_config 2 simple_xor ipv6 enable
+
+set_hash_input_set
+~~~~~~~~~~~~~~~~~~
+
+Set the input set for hash::
+
+   set_hash_input_set (port_id) (ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp| \
+   ipv4-other|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other| \
+   l2_payload) (ovlan|ivlan|src-ipv4|dst-ipv4|src-ipv6|dst-ipv6|ipv4-tos| \
+   ipv4-proto|ipv6-tc|ipv6-next-header|udp-src-port|udp-dst-port| \
+   tcp-src-port|tcp-dst-port|sctp-src-port|sctp-dst-port|sctp-veri-tag| \
+   udp-key|gre-key|fld-1st|fld-2nd|fld-3rd|fld-4th|fld-5th|fld-6th|fld-7th| \
+   fld-8th|none) (select|add)
+
+For example, to add source IP to hash input set for flow type of ipv4-udp on port 0::
+
+   testpmd> set_hash_input_set 0 ipv4-udp src-ipv4 add
+
+set_fdir_input_set
+~~~~~~~~~~~~~~~~~~
+
+The Flow Director filters can match the different fields for different type of packet, i.e. specific input set
+on per flow type and the flexible payload. This command can be used to change input set for each flow type.
+
+Set the input set for flow director::
+
+   set_fdir_input_set (port_id) (ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp| \
+   ipv4-other|ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other| \
+   l2_payload) (ivlan|ethertype|src-ipv4|dst-ipv4|src-ipv6|dst-ipv6|ipv4-tos| \
+   ipv4-proto|ipv4-ttl|ipv6-tc|ipv6-next-header|ipv6-hop-limits| \
+   tudp-src-port|udp-dst-port|cp-src-port|tcp-dst-port|sctp-src-port| \
+   sctp-dst-port|sctp-veri-tag|none) (select|add)
+
+For example to add source IP to FD input set for flow type of ipv4-udp on port 0::
+
+   testpmd> set_fdir_input_set 0 ipv4-udp src-ipv4 add
+
+global_config
+~~~~~~~~~~~~~
+
+Set different GRE key length for input set::
+
+   global_config (port_id) gre-key-len (number in bytes)
+
+For example to set GRE key length for input set to 4 bytes on port 0::
+
+   testpmd> global_config 0 gre-key-len 4