[dpdk-stable] patch 'net/netvsc: fix Tx queue leak in error path' has been queued to LTS release 18.11.11

Kevin Traynor ktraynor at redhat.com
Wed Nov 18 17:34:55 CET 2020


Hi,

FYI, your patch has been queued to LTS release 18.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 11/24/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.

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

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/3e74baf061d8f906e13295c0f7c11dc6133c3ef2

Thanks.

Kevin.

---
>From 3e74baf061d8f906e13295c0f7c11dc6133c3ef2 Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian at huawei.com>
Date: Wed, 7 Oct 2020 10:06:25 +0800
Subject: [PATCH] net/netvsc: fix Tx queue leak in error path

[ upstream commit f3013acfc17b8920b97223421976f3b3bb32489a ]

In hn_dev_tx_queue_setup() allocated memory for txq, we don't free it
when error happens and it will lead to memory leak.

We can check for tx_free_thresh at the beginning of the function to
fix it, before calling txq = rte_zmalloc_socket().

Fixes: cc0251813277 ("net/netvsc: split send buffers from Tx descriptors")

Signed-off-by: Yunjian Wang <wangyunjian at huawei.com>
Acked-by: Long Li <longli at microsoft.com>
---
 drivers/net/netvsc/hn_rxtx.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c
index a70bac53d3..63b0f83f3a 100644
--- a/drivers/net/netvsc/hn_rxtx.c
+++ b/drivers/net/netvsc/hn_rxtx.c
@@ -253,14 +253,4 @@ hn_dev_tx_queue_setup(struct rte_eth_dev *dev,
 	PMD_INIT_FUNC_TRACE();
 
-	txq = rte_zmalloc_socket("HN_TXQ", sizeof(*txq), RTE_CACHE_LINE_SIZE,
-				 socket_id);
-	if (!txq)
-		return -ENOMEM;
-
-	txq->hv = hv;
-	txq->chan = hv->channels[queue_idx];
-	txq->port_id = dev->data->port_id;
-	txq->queue_id = queue_idx;
-
 	tx_free_thresh = tx_conf->tx_free_thresh;
 	if (tx_free_thresh == 0)
@@ -277,4 +267,13 @@ hn_dev_tx_queue_setup(struct rte_eth_dev *dev,
 	}
 
+	txq = rte_zmalloc_socket("HN_TXQ", sizeof(*txq), RTE_CACHE_LINE_SIZE,
+				 socket_id);
+	if (!txq)
+		return -ENOMEM;
+
+	txq->hv = hv;
+	txq->chan = hv->channels[queue_idx];
+	txq->port_id = dev->data->port_id;
+	txq->queue_id = queue_idx;
 	txq->free_thresh = tx_free_thresh;
 
-- 
2.26.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-11-18 16:33:38.158466889 +0000
+++ 0009-net-netvsc-fix-Tx-queue-leak-in-error-path.patch	2020-11-18 16:33:37.907215048 +0000
@@ -1 +1 @@
-From f3013acfc17b8920b97223421976f3b3bb32489a Mon Sep 17 00:00:00 2001
+From 3e74baf061d8f906e13295c0f7c11dc6133c3ef2 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit f3013acfc17b8920b97223421976f3b3bb32489a ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org
@@ -22 +23 @@
-index 65f1abae51..5d59db513c 100644
+index a70bac53d3..63b0f83f3a 100644



More information about the stable mailing list