Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp937278ybl; Wed, 28 Aug 2019 07:26:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzRgBXqSa+wFpGeJOZwpocyN+8iSBg74uGXFwm/ySYdfY+wIGiWh0F9A0LIs2mF6qKbp6bS X-Received: by 2002:a63:bf01:: with SMTP id v1mr3614388pgf.278.1567002412215; Wed, 28 Aug 2019 07:26:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567002412; cv=none; d=google.com; s=arc-20160816; b=aoR/C8MU/UvLvyH23VzFYfJNYrq88X9YTYK4qEYmpaBG6SAc7DPJl/E5RTdnxXFR14 M9ozk9vnTw10XLA4Y8/j+134OP688yCIWAPCZ642UZMa1rdt7XGUpogJjLF8SJsPtHQt bZMiInZdoVc+NZN9wttECUasDxTAMcgKnYubA+iE4o3P1iYeKD/T1ExuvEB+N7NDK9zv cEzXmLIWd3hXVxf/jFHfO+wIbmEBhjg818giOlKpxIhFLrW++skFwGWvR57lpR+2Hgt2 hiijrAbn/7uRm+nL7gSOX4sXkHdHNbMM8klFnFLOSBnnuL7jOo4IMGUmMtMX+NdGH9E9 RaTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=KksYM8MJY/UXQX24pqPZZknENPkppmcIsHbHCdTRouU=; b=mJ9VrMKZV/Ern9HoEltSJt1b5d83Aidcm0h+b5zHHwjbwvRtqcXRCPTUpAqctR9K1v PVRy0hhqBZa3R12E+cXV/Onj8EC07upk2is7e2mR6caaxO6q1t8TG35dYEe3KFtjh76c 3pFC9Xfzd1v0vMK00sv243OBTYVPA0xOUv0qGTLMZ/43H7ozyYNf8AGUNX/WAwxJ1iTE pgK49dSC9kJ9F7PCOGtiBnPRsLLnqqgnuXS8mQWrKc27vDu6xpDLjAu/pns212o7LhiE se0DAcF3HmnM1fIqbFSdubhZGEV0pFpTvoJS0ngK/02vVoZ8JVSswQJCKFjQF/Og6imK ICPw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3si2022901pll.127.2019.08.28.07.26.36; Wed, 28 Aug 2019 07:26:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726911AbfH1OZo (ORCPT + 99 others); Wed, 28 Aug 2019 10:25:44 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:41768 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726828AbfH1OZo (ORCPT ); Wed, 28 Aug 2019 10:25:44 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 58660D488D2F89626D47; Wed, 28 Aug 2019 22:25:41 +0800 (CST) Received: from localhost.localdomain (10.67.212.132) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.439.0; Wed, 28 Aug 2019 22:25:31 +0800 From: Huazhong Tan To: CC: , , , , , Zhongzhu Liu , Huazhong Tan Subject: [PATCH net-next 08/12] net: hns3: optimize waiting time for TQP reset Date: Wed, 28 Aug 2019 22:23:12 +0800 Message-ID: <1567002196-63242-9-git-send-email-tanhuazhong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1567002196-63242-1-git-send-email-tanhuazhong@huawei.com> References: <1567002196-63242-1-git-send-email-tanhuazhong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.212.132] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhongzhu Liu This patch optimizes the waiting time for TQP reset. Signed-off-by: Zhongzhu Liu Reviewed-by: Yunsheng Lin Reviewed-by: Peng Li Signed-off-by: Huazhong Tan --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 10 ++++++---- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 8a5b81d..f43c298 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -8262,11 +8262,12 @@ int hclge_reset_tqp(struct hnae3_handle *handle, u16 queue_id) } while (reset_try_times++ < HCLGE_TQP_RESET_TRY_TIMES) { - /* Wait for tqp hw reset */ - msleep(20); reset_status = hclge_get_reset_status(hdev, queue_gid); if (reset_status) break; + + /* Wait for tqp hw reset */ + usleep_range(1000, 1200); } if (reset_try_times >= HCLGE_TQP_RESET_TRY_TIMES) { @@ -8300,11 +8301,12 @@ void hclge_reset_vf_queue(struct hclge_vport *vport, u16 queue_id) } while (reset_try_times++ < HCLGE_TQP_RESET_TRY_TIMES) { - /* Wait for tqp hw reset */ - msleep(20); reset_status = hclge_get_reset_status(hdev, queue_gid); if (reset_status) break; + + /* Wait for tqp hw reset */ + usleep_range(1000, 1200); } if (reset_try_times >= HCLGE_TQP_RESET_TRY_TIMES) { diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h index 7ff03b9..00c07f8 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h @@ -119,7 +119,7 @@ #define HCLGE_DEFAULT_UMV_SPACE_PER_PF \ (HCLGE_UMV_TBL_SIZE / HCLGE_MAX_PF_NUM) -#define HCLGE_TQP_RESET_TRY_TIMES 10 +#define HCLGE_TQP_RESET_TRY_TIMES 200 #define HCLGE_PHY_PAGE_MDIX 0 #define HCLGE_PHY_PAGE_COPPER 0 -- 2.7.4