DPDK-dev Archive on lore.kernel.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 6/7] net/ice: fix stale profile after L2TPv2 subtype change
Date: Mon, 27 Apr 2026 08:01:14 +0530	[thread overview]
Message-ID: <20260427023115.1225843-7-shaiq.wani@intel.com> (raw)
In-Reply-To: <20260427023115.1225843-1-shaiq.wani@intel.com>

After a rule is destroyed, the HW profile for that ptype persists.
If a new rule with the same ptype but a different L2TPv2 subtype is
created (e.g. data then data_l), the old profile is reused via -EEXIST
with stale field extraction offsets.  Since data and data_l have
session_id at different byte offsets, the NIC matches on the wrong
field and packets with mismatched session_id incorrectly hit the rule.

Remove the HW profile in ice_fdir_destroy_filter when the last
filter for a given ptype is destroyed so the next rule creates a fresh
profile with the correct offsets.

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 | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/net/intel/ice/ice_fdir_filter.c b/drivers/net/intel/ice/ice_fdir_filter.c
index 0531208066..5ea74a4a5c 100644
--- a/drivers/net/intel/ice/ice_fdir_filter.c
+++ b/drivers/net/intel/ice/ice_fdir_filter.c
@@ -1777,6 +1777,17 @@ ice_fdir_destroy_filter(struct ice_adapter *ad,
 
 	ice_fdir_cnt_update(pf, filter->input.flow_type, is_tun, false);
 
+	/* Remove the FDIR HW profile when no filters of this ptype
+	 * remain.  The profile encodes field extraction offsets that
+	 * vary between L2TPv2 subtypes (e.g. data vs data_l).  If the
+	 * profile is not removed, a subsequent rule with a different
+	 * subtype but the same ptype reuses the stale profile via
+	 * -EEXIST and the NIC extracts session_id from the wrong
+	 * offset, causing mismatched packets to hit the rule.
+	 */
+	if (pf->fdir_fltr_cnt[filter->input.flow_type][is_tun] == 0)
+		ice_fdir_prof_rm(pf, filter->input.flow_type, is_tun);
+
 	if (filter->mark_flag == 1)
 		ice_fdir_rx_parsing_enable(ad, 0);
 
-- 
2.43.0


  parent reply	other threads:[~2026-04-27  2:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-27  2:31 [PATCH 0/7] net/ice: L2TPv2 flow rule fixes Shaiq Wani
2026-04-27  2:31 ` [PATCH 1/7] net/ice: use granular PTYPEs for L2TPv2 PPP Shaiq Wani
2026-04-27  2:31 ` [PATCH 2/7] net/ice: add tunnel inset bits to flow input set map Shaiq Wani
2026-04-27  2:31 ` [PATCH 3/7] net/ice: fix L2TPv2 inner segment header setup Shaiq Wani
2026-04-27  2:31 ` [PATCH 4/7] net/ice: fix bare L2TPv2 flow rule deletion Shaiq Wani
2026-04-27  2:31 ` [PATCH 5/7] net/ice: fix GTP-U failure due to wrong tunnel profile Shaiq Wani
2026-04-27  2:31 ` Shaiq Wani [this message]
2026-04-27  2:31 ` [PATCH 7/7] net/ice: pin outer Ethertype for L2TPv2 flow rules Shaiq Wani
2026-04-27  9:13   ` 回复: " Jiale, SongX

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=20260427023115.1225843-7-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