[dpdk-stable] patch 'net/hns3: fix timing in resetting queues' has been queued to stable release 20.11.2

Xueming Li xuemingl at nvidia.com
Mon May 10 18:02:08 CEST 2021


Hi,

FYI, your patch has been queued to stable release 20.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/12/21. 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/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/da8413c234cd0cd487f5d4474875a49a555600c6

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From da8413c234cd0cd487f5d4474875a49a555600c6 Mon Sep 17 00:00:00 2001
From: Chengchang Tang <tangchengchang at huawei.com>
Date: Sat, 10 Apr 2021 09:11:18 +0800
Subject: [PATCH] net/hns3: fix timing in resetting queues
Cc: Luca Boccassi <bluca at debian.org>

[ upstream commit fde636caf49a96138602d3232af6ec5ac4f15538 ]

During the task queue pairs reset, the getimeofday is used to obtain the
timestamp to determine whether the command execution times out. But
gettimeofday is not monotonous, it can be modified by system
administrators, so the timing may not be accurate or even cause the loop
to wait consistently.
And actually, in this scenario, it is not necessary to obtain the
timestamp.

This patch removes the operation of obtaining the timestamp from the task
queue pairs reset function.

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

Signed-off-by: Chengchang Tang <tangchengchang at huawei.com>
Signed-off-by: Min Hu (Connor) <humin29 at huawei.com>
---
 drivers/net/hns3/hns3_rxtx.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index 4f67d73de4..ba566cdba7 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -625,8 +625,8 @@ static int
 hns3pf_reset_tqp(struct hns3_hw *hw, uint16_t queue_id)
 {
 #define HNS3_TQP_RESET_TRY_MS	200
+	uint16_t wait_time = 0;
 	uint8_t reset_status;
-	uint64_t end;
 	int ret;
 
 	/*
@@ -639,17 +639,18 @@ hns3pf_reset_tqp(struct hns3_hw *hw, uint16_t queue_id)
 		hns3_err(hw, "Send reset tqp cmd fail, ret = %d", ret);
 		return ret;
 	}
-	end = get_timeofday_ms() + HNS3_TQP_RESET_TRY_MS;
+
 	do {
 		/* Wait for tqp hw reset */
 		rte_delay_ms(HNS3_POLL_RESPONE_MS);
+		wait_time += HNS3_POLL_RESPONE_MS;
 		ret = hns3_get_tqp_reset_status(hw, queue_id, &reset_status);
 		if (ret)
 			goto tqp_reset_fail;
 
 		if (reset_status)
 			break;
-	} while (get_timeofday_ms() < end);
+	} while (wait_time < HNS3_TQP_RESET_TRY_MS);
 
 	if (!reset_status) {
 		ret = -ETIMEDOUT;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-05-10 23:59:31.210349100 +0800
+++ 0180-net-hns3-fix-timing-in-resetting-queues.patch	2021-05-10 23:59:26.620000000 +0800
@@ -1 +1 @@
-From fde636caf49a96138602d3232af6ec5ac4f15538 Mon Sep 17 00:00:00 2001
+From da8413c234cd0cd487f5d4474875a49a555600c6 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Luca Boccassi <bluca at debian.org>
+
+[ upstream commit fde636caf49a96138602d3232af6ec5ac4f15538 ]
@@ -18 +20,0 @@
-Cc: stable at dpdk.org
@@ -27 +29 @@
-index 1074d8a3a4..469d8de5df 100644
+index 4f67d73de4..ba566cdba7 100644


More information about the stable mailing list