patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH v1 02/12] net/ice/base: fix adding special words
       [not found] <cover.1756833701.git.anatoly.burakov@intel.com>
@ 2025-09-02 17:26 ` Anatoly Burakov
  2025-09-05 15:06   ` Bruce Richardson
  2025-09-02 17:26 ` [PATCH v1 03/12] net/ice/base: fix memory leak in HW profile handling Anatoly Burakov
  2025-09-02 17:26 ` [PATCH v1 04/12] net/ice/base: fix memory leak in recipe handling Anatoly Burakov
  2 siblings, 1 reply; 6+ messages in thread
From: Anatoly Burakov @ 2025-09-02 17:26 UTC (permalink / raw)
  To: dev, Bruce Richardson, Wojciech Drewek, Qi Zhang,
	Sergey Temerkhanov, Dan Nowlin, Qiming Yang
  Cc: stable

From: Shaiq Wani <shaiq.wani@intel.com>

The function ice_add_special_words() is meant to add special words (such
as traffic direction) to the rule. The function that
interprets/translates these additional words is ice_get_sw_fv_list().

However, the ice_get_sw_fv_list() is called *before*
ice_add_special_words(), so the "special" words weren't added at that
point yet, hence they're not translated. This results in the driver
ignoring whatever special words that were added. The fix is to call
ice_get_sw_fv_list() *after* ice_add_special_words().

Fixes: ed3066a3b1b0 ("net/ice/base: refactor DDP code")
Cc: stable@dpdk.org

Signed-off-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Signed-off-by: Shaiq Wani <shaiq.wani@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/intel/ice/base/ice_switch.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/intel/ice/base/ice_switch.c b/drivers/net/intel/ice/base/ice_switch.c
index 54cc2e1c07..f16bec044c 100644
--- a/drivers/net/intel/ice/base/ice_switch.c
+++ b/drivers/net/intel/ice/base/ice_switch.c
@@ -8287,10 +8287,6 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
 	 */
 	ice_get_compat_fv_bitmap(hw, rinfo, fv_bitmap);
 
-	status = ice_get_sw_fv_list(hw, lkup_exts, fv_bitmap, &rm->fv_list);
-	if (status)
-		goto err_unroll;
-
 	/* Create any special protocol/offset pairs, such as looking at tunnel
 	 * bits by extracting metadata
 	 */
@@ -8298,6 +8294,10 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
 	if (status)
 		goto err_free_lkup_exts;
 
+	status = ice_get_sw_fv_list(hw, lkup_exts, fv_bitmap, &rm->fv_list);
+	if (status)
+		goto err_unroll;
+
 	/* Group match words into recipes using preferred recipe grouping
 	 * criteria.
 	 */
-- 
2.47.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v1 03/12] net/ice/base: fix memory leak in HW profile handling
       [not found] <cover.1756833701.git.anatoly.burakov@intel.com>
  2025-09-02 17:26 ` [PATCH v1 02/12] net/ice/base: fix adding special words Anatoly Burakov
@ 2025-09-02 17:26 ` Anatoly Burakov
  2025-09-05 15:08   ` Bruce Richardson
  2025-09-02 17:26 ` [PATCH v1 04/12] net/ice/base: fix memory leak in recipe handling Anatoly Burakov
  2 siblings, 1 reply; 6+ messages in thread
From: Anatoly Burakov @ 2025-09-02 17:26 UTC (permalink / raw)
  To: dev, Bruce Richardson, Qi Zhang, Junfeng Guo; +Cc: stable

From: Jacob Keller <jacob.e.keller@intel.com>

The ice_flow_set_hw_prof() function allocates a params structure with
ice_malloc. It uses this structure to hold some data temporarily while
processing the hardware profile to set.

Static analysis indicated that this memory is not released. Fix this
function to free the memory upon exit.

