patch 'net/ice: remove indirection for FDIR filters' has been queued to stable release 22.11.11

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Oct 27 17:19:25 CET 2025


Hi,

FYI, your patch has been queued to stable release 22.11.11

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 10/29/25. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/b16d67cc79ec48e31b1478e81bd5648b713c50f4

Thanks.

Luca Boccassi

---
>From b16d67cc79ec48e31b1478e81bd5648b713c50f4 Mon Sep 17 00:00:00 2001
From: Anatoly Burakov <anatoly.burakov at intel.com>
Date: Fri, 10 Oct 2025 14:13:19 +0100
Subject: [PATCH] net/ice: remove indirection for FDIR filters

[ upstream commit f1dd6c3fdf974810e9a0d57920a4aa66fa16342e ]

Currently, when filters are created for FDIR, they are allocated
dynamically using `ice_malloc()`. Not only this is inconsistent with hash
filter code paths (hash uses embedded structures), this is also creating
unnecessary indirection and complexity, and creates a memory leak where,
if something fails during raw pattern parse, the profile memory isn't
deallocated.

Since there is no actual reason for why FDIR filter profile must use
indirection, instead of fixing the memory leak just avoid it altogether
by making the filter profile an embedded struct. When parsing begins, the
entire scratch filter structure is zeroed out anyway, so there is no need
to add any additional zero-initialization code.

Fixes: 25be39cc1760 ("net/ice: enable protocol agnostic flow offloading in FDIR")

Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
 drivers/net/ice/ice_ethdev.h      |  2 +-
 drivers/net/ice/ice_fdir_filter.c | 30 +++++++++++-------------------
 2 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h
