Commit 165d80d6 authored by Henry Tieman's avatar Henry Tieman Committed by Jeff Kirsher

ice: Support IPv6 Flow Director filters

Extend supported filters to allow for IPv6 filters.

Supported fields are: src-ip, dst-ip, src-port, and dst-port
Supported flow-types are: tcp6, udp6, sctp6, ip6

Example usage:

ethtool -N eth0 flow-type tcp6 src-port 12 dst-port 13 \
src-ip fce0::1:34 dst-ip fce0::1:35 action 32
Signed-off-by: default avatarHenry Tieman <henry.w.tieman@intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent cac2a27c
This diff is collapsed.
...@@ -80,6 +80,19 @@ struct ice_fdir_v4 { ...@@ -80,6 +80,19 @@ struct ice_fdir_v4 {
u8 proto; u8 proto;
}; };
#define ICE_IPV6_ADDR_LEN_AS_U32 4
struct ice_fdir_v6 {
__be32 dst_ip[ICE_IPV6_ADDR_LEN_AS_U32];
__be32 src_ip[ICE_IPV6_ADDR_LEN_AS_U32];
__be16 dst_port;
__be16 src_port;
__be32 l4_header; /* next header */
__be32 sec_parm_idx; /* security parameter index */
u8 tc;
u8 proto;
};
struct ice_fdir_extra { struct ice_fdir_extra {
u8 dst_mac[ETH_ALEN]; /* dest MAC address */ u8 dst_mac[ETH_ALEN]; /* dest MAC address */
u32 usr_def[2]; /* user data */ u32 usr_def[2]; /* user data */
...@@ -91,8 +104,10 @@ struct ice_fdir_fltr { ...@@ -91,8 +104,10 @@ struct ice_fdir_fltr {
struct list_head fltr_node; struct list_head fltr_node;
enum ice_fltr_ptype flow_type; enum ice_fltr_ptype flow_type;
struct ice_fdir_v4 ip; union {
struct ice_fdir_v4 mask; struct ice_fdir_v4 v4;
struct ice_fdir_v6 v6;
} ip, mask;
struct ice_fdir_extra ext_data; struct ice_fdir_extra ext_data;
struct ice_fdir_extra ext_mask; struct ice_fdir_extra ext_mask;
......
...@@ -3518,6 +3518,12 @@ static const struct ice_fd_src_dst_pair ice_fd_pairs[] = { ...@@ -3518,6 +3518,12 @@ static const struct ice_fd_src_dst_pair ice_fd_pairs[] = {
{ ICE_PROT_IPV4_IL, 2, 12 }, { ICE_PROT_IPV4_IL, 2, 12 },
{ ICE_PROT_IPV4_IL, 2, 16 }, { ICE_PROT_IPV4_IL, 2, 16 },
{ ICE_PROT_IPV6_OF_OR_S, 8, 8 },
{ ICE_PROT_IPV6_OF_OR_S, 8, 24 },
{ ICE_PROT_IPV6_IL, 8, 8 },
{ ICE_PROT_IPV6_IL, 8, 24 },
{ ICE_PROT_TCP_IL, 1, 0 }, { ICE_PROT_TCP_IL, 1, 0 },
{ ICE_PROT_TCP_IL, 1, 2 }, { ICE_PROT_TCP_IL, 1, 2 },
......
...@@ -171,6 +171,10 @@ enum ice_fltr_ptype { ...@@ -171,6 +171,10 @@ enum ice_fltr_ptype {
ICE_FLTR_PTYPE_NONF_IPV4_SCTP, ICE_FLTR_PTYPE_NONF_IPV4_SCTP,
ICE_FLTR_PTYPE_NONF_IPV4_OTHER, ICE_FLTR_PTYPE_NONF_IPV4_OTHER,
ICE_FLTR_PTYPE_FRAG_IPV4, ICE_FLTR_PTYPE_FRAG_IPV4,
ICE_FLTR_PTYPE_NONF_IPV6_UDP,
ICE_FLTR_PTYPE_NONF_IPV6_TCP,
ICE_FLTR_PTYPE_NONF_IPV6_SCTP,
ICE_FLTR_PTYPE_NONF_IPV6_OTHER,
ICE_FLTR_PTYPE_MAX, ICE_FLTR_PTYPE_MAX,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment