public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: Shaiq Wani <shaiq.wani@intel.com>
To: dev@dpdk.org, bruce.richardson@intel.com, aman.deep.singh@intel.com
Subject: [PATCH v1] net/ice: fix FDIR flow type for tunnel inner items
Date: Mon, 23 Mar 2026 08:24:18 +0530	[thread overview]
Message-ID: <20260323025418.651923-1-shaiq.wani@intel.com> (raw)

The inner_l3/inner_l4 tracking was introduced  to handle L2TPv2 tunnel
inner protocols separately from outer ones. However, the conditions used
to branch into the inner tracking than specifically L2TPv2 tunnels.

This caused VXLAN and GTPU FDIR rules with inner L3/L4 items to fail
because the inner IPv4/IPv6/TCP/UDP/SCTP items no longer updated
flow_type and l3, resulting in stale flow_type values.

Fix by narrowing the inner protocol tracking conditions to only apply
when tunnel_type is ICE_FDIR_TUNNEL_TYPE_L2TPV2.

Fixes: 733640dae75e ("net/ice: support L2TPv2 flow pattern matching")

Signed-off-by: Shaiq Wani <shaiq.wani@intel.com>
---
 drivers/net/intel/ice/ice_fdir_filter.c | 34 ++++++++++++-------------
 1 file changed, 16 insertions(+), 18 deletions(-)

diff --git a/drivers/net/intel/ice/ice_fdir_filter.c b/drivers/net/intel/ice/ice_fdir_filter.c
index 5b27f5a077..3522d77123 100644
--- a/drivers/net/intel/ice/ice_fdir_filter.c
+++ b/drivers/net/intel/ice/ice_fdir_filter.c
@@ -2094,13 +2094,13 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 				   &eth_spec->hdr.ether_type, sizeof(eth_spec->hdr.ether_type));
 			break;
 		case RTE_FLOW_ITEM_TYPE_IPV4:
-			/* Only set flow_type for outer IPv4, track inner L3 for tunnels */
-			if (is_outer || !tunnel_type) {
-				flow_type = ICE_FLTR_PTYPE_NONF_IPV4_OTHER;
-				l3 = RTE_FLOW_ITEM_TYPE_IPV4;
+			if (!is_outer &&
+			    tunnel_type == ICE_FDIR_TUNNEL_TYPE_L2TPV2) {
+				inner_l3 = RTE_FLOW_ITEM_TYPE_IPV4;
 				current_l3 = RTE_FLOW_ITEM_TYPE_IPV4;
 			} else {
-				inner_l3 = RTE_FLOW_ITEM_TYPE_IPV4;
+				flow_type = ICE_FLTR_PTYPE_NONF_IPV4_OTHER;
+				l3 = RTE_FLOW_ITEM_TYPE_IPV4;
 				current_l3 = RTE_FLOW_ITEM_TYPE_IPV4;
 			}
 
@@ -2203,12 +2203,13 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 
 			break;
 		case RTE_FLOW_ITEM_TYPE_IPV6:
-			if (is_outer || !tunnel_type) {
-				flow_type = ICE_FLTR_PTYPE_NONF_IPV6_OTHER;
-				l3 = RTE_FLOW_ITEM_TYPE_IPV6;
+			if (!is_outer &&
+			    tunnel_type == ICE_FDIR_TUNNEL_TYPE_L2TPV2) {
+				inner_l3 = RTE_FLOW_ITEM_TYPE_IPV6;
 				current_l3 = RTE_FLOW_ITEM_TYPE_IPV6;
 			} else {
-				inner_l3 = RTE_FLOW_ITEM_TYPE_IPV6;
+				flow_type = ICE_FLTR_PTYPE_NONF_IPV6_OTHER;
+				l3 = RTE_FLOW_ITEM_TYPE_IPV6;
 				current_l3 = RTE_FLOW_ITEM_TYPE_IPV6;
 			}
 
@@ -2294,11 +2295,10 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 			break;
 
 		case RTE_FLOW_ITEM_TYPE_TCP:
-			if (!is_outer && tunnel_type) {
-				/* For inner TCP in tunnels, track inner_l4 */
+			if (!is_outer &&
+			    tunnel_type == ICE_FDIR_TUNNEL_TYPE_L2TPV2) {
 				inner_l4 = RTE_FLOW_ITEM_TYPE_TCP;
 			} else {
-				/* For outer TCP, update flow_type normally */
 				if (l3 == RTE_FLOW_ITEM_TYPE_IPV4)
 					flow_type = ICE_FLTR_PTYPE_NONF_IPV4_TCP;
 				if (l3 == RTE_FLOW_ITEM_TYPE_IPV6)
@@ -2361,11 +2361,10 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 			}
 			break;
 		case RTE_FLOW_ITEM_TYPE_UDP:
-			if (!is_outer && tunnel_type) {
-				/* For inner UDP in tunnels, track inner_l4 */
+			if (!is_outer &&
+			    tunnel_type == ICE_FDIR_TUNNEL_TYPE_L2TPV2) {
 				inner_l4 = RTE_FLOW_ITEM_TYPE_UDP;
 			} else {
-				/* For outer UDP, update flow_type normally */
 				l4 = RTE_FLOW_ITEM_TYPE_UDP;
 				if (l3 == RTE_FLOW_ITEM_TYPE_IPV4)
 					flow_type = ICE_FLTR_PTYPE_NONF_IPV4_UDP;
@@ -2424,11 +2423,10 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 			}
 			break;
 		case RTE_FLOW_ITEM_TYPE_SCTP:
-			if (!is_outer && tunnel_type) {
-				/* For inner SCTP in tunnels, track inner_l4 */
+			if (!is_outer &&
+			    tunnel_type == ICE_FDIR_TUNNEL_TYPE_L2TPV2) {
 				inner_l4 = RTE_FLOW_ITEM_TYPE_SCTP;
 			} else {
-				/* For outer SCTP, update flow_type normally */
 				if (l3 == RTE_FLOW_ITEM_TYPE_IPV4)
 					flow_type = ICE_FLTR_PTYPE_NONF_IPV4_SCTP;
 				if (l3 == RTE_FLOW_ITEM_TYPE_IPV6)
-- 
2.43.0


             reply	other threads:[~2026-03-23  2:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-23  2:54 Shaiq Wani [this message]
2026-03-25 15:12 ` [PATCH v1] net/ice: fix FDIR flow type for tunnel inner items Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260323025418.651923-1-shaiq.wani@intel.com \
    --to=shaiq.wani@intel.com \
    --cc=aman.deep.singh@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox