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

Xueming Li xuemingl at nvidia.com
Mon Dec 11 11:10:45 CET 2023


Hi,

FYI, your patch has been queued to stable release 22.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 12/13/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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=70c868a1556ef6a89571298d5b7cac97e7eb458a

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 70c868a1556ef6a89571298d5b7cac97e7eb458a 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
Cc: Xueming Li <xuemingl at nvidia.com>

[ 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 296aba8b35..5db0d3418c 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -1789,6 +1789,12 @@ hns3_rx_queue_conf_check(struct hns3_hw *hw, const struct rte_eth_rxconf *conf,
 		return -EINVAL;
 	}
 
+	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 "
 			  "dropped and rx_drop_en (1) is fixed on");
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-12-11 17:56:23.836913800 +0800
+++ 0020-net-hns3-fix-unchecked-Rx-free-threshold.patch	2023-12-11 17:56:22.907652300 +0800
@@ -1 +1 @@
-From c1f0cd3a4c834c2e550370b6d31b6bcd456a15f9 Mon Sep 17 00:00:00 2001
+From 70c868a1556ef6a89571298d5b7cac97e7eb458a Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit c1f0cd3a4c834c2e550370b6d31b6bcd456a15f9 ]
@@ -16 +18,0 @@
-Cc: stable at dpdk.org
@@ -24 +26 @@
-index f3c3b38c55..13214d02d5 100644
+index 296aba8b35..5db0d3418c 100644
@@ -27 +29 @@
-@@ -1785,6 +1785,12 @@ hns3_rx_queue_conf_check(struct hns3_hw *hw, const struct rte_eth_rxconf *conf,
+@@ -1789,6 +1789,12 @@ hns3_rx_queue_conf_check(struct hns3_hw *hw, const struct rte_eth_rxconf *conf,


More information about the stable mailing list