Skip to contentSkip to conversation

ice: Add support for inner etype in switchdev

PATCH New Martyna Szapar-Mudlaw 3 participants 3 messages Jan 16, 2022 – Feb 18, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 .../ethernet/intel/ice/ice_protocol_type.h    |   2 +
 drivers/net/ethernet/intel/ice/ice_switch.c   | 272 +++++++++++++++++-
 drivers/net/ethernet/intel/ice/ice_tc_lib.c   |  15 +-
 3 files changed, 277 insertions(+), 12 deletions(-)
drivers/net/ethernet/intel/ice/ice_protocol_type.h +2 -0
index dc1b0e9e6df5..3ca15a64476e 100644
@@ -29,6 +29,7 @@ enum ice_protocol_type {
 	ICE_MAC_OFOS = 0,
 	ICE_MAC_IL,
 	ICE_ETYPE_OL,
+	ICE_ETYPE_IL,
 	ICE_VLAN_OFOS,
 	ICE_IPV4_OFOS,
 	ICE_IPV4_IL,
@@ -91,6 +92,7 @@ enum ice_prot_id {
 #define ICE_MAC_OFOS_HW		1
 #define ICE_MAC_IL_HW		4
 #define ICE_ETYPE_OL_HW		9
+#define ICE_ETYPE_IL_HW		10
 #define ICE_VLAN_OF_HW		16
 #define ICE_VLAN_OL_HW		17
 #define ICE_IPV4_OFOS_HW	32
drivers/net/ethernet/intel/ice/ice_switch.c +265 -7

378 lines not on this page · raw message

drivers/net/ethernet/intel/ice/ice_tc_lib.c +10 -5
index e8aab664270a..d19def5ddb1c 100644
@@ -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)
 		lkups_cnt++;
 
-	/* currently inner etype filter isn't supported */
-	if ((flags & ICE_TC_FLWR_FIELD_ETH_TYPE_ID) &&
-	    fltr->tunnel_type == TNL_LAST)
+	if (flags & ICE_TC_FLWR_FIELD_ETH_TYPE_ID)
 		lkups_cnt++;
 
 	/* are MAC fields specified? */
@@ -64,6 +62,11 @@ static enum ice_protocol_type ice_proto_type_from_mac(bool inner)
 	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)
 {
 	return inner ? ICE_IPV4_IL : ICE_IPV4_OFOS;
@@ -224,8 +227,10 @@ ice_tc_fill_rules(struct ice_hw *hw, u32 flags,
 
 		headers = &tc_fltr->inner_headers;
 		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].m_u.ethertype.ethtype_id = headers->l2_mask.n_proto;
 		i++;
Signature · 1 line
2.31.1
#1 lore raw

PATCH 1/1 ice: Add support for inner etype in switchdev

From: Martyna Szapar-Mudlaw <[email protected]>
Date: Sun, 16 Jan 2022 10:01:43 +0100

Quoted 4 lines

Enable support for adding TC rules that filter on the inner EtherType field of tunneled packet headers.

Quoted 5 lines
---
 .../ethernet/intel/ice/ice_protocol_type.h    |   2 +
 drivers/net/ethernet/intel/ice/ice_switch.c   | 272 +++++++++++++++++-
 drivers/net/ethernet/intel/ice/ice_tc_lib.c   |  15 +-
 3 files changed, 277 insertions(+), 12 deletions(-)

--- 8< ---

Quoted 2 lines
Signature · 1 line
2.31.1

Thanks!
Al

#2 lore raw

PATCH 1/1 ice: Add support for inner etype in switchdev

In reply to Martyna Szapar-Mudlaw
Quoted 4 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Martyna Szapar-Mudlaw
Sent: Sunday, January 16, 2022 2:32 PM

To: [email protected]

Quoted 7 lines

Cc: Szapar-Mudlaw, Martyna <[email protected]>
Subject: [Intel-wired-lan] [PATCH net-next] 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.

Quoted 7 lines

---

.../ethernet/intel/ice/ice_protocol_type.h    |   2 +
drivers/net/ethernet/intel/ice/ice_switch.c   | 272 +++++++++++++++++-
drivers/net/ethernet/intel/ice/ice_tc_lib.c   |  15 +-
3 files changed, 277 insertions(+), 12 deletions(-)