Fixes: 8ebb93942b2c ("net/ice/base: add function to set HW profile for raw flow")
Cc: stable@dpdk.org

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/intel/ice/base/ice_flow.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/net/intel/ice/base/ice_flow.c b/drivers/net/intel/ice/base/ice_flow.c
index cdc9ee26c5..7b0ecd54df 100644
--- a/drivers/net/intel/ice/base/ice_flow.c
+++ b/drivers/net/intel/ice/base/ice_flow.c
@@ -2632,10 +2632,6 @@ ice_flow_set_hw_prof(struct ice_hw *hw, u16 dest_vsi_handle,
 
 	status = ice_flow_assoc_hw_prof(hw, blk, dest_vsi_handle,
 					fdir_vsi_handle, id);
-	if (status)
-		goto free_params;
-
-	return 0;
 
 free_params:
 	ice_free(hw, params);
-- 
2.47.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v1 04/12] net/ice/base: fix memory leak in recipe handling
       [not found] <cover.1756833701.git.anatoly.burakov@intel.com>
  2025-09-02 17:26 ` [PATCH v1 02/12] net/ice/base: fix adding special words Anatoly Burakov
  2025-09-02 17:26 ` [PATCH v1 03/12] net/ice/base: fix memory leak in HW profile handling Anatoly Burakov
@ 2025-09-02 17:26 ` Anatoly Burakov
  2025-09-05 15:10   ` Bruce Richardson
  2 siblings, 1 reply; 6+ messages in thread
From: Anatoly Burakov @ 2025-09-02 17:26 UTC (permalink / raw)
  To: dev, Bruce Richardson, Grishma Kotecha, Leyi Rong, Qi Zhang,
	Paul M Stillwell Jr
  Cc: stable

From: Pandi Kumar Maharajan <pandi.maharajan@intel.com>

Advanced filter operations (apply/remove GENEVE/VXLAN filters) trigger
the call chain: ice_add_adv_rule()/ice_rem_adv_rule() -> ice_find_recp()
-> ice_get_recp_frm_fw(). Each call to ice_get_recp_frm_fw() creates new
linked list entries for SW recipe tracking without cleaning up previous
entries for the same recipe ID. The linked list then continuously grows
with each filter add/remove operation, leading to excessive heap usage
over time.

Fix the memory leak by adding logic to remove the duplicate entries
before adding new ones for the same recipe ID.

Fixes: fed0c5ca5f19 ("net/ice/base: support programming a new switch recipe")
Cc: stable@dpdk.org