index 9799cad394..7cee77b898 100644
--- a/drivers/net/ice/ice_ethdev.h
+++ b/drivers/net/ice/ice_ethdev.h
@@ -345,7 +345,7 @@ struct ice_fdir_filter_conf {
 	uint64_t input_set_i; /* only for tunnel inner fields */
 	uint32_t mark_flag;
 
-	struct ice_parser_profile *prof;
+	struct ice_parser_profile prof;
 	bool parser_ena;
 	u8 *pkt_buf;
 	u8 pkt_len;
diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
index 7e97547d8b..8829041c47 100644
--- a/drivers/net/ice/ice_fdir_filter.c
+++ b/drivers/net/ice/ice_fdir_filter.c
@@ -1330,7 +1330,7 @@ ice_fdir_create_filter(struct ice_adapter *ad,
 	if (filter->parser_ena) {
 		struct ice_hw *hw = ICE_PF_TO_HW(pf);
 
-		int id = ice_find_first_bit(filter->prof->ptypes, UINT16_MAX);
+		int id = ice_find_first_bit(filter->prof.ptypes, UINT16_MAX);
 		int ptg = hw->blk[ICE_BLK_FD].xlt1.t[id];
 		u16 ctrl_vsi = pf->fdir.fdir_vsi->idx;
 		u16 main_vsi = pf->main_vsi->idx;
@@ -1340,11 +1340,11 @@ ice_fdir_create_filter(struct ice_adapter *ad,
 		if (pi->fdir_actived_cnt != 0) {
 			for (i = 0; i < ICE_MAX_FV_WORDS; i++)
 				if (pi->prof.fv[i].proto_id !=
-				    filter->prof->fv[i].proto_id ||
+				    filter->prof.fv[i].proto_id ||
 				    pi->prof.fv[i].offset !=
-				    filter->prof->fv[i].offset ||
+				    filter->prof.fv[i].offset ||
 				    pi->prof.fv[i].msk !=
-				    filter->prof->fv[i].msk)
+				    filter->prof.fv[i].msk)
 					break;
 			if (i == ICE_MAX_FV_WORDS) {
 				fv_found = true;
@@ -1354,7 +1354,7 @@ ice_fdir_create_filter(struct ice_adapter *ad,
 
 		if (!fv_found) {
 			ret = ice_flow_set_hw_prof(hw, main_vsi, ctrl_vsi,
-						   filter->prof, ICE_BLK_FD);
+						   &filter->prof, ICE_BLK_FD);
 			if (ret)
 				goto error;
 		}
@@ -1364,12 +1364,12 @@ ice_fdir_create_filter(struct ice_adapter *ad,
 			goto error;
 
 		if (!fv_found) {
-			for (i = 0; i < filter->prof->fv_num; i++) {
+			for (i = 0; i < filter->prof.fv_num; i++) {
 				pi->prof.fv[i].proto_id =
-					filter->prof->fv[i].proto_id;
+					filter->prof.fv[i].proto_id;
 				pi->prof.fv[i].offset =
-					filter->prof->fv[i].offset;
-				pi->prof.fv[i].msk = filter->prof->fv[i].msk;
+					filter->prof.fv[i].offset;
+				pi->prof.fv[i].msk = filter->prof.fv[i].msk;
 			}
 			pi->fdir_actived_cnt = 1;
 		}
@@ -1467,7 +1467,6 @@ free_entry:
 	return -rte_errno;
 
 error:
-	rte_free(filter->prof);
 	rte_free(filter->pkt_buf);
 	return -rte_errno;
 }
@@ -1489,7 +1488,7 @@ ice_fdir_destroy_filter(struct ice_adapter *ad,
 	if (filter->parser_ena) {
 		struct ice_hw *hw = ICE_PF_TO_HW(pf);
 
-		int id = ice_find_first_bit(filter->prof->ptypes, UINT16_MAX);
+		int id = ice_find_first_bit(filter->prof.ptypes, UINT16_MAX);
 		int ptg = hw->blk[ICE_BLK_FD].xlt1.t[id];
 		u16 ctrl_vsi = pf->fdir.fdir_vsi->idx;
 		u16 main_vsi = pf->main_vsi->idx;
@@ -1517,7 +1516,6 @@ ice_fdir_destroy_filter(struct ice_adapter *ad,
 
 		flow->rule = NULL;
 
-		rte_free(filter->prof);
 		rte_free(filter->pkt_buf);
 		rte_free(filter);
 
@@ -1944,13 +1942,8 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 			if (!tmp_mask)
 				return -rte_errno;
 
-			filter->prof = (struct ice_parser_profile *)
-				ice_malloc(&ad->hw, sizeof(*filter->prof));
-			if (!filter->prof)
-				return -ENOMEM;
-
 			if (ice_parser_profile_init(&rslt, tmp_spec, tmp_mask,
-				pkt_len, ICE_BLK_FD, true, filter->prof))
+				pkt_len, ICE_BLK_FD, true, &filter->prof))
 				return -rte_errno;
 
 			u8 *pkt_buf = (u8 *)ice_malloc(&ad->hw, pkt_len + 1);
@@ -2509,7 +2502,6 @@ ice_fdir_parse(struct ice_adapter *ad,
 	rte_free(item);
 	return ret;
 error:
-	rte_free(filter->prof);
 	rte_free(filter->pkt_buf);
 	rte_free(item);
 	return ret;
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-10-27 15:54:36.548631009 +0000
+++ 0047-net-ice-remove-indirection-for-FDIR-filters.patch	2025-10-27 15:54:34.815950051 +0000
@@ -1 +1 @@
-From f1dd6c3fdf974810e9a0d57920a4aa66fa16342e Mon Sep 17 00:00:00 2001
+From b16d67cc79ec48e31b1478e81bd5648b713c50f4 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit f1dd6c3fdf974810e9a0d57920a4aa66fa16342e ]
+
@@ -20 +21,0 @@
-Cc: stable at dpdk.org
@@ -25,2 +26,2 @@
- drivers/net/intel/ice/ice_ethdev.h      |  2 +-
- drivers/net/intel/ice/ice_fdir_filter.c | 30 +++++++++----------------
+ drivers/net/ice/ice_ethdev.h      |  2 +-
+ drivers/net/ice/ice_fdir_filter.c | 30 +++++++++++-------------------
@@ -29,5 +30,5 @@
-diff --git a/drivers/net/intel/ice/ice_ethdev.h b/drivers/net/intel/ice/ice_ethdev.h
-index a0d2082206..6478d6dfbd 100644
---- a/drivers/net/intel/ice/ice_ethdev.h
-+++ b/drivers/net/intel/ice/ice_ethdev.h
-@@ -379,7 +379,7 @@ struct ice_fdir_filter_conf {
+diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h
+index 9799cad394..7cee77b898 100644
+--- a/drivers/net/ice/ice_ethdev.h
++++ b/drivers/net/ice/ice_ethdev.h
+@@ -345,7 +345,7 @@ struct ice_fdir_filter_conf {
@@ -42,5 +43,5 @@
-diff --git a/drivers/net/intel/ice/ice_fdir_filter.c b/drivers/net/intel/ice/ice_fdir_filter.c
-index d41d223d52..d593624792 100644
---- a/drivers/net/intel/ice/ice_fdir_filter.c
-+++ b/drivers/net/intel/ice/ice_fdir_filter.c
-@@ -1314,7 +1314,7 @@ ice_fdir_create_filter(struct ice_adapter *ad,
+diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
+index 7e97547d8b..8829041c47 100644
+--- a/drivers/net/ice/ice_fdir_filter.c
++++ b/drivers/net/ice/ice_fdir_filter.c
+@@ -1330,7 +1330,7 @@ ice_fdir_create_filter(struct ice_adapter *ad,
@@ -55 +56 @@
-@@ -1324,11 +1324,11 @@ ice_fdir_create_filter(struct ice_adapter *ad,
+@@ -1340,11 +1340,11 @@ ice_fdir_create_filter(struct ice_adapter *ad,
@@ -70 +71 @@
-@@ -1338,7 +1338,7 @@ ice_fdir_create_filter(struct ice_adapter *ad,
+@@ -1354,7 +1354,7 @@ ice_fdir_create_filter(struct ice_adapter *ad,
@@ -79 +80 @@
-@@ -1348,12 +1348,12 @@ ice_fdir_create_filter(struct ice_adapter *ad,
+@@ -1364,12 +1364,12 @@ ice_fdir_create_filter(struct ice_adapter *ad,
@@ -96 +97 @@
-@@ -1451,7 +1451,6 @@ free_entry:
+@@ -1467,7 +1467,6 @@ free_entry:
@@ -104 +105 @@
-@@ -1473,7 +1472,7 @@ ice_fdir_destroy_filter(struct ice_adapter *ad,
+@@ -1489,7 +1488,7 @@ ice_fdir_destroy_filter(struct ice_adapter *ad,
@@ -113 +114 @@
-@@ -1501,7 +1500,6 @@ ice_fdir_destroy_filter(struct ice_adapter *ad,
+@@ -1517,7 +1516,6 @@ ice_fdir_destroy_filter(struct ice_adapter *ad,
@@ -121 +122 @@
-@@ -1928,13 +1926,8 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
+@@ -1944,13 +1942,8 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
@@ -136 +137 @@
-@@ -2495,7 +2488,6 @@ ice_fdir_parse(struct ice_adapter *ad,
+@@ -2509,7 +2502,6 @@ ice_fdir_parse(struct ice_adapter *ad,


More information about the stable mailing list