[PATCH v5 3/7] net/ice: add L2TPv2 protocol and field definitions

Shaiq Wani
2026-02-12T05:31:51Z

Add L2TPv2 protocol identifier (ICE_PROT_L2TPV2OIP) and session ID
field definition (ICE_L2TPV2OIP_SESSION_ID) to the generic flow header.

Signed-off-by: Shaiq Wani <shaiq.wani@intel.com>
Tested-by: Song Jiale <songx.jiale@intel.com>
---
drivers/net/intel/ice/ice_generic_flow.h | 129 ++++++++++++++++-------
1 file changed, 88 insertions(+), 41 deletions(-)

diff --git a/drivers/net/intel/ice/ice_generic_flow.h b/drivers/net/intel/ice/ice_generic_flow.h
index 54bbb47398..deaf7b66e5 100644
--- a/drivers/net/intel/ice/ice_generic_flow.h
+++ b/drivers/net/intel/ice/ice_generic_flow.h
@@ -9,15 +9,15 @@

/* protocol */

-#define ICE_PROT_MAC BIT_ULL(1)
-#define ICE_PROT_VLAN BIT_ULL(2)
-#define ICE_PROT_IPV4 BIT_ULL(3)
-#define ICE_PROT_IPV6 BIT_ULL(4)
-#define ICE_PROT_TCP BIT_ULL(5)
-#define ICE_PROT_UDP BIT_ULL(6)
-#define ICE_PROT_SCTP BIT_ULL(7)
-#define ICE_PROT_ICMP4 BIT_ULL(8)
-#define ICE_PROT_ICMP6 BIT_ULL(9)
+#define ICE_PROT_MAC_OUTER BIT_ULL(1)
+#define ICE_PROT_VLAN_OUTER BIT_ULL(2)
+#define ICE_PROT_IPV4_OUTER BIT_ULL(3)
+#define ICE_PROT_IPV6_OUTER BIT_ULL(4)
+#define ICE_PROT_TCP_OUTER BIT_ULL(5)
+#define ICE_PROT_UDP_OUTER BIT_ULL(6)
+#define ICE_PROT_SCTP_OUTER BIT_ULL(7)
+#define ICE_PROT_ICMP4_OUTER BIT_ULL(8)
+#define ICE_PROT_ICMP6_OUTER BIT_ULL(9)
#define ICE_PROT_VXLAN BIT_ULL(10)
#define ICE_PROT_NVGRE BIT_ULL(11)
#define ICE_PROT_GTPU BIT_ULL(12)
@@ -27,6 +27,16 @@
#define ICE_PROT_L2TPV3OIP BIT_ULL(16)
#define ICE_PROT_PFCP BIT_ULL(17)
#define ICE_PROT_NAT_T_ESP BIT_ULL(18)
+#define ICE_PROT_L2TPV2OIP BIT_ULL(19)
+#define ICE_PROT_MAC_INNER BIT_ULL(20)
+#define ICE_PROT_VLAN_INNER BIT_ULL(21)
+#define ICE_PROT_IPV4_INNER BIT_ULL(22)
+#define ICE_PROT_IPV6_INNER BIT_ULL(23)
+#define ICE_PROT_TCP_INNER BIT_ULL(24)
+#define ICE_PROT_UDP_INNER BIT_ULL(25)
+#define ICE_PROT_SCTP_INNER BIT_ULL(26)
+#define ICE_PROT_ICMP4_INNER BIT_ULL(27)
+#define ICE_PROT_ICMP6_INNER BIT_ULL(28)

/* field */

@@ -53,8 +63,9 @@
#define ICE_L2TPV3OIP_SESSION_ID BIT_ULL(43)
#define ICE_PFCP_SEID BIT_ULL(42)
#define ICE_PFCP_S_FIELD BIT_ULL(41)
-#define ICE_IP_PK_ID BIT_ULL(40)
+#define ICE_IP_PK_ID BIT_ULL(40)
#define ICE_IP_FRAG_OFS BIT_ULL(39)
+#define ICE_L2TPV2OIP_SESSION_ID BIT_ULL(38)

