]> git.droids-corp.org - dpdk.git/commit
net/iavf: enable flow rule with raw pattern
authorJunfeng Guo <junfeng.guo@intel.com>
Mon, 23 May 2022 02:31:36 +0000 (10:31 +0800)
committerQi Zhang <qi.z.zhang@intel.com>
Tue, 24 May 2022 02:53:37 +0000 (04:53 +0200)
commit444a7d096e72125c1e12ba191e238c481d77225b
tree97684d97ac6398a9d38d65743214f282f2867a97
parentbdd7558f5ba2b1f4fe5cae583a2ffdd51568c054
net/iavf: enable flow rule with raw pattern

This patch enabled Protocol Agnostic Flow (raw flow) Offloading Flow
Director (FDIR) in AVF, based on the Parser Library feature and the
existing rte_flow `raw` API.

The input spec and mask of raw pattern are first parsed via the
Parser Library, and then passed to the kernel driver to create the
flow rule.

Similar as ice PMD's implemnentation, each raw flow requires:
1. A byte string of raw target packet bits.
2. A byte string contains mask of target packet.

Here is an example:
FDIR matching ipv4 dst addr with 1.2.3.4 and redirect to queue 3:

flow create 0 ingress pattern raw \
pattern spec \
00000000000000000000000008004500001400004000401000000000000001020304 \
pattern mask \
000000000000000000000000000000000000000000000000000000000000ffffffff \
/ end actions queue index 3 / mark id 3 / end

Note that mask of some key bits (e.g., 0x0800 to indicate ipv4 proto)
is optional in our cases. To avoid redundancy, we just omit the mask
of 0x0800 (with 0xFFFF) in the mask byte string example. The prefix
'0x' for the spec and mask byte (hex) strings are also omitted here.

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
doc/guides/nics/features/iavf.ini
doc/guides/rel_notes/release_22_07.rst
drivers/net/iavf/iavf_fdir.c
drivers/net/iavf/iavf_generic_flow.c
drivers/net/iavf/iavf_generic_flow.h