patch 'net/hns3: fix mbuf free on Tx done cleanup' has been queued to stable release 21.11.2

Kevin Traynor ktraynor at redhat.com
Wed May 25 18:28:14 CEST 2022


Hi,

FYI, your patch has been queued to stable release 21.11.2

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

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/8b00917c0834f462dcc79c0c31ff3a10d6f4f310

Thanks.

Kevin

---
>From 8b00917c0834f462dcc79c0c31ff3a10d6f4f310 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen at huawei.com>
Date: Thu, 5 May 2022 20:27:04 +0800
Subject: [PATCH] net/hns3: fix mbuf free on Tx done cleanup

[ upstream commit 2d287ea3c2301219c201617df15efa161deabf76 ]

Currently, the hns3 PMD may free more mbufs than free_cnt parameter,
this is an incorrect implementation. This patch fixes it.

Fixes: 0b77e8f3d364 ("net/hns3: optimize Tx performance")

Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
Signed-off-by: Min Hu (Connor) <humin29 at huawei.com>
---
 drivers/net/hns3/hns3_rxtx.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index c43131cac6..7c184a5850 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -4613,5 +4613,5 @@ static int
 hns3_tx_done_cleanup_full(struct hns3_tx_queue *txq, uint32_t free_cnt)
 {
-	uint16_t round_free_cnt;
+	uint16_t round_cnt;
 	uint32_t idx;
 
@@ -4622,11 +4622,11 @@ hns3_tx_done_cleanup_full(struct hns3_tx_queue *txq, uint32_t free_cnt)
 		return 0;
 
-	round_free_cnt = roundup(free_cnt, txq->tx_rs_thresh);
-	for (idx = 0; idx < round_free_cnt; idx += txq->tx_rs_thresh) {
+	round_cnt = rounddown(free_cnt, txq->tx_rs_thresh);
+	for (idx = 0; idx < round_cnt; idx += txq->tx_rs_thresh) {
 		if (hns3_tx_free_useless_buffer(txq) != 0)
 			break;
 	}
 
-	return RTE_MIN(idx, free_cnt);
+	return idx;
 }
 
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-05-25 17:26:59.118706255 +0100
+++ 0022-net-hns3-fix-mbuf-free-on-Tx-done-cleanup.patch	2022-05-25 17:26:58.572828339 +0100
@@ -1 +1 @@
-From 2d287ea3c2301219c201617df15efa161deabf76 Mon Sep 17 00:00:00 2001
+From 8b00917c0834f462dcc79c0c31ff3a10d6f4f310 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 2d287ea3c2301219c201617df15efa161deabf76 ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -19 +20 @@
-index a28de06dfd..0c91e4721e 100644
+index c43131cac6..7c184a5850 100644
@@ -22 +23 @@
-@@ -4596,5 +4596,5 @@ static int
+@@ -4613,5 +4613,5 @@ static int
@@ -29 +30 @@
-@@ -4605,11 +4605,11 @@ hns3_tx_done_cleanup_full(struct hns3_tx_queue *txq, uint32_t free_cnt)
+@@ -4622,11 +4622,11 @@ hns3_tx_done_cleanup_full(struct hns3_tx_queue *txq, uint32_t free_cnt)



More information about the stable mailing list