diff options
author | Haiyue Wang <haiyue.wang@intel.com> | 2021-03-09 06:08:12 +0300 |
---|---|---|
committer | Tony Nguyen <anthony.l.nguyen@intel.com> | 2021-03-22 21:32:12 +0300 |
commit | 527691bf0682d7ddcca77fc17dabd2fa090572ff (patch) | |
tree | 100c3122bbaf35c5fcae933cb7ef3e92c9e18a6d /drivers/net/ethernet/intel/iavf/iavf_fdir.h | |
parent | 0dbfbabb840d711d7ea1627d88afd0520f374a90 (diff) | |
download | linux-527691bf0682d7ddcca77fc17dabd2fa090572ff.tar.xz |
iavf: Support IPv4 Flow Director filters
Support the addition and deletion of IPv4 filters.
Supported fields are: src-ip, dst-ip, src-port, dst-port and l4proto
Supported flow-types are: tcp4, udp4, sctp4, ip4, ah4, esp4
Example usage:
ethtool -N ens787f0v0 flow-type tcp4 src-ip 192.168.0.20 \
dst-ip 192.168.0.21 tos 4 src-port 22 dst-port 23 action 8
L2TPv3 over IP with 'Session ID' 17:
ethtool -N ens787f0v0 flow-type ip4 l4proto 115 l4data 17 action 3
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.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/iavf/iavf_fdir.h b/drivers/net/ethernet/intel/iavf/iavf_fdir.h index 4e6494b14016..bce913c2541d 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_fdir.h +++ b/drivers/net/ethernet/intel/iavf/iavf_fdir.h @@ -15,13 +15,53 @@ enum iavf_fdir_fltr_state_t { IAVF_FDIR_FLTR_ACTIVE, /* Filter is active */ }; +enum iavf_fdir_flow_type { + /* NONE - used for undef/error */ + IAVF_FDIR_FLOW_NONE = 0, + IAVF_FDIR_FLOW_IPV4_TCP, + IAVF_FDIR_FLOW_IPV4_UDP, + IAVF_FDIR_FLOW_IPV4_SCTP, + IAVF_FDIR_FLOW_IPV4_AH, + IAVF_FDIR_FLOW_IPV4_ESP, + IAVF_FDIR_FLOW_IPV4_OTHER, + /* MAX - this must be last and add anything new just above it */ + IAVF_FDIR_FLOW_PTYPE_MAX, +}; + +struct iavf_ipv4_addrs { + __be32 src_ip; + __be32 dst_ip; +}; + +struct iavf_fdir_ip { + union { + struct iavf_ipv4_addrs v4_addrs; + }; + __be16 src_port; + __be16 dst_port; + __be32 l4_header; /* first 4 bytes of the layer 4 header */ + __be32 spi; /* security parameter index for AH/ESP */ + union { + u8 tos; + }; + u8 proto; +}; /* bookkeeping of Flow Director filters */ struct iavf_fdir_fltr { enum iavf_fdir_fltr_state_t state; struct list_head list; + enum iavf_fdir_flow_type flow_type; + + struct iavf_fdir_ip ip_data; + struct iavf_fdir_ip ip_mask; + + enum virtchnl_action action; u32 flow_id; + u32 loc; /* Rule location inside the flow table */ + u32 q_index; + struct virtchnl_fdir_add vc_add_msg; }; |