[PATCH v7 7/7] net/ice: add L2TPv2 RSS hash support

Shaiq Wani
2026-02-19T11:25:33Z

Add RSS (Receive Side Scaling) hash support for L2TPv2 packets.
Add L2TPv2 over UDP support for ice PMD in the release notes.

Signed-off-by: Shaiq Wani <shaiq.wani@intel.com>
Tested-by: Song Jiale <songx.jiale@intel.com>
---
doc/guides/rel_notes/release_26_03.rst | 4 ++++
drivers/net/intel/ice/ice_hash.c | 25 +++++++++++++++++++++++++
2 files changed, 29 insertions(+)

diff --git a/doc/guides/rel_notes/release_26_03.rst b/doc/guides/rel_notes/release_26_03.rst
index b4499ec066..8ae46e78e7 100644
--- a/doc/guides/rel_notes/release_26_03.rst
+++ b/doc/guides/rel_notes/release_26_03.rst
@@ -77,6 +77,10 @@ New Features

* Added support for pre and post VF reset callbacks.

+* **Updated Intel ice driver.**
+
+ * Added rte_flow support for L2TPv2 over UDP.
+
* **Updated Marvell cnxk net driver.**

* Added out-of-place support for CN20K SoC.
diff --git a/drivers/net/intel/ice/ice_hash.c b/drivers/net/intel/ice/ice_hash.c
index afdc8f220a..b20103a452 100644
--- a/drivers/net/intel/ice/ice_hash.c
+++ b/drivers/net/intel/ice/ice_hash.c
@@ -305,6 +305,22 @@ struct ice_rss_hash_cfg eth_ipv4_l2tpv3_tmplt = {
0
};

+struct ice_rss_hash_cfg eth_ipv4_l2tpv2_tmplt = {
+ ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_IPV_OTHER |
+ ICE_FLOW_SEG_HDR_L2TPV2,
+ ICE_FLOW_HASH_L2TPV2_SESS_ID,
+ ICE_RSS_OUTER_HEADERS,
+ 0
+};
+
+struct ice_rss_hash_cfg eth_ipv6_l2tpv2_tmplt = {
+ ICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_IPV_OTHER |
+ ICE_FLOW_SEG_HDR_L2TPV2,
+ ICE_FLOW_HASH_L2TPV2_SESS_ID,
+ ICE_RSS_OUTER_HEADERS,
+ 0
+};
+
struct ice_rss_hash_cfg eth_ipv4_pfcp_tmplt = {
ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_IPV_OTHER |
ICE_FLOW_SEG_HDR_PFCP_SESSION,
@@ -480,6 +496,8 @@ struct ice_rss_hash_cfg eth_tmplt = {
#define ICE_RSS_TYPE_IPV6_AH (RTE_ETH_RSS_AH | RTE_ETH_RSS_IPV6)
#define ICE_RSS_TYPE_IPV4_L2TPV3 (RTE_ETH_RSS_L2TPV3 | RTE_ETH_RSS_IPV4)
#define ICE_RSS_TYPE_IPV6_L2TPV3 (RTE_ETH_RSS_L2TPV3 | RTE_ETH_RSS_IPV6)
+#define ICE_RSS_TYPE_IPV4_L2TPV2 (RTE_ETH_RSS_L2TPV2 | RTE_ETH_RSS_IPV4)
+#define ICE_RSS_TYPE_IPV6_L2TPV2 (RTE_ETH_RSS_L2TPV2 | RTE_ETH_RSS_IPV6)
#define ICE_RSS_TYPE_IPV4_PFCP (RTE_ETH_RSS_PFCP | RTE_ETH_RSS_IPV4)
#define ICE_RSS_TYPE_IPV6_PFCP (RTE_ETH_RSS_PFCP | RTE_ETH_RSS_IPV6)

@@ -522,6 +540,8 @@ static struct ice_pattern_match_item ice_hash_pattern_list[] = {
{pattern_eth_ipv4_udp_esp, ICE_RSS_TYPE_IPV4_ESP, ICE_INSET_NONE, &eth_ipv4_udp_esp_tmplt},
{pattern_eth_ipv4_ah, ICE_RSS_TYPE_IPV4_AH, ICE_INSET_NONE, &eth_ipv4_ah_tmplt},
{pattern_eth_ipv4_l2tp, ICE_RSS_TYPE_IPV4_L2TPV3, ICE_INSET_NONE, &eth_ipv4_l2tpv3_tmplt},
+ {pattern_eth_ipv4_l2tpv2, ICE_RSS_TYPE_IPV4_L2TPV2, ICE_INSET_NONE, &eth_ipv4_l2tpv2_tmplt},
+ {pattern_eth_ipv6_l2tpv2, ICE_RSS_TYPE_IPV6_L2TPV2, ICE_INSET_NONE, &eth_ipv6_l2tpv2_tmplt},
{pattern_eth_ipv4_pfcp, ICE_RSS_TYPE_IPV4_PFCP, ICE_INSET_NONE, &eth_ipv4_pfcp_tmplt},
/* IPV6 */
{pattern_eth_ipv6, ICE_RSS_TYPE_ETH_IPV6, ICE_INSET_NONE, &ipv6_tmplt},
@@ -925,6 +945,11 @@ ice_refine_hash_cfg_l234(struct ice_rss_hash_cfg *hash_cfg,
*hash_flds &= ~ICE_FLOW_HASH_L2TPV3_SESS_ID;
}

+ if (*addl_hdrs & ICE_FLOW_SEG_HDR_L2TPV2) {
+ if (!(rss_type & RTE_ETH_RSS_L2TPV2))
+ *hash_flds &= ~ICE_FLOW_HASH_L2TPV2_SESS_ID;
+ }
+
if (*addl_hdrs & ICE_FLOW_SEG_HDR_ESP) {
if (!(rss_type & RTE_ETH_RSS_ESP))
*hash_flds &= ~ICE_FLOW_HASH_ESP_SPI;
--
2.34.1