app/testpmd: add forwarding engine for shared Rx queue
[dpdk.git] / doc / guides / testpmd_app_ug / testpmd_funcs.rst
index 2c43719..d8d5053 100644 (file)
@@ -314,7 +314,7 @@ set fwd
 Set the packet forwarding mode::
 
    testpmd> set fwd (io|mac|macswap|flowgen| \
-                     rxonly|txonly|csum|icmpecho|noisy|5tswap) (""|retry)
+                     rxonly|txonly|csum|icmpecho|noisy|5tswap|shared-rxq) (""|retry)
 
 ``retry`` can be specified for forwarding engines except ``rx_only``.
 
@@ -357,6 +357,9 @@ The available information categories are:
 
   L4 swaps the source port and destination port of transport layer (TCP and UDP).
 
+* ``shared-rxq``: Receive only for shared Rx queue.
+  Resolve packet source port from mbuf and update stream statistics accordingly.
+
 Example::
 
    testpmd> set fwd rxonly
@@ -1610,31 +1613,6 @@ Set TX rate limitation for queues in VF on a port::
 
    testpmd> set port (port_id) vf (vf_id) rate (rate_value) queue_mask (queue_mask)
 
-set port - mirror rule
-~~~~~~~~~~~~~~~~~~~~~~
-
-Set pool or vlan type mirror rule for a port::
-
-   testpmd> set port (port_id) mirror-rule (rule_id) \
-            (pool-mirror-up|pool-mirror-down|vlan-mirror) \
-            (poolmask|vlanid[,vlanid]*) dst-pool (pool_id) (on|off)
-
-Set link mirror rule for a port::
-
-   testpmd> set port (port_id) mirror-rule (rule_id) \
-           (uplink-mirror|downlink-mirror) dst-pool (pool_id) (on|off)
-
-For example to enable mirror traffic with vlan 0,1 to pool 0::
-
-   set port 0 mirror-rule 0 vlan-mirror 0,1 dst-pool 0 on
-
-reset port - mirror rule
-~~~~~~~~~~~~~~~~~~~~~~~~
-
-Reset a mirror rule for a port::
-
-   testpmd> reset port (port_id) mirror-rule (rule_id)
-
 set flush_rx
 ~~~~~~~~~~~~
 
@@ -1742,7 +1720,7 @@ List all items from the ptype mapping table::
 
 Where:
 
-* ``valid_only``: A flag indicates if only list valid items(=1) or all itemss(=0).
+* ``valid_only``: A flag indicates if only list valid items(=1) or all items(=0).
 
 Replace a specific or a group of software defined ptype with a new one::
 
@@ -2630,6 +2608,12 @@ in balance mode with a transmission policy of layer 2+3::
         Active Slaves (3): [1 3 4]
         Primary: [3]
 
+show bonding lacp info
+~~~~~~~~~~~~~~~~~~~~~~
+
+Show information about the Link Bonding device in mode 4 (link-aggregation-802.3ad)::
+
+   testpmd> show bonding lacp info (port_id)
 
 Register Functions
 ------------------
@@ -3788,7 +3772,7 @@ This section lists supported pattern items and their attributes, if any.
 
   - ``pdu_type {unsigned}``: PDU type.
 
-  - ``qfi {unsigned}``: PPP, RQI and QoS flow identifier.
+  - ``qfi {unsigned}``: QoS flow identifier.
 
 - ``pppoes``, ``pppoed``: match PPPoE header.
 
@@ -3820,6 +3804,29 @@ This section lists supported pattern items and their attributes, if any.
 
 - ``conntrack``: match conntrack state.
 
+- ``port_representor``: match traffic entering the embedded switch from the given ethdev
+
+  - ``port_id {unsigned}``: ethdev port ID
+
+- ``represented_port``: match traffic entering the embedded switch from
+  the entity represented by the given ethdev
+
+  - ``ethdev_port_id {unsigned}``: ethdev port ID
+
+- ``l2tpv2``: match L2TPv2 header.
+
+  - ``length {unsigned}``: L2TPv2 option length.
+  - ``tunnel_id {unsigned}``: L2TPv2 tunnel identifier.
+  - ``session_id {unsigned}``: L2TPv2 session identifier.
+  - ``ns {unsigned}``: L2TPv2 option ns.
+  - ``nr {unsigned}``: L2TPv2 option nr.
+
+- ``ppp``: match PPP header.
+
+  - ``addr {unsigned}``: PPP address.
+  - ``ctrl {unsigned}``: PPP control.
+  - ``proto_id {unsigned}``: PPP protocol identifier.
+
 Actions list
 ^^^^^^^^^^^^
 
@@ -4095,6 +4102,16 @@ This section lists supported actions and their attributes, if any.
 
   - ``type {value}``: Set color type with specified value(green/yellow/red)
 
+- ``port_representor``: at embedded switch level, send matching traffic to
+  the given ethdev
+
+  - ``port_id {unsigned}``: ethdev port ID
+
+- ``represented_port``: at embedded switch level, send matching traffic to
+  the entity represented by the given ethdev
+
+  - ``ethdev_port_id {unsigned}``: ethdev port ID
+
 Destroying flow rules
 ~~~~~~~~~~~~~~~~~~~~~
 