/* input set */

@@ -62,39 +73,39 @@

#define ICE_INSET_SMAC (ICE_SMAC)
#define ICE_INSET_DMAC (ICE_DMAC)
-#define ICE_INSET_VLAN (ICE_PROT_VLAN)
-#define ICE_INSET_VLAN_INNER (ICE_PROT_VLAN)
-#define ICE_INSET_VLAN_OUTER (ICE_PROT_VLAN)
+#define ICE_INSET_VLAN (ICE_PROT_VLAN_OUTER)
+#define ICE_INSET_VLAN_INNER (ICE_PROT_VLAN_OUTER)
+#define ICE_INSET_VLAN_OUTER (ICE_PROT_VLAN_OUTER)
#define ICE_INSET_ETHERTYPE (ICE_ETHERTYPE)

-#define ICE_INSET_IPV4_SRC (ICE_PROT_IPV4 | ICE_IP_SRC)
-#define ICE_INSET_IPV4_DST (ICE_PROT_IPV4 | ICE_IP_DST)
-#define ICE_INSET_IPV4_TOS (ICE_PROT_IPV4 | ICE_IP_TOS)
-#define ICE_INSET_IPV4_PROTO (ICE_PROT_IPV4 | ICE_IP_PROTO)
-#define ICE_INSET_IPV4_TTL (ICE_PROT_IPV4 | ICE_IP_TTL)
-#define ICE_INSET_IPV4_PKID (ICE_PROT_IPV4 | ICE_IP_PK_ID)
-#define ICE_INSET_IPV4_FRAG_OFS (ICE_PROT_IPV4 | ICE_IP_FRAG_OFS)
-#define ICE_INSET_IPV6_SRC (ICE_PROT_IPV6 | ICE_IP_SRC)
-#define ICE_INSET_IPV6_DST (ICE_PROT_IPV6 | ICE_IP_DST)
-#define ICE_INSET_IPV6_NEXT_HDR (ICE_PROT_IPV6 | ICE_IP_PROTO)
-#define ICE_INSET_IPV6_HOP_LIMIT (ICE_PROT_IPV6 | ICE_IP_TTL)
-#define ICE_INSET_IPV6_TC (ICE_PROT_IPV6 | ICE_IP_TOS)
-#define ICE_INSET_IPV6_PKID (ICE_PROT_IPV6 | ICE_IP_PK_ID)
-
-#define ICE_INSET_TCP_SRC_PORT (ICE_PROT_TCP | ICE_SPORT)
-#define ICE_INSET_TCP_DST_PORT (ICE_PROT_TCP | ICE_DPORT)
-#define ICE_INSET_UDP_SRC_PORT (ICE_PROT_UDP | ICE_SPORT)
-#define ICE_INSET_UDP_DST_PORT (ICE_PROT_UDP | ICE_DPORT)
-#define ICE_INSET_SCTP_SRC_PORT (ICE_PROT_SCTP | ICE_SPORT)
-#define ICE_INSET_SCTP_DST_PORT (ICE_PROT_SCTP | ICE_DPORT)
-#define ICE_INSET_ICMP4_SRC_PORT (ICE_PROT_ICMP4 | ICE_SPORT)
-#define ICE_INSET_ICMP4_DST_PORT (ICE_PROT_ICMP4 | ICE_DPORT)
-#define ICE_INSET_ICMP6_SRC_PORT (ICE_PROT_ICMP6 | ICE_SPORT)
-#define ICE_INSET_ICMP6_DST_PORT (ICE_PROT_ICMP6 | ICE_DPORT)
-#define ICE_INSET_ICMP4_TYPE (ICE_PROT_ICMP4 | ICE_ICMP_TYPE)
-#define ICE_INSET_ICMP4_CODE (ICE_PROT_ICMP4 | ICE_ICMP_CODE)
-#define ICE_INSET_ICMP6_TYPE (ICE_PROT_ICMP6 | ICE_ICMP_TYPE)
-#define ICE_INSET_ICMP6_CODE (ICE_PROT_ICMP6 | ICE_ICMP_CODE)
+#define ICE_INSET_IPV4_SRC (ICE_PROT_IPV4_OUTER | ICE_IP_SRC)
+#define ICE_INSET_IPV4_DST (ICE_PROT_IPV4_OUTER | ICE_IP_DST)
+#define ICE_INSET_IPV4_TOS (ICE_PROT_IPV4_OUTER | ICE_IP_TOS)
+#define ICE_INSET_IPV4_PROTO (ICE_PROT_IPV4_OUTER | ICE_IP_PROTO)
+#define ICE_INSET_IPV4_TTL (ICE_PROT_IPV4_OUTER | ICE_IP_TTL)
+#define ICE_INSET_IPV4_PKID (ICE_PROT_IPV4_OUTER | ICE_IP_PK_ID)
+#define ICE_INSET_IPV4_FRAG_OFS (ICE_PROT_IPV4_OUTER | ICE_IP_FRAG_OFS)
+#define ICE_INSET_IPV6_SRC (ICE_PROT_IPV6_OUTER | ICE_IP_SRC)
+#define ICE_INSET_IPV6_DST (ICE_PROT_IPV6_OUTER | ICE_IP_DST)
+#define ICE_INSET_IPV6_NEXT_HDR (ICE_PROT_IPV6_OUTER | ICE_IP_PROTO)
+#define ICE_INSET_IPV6_HOP_LIMIT (ICE_PROT_IPV6_OUTER | ICE_IP_TTL)
+#define ICE_INSET_IPV6_TC (ICE_PROT_IPV6_OUTER | ICE_IP_TOS)
+#define ICE_INSET_IPV6_PKID (ICE_PROT_IPV6_OUTER | ICE_IP_PK_ID)
+
+#define ICE_INSET_TCP_SRC_PORT (ICE_PROT_TCP_OUTER | ICE_SPORT)
+#define ICE_INSET_TCP_DST_PORT (ICE_PROT_TCP_OUTER | ICE_DPORT)
+#define ICE_INSET_UDP_SRC_PORT (ICE_PROT_UDP_OUTER | ICE_SPORT)
+#define ICE_INSET_UDP_DST_PORT (ICE_PROT_UDP_OUTER | ICE_DPORT)
+#define ICE_INSET_SCTP_SRC_PORT (ICE_PROT_SCTP_OUTER | ICE_SPORT)
+#define ICE_INSET_SCTP_DST_PORT (ICE_PROT_SCTP_OUTER | ICE_DPORT)
+#define ICE_INSET_ICMP4_SRC_PORT (ICE_PROT_ICMP4_OUTER | ICE_SPORT)
+#define ICE_INSET_ICMP4_DST_PORT (ICE_PROT_ICMP4_OUTER | ICE_DPORT)
+#define ICE_INSET_ICMP6_SRC_PORT (ICE_PROT_ICMP6_OUTER | ICE_SPORT)
+#define ICE_INSET_ICMP6_DST_PORT (ICE_PROT_ICMP6_OUTER | ICE_DPORT)
+#define ICE_INSET_ICMP4_TYPE (ICE_PROT_ICMP4_OUTER | ICE_ICMP_TYPE)
+#define ICE_INSET_ICMP4_CODE (ICE_PROT_ICMP4_OUTER | ICE_ICMP_CODE)
+#define ICE_INSET_ICMP6_TYPE (ICE_PROT_ICMP6_OUTER | ICE_ICMP_TYPE)
+#define ICE_INSET_ICMP6_CODE (ICE_PROT_ICMP6_OUTER | ICE_ICMP_CODE)

