summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel/iavf/iavf_fdir.h
diff options
context:
space:
mode:
authorHaiyue Wang <haiyue.wang@intel.com>2021-03-09 06:08:15 +0300
committerTony Nguyen <anthony.l.nguyen@intel.com>2021-03-22 21:32:12 +0300
commita6379db818a850d1c1012cffe160cfc14d64cb40 (patch)
tree875b47acd35fa8e15a14605eea605a74ae265f19 /drivers/net/ethernet/intel/iavf/iavf_fdir.h
parenta6ccffaa8da32b6077e37e7d254d519bc071433a (diff)
downloadlinux-a6379db818a850d1c1012cffe160cfc14d64cb40.tar.xz
iavf: Enable flex-bytes support
Flex-bytes allows for packet matching based on an offset and value. This is supported via the ethtool user-def option. The user-def 0xAAAABBBBCCCCDDDD: BBBB is the 2 byte pattern while AAAA corresponds to its offset in the packet. Similarly DDDD is the 2 byte pattern with CCCC being the corresponding offset. The offset ranges from 0x0 to 0x1F7 (up to 504 bytes into the packet). The offset starts from the beginning of the packet. This feature can be used to allow customers to set flow director rules for protocols headers that are beyond standard ones supported by ethtool (e.g. PFCP or GTP-U). Like for matching GTP-U's TEID value 0x10203040: ethtool -N ens787f0v0 flow-type udp4 dst-port 2152 \ user-def 0x002e102000303040 action 13 Signed-off-by: Haiyue Wang <haiyue.wang@intel.com> Tested-by: Chen Bo <BoX.C.Chen@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/iavf/iavf_fdir.h')
-rw-r--r--drivers/net/ethernet/intel/iavf/iavf_fdir.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/iavf/iavf_fdir.h b/drivers/net/ethernet/intel/iavf/iavf_fdir.h
index ad75b89cb207..2439c970b657 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_fdir.h
+++ b/drivers/net/ethernet/intel/iavf/iavf_fdir.h
@@ -35,6 +35,11 @@ enum iavf_fdir_flow_type {
IAVF_FDIR_FLOW_PTYPE_MAX,
};
+struct iavf_flex_word {
+ u16 offset;
+ u16 word;
+};
+
struct iavf_ipv4_addrs {
__be32 src_ip;
__be32 dst_ip;
@@ -64,6 +69,11 @@ struct iavf_fdir_ip {
};
u8 proto;
};
+
+struct iavf_fdir_extra {
+ u32 usr_def[2];
+};
+
/* bookkeeping of Flow Director filters */
struct iavf_fdir_fltr {
enum iavf_fdir_fltr_state_t state;
@@ -77,7 +87,16 @@ struct iavf_fdir_fltr {
struct iavf_fdir_ip ip_data;
struct iavf_fdir_ip ip_mask;
+ struct iavf_fdir_extra ext_data;
+ struct iavf_fdir_extra ext_mask;
+
enum virtchnl_action action;
+
+ /* flex byte filter data */
+ u8 ip_ver; /* used to adjust the flex offset, 4 : IPv4, 6 : IPv6 */
+ u8 flex_cnt;
+ struct iavf_flex_word flex_words[2];
+
u32 flow_id;
u32 loc; /* Rule location inside the flow table */