Commit 34a89775 authored by Martyna Szapar-Mudlaw's avatar Martyna Szapar-Mudlaw Committed by Tony Nguyen

ice: Add support for inner etype in switchdev

Enable support for adding TC rules that filter on the inner
EtherType field of tunneled packet headers.
Signed-off-by: default avatarMartyna Szapar-Mudlaw <martyna.szapar-mudlaw@intel.com>
Reviewed-by: default avatarAlexander Lobakin <alexandr.lobakin@intel.com>
Tested-by: default avatarSandeep Penigalapati <sandeep.penigalapati@intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent 7f415828
...@@ -29,6 +29,7 @@ enum ice_protocol_type { ...@@ -29,6 +29,7 @@ enum ice_protocol_type {
ICE_MAC_OFOS = 0, ICE_MAC_OFOS = 0,
ICE_MAC_IL, ICE_MAC_IL,
ICE_ETYPE_OL, ICE_ETYPE_OL,
ICE_ETYPE_IL,
ICE_VLAN_OFOS, ICE_VLAN_OFOS,
ICE_IPV4_OFOS, ICE_IPV4_OFOS,
ICE_IPV4_IL, ICE_IPV4_IL,
...@@ -92,6 +93,7 @@ enum ice_prot_id { ...@@ -92,6 +93,7 @@ enum ice_prot_id {
#define ICE_MAC_OFOS_HW 1 #define ICE_MAC_OFOS_HW 1
#define ICE_MAC_IL_HW 4 #define ICE_MAC_IL_HW 4
#define ICE_ETYPE_OL_HW 9 #define ICE_ETYPE_OL_HW 9
#define ICE_ETYPE_IL_HW 10
#define ICE_VLAN_OF_HW 16 #define ICE_VLAN_OF_HW 16
#define ICE_VLAN_OL_HW 17 #define ICE_VLAN_OL_HW 17
#define ICE_IPV4_OFOS_HW 32 #define ICE_IPV4_OFOS_HW 32
......
This diff is collapsed.
...@@ -33,9 +33,7 @@ ice_tc_count_lkups(u32 flags, struct ice_tc_flower_lyr_2_4_hdrs *headers, ...@@ -33,9 +33,7 @@ ice_tc_count_lkups(u32 flags, struct ice_tc_flower_lyr_2_4_hdrs *headers,
if (flags & ICE_TC_FLWR_FIELD_ENC_DEST_L4_PORT) if (flags & ICE_TC_FLWR_FIELD_ENC_DEST_L4_PORT)
lkups_cnt++; lkups_cnt++;
/* currently inner etype filter isn't supported */ if (flags & ICE_TC_FLWR_FIELD_ETH_TYPE_ID)
if ((flags & ICE_TC_FLWR_FIELD_ETH_TYPE_ID) &&
fltr->tunnel_type == TNL_LAST)
lkups_cnt++; lkups_cnt++;
/* are MAC fields specified? */ /* are MAC fields specified? */
...@@ -64,6 +62,11 @@ static enum ice_protocol_type ice_proto_type_from_mac(bool inner) ...@@ -64,6 +62,11 @@ static enum ice_protocol_type ice_proto_type_from_mac(bool inner)
return inner ? ICE_MAC_IL : ICE_MAC_OFOS; return inner ? ICE_MAC_IL : ICE_MAC_OFOS;
} }
static enum ice_protocol_type ice_proto_type_from_etype(bool inner)
{
return inner ? ICE_ETYPE_IL : ICE_ETYPE_OL;
}
static enum ice_protocol_type ice_proto_type_from_ipv4(bool inner) static enum ice_protocol_type ice_proto_type_from_ipv4(bool inner)
{ {
return inner ? ICE_IPV4_IL : ICE_IPV4_OFOS; return inner ? ICE_IPV4_IL : ICE_IPV4_OFOS;
...@@ -224,8 +227,10 @@ ice_tc_fill_rules(struct ice_hw *hw, u32 flags, ...@@ -224,8 +227,10 @@ ice_tc_fill_rules(struct ice_hw *hw, u32 flags,
headers = &tc_fltr->inner_headers; headers = &tc_fltr->inner_headers;
inner = true; inner = true;
} else if (flags & ICE_TC_FLWR_FIELD_ETH_TYPE_ID) { }
list[i].type = ICE_ETYPE_OL;
if (flags & ICE_TC_FLWR_FIELD_ETH_TYPE_ID) {
list[i].type = ice_proto_type_from_etype(inner);
list[i].h_u.ethertype.ethtype_id = headers->l2_key.n_proto; list[i].h_u.ethertype.ethtype_id = headers->l2_key.n_proto;
list[i].m_u.ethertype.ethtype_id = headers->l2_mask.n_proto; list[i].m_u.ethertype.ethtype_id = headers->l2_mask.n_proto;
i++; i++;
......
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