patch 'net/hns3: fix unchecked Rx free threshold' has been queued to stable release 21.11.6

Kevin Traynor ktraynor at redhat.com
Thu Nov 16 14:22:54 CET 2023


Hi,

FYI, your patch has been queued to stable release 21.11.6

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/21/23. 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/fc1e7c7b6e370c8accf5a6ded2560496b5e1854c

Thanks.

Kevin

---
>From fc1e7c7b6e370c8accf5a6ded2560496b5e1854c Mon Sep 17 00:00:00 2001
From: Dengdui Huang <huangdengdui at huawei.com>
Date: Fri, 27 Oct 2023 14:09:40 +0800
Subject: [PATCH] net/hns3: fix unchecked Rx free threshold

[ upstream commit c1f0cd3a4c834c2e550370b6d31b6bcd456a15f9 ]

To reduce the frequency of updating the head pointer of Rx queue,
driver just updates this pointer when the number of processed
descriptors is greater than the Rx free threshold. If the Rx free
threshold is set to a value greater than or equal to the number of
descriptors in Rx queue, the driver does not update this pointer.
As a result, the hardware cannot receive more packets.

This patch fix it by adding Rx free threshold check.

Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations")

Signed-off-by: Dengdui Huang <huangdengdui at huawei.com>
---
 drivers/net/hns3/hns3_rxtx.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index a758300060..5abb3556d1 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -1797,4 +1797,10 @@ hns3_rx_queue_conf_check(struct hns3_hw *hw, const struct rte_eth_rxconf *conf,
 	}
 
+	if (conf->rx_free_thresh >= nb_desc) {
+		hns3_err(hw, "rx_free_thresh (%u) must be less than %u",
+			 conf->rx_free_thresh, nb_desc);
+		return -EINVAL;
+	}
+
 	if (conf->rx_drop_en == 0)
 		hns3_warn(hw, "if no descriptors available, packets are always "
-- 
2.41.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-11-16 13:21:52.864960846 +0000
+++ 0012-net-hns3-fix-unchecked-Rx-free-threshold.patch	2023-11-16 13:21:52.413946267 +0000
@@ -1 +1 @@
-From c1f0cd3a4c834c2e550370b6d31b6bcd456a15f9 Mon Sep 17 00:00:00 2001
+From fc1e7c7b6e370c8accf5a6ded2560496b5e1854c Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit c1f0cd3a4c834c2e550370b6d31b6bcd456a15f9 ]
+
@@ -16 +17,0 @@
-Cc: stable at dpdk.org
@@ -24 +25 @@
-index f3c3b38c55..13214d02d5 100644
+index a758300060..5abb3556d1 100644
@@ -27 +28 @@
-@@ -1786,4 +1786,10 @@ hns3_rx_queue_conf_check(struct hns3_hw *hw, const struct rte_eth_rxconf *conf,
+@@ -1797,4 +1797,10 @@ hns3_rx_queue_conf_check(struct hns3_hw *hw, const struct rte_eth_rxconf *conf,



More information about the stable mailing list