/* tunnel */

@@ -122,6 +133,24 @@
(ICE_PROT_PFCP | ICE_PFCP_S_FIELD | ICE_PFCP_SEID)
#define ICE_INSET_NAT_T_ESP_SPI \
(ICE_PROT_NAT_T_ESP | ICE_ESP_SPI)
+#define ICE_INSET_L2TPV2OIP_SESSION_ID \
+ (ICE_PROT_L2TPV2OIP | ICE_L2TPV2OIP_SESSION_ID)
+#define ICE_INSET_TUN_IPV4_SRC \
+ (ICE_PROT_IPV4_INNER | ICE_IP_SRC)
+#define ICE_INSET_TUN_IPV4_DST \
+ (ICE_PROT_IPV4_INNER | ICE_IP_DST)
+#define ICE_INSET_TUN_UDP_SRC_PORT \
+ (ICE_PROT_UDP_INNER | ICE_SPORT)
+#define ICE_INSET_TUN_UDP_DST_PORT \
+ (ICE_PROT_UDP_INNER | ICE_DPORT)
+#define ICE_INSET_TUN_TCP_SRC_PORT \
+ (ICE_PROT_TCP_INNER | ICE_SPORT)
+#define ICE_INSET_TUN_TCP_DST_PORT \
+ (ICE_PROT_TCP_INNER | ICE_DPORT)
+#define ICE_INSET_TUN_IPV6_SRC \
+ (ICE_PROT_IPV6_INNER | ICE_IP_SRC)
+#define ICE_INSET_TUN_IPV6_DST \
+ (ICE_PROT_IPV6_INNER | ICE_IP_DST)

