diff mbox series

[net,6/8] net: hns3: fix reset timeout under full functions and queues

Message ID 20240307010115.3054770-7-shaojijie@huawei.com (mailing list archive)
State Superseded
Commit 216bc415d6631e769e2bd2266e2017f89a8b78f9
Delegated to: Netdev Maintainers
Headers show
Series There are some bugfix for the HNS3 ethernet driver | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 956 this patch: 956
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 2 maintainers not CCed: wangpeiyang1@huawei.com lanhao@huawei.com
netdev/build_clang success Errors and warnings before: 972 this patch: 972
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 972 this patch: 972
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 16 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-03-07--15-00 (tests: 892)

Commit Message

Jijie Shao March 7, 2024, 1:01 a.m. UTC
From: Peiyang Wang <wangpeiyang1@huawei.com>

The cmdq reset command times out when all VFs are enabled and the queue is
full. The hardware processing time exceeds the timeout set by the driver.
In order to avoid the above extreme situations, the driver extends the
reset timeout to 1 second.

Signed-off-by: Peiyang Wang <wangpeiyang1@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
---
 .../net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.c    | 2 +-
 .../net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.h    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Sunil Kovvuri Goutham March 7, 2024, 11:24 a.m. UTC | #1
> -----Original Message-----
> From: Jijie Shao <shaojijie@huawei.com>
> Sent: Thursday, March 7, 2024 6:31 AM
> To: yisen.zhuang@huawei.com; salil.mehta@huawei.com;
> davem@davemloft.net; edumazet@google.com; kuba@kernel.org;
> pabeni@redhat.com
> Cc: shenjian15@huawei.com; wangjie125@huawei.com;
> liuyonglong@huawei.com; shaojijie@huawei.com; netdev@vger.kernel.org;
> linux-kernel@vger.kernel.org
> Subject: [EXTERNAL] [PATCH net 6/8] net: hns3: fix reset timeout under full
> functions and queues
> 
> From: Peiyang Wang <wangpeiyang1@huawei.com>
> 
> The cmdq reset command times out when all VFs are enabled and the
> queue is full. The hardware processing time exceeds the timeout set by the
> driver.
> In order to avoid the above extreme situations, the driver extends the reset
> timeout to 1 second.
> 

Reviewed-by: Sunil Goutham <sgoutham@marvell.com>

But one observation, loop of udelay(1) for 1sec seems a lot, probably better to use usleep_range().
Jijie Shao March 8, 2024, 9:38 a.m. UTC | #2
on 2024/3/7 19:24, Sunil Kovvuri Goutham wrote:
>> In order to avoid the above extreme situations, the driver extends the reset
>> timeout to 1 second.
>>
> Reviewed-by: Sunil Goutham <sgoutham@marvell.com>
>
> But one observation, loop of udelay(1) for 1sec seems a lot, probably better to use usleep_range().

but this is protected by splock, so cannot use usleep_range().
diff mbox series

Patch

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.c b/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.c
index d92ad6082d8e..652d71326231 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.c
@@ -351,7 +351,7 @@  static int hclge_comm_cmd_csq_done(struct hclge_comm_hw *hw)
 static u32 hclge_get_cmdq_tx_timeout(u16 opcode, u32 tx_timeout)
 {
 	static const struct hclge_cmdq_tx_timeout_map cmdq_tx_timeout_map[] = {
-		{HCLGE_OPC_CFG_RST_TRIGGER, HCLGE_COMM_CMDQ_TX_TIMEOUT_500MS},
+		{HCLGE_OPC_CFG_RST_TRIGGER, HCLGE_COMM_CMDQ_CFG_RST_TIMEOUT},
 	};
 	u32 i;
 
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.h b/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.h
index 533c19d25e4f..552396518e08 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.h
@@ -55,7 +55,7 @@ 
 #define HCLGE_COMM_NIC_CMQ_DESC_NUM_S		3
 #define HCLGE_COMM_NIC_CMQ_DESC_NUM		1024
 #define HCLGE_COMM_CMDQ_TX_TIMEOUT_DEFAULT	30000
-#define HCLGE_COMM_CMDQ_TX_TIMEOUT_500MS	500000
+#define HCLGE_COMM_CMDQ_CFG_RST_TIMEOUT		1000000
 
 enum hclge_opcode_type {
 	/* Generic commands */