DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Min Hu (Connor)" <humin29@huawei.com>
To: <dev@dpdk.org>
Cc: <ferruh.yigit@intel.com>
Subject: [dpdk-dev] [PATCH v2 5/7] net/hns3: fix incorrect timing in resetting queues
Date: Sat, 10 Apr 2021 09:11:18 +0800	[thread overview]
Message-ID: <1618017080-50053-6-git-send-email-humin29@huawei.com> (raw)
In-Reply-To: <1618017080-50053-1-git-send-email-humin29@huawei.com>

From: Chengchang Tang <tangchengchang@huawei.com>

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 obain 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")
Cc: stable@dpdk.org

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@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 8c5da44..be93618 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.7.4


  parent reply	other threads:[~2021-04-10  1:11 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09 10:15 [dpdk-dev] [PATCH 0/7] Bugfix for hns3 PMD Min Hu (Connor)
2021-04-09 10:15 ` [dpdk-dev] [PATCH 1/7] net/hns3: remove ariables of selecting Rx/Tx function Min Hu (Connor)
2021-04-09 10:16 ` [dpdk-dev] [PATCH 2/7] net/hns3: fix missing rollback in PF init Min Hu (Connor)
2021-04-09 10:16 ` [dpdk-dev] [PATCH 3/7] net/hns3: fix FLR failure when RAS concurrently with FLR Min Hu (Connor)
2021-04-09 10:16 ` [dpdk-dev] [PATCH 4/7] net/hns3: fix some packet type calc error Min Hu (Connor)
2021-04-09 10:16 ` [dpdk-dev] [PATCH 5/7] net/hns3: fix incorrect timing in resetting queues Min Hu (Connor)
2021-04-09 10:16 ` [dpdk-dev] [PATCH 6/7] net/hns3: fix queue state when concurrent with reset Min Hu (Connor)
2021-04-09 10:16 ` [dpdk-dev] [PATCH 7/7] net/hns3: fix configure FEC " Min Hu (Connor)
2021-04-10  1:11 ` [dpdk-dev] [PATCH v2 0/7] Bugfix for hns3 PMD Min Hu (Connor)
2021-04-10  1:11   ` [dpdk-dev] [PATCH v2 1/7] net/hns3: remove variables of selecting Rx/Tx function Min Hu (Connor)
2021-04-10  1:11   ` [dpdk-dev] [PATCH v2 2/7] net/hns3: fix missing rollback in PF init Min Hu (Connor)
2021-04-10  1:11   ` [dpdk-dev] [PATCH v2 3/7] net/hns3: fix FLR failure when RAS concurrent with FLR Min Hu (Connor)
2021-04-10  1:11   ` [dpdk-dev] [PATCH v2 4/7] net/hns3: fix some packet type calc error Min Hu (Connor)
2021-04-10  1:11   ` Min Hu (Connor) [this message]
2021-04-10  1:11   ` [dpdk-dev] [PATCH v2 6/7] net/hns3: fix queue state when concurrent with reset Min Hu (Connor)
2021-04-10  1:11   ` [dpdk-dev] [PATCH v2 7/7] net/hns3: fix configure FEC " Min Hu (Connor)
2021-04-13  9:28   ` [dpdk-dev] [PATCH v2 0/7] Bugfix for hns3 PMD Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1618017080-50053-6-git-send-email-humin29@huawei.com \
    --to=humin29@huawei.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).