@@ -4842,7 +4859,7 @@ Sample Raw encapsulation rule
 
 Raw encapsulation configuration can be set by the following commands
 
-Eecapsulating VxLAN::
+Encapsulating VxLAN::
 
  testpmd> set raw_encap 4 eth src is 10:11:22:33:44:55 / vlan tci is 1
         inner_type is 0x0800 / ipv4 / udp dst is 4789 / vxlan vni
@@ -5036,6 +5053,20 @@ The meter policy action list: ``green -> green, yellow -> yellow, red -> red``.
    testpmd> create port meter 0 1 13 1 yes 0xffff 0 0
    testpmd> flow create 0 priority 0 ingress group 1 pattern eth / end actions meter mtr_id 1 / end
 
+Sample PPPoL2TPv2oUDP RSS rules
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+PPPoL2TPv2oUDP RSS rules can be created by the following commands::
+
+ testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 / ppp / ipv4
+          / end actions rss types ipv4 end queues end / end
+ testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 / ppp / ipv6
+          / udp / end actions rss types ipv6-udp end queues end / end
+ testpmd> flow create 0 ingress pattern eth / ipv6 / udp / l2tpv2 / ppp / ipv4
+          / tcp / end actions rss types ipv4-tcp end queues end / end
+ testpmd> flow create 0 ingress pattern eth / ipv6 / udp / l2tpv2 / ppp / ipv6
+          / end actions rss types ipv6 end queues end / end
+
 BPF Functions
 --------------
 
@@ -5091,3 +5122,122 @@ For example to unload BPF filter from TX queue 0, port 0:
 .. code-block:: console
 
    testpmd> bpf-unload tx 0 0
+
+Flex Item Functions
+-------------------
+
+The following sections show functions that configure and create flex item object,
+create flex pattern and use it in a flow rule.
+The commands will use 20 bytes IPv4 header for examples:
+
+::
+
+   0                   1                   2                   3
+   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
+   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+   |  ver  |  IHL  |     TOS       |        length                 | +0
+   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+   |       identification          | flg |    frag. offset         | +4
+   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+   |       TTL     |  protocol     |        checksum               | +8
+   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+   |               source IP address                               | +12
+   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+   |              destination IP address                           | +16
+   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+Create flex item
+~~~~~~~~~~~~~~~~
+
+Flex item object is created by PMD according to a new header configuration. The
+header configuration is compiled by the testpmd and stored in
+``rte_flow_item_flex_conf`` type variable.
+
+::
+
+   # flow flex_item create <port> <flex id> <configuration file>
+   testpmd> flow flex_item init 0 3 ipv4_flex_config.json
+   port-0: created flex item #3
+
+Flex item configuration is kept in external JSON file.
+It describes the following header elements:
+
+**New header length.**
+
+Specify whether the new header has fixed or variable length and the basic/minimal
+header length value.
+
+If header length is not fixed, header location with a value that completes header
+length calculation and scale/offset function must be added.
+
+Scale function depends on port hardware.
+
+**Next protocol.**
+
+Describes location in the new header that specify following network header type.
+
+**Flow match samples.**
+
+Describes locations in the new header that will be used in flow rules.
+
+Number of flow samples and sample maximal length depend of port hardware.
+
+**Input trigger.**
+
+Describes preceding network header configuration.
+
+**Output trigger.**
+
+Describes conditions that trigger transfer to following network header
+
+.. code-block:: json
+
+   {
+      "next_header": { "field_mode": "FIELD_MODE_FIXED", "field_size": 20},
+      "next_protocol": {"field_size": 8, "field_base": 72},
+      "sample_data": [
+         { "field_mode": "FIELD_MODE_FIXED", "field_size": 32, "field_base": 0},
+         { "field_mode": "FIELD_MODE_FIXED", "field_size": 32, "field_base": 32},
+         { "field_mode": "FIELD_MODE_FIXED", "field_size": 32, "field_base": 64},
+         { "field_mode": "FIELD_MODE_FIXED", "field_size": 32, "field_base": 96}
+      ],
+      "input_link": [
+         {"item": "eth type is 0x0800"},
+         {"item": "vlan inner_type is 0x0800"}
+      ],
+      "output_link": [
+         {"item": "udp", "next": 17},
+         {"item": "tcp", "next": 6},
+         {"item": "icmp", "next": 1}
+      ]
+   }
+
+
+Flex pattern and flow rules
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Flex pattern describe parts of network header that will trigger flex flow item hit in a flow rule.
+Flex pattern directly related to flex item samples configuration.
+Flex pattern can be shared between ports.
+
+**Flex pattern and flow rule to match IPv4 version and 20 bytes length**
+
+::
+
+   # set flex_pattern <pattern_id> is <hex bytes sequence>
+   testpmd> flow flex_item pattern 5 is 45FF
+   created pattern #5
+
+   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
+   Flow rule #0 created
+
+**Flex pattern and flow rule to match packets with source address 1.2.3.4**
+
+::
+
+   testpmd> flow flex_item pattern 2 spec 45000000000000000000000001020304 mask FF0000000000000000000000FFFFFFFF
+   created pattern #2
+
+   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
+   Flow rule #0 created