[dpdk-stable] patch 'net/ice: fix memory leak when releasing VSI' has been queued to stable release 19.11.4

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Aug 6 11:53:59 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/08/20. 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.

Thanks.

Luca Boccassi

---
>From 3e0872f373407e8fed3faf060296850e5ae79f5a Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian at huawei.com>
Date: Tue, 28 Jul 2020 21:11:12 +0800
Subject: [PATCH] net/ice: fix memory leak when releasing VSI

[ upstream commit 5d4a54fd1646585adfedb1675e78a513cf194b25 ]

At the end of the vsi release, we should free the 'rss_lut'
and 'rss_key' for the vsi.

Fixes: 50370662b727 ("net/ice: support device and queue ops")

Signed-off-by: Yunjian Wang <wangyunjian at huawei.com>
Acked-by: Qi Zhang <qi.z.zhang at intel.com>
---
 drivers/net/ice/ice_ethdev.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 5166dafd0..34ca161e5 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2288,9 +2288,10 @@ ice_release_vsi(struct ice_vsi *vsi)
 	struct ice_hw *hw;
 	struct ice_vsi_ctx vsi_ctx;
 	enum ice_status ret;
+	int error = 0;
 
 	if (!vsi)
-		return 0;
+		return error;
 
 	hw = ICE_VSI_TO_HW(vsi);
 
@@ -2303,12 +2304,13 @@ ice_release_vsi(struct ice_vsi *vsi)
 	ret = ice_free_vsi(hw, vsi->idx, &vsi_ctx, false, NULL);
 	if (ret != ICE_SUCCESS) {
 		PMD_INIT_LOG(ERR, "Failed to free vsi by aq, %u", vsi->vsi_id);
-		rte_free(vsi);
-		return -1;
+		error = -1;
 	}
 
+	rte_free(vsi->rss_lut);
+	rte_free(vsi->rss_key);
 	rte_free(vsi);
-	return 0;
+	return error;
 }
 
 void
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-08-06 10:53:16.996273736 +0100
+++ 0031-net-ice-fix-memory-leak-when-releasing-VSI.patch	2020-08-06 10:53:15.820597797 +0100
@@ -1,13 +1,14 @@
-From 5d4a54fd1646585adfedb1675e78a513cf194b25 Mon Sep 17 00:00:00 2001
+From 3e0872f373407e8fed3faf060296850e5ae79f5a Mon Sep 17 00:00:00 2001
 From: Yunjian Wang <wangyunjian at huawei.com>
 Date: Tue, 28 Jul 2020 21:11:12 +0800
 Subject: [PATCH] net/ice: fix memory leak when releasing VSI
 
+[ upstream commit 5d4a54fd1646585adfedb1675e78a513cf194b25 ]
+
 At the end of the vsi release, we should free the 'rss_lut'
 and 'rss_key' for the vsi.
 
 Fixes: 50370662b727 ("net/ice: support device and queue ops")
-Cc: stable at dpdk.org
 
 Signed-off-by: Yunjian Wang <wangyunjian at huawei.com>
 Acked-by: Qi Zhang <qi.z.zhang at intel.com>
@@ -16,10 +17,10 @@
  1 file changed, 6 insertions(+), 4 deletions(-)
 
 diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
-index c4c0e638f..a29c9addc 100644
+index 5166dafd0..34ca161e5 100644
 --- a/drivers/net/ice/ice_ethdev.c
 +++ b/drivers/net/ice/ice_ethdev.c
-@@ -2280,9 +2280,10 @@ ice_release_vsi(struct ice_vsi *vsi)
+@@ -2288,9 +2288,10 @@ ice_release_vsi(struct ice_vsi *vsi)
  	struct ice_hw *hw;
  	struct ice_vsi_ctx vsi_ctx;
  	enum ice_status ret;
@@ -31,7 +32,7 @@
  
  	hw = ICE_VSI_TO_HW(vsi);
  
-@@ -2295,12 +2296,13 @@ ice_release_vsi(struct ice_vsi *vsi)
+@@ -2303,12 +2304,13 @@ ice_release_vsi(struct ice_vsi *vsi)
  	ret = ice_free_vsi(hw, vsi->idx, &vsi_ctx, false, NULL);
  	if (ret != ICE_SUCCESS) {
  		PMD_INIT_LOG(ERR, "Failed to free vsi by aq, %u", vsi->vsi_id);


More information about the stable mailing list