Signed-off-by: Pandi Kumar Maharajan <pandi.maharajan@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/intel/ice/base/ice_switch.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/intel/ice/base/ice_switch.c b/drivers/net/intel/ice/base/ice_switch.c
index f16bec044c..628473f100 100644
--- a/drivers/net/intel/ice/base/ice_switch.c
+++ b/drivers/net/intel/ice/base/ice_switch.c
@@ -2435,6 +2435,7 @@ ice_get_recp_frm_fw(struct ice_hw *hw, struct ice_sw_recipe *recps, u8 rid,
 		    bool *refresh_required)
 {
 	ice_declare_bitmap(result_bm, ICE_MAX_FV_WORDS);
+	struct ice_recp_grp_entry *rg, *tmprg_entry;
 	struct ice_aqc_recipe_data_elem *tmp;
 	u16 num_recps = ICE_MAX_NUM_RECIPES;
 	struct ice_prot_lkup_ext *lkup_exts;
@@ -2481,6 +2482,15 @@ ice_get_recp_frm_fw(struct ice_hw *hw, struct ice_sw_recipe *recps, u8 rid,
 	 */
 	lkup_exts = &recps[rid].lkup_exts;
 
+	/* Remove duplicate entries */
+	LIST_FOR_EACH_ENTRY_SAFE(rg, tmprg_entry, &recps[rid].rg_list,
+	                         ice_recp_grp_entry, l_entry) {
+		if (rg->rid == rid) {
+			LIST_DEL(&rg->l_entry);
+			ice_free(hw, rg);
+		}
+	}
+
 	for (sub_recps = 0; sub_recps < num_recps; sub_recps++) {
 		struct ice_aqc_recipe_data_elem root_bufs = tmp[sub_recps];
 		struct ice_recp_grp_entry *rg_entry;
-- 
2.47.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1 02/12] net/ice/base: fix adding special words
  2025-09-02 17:26 ` [PATCH v1 02/12] net/ice/base: fix adding special words Anatoly Burakov
@ 2025-09-05 15:06   ` Bruce Richardson
  0 siblings, 0 replies; 6+ messages in thread
From: Bruce Richardson @ 2025-09-05 15:06 UTC (permalink / raw)
  To: Anatoly Burakov
  Cc: dev, Wojciech Drewek, Qi Zhang, Sergey Temerkhanov, Dan Nowlin,
	Qiming Yang, stable

On Tue, Sep 02, 2025 at 06:26:52PM +0100, Anatoly Burakov wrote:
> From: Shaiq Wani <shaiq.wani@intel.com>
> 
> The function ice_add_special_words() is meant to add special words (such
> as traffic direction) to the rule. The function that
> interprets/translates these additional words is ice_get_sw_fv_list().
> 
> However, the ice_get_sw_fv_list() is called *before*
> ice_add_special_words(), so the "special" words weren't added at that
> point yet, hence they're not translated. This results in the driver
> ignoring whatever special words that were added. The fix is to call
> ice_get_sw_fv_list() *after* ice_add_special_words().
> 
> Fixes: ed3066a3b1b0 ("net/ice/base: refactor DDP code")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
> Signed-off-by: Shaiq Wani <shaiq.wani@intel.com>
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
>  drivers/net/intel/ice/base/ice_switch.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1 03/12] net/ice/base: fix memory leak in HW profile handling
  2025-09-02 17:26 ` [PATCH v1 03/12] net/ice/base: fix memory leak in HW profile handling Anatoly Burakov
@ 2025-09-05 15:08   ` Bruce Richardson
  0 siblings, 0 replies; 6+ messages in thread
From: Bruce Richardson @ 2025-09-05 15:08 UTC (permalink / raw)
  To: Anatoly Burakov; +Cc: dev, Qi Zhang, Junfeng Guo, stable

On Tue, Sep 02, 2025 at 06:26:53PM +0100, Anatoly Burakov wrote:
> From: Jacob Keller <jacob.e.keller@intel.com>
> 
> The ice_flow_set_hw_prof() function allocates a params structure with
> ice_malloc. It uses this structure to hold some data temporarily while
> processing the hardware profile to set.
> 
> Static analysis indicated that this memory is not released. Fix this
> function to free the memory upon exit.
> 
> Fixes: 8ebb93942b2c ("net/ice/base: add function to set HW profile for raw flow")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
>  drivers/net/intel/ice/base/ice_flow.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1 04/12] net/ice/base: fix memory leak in recipe handling
  2025-09-02 17:26 ` [PATCH v1 04/12] net/ice/base: fix memory leak in recipe handling Anatoly Burakov
@ 2025-09-05 15:10   ` Bruce Richardson
  0 siblings, 0 replies; 6+ messages in thread
From: Bruce Richardson @ 2025-09-05 15:10 UTC (permalink / raw)
  To: Anatoly Burakov
  Cc: dev, Grishma Kotecha, Leyi Rong, Qi Zhang, Paul M Stillwell Jr, stable

On Tue, Sep 02, 2025 at 06:26:54PM +0100, Anatoly Burakov wrote:
> From: Pandi Kumar Maharajan <pandi.maharajan@intel.com>
> 
> Advanced filter operations (apply/remove GENEVE/VXLAN filters) trigger
> the call chain: ice_add_adv_rule()/ice_rem_adv_rule() -> ice_find_recp()
> -> ice_get_recp_frm_fw(). Each call to ice_get_recp_frm_fw() creates new
> linked list entries for SW recipe tracking without cleaning up previous
> entries for the same recipe ID. The linked list then continuously grows
> with each filter add/remove operation, leading to excessive heap usage
> over time.
> 
> Fix the memory leak by adding logic to remove the duplicate entries
> before adding new ones for the same recipe ID.
> 
> Fixes: fed0c5ca5f19 ("net/ice/base: support programming a new switch recipe")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Pandi Kumar Maharajan <pandi.maharajan@intel.com>
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-09-05 15:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <cover.1756833701.git.anatoly.burakov@intel.com>
2025-09-02 17:26 ` [PATCH v1 02/12] net/ice/base: fix adding special words Anatoly Burakov
2025-09-05 15:06   ` Bruce Richardson
2025-09-02 17:26 ` [PATCH v1 03/12] net/ice/base: fix memory leak in HW profile handling Anatoly Burakov
2025-09-05 15:08   ` Bruce Richardson
2025-09-02 17:26 ` [PATCH v1 04/12] net/ice/base: fix memory leak in recipe handling Anatoly Burakov
2025-09-05 15:10   ` Bruce Richardson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).