testpmd> show port (port_id) pctype mapping
+show rx offloading capabilities
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+List all per queue and per port Rx offloading capabilities of a port::
+
+ testpmd> show port (port_id) rx_offload capabilities
+
+show rx offloading configuration
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+List port level and all queue level Rx offloading configuration::
+
+ testpmd> show port (port_id) rx_offload configuration
+
+show tx offloading capabilities
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+List all per queue and per port Tx offloading capabilities of a port::
+
+ testpmd> show port (port_id) tx_offload capabilities
+
+show tx offloading configuration
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+List port level and all queue level Tx offloading configuration::
+
+ testpmd> show port (port_id) tx_offload configuration
+
Configuration Functions
-----------------------
testpmd> ptype mapping reset (port_id)
+config per port Rx offloading
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Enable or disable a per port Rx offloading on all Rx queues of a port::
+
+ testpmd> port config (port_id) rx_offload (offloading) on|off
+
+* ``offloading``: can be any of these offloading capability:
+ vlan_strip, ipv4_cksum, udp_cksum, tcp_cksum, tcp_lro,
+ qinq_strip, outer_ipv4_cksum, macsec_strip,
+ header_split, vlan_filter, vlan_extend, jumbo_frame,
+ crc_strip, scatter, timestamp, security
+
+This command should be run when the port is stopped, or else it will fail.
+
+config per queue Rx offloading
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Enable or disable a per queue Rx offloading only on a specific Rx queue::
+
+ testpmd> port (port_id) rxq (queue_id) rx_offload (offloading) on|off
+
+* ``offloading``: can be any of these offloading capability:
+ vlan_strip, ipv4_cksum, udp_cksum, tcp_cksum, tcp_lro,
+ qinq_strip, outer_ipv4_cksum, macsec_strip,
+ header_split, vlan_filter, vlan_extend, jumbo_frame,
+ crc_strip, scatter, timestamp, security
+
+This command should be run when the port is stopped, or else it will fail.
+
+config per port Tx offloading
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Enable or disable a per port Tx offloading on all Tx queues of a port::
+
+ testpmd> port config (port_id) tx_offload (offloading) on|off
+
+* ``offloading``: can be any of these offloading capability:
+ vlan_insert, ipv4_cksum, udp_cksum, udp_cksum,
+ sctp_cksum, tcp_tso, udp_tso, outer_ipv4_cksum,
+ qinq_insert, vxlan_tnl_tso, gre_tnl_tso,
+ ipip_tnl_tso, geneve_tnl_tso, macsec_insert,
+ mt_lockfree, multi_segs, fast_free, security
+
+This command should be run when the port is stopped, or else it will fail.
+
+config per queue Tx offloading
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Enable or disable a per queue Tx offloading only on a specific Tx queue::
+
+ testpmd> port (port_id) txq (queue_id) tx_offload (offloading) on|off
+
+* ``offloading``: can be any of these offloading capability:
+ vlan_insert, ipv4_cksum, udp_cksum, udp_cksum,
+ sctp_cksum, tcp_tso, udp_tso, outer_ipv4_cksum,
+ qinq_insert, vxlan_tnl_tso, gre_tnl_tso,
+ ipip_tnl_tso, geneve_tnl_tso, macsec_insert,
+ mt_lockfree, multi_segs, fast_free, security
+
+This command should be run when the port is stopped, or else it will fail.
+
+
Port Functions
--------------
the port capability set. This function is valid for all nodes of the traffic
management hierarchy except root node.
+Suspend port traffic management hierarchy node
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ testpmd> suspend port tm node (port_id) (node_id)
+
+Resume port traffic management hierarchy node
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ testpmd> resume port tm node (port_id) (node_id)
+
Commit port traffic management hierarchy
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Check whether a flow rule can be created::
flow validate {port_id}
- [group {group_id}] [priority {level}] [ingress] [egress]
+ [group {group_id}] [priority {level}] [ingress] [egress] [transfer]
pattern {item} [/ {item} [...]] / end
actions {action} [/ {action} [...]] / end
- Create a flow rule::
flow create {port_id}
- [group {group_id}] [priority {level}] [ingress] [egress]
+ [group {group_id}] [priority {level}] [ingress] [egress] [transfer]
pattern {item} [/ {item} [...]] / end
actions {action} [/ {action} [...]] / end
bound to ``rte_flow_validate()``::
flow validate {port_id}
- [group {group_id}] [priority {level}] [ingress] [egress]
+ [group {group_id}] [priority {level}] [ingress] [egress] [transfer]
pattern {item} [/ {item} [...]] / end
actions {action} [/ {action} [...]] / end
to ``rte_flow_create()``::
flow create {port_id}
- [group {group_id}] [priority {level}] [ingress] [egress]
+ [group {group_id}] [priority {level}] [ingress] [egress] [transfer]
pattern {item} [/ {item} [...]] / end
actions {action} [/ {action} [...]] / end
Parameters describe in the following order:
-- Attributes (*group*, *priority*, *ingress*, *egress* tokens).
+- Attributes (*group*, *priority*, *ingress*, *egress*, *transfer* tokens).
- A matching pattern, starting with the *pattern* token and terminated by an
*end* pattern item.
- Actions, starting with the *actions* token and terminated by an *end*
- ``priority {level}``: priority level within group.
- ``ingress``: rule applies to ingress traffic.
- ``egress``: rule applies to egress traffic.
+- ``transfer``: apply rule directly to endpoints found in pattern.
Each instance of an attribute specified several times overrides the previous
value as shown below (group 4 is used)::
- ``num {unsigned}``: number of layers covered.
-- ``pf``: match packets addressed to the physical function.
+- ``pf``: match traffic from/to the physical function.
-- ``vf``: match packets addressed to a virtual function ID.
+- ``vf``: match traffic from/to a virtual function ID.
- - ``id {unsigned}``: destination VF ID.
+ - ``id {unsigned}``: VF ID.
-- ``port``: device-specific physical port index to use.
+- ``phy_port``: match traffic from/to a specific physical port.
- ``index {unsigned}``: physical port index.
+- ``port_id``: match traffic from/to a given DPDK port ID.
+
+ - ``id {unsigned}``: DPDK port ID.
+
+- ``mark``: match value set in previously matched flow rule using the mark action.
+
+ - ``id {unsigned}``: arbitrary integer value.
+
- ``raw``: match an arbitrary byte string.
- ``relative {boolean}``: look for pattern after the previous item.
- ``dst {MAC-48}``: destination MAC.
- ``src {MAC-48}``: source MAC.
- - ``type {unsigned}``: EtherType.
+ - ``type {unsigned}``: EtherType or TPID.
- ``vlan``: match 802.1Q/ad VLAN tag.
- - ``tpid {unsigned}``: tag protocol identifier.
- ``tci {unsigned}``: tag control information.
- ``pcp {unsigned}``: priority code point.
- ``dei {unsigned}``: drop eligible indicator.
- ``vid {unsigned}``: VLAN identifier.
+ - ``inner_type {unsigned}``: inner EtherType or TPID.
- ``ipv4``: match IPv4 header.
- ``vni {unsigned}``: virtual network identifier.
- ``protocol {unsigned}``: protocol type.
+- ``vxlan-gpe``: match VXLAN-GPE header.
+
+ - ``vni {unsigned}``: VXLAN-GPE identifier.
+
+- ``arp_eth_ipv4``: match ARP header for Ethernet/IPv4.
+
+ - ``sha {MAC-48}``: sender hardware address.
+ - ``spa {ipv4 address}``: sender IPv4 address.
+ - ``tha {MAC-48}``: target hardware address.
+ - ``tpa {ipv4 address}``: target IPv4 address.
+
+- ``ipv6_ext``: match presence of any IPv6 extension header.
+
+ - ``next_hdr {unsigned}``: next header.
+
+- ``icmp6``: match any ICMPv6 header.
+
+ - ``type {unsigned}``: ICMPv6 type.
+ - ``code {unsigned}``: ICMPv6 code.
+
+- ``icmp6_nd_ns``: match ICMPv6 neighbor discovery solicitation.
+
+ - ``target_addr {ipv6 address}``: target address.
+
+- ``icmp6_nd_na``: match ICMPv6 neighbor discovery advertisement.
+
+ - ``target_addr {ipv6 address}``: target address.
+
+- ``icmp6_nd_opt``: match presence of any ICMPv6 neighbor discovery option.
+
+ - ``type {unsigned}``: ND option type.
+
+- ``icmp6_nd_opt_sla_eth``: match ICMPv6 neighbor discovery source Ethernet
+ link-layer address option.
+
+ - ``sla {MAC-48}``: source Ethernet LLA.
+
+- ``icmp6_nd_opt_sla_eth``: match ICMPv6 neighbor discovery target Ethernet
+ link-layer address option.
+
+ - ``tla {MAC-48}``: target Ethernet LLA.
+
Actions list
^^^^^^^^^^^^
- ``passthru``: let subsequent rule process matched packets.
+- ``jump``: redirect traffic to group on device.
+
+ - ``group {unsigned}``: group to redirect to.
+
- ``mark``: attach 32 bit value to packets.
- ``id {unsigned}``: 32 bit value to return with packets.
- ``func {hash function}``: RSS hash function to apply, allowed tokens are
the same as `set_hash_global_config`_.
+ - ``level {unsigned}``: encapsulation level for ``types``.
+
- ``types [{RSS hash type} [...]] end``: specific RSS hash types, allowed
tokens are the same as `set_hash_input_set`_, except that an empty list
does not disable RSS but instead requests unspecified "best-effort"
- ``queues [{unsigned} [...]] end``: queue indices to use.
-- ``pf``: redirect packets to physical device function.
+- ``pf``: direct traffic to physical function.
-- ``vf``: redirect packets to virtual device function.
+- ``vf``: direct traffic to a virtual function ID.
- ``original {boolean}``: use original VF ID if possible.
- - ``id {unsigned}``: VF ID to redirect packets to.
+ - ``id {unsigned}``: VF ID.
+
+- ``phy_port``: direct packets to physical port index.
+
+ - ``original {boolean}``: use original port index if possible.
+ - ``index {unsigned}``: physical port index.
+
+- ``port_id``: direct matching traffic to a given DPDK port ID.
+
+ - ``original {boolean}``: use original DPDK port ID if possible.
+ - ``id {unsigned}``: DPDK port ID.
+
+- ``of_set_mpls_ttl``: OpenFlow's ``OFPAT_SET_MPLS_TTL``.
+
+ - ``mpls_ttl``: MPLS TTL.
+
+- ``of_dec_mpls_ttl``: OpenFlow's ``OFPAT_DEC_MPLS_TTL``.
+
+- ``of_set_nw_ttl``: OpenFlow's ``OFPAT_SET_NW_TTL``.
+
+ - ``nw_ttl``: IP TTL.
+
+- ``of_dec_nw_ttl``: OpenFlow's ``OFPAT_DEC_NW_TTL``.
+
+- ``of_copy_ttl_out``: OpenFlow's ``OFPAT_COPY_TTL_OUT``.
+
+- ``of_copy_ttl_in``: OpenFlow's ``OFPAT_COPY_TTL_IN``.
+
+- ``of_pop_vlan``: OpenFlow's ``OFPAT_POP_VLAN``.
+
+- ``of_push_vlan``: OpenFlow's ``OFPAT_PUSH_VLAN``.
+
+ - ``ethertype``: Ethertype.
+
+- ``of_set_vlan_vid``: OpenFlow's ``OFPAT_SET_VLAN_VID``.
+
+ - ``vlan_vid``: VLAN id.
+
+- ``of_set_vlan_pcp``: OpenFlow's ``OFPAT_SET_VLAN_PCP``.
+
+ - ``vlan_pcp``: VLAN priority.
+
+- ``of_pop_mpls``: OpenFlow's ``OFPAT_POP_MPLS``.
+
+ - ``ethertype``: Ethertype.
+
+- ``of_push_mpls``: OpenFlow's ``OFPAT_PUSH_MPLS``.
+
+ - ``ethertype``: Ethertype.
Destroying flow rules
~~~~~~~~~~~~~~~~~~~~~
ID Group Prio Attr Rule
0 0 0 i- ETH VLAN VLAN=>VF QUEUE
1 0 0 i- ETH VLAN VLAN=>PF QUEUE
+
+BPF Functions
+--------------
+
+The following sections show functions to load/unload eBPF based filters.
+
+bpf-load
+~~~~~~~~
+
+Load an eBPF program as a callback for partciular RX/TX queue::
+
+ testpmd> bpf-load rx|tx (portid) (queueid) (load-flags) (bpf-prog-filename)
+
+The available load-flags are:
+
+* ``J``: use JIT generated native code, otherwise BPF interpreter will be used.
+
+* ``M``: assume input parameter is a pointer to rte_mbuf, otherwise assume it is a pointer to first segment's data.
+
+* ``-``: none.
+
+.. note::
+
+ You'll need clang v3.7 or above to build bpf program you'd like to load
+
+For example:
+
+.. code-block:: console
+
+ cd test/bpf
+ clang -O2 -target bpf -c t1.c
+
+Then to load (and JIT compile) t1.o at RX queue 0, port 1::
+
+.. code-block:: console
+
+ testpmd> bpf-load rx 1 0 J ./dpdk.org/test/bpf/t1.o
+
+To load (not JITed) t1.o at TX queue 0, port 0::
+
+.. code-block:: console
+
+ testpmd> bpf-load tx 0 0 - ./dpdk.org/test/bpf/t1.o
+
+bpf-unload
+~~~~~~~~~~
+
+Unload previously loaded eBPF program for partciular RX/TX queue::
+
+ testpmd> bpf-unload rx|tx (portid) (queueid)
+
+For example to unload BPF filter from TX queue 0, port 0:
+
+.. code-block:: console
+
+ testpmd> bpf-load tx 0 0 - ./dpdk.org/test/bpf/t1.o