diff mbox series

[v2,66/70] net/ice/base: add GTP tunnel

Message ID 20220815073206.2917968-67-qi.z.zhang@intel.com (mailing list archive)
State Awaiting Upstream
Delegated to: Qi Zhang
Headers show
Series ice base code update | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Zhang, Qi Z Aug. 15, 2022, 7:32 a.m. UTC
Added GTP tunnel type and also re-order the code to align with
kernel driver.

Signed-off-by: Marcin Szycik <marcin.szycik@intel.com>
Signed-off-by: Michal Swiatkowski <michal.swiatkowski@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/base/ice_flex_type.h     | 10 +++++++---
 drivers/net/ice/base/ice_protocol_type.h |  2 +-
 drivers/net/ice/base/ice_switch.c        |  8 ++++----
 drivers/net/ice/base/ice_switch.h        |  3 +++
 4 files changed, 15 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/ice/base/ice_flex_type.h b/drivers/net/ice/base/ice_flex_type.h
index 070d2aeb1e..988a2db958 100644
--- a/drivers/net/ice/base/ice_flex_type.h
+++ b/drivers/net/ice/base/ice_flex_type.h
@@ -442,8 +442,10 @@  enum ice_tunnel_type {
 	TNL_VXLAN = 0,
 	TNL_GENEVE,
 	TNL_GRETAP,
-	TNL_ECPRI,
 	TNL_GTP,
+	TNL_GTPC,
+	TNL_GTPU,
+	TNL_ECPRI,
 	TNL_LAST = 0xFF,
 	TNL_ALL = 0xFF,
 };
@@ -724,8 +726,10 @@  enum ice_prof_type {
 	ICE_PROF_NON_TUN = 0x1,
 	ICE_PROF_TUN_UDP = 0x2,
 	ICE_PROF_TUN_GRE = 0x4,
-	ICE_PROF_TUN_PPPOE = 0x8,
-	ICE_PROF_TUN_ALL = 0xE,
+	ICE_PROF_TUN_GTPU = 0x8,
+	ICE_PROF_TUN_GTPC = 0x10,
+	ICE_PROF_TUN_PPPOE = 0x20,
+	ICE_PROF_TUN_ALL = 0x3E,
 	ICE_PROF_ALL = 0xFF,
 };
 
diff --git a/drivers/net/ice/base/ice_protocol_type.h b/drivers/net/ice/base/ice_protocol_type.h
index 74107de988..da1f65fb22 100644
--- a/drivers/net/ice/base/ice_protocol_type.h
+++ b/drivers/net/ice/base/ice_protocol_type.h
@@ -45,13 +45,13 @@  enum ice_protocol_type {
 	ICE_VXLAN_GPE,
 	ICE_NVGRE,
 	ICE_GTP,
+	ICE_GTP_NO_PAY,
 	ICE_PPPOE,
 	ICE_PFCP,
 	ICE_L2TPV3,
 	ICE_ESP,
 	ICE_AH,
 	ICE_NAT_T,
-	ICE_GTP_NO_PAY,
 	ICE_VLAN_EX,
 	ICE_VLAN_IN,
 	ICE_FLG_DIR,
diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
index ac045790ad..bb7e76bd29 100644
--- a/drivers/net/ice/base/ice_switch.c
+++ b/drivers/net/ice/base/ice_switch.c
@@ -8556,10 +8556,6 @@  ice_fill_adv_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,
 			len = sizeof(struct ice_udp_tnl_hdr);
 			break;
 
-		case ICE_GTP:
-		case ICE_GTP_NO_PAY:
-			len = sizeof(struct ice_udp_gtp_hdr);
-			break;
 		case ICE_PPPOE:
 			len = sizeof(struct ice_pppoe_hdr);
 			break;
@@ -8575,6 +8571,10 @@  ice_fill_adv_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,
 		case ICE_L2TPV3:
 			len = sizeof(struct ice_l2tpv3_sess_hdr);
 			break;
+		case ICE_GTP:
+		case ICE_GTP_NO_PAY:
+			len = sizeof(struct ice_udp_gtp_hdr);
+			break;
 		default:
 			return ICE_ERR_PARAM;
 		}
diff --git a/drivers/net/ice/base/ice_switch.h b/drivers/net/ice/base/ice_switch.h
index 3c05a1531f..dbad9363c4 100644
--- a/drivers/net/ice/base/ice_switch.h
+++ b/drivers/net/ice/base/ice_switch.h
@@ -28,7 +28,10 @@ 
 #define ICE_PROFID_PPPOE_IPV6_UDP	39
 #define ICE_PROFID_PPPOE_IPV6_OTHER	40
 #define ICE_PROFID_IPV4_GTPC_TEID	41
+#define ICE_PROFID_IPV4_GTPC_NO_TEID		42
 #define ICE_PROFID_IPV4_GTPU_TEID		43
+#define ICE_PROFID_IPV6_GTPC_TEID		44
+#define ICE_PROFID_IPV6_GTPC_NO_TEID		45
 #define ICE_PROFID_IPV6_GTPU_TEID		46
 #define ICE_PROFID_IPV4_GTPU_EH_IPV4_OTHER	47
 #define ICE_PROFID_IPV4_GTPU_IPV4_OTHER		48