[PATCH 7/7] net/ice: pin outer Ethertype for L2TPv2 flow rules

Shaiq Wani shaiq.wani at intel.com
Mon Apr 27 04:31:15 CEST 2026


L2TPv2 flow rules do not include the outer Ethertype in the input set,
so a rule created for outer IPv6 also matches packets with outer IPv4
(and vice versa). The hardware profile cannot distinguish the two
families because nothing in the match key differentiates them.

Add ICE_INSET_ETHERTYPE to input_set_o and set ext_data.ether_type to
0x0800 or 0x86DD based on the outer L3 item, so the profile includes
the Ethertype field and rejects cross-family mismatches.

Fixes: 733640dae75e ("net/ice: support L2TPv2 flow pattern matching")
Signed-off-by: Shaiq Wani <shaiq.wani at intel.com>
---
 drivers/net/intel/ice/ice_fdir_filter.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/net/intel/ice/ice_fdir_filter.c b/drivers/net/intel/ice/ice_fdir_filter.c
index 5ea74a4a5c..2f843d66b9 100644
--- a/drivers/net/intel/ice/ice_fdir_filter.c
+++ b/drivers/net/intel/ice/ice_fdir_filter.c
@@ -2958,6 +2958,19 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 	    input_set_i == 0 && !ppp_present)
 		tunnel_type = ICE_FDIR_TUNNEL_TYPE_NONE;
 
+	/* Match outer IPv4/IPv6 for L2TPv2 via Ethertype. */
+	if (tunnel_type == ICE_FDIR_TUNNEL_TYPE_L2TPV2) {
+		if (l3 == RTE_FLOW_ITEM_TYPE_IPV4) {
+			input_set_o |= ICE_INSET_ETHERTYPE;
+			filter->input.ext_data.ether_type =
+				rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);
+		} else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6) {
+			input_set_o |= ICE_INSET_ETHERTYPE;
+			filter->input.ext_data.ether_type =
+				rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);
+		}
+	}
+
 	filter->tunnel_type = tunnel_type;
 	filter->input.flow_type = flow_type;
 	filter->input_set_o = input_set_o;
-- 
2.43.0



More information about the dev mailing list