/* empty pattern */
extern enum rte_flow_item_type pattern_empty[];
@@ -400,6 +429,24 @@ extern enum rte_flow_item_type pattern_eth_ipv6_udp_ah[];
/* L2TP */
extern enum rte_flow_item_type pattern_eth_ipv4_l2tp[];
extern enum rte_flow_item_type pattern_eth_ipv6_l2tp[];
+extern enum rte_flow_item_type pattern_eth_ipv4_l2tpv2[];
+extern enum rte_flow_item_type pattern_eth_ipv6_l2tpv2[];
+extern enum rte_flow_item_type pattern_eth_ipv4_udp_l2tpv2[];
+extern enum rte_flow_item_type pattern_eth_ipv4_udp_l2tpv2_ppp[];
+extern enum rte_flow_item_type pattern_eth_ipv6_udp_l2tpv2[];
+extern enum rte_flow_item_type pattern_eth_ipv6_udp_l2tpv2_ppp[];
+extern enum rte_flow_item_type pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4[];
+extern enum rte_flow_item_type pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4_udp[];
+extern enum rte_flow_item_type pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4_tcp[];
+extern enum rte_flow_item_type pattern_eth_ipv6_udp_l2tpv2_ppp_ipv4[];
+extern enum rte_flow_item_type pattern_eth_ipv6_udp_l2tpv2_ppp_ipv4_udp[];
+extern enum rte_flow_item_type pattern_eth_ipv6_udp_l2tpv2_ppp_ipv4_tcp[];
+extern enum rte_flow_item_type pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6[];
+extern enum rte_flow_item_type pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6_udp[];
+extern enum rte_flow_item_type pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6_tcp[];
+extern enum rte_flow_item_type pattern_eth_ipv6_udp_l2tpv2_ppp_ipv6[];
+extern enum rte_flow_item_type pattern_eth_ipv6_udp_l2tpv2_ppp_ipv6_udp[];
+extern enum rte_flow_item_type pattern_eth_ipv6_udp_l2tpv2_ppp_ipv6_tcp[];

/* PFCP */
extern enum rte_flow_item_type pattern_eth_ipv4_pfcp[];
--
2.34.1