Hardware flow rules¶
Overview¶
This guide describes how to enable and configure the hardware-flow.
This feature is currently limited on e810 Intel NIC and only support a subset of the rules capabilities.
Supported platforms¶
This feature is only available on products based on DPDK. It requires a specific PMD which is
available for the following PMDs: ice
, iavf
.
API¶
The API is based on DPDK rte-flow API which describe the matching packet header by header (aka pattern) and apply actions on it.
Usage¶
Adding a flow:
fp-cli> dpdk-port-flow add <poort> patterns <item> [ / <items> …] / end actions <action> [ / <action> …] / end
Example:
fp-cli> dpdk-port-flow 0 add patterns eth / ipv4 spec src 192.168.1.2 / udp spec sport 10 / end
action rss / end
Removing the flow:
The same command line must be provide and will be use as a template to match the applied flow.
By using the same example:
fp-cli> dpdk-port-flow 0 del patterns eth / ipv4 spec src 192.168.1.2 / udp spec sport 10 / end
action rss / end
The list of flows can be displayed in both format, txt or json by using the following command:
fp-cli> dpdk-port-flow 0 show
fp-cli> dpdk-port-flow 0 show json
Items¶
This list is an exhaustive list of the Item supported by the fp-cli.
Ethernet¶
eth [spec [<src <addr>] [<dst <addr>] [type <type>]] [mask [src <addr>] [<dst <addr>] [type <type>]]
spec […]: Specify a field value to match, if its equivalent field in mask is 0, the field is ignored. The exact matching result being match = spec & mask.
mask […]: Specify which bits in the spec field to keep, any bit at 0 is ignored in the matching (can be 0 or 1).
src: Ethernet source address to match in the header.
dst: Ethernet destination to match in the header.
type: Ethernet type to match in the header.
VLAN¶
vlan [spec id <vlanid> mask id <vlanid>]
spec […]: Specify a field value to match, if its equivalent field in mask is 0, the field is ignored. The exact matching result being match = spec & mask.
mask […]: Specify which bits in the spec field to keep, any bit at 0 is ignored in the matching (can be 0 or 1).
id: VLAN identifier.
IPv4¶
ipv4 [spec [src <ip-src>] [dst <ip-dst>]] [mask [src <ip-src>] [dst <ip-dst>]]
spec […]: Specify a field value to match, if its equivalent field in mask is 0, the field is ignored. The exact matching result being match = spec & mask.
mask […]: Specify which bits in the spec field to keep, any bit at 0 is ignored in the matching (can be 0 or 1).
src: IPv4 source address to match in the header.
dst: IPV4 destination to match in the header.
IPv6¶
ipv6 [spec [src <ip-src>] [dst <ip-dst>]] [mask [src <ip-src>] [dst <ip-dst>]]
spec […]: Specify a field value to match, if its equivalent field in mask is 0, the field is ignored. The exact matching result being match = spec & mask.
mask […]: Specify which bits in the spec field to keep, any bit at 0 is ignored in the matching (can be 0 or 1).
src: IPv6 source address to match in the header.
dst: IPV6 destination to match in the header.
UDP¶
udp [spec [sport <src-port>] [dport <dst-port>]] [mask [sport <src-port>] [dport <dst-port>]]
spec […]: Specify a field value to match, if its equivalent field in mask is 0, the field is ignored. The exact matching result being match = spec & mask.
mask […]: Specify which bits in the spec field to keep, any bit at 0 is ignored in the matching (can be 0 or 1).
sport: source port to match in the header.
dport: destination port to match in the header.
TCP¶
tcp [spec [sport <src-port>] [dport <dst-port>]] [mask [sport <src-port>] [dport <dst-port>]]
spec […]: Specify a field value to match, if its equivalent field in mask is 0, the field is ignored. The exact matching result being match = spec & mask.
mask […]: Specify which bits in the spec field to keep, any bit at 0 is ignored in the matching (can be 0 or 1).
sport: source port to match in the header.
dport: destination port to match in the header.
GTP-U¶
gtpu [spec [version <version> pt <pt> f-eh <f-eh> f-sn <f-sn> f-npdu <f-npdu> msg-type
<msg-type> msg-len <msg-len> teid <teid>]] [mask [version <version> pt <pt> f-eh <f-eh>
f-sn <f-sn> f-npdu <f-npdu> msg-type <msg-type> msg-len <msg-len> teid <teid>]]
spec […]: Specify a field value to match, if its equivalent field in mask is 0, the field is ignored. The exact matching result being match = spec & mask.
mask […]: Specify which bits in the spec field to keep, any bit at 0 is ignored in the matching (can be 0 or 1).
version: version to match in GTP header.
pt: Protocol Type to match in GTP header.
f-eh: Flag extended header.
f-sn: Flag Sequence Number
f-npdu: Flag N-PDU.
msg-type: Message type.
msg-len: Message length.
teid: Tunnel Endpoint Identifier.
GTP-PSC¶
gtp-psc [spec pdu-type <pdu-type>] [mask pdu-type <pdu-type>]
spec […]: Specify a field value to match, if its equivalent field in mask is 0, the field is ignored. The exact matching result being match = spec & mask.
mask […]: Specify which bits in the spec field to keep, any bit at 0 is ignored in the matching (can be 0 or 1).
pdu-type: PDU type.
GRE¶
gre [spec protocol <type>] [mask [protocol <type>]
spec […]: Specify a field value to match, if its equivalent field in mask is 0, the field is ignored. The exact matching result being match = spec & mask.
mask […]: Specify which bits in the spec field to keep, any bit at 0 is ignored in the matching (can be 0 or 1).
protocol: GRE protocol.
SCTP¶
sctp [spec [sport <src-port>] [dport <dst-port>]] [mask [sport <src-port>] [dport <dst-port>]]
spec […]: Specify a field value to match, if its equivalent field in mask is 0, the field is ignored. The exact matching result being match = spec & mask.
mask […]: Specify which bits in the spec field to keep, any bit at 0 is ignored in the matching (can be 0 or 1).
sport: source port to match in the header.
dport: destination port to match in the header.
ICMP¶
icmp: [spec [type <type>] [code <code>]] [mask [type <type>] [code <code>]]
spec […]: Specify a field value to match, if its equivalent field in mask is 0, the field is ignored. The exact matching result being match = spec & mask.
mask […]: Specify which bits in the spec field to keep, any bit at 0 is ignored in the matching (can be 0 or 1).
type: ICMP type to match in the header.
code: ICMP code match in the header.
ICMPv6¶
icmp6 [spec [type <type>] [code <code>]] [mask [type <type>] [code <code>]]
spec […]: Specify a field value to match, if its equivalent field in mask is 0, the field is ignored. The exact matching result being match = spec & mask.
mask […]: Specify which bits in the spec field to keep, any bit at 0 is ignored in the matching (can be 0 or 1).
type: ICMP type to match in the header.
code: ICMP code match in the header.
Actions¶
RSS¶
rss types <types[, type[,...]]>
- type: List of possible RSS fields to hash on.
DPDK 19.11: geneve, ip, ipv4, ipv4-frag, ipv4-other, ipv4-sctp, ipv4-tcp, ipv4-udp, ipv6, ipv6-ex, ipv6-frag, ipv6-other, ipv6-sctp, ipv6-tcp, ipv6-tcp-ex, ipv6-udp, ipv6-udp-ex, l2-payload, l3-dst-only, l3-src-only, l4-dst-only, l4-src-only, nvgre, port, sctp, tcp, tunnel, udp, vxlan.
DPDK 20.11 additional hash type: ah, c-vlan, esp, eth, gtpu, l2-dst-only, l2-src-only, l2tpv3, l3-pre32, l3-pre40, l3-pre48, l3-pre56, l3-pre64, l3-pre96, pfcp, pppoe, s-vlan, vlan.