* [PATCH net 0/4] net: hns3: There are some bugfixes for the HNS3 ethernet driver
@ 2023-05-12 10:00 Hao Lan
2023-05-12 10:00 ` [PATCH net 1/4] net: hns3: fix output information incomplete for dumping tx queue info with debugfs Hao Lan
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Hao Lan @ 2023-05-12 10:00 UTC (permalink / raw)
To: netdev
Cc: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni, lanhao,
huangguangbin2, simon.horman, shaojijie, chenhao418, shenjian15,
liuyonglong, wangjie125, yuanjilin, cai.huoqing, xiujianfeng,
tanhuazhong
There are some bugfixes for the HNS3 ethernet driver.
Patch#1 fix output information incomplete for dumping tx queue info
with debugfs.
Patch#2 fix sending pfc frames after reset issue.
Patch#3 fix reset delay time to avoid configuration timeout.
Patch#4 fix reset timeout when enable full VF.
Jie Wang (2):
net: hns3: fix output information incomplete for dumping tx queue info
with debugfs
net: hns3: fix reset delay time to avoid configuration timeout
Jijie Shao (2):
net: hns3: fix sending pfc frames after reset issue
net: hns3: fix reset timeout when enable full VF
.../hns3/hns3_common/hclge_comm_cmd.c | 25 ++++++++++++++++---
.../hns3/hns3_common/hclge_comm_cmd.h | 8 +++++-
.../ethernet/hisilicon/hns3/hns3_debugfs.c | 2 +-
.../ethernet/hisilicon/hns3/hns3_debugfs.h | 1 +
.../hisilicon/hns3/hns3pf/hclge_main.c | 15 ++++++-----
.../ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 4 +--
.../ethernet/hisilicon/hns3/hns3pf/hclge_tm.h | 5 ++++
.../hisilicon/hns3/hns3vf/hclgevf_main.c | 5 +++-
8 files changed, 50 insertions(+), 15 deletions(-)
--
2.30.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH net 1/4] net: hns3: fix output information incomplete for dumping tx queue info with debugfs
2023-05-12 10:00 [PATCH net 0/4] net: hns3: There are some bugfixes for the HNS3 ethernet driver Hao Lan
@ 2023-05-12 10:00 ` Hao Lan
2023-05-12 10:00 ` [PATCH net 2/4] net: hns3: fix sending pfc frames after reset issue Hao Lan
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Hao Lan @ 2023-05-12 10:00 UTC (permalink / raw)
To: netdev
Cc: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni, lanhao,
huangguangbin2, simon.horman, shaojijie, chenhao418, shenjian15,
liuyonglong, wangjie125, yuanjilin, cai.huoqing, xiujianfeng,
tanhuazhong
From: Jie Wang <wangjie125@huawei.com>
In function hns3_dump_tx_queue_info, The print buffer is not enough when
the tx BD number is configured to 32760. As a result several BD
information wouldn't be displayed.
So fix it by increasing the tx queue print buffer length.
Fixes: 630a6738da82 ("net: hns3: adjust string spaces of some parameters of tx bd info in debugfs")
Signed-off-by: Jie Wang <wangjie125@huawei.com>
Signed-off-by: Hao Lan <lanhao@huawei.com>
---
drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | 2 +-
drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.h | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
index 4c3e90a1c4d0..d385ffc21876 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
@@ -130,7 +130,7 @@ static struct hns3_dbg_cmd_info hns3_dbg_cmd[] = {
.name = "tx_bd_queue",
.cmd = HNAE3_DBG_CMD_TX_BD,
.dentry = HNS3_DBG_DENTRY_TX_BD,
- .buf_len = HNS3_DBG_READ_LEN_4MB,
+ .buf_len = HNS3_DBG_READ_LEN_5MB,
.init = hns3_dbg_bd_file_init,
},
{
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.h b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.h
index 97578eabb7d8..4a5ef8a90a10 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.h
@@ -10,6 +10,7 @@
#define HNS3_DBG_READ_LEN_128KB 0x20000
#define HNS3_DBG_READ_LEN_1MB 0x100000
#define HNS3_DBG_READ_LEN_4MB 0x400000
+#define HNS3_DBG_READ_LEN_5MB 0x500000
#define HNS3_DBG_WRITE_LEN 1024
#define HNS3_DBG_DATA_STR_LEN 32
--
2.30.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net 2/4] net: hns3: fix sending pfc frames after reset issue
2023-05-12 10:00 [PATCH net 0/4] net: hns3: There are some bugfixes for the HNS3 ethernet driver Hao Lan
2023-05-12 10:00 ` [PATCH net 1/4] net: hns3: fix output information incomplete for dumping tx queue info with debugfs Hao Lan
@ 2023-05-12 10:00 ` Hao Lan
2023-05-12 10:00 ` [PATCH net 3/4] net: hns3: fix reset delay time to avoid configuration timeout Hao Lan
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Hao Lan @ 2023-05-12 10:00 UTC (permalink / raw)
To: netdev
Cc: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni, lanhao,
huangguangbin2, simon.horman, shaojijie, chenhao418, shenjian15,
liuyonglong, wangjie125, yuanjilin, cai.huoqing, xiujianfeng,
tanhuazhong
From: Jijie Shao <shaojijie@huawei.com>
To prevent the system from abnormally sending PFC frames after an
abnormal reset. The hns3 driver notifies the firmware to disable pfc
before reset.
Fixes: 35d93a30040c ("net: hns3: adjust the process of PF reset")
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Signed-off-by: Hao Lan <lanhao@huawei.com>
---
.../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 15 +++++++++------
.../net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 4 ++--
.../net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h | 5 +++++
3 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 4fb5406c1951..2689b108f7df 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -8053,12 +8053,15 @@ static void hclge_ae_stop(struct hnae3_handle *handle)
/* If it is not PF reset or FLR, the firmware will disable the MAC,
* so it only need to stop phy here.
*/
- if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state) &&
- hdev->reset_type != HNAE3_FUNC_RESET &&
- hdev->reset_type != HNAE3_FLR_RESET) {
- hclge_mac_stop_phy(hdev);
- hclge_update_link_status(hdev);
- return;
+ if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state)) {
+ hclge_pfc_pause_en_cfg(hdev, HCLGE_PFC_TX_RX_DISABLE,
+ HCLGE_PFC_DISABLE);
+ if (hdev->reset_type != HNAE3_FUNC_RESET &&
+ hdev->reset_type != HNAE3_FLR_RESET) {
+ hclge_mac_stop_phy(hdev);
+ hclge_update_link_status(hdev);
+ return;
+ }
}
hclge_reset_tqp(handle);
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
index 4a33f65190e2..922c0da3660c 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
@@ -171,8 +171,8 @@ int hclge_mac_pause_en_cfg(struct hclge_dev *hdev, bool tx, bool rx)
return hclge_cmd_send(&hdev->hw, &desc, 1);
}
-static int hclge_pfc_pause_en_cfg(struct hclge_dev *hdev, u8 tx_rx_bitmap,
- u8 pfc_bitmap)
+int hclge_pfc_pause_en_cfg(struct hclge_dev *hdev, u8 tx_rx_bitmap,
+ u8 pfc_bitmap)
{
struct hclge_desc desc;
struct hclge_pfc_en_cmd *pfc = (struct hclge_pfc_en_cmd *)desc.data;
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h
index 68f28a98e380..dd6f1fd486cf 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h
@@ -164,6 +164,9 @@ struct hclge_bp_to_qs_map_cmd {
u32 rsvd1;
};
+#define HCLGE_PFC_DISABLE 0
+#define HCLGE_PFC_TX_RX_DISABLE 0
+
struct hclge_pfc_en_cmd {
u8 tx_rx_en_bitmap;
u8 pri_en_bitmap;
@@ -235,6 +238,8 @@ void hclge_tm_schd_info_update(struct hclge_dev *hdev, u8 num_tc);
void hclge_tm_pfc_info_update(struct hclge_dev *hdev);
int hclge_tm_dwrr_cfg(struct hclge_dev *hdev);
int hclge_tm_init_hw(struct hclge_dev *hdev, bool init);
+int hclge_pfc_pause_en_cfg(struct hclge_dev *hdev, u8 tx_rx_bitmap,
+ u8 pfc_bitmap);
int hclge_mac_pause_en_cfg(struct hclge_dev *hdev, bool tx, bool rx);
int hclge_pause_addr_cfg(struct hclge_dev *hdev, const u8 *mac_addr);
void hclge_pfc_rx_stats_get(struct hclge_dev *hdev, u64 *stats);
--
2.30.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net 3/4] net: hns3: fix reset delay time to avoid configuration timeout
2023-05-12 10:00 [PATCH net 0/4] net: hns3: There are some bugfixes for the HNS3 ethernet driver Hao Lan
2023-05-12 10:00 ` [PATCH net 1/4] net: hns3: fix output information incomplete for dumping tx queue info with debugfs Hao Lan
2023-05-12 10:00 ` [PATCH net 2/4] net: hns3: fix sending pfc frames after reset issue Hao Lan
@ 2023-05-12 10:00 ` Hao Lan
2023-05-12 10:00 ` [PATCH net 4/4] net: hns3: fix reset timeout when enable full VF Hao Lan
2023-05-13 16:30 ` [PATCH net 0/4] net: hns3: There are some bugfixes for the HNS3 ethernet driver patchwork-bot+netdevbpf
4 siblings, 0 replies; 6+ messages in thread
From: Hao Lan @ 2023-05-12 10:00 UTC (permalink / raw)
To: netdev
Cc: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni, lanhao,
huangguangbin2, simon.horman, shaojijie, chenhao418, shenjian15,
liuyonglong, wangjie125, yuanjilin, cai.huoqing, xiujianfeng,
tanhuazhong
From: Jie Wang <wangjie125@huawei.com>
Currently the hns3 vf function reset delays 5000ms before vf rebuild
process. In product applications, this delay is too long for application
configurations and causes configuration timeout.
According to the tests, 500ms delay is enough for reset process except PF
FLR. So this patch modifies delay to 500ms in these scenarios.
Fixes: 6988eb2a9b77 ("net: hns3: Add support to reset the enet/ring mgmt layer")
Signed-off-by: Jie Wang <wangjie125@huawei.com>
Signed-off-by: Hao Lan <lanhao@huawei.com>
---
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
index f24046250341..dd08989a4c7c 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
@@ -1436,7 +1436,10 @@ static int hclgevf_reset_wait(struct hclgevf_dev *hdev)
* might happen in case reset assertion was made by PF. Yes, this also
* means we might end up waiting bit more even for VF reset.
*/
- msleep(5000);
+ if (hdev->reset_type == HNAE3_VF_FULL_RESET)
+ msleep(5000);
+ else
+ msleep(500);
return 0;
}
--
2.30.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net 4/4] net: hns3: fix reset timeout when enable full VF
2023-05-12 10:00 [PATCH net 0/4] net: hns3: There are some bugfixes for the HNS3 ethernet driver Hao Lan
` (2 preceding siblings ...)
2023-05-12 10:00 ` [PATCH net 3/4] net: hns3: fix reset delay time to avoid configuration timeout Hao Lan
@ 2023-05-12 10:00 ` Hao Lan
2023-05-13 16:30 ` [PATCH net 0/4] net: hns3: There are some bugfixes for the HNS3 ethernet driver patchwork-bot+netdevbpf
4 siblings, 0 replies; 6+ messages in thread
From: Hao Lan @ 2023-05-12 10:00 UTC (permalink / raw)
To: netdev
Cc: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni, lanhao,
huangguangbin2, simon.horman, shaojijie, chenhao418, shenjian15,
liuyonglong, wangjie125, yuanjilin, cai.huoqing, xiujianfeng,
tanhuazhong
From: Jijie Shao <shaojijie@huawei.com>
The timeout of the cmdq reset command has been increased to
resolve the reset timeout issue in the full VF scenario.
The timeout of other cmdq commands remains unchanged.
Fixes: 8d307f8e8cf1 ("net: hns3: create new set of unified hclge_comm_cmd_send APIs")
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Signed-off-by: Hao Lan <lanhao@huawei.com>
---
.../hns3/hns3_common/hclge_comm_cmd.c | 25 ++++++++++++++++---
.../hns3/hns3_common/hclge_comm_cmd.h | 8 +++++-
2 files changed, 28 insertions(+), 5 deletions(-)
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 cbbab5b2b402..b85c412683dd 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
@@ -331,9 +331,25 @@ static int hclge_comm_cmd_csq_done(struct hclge_comm_hw *hw)
return head == hw->cmq.csq.next_to_use;
}
-static void hclge_comm_wait_for_resp(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},
+ };
+ u32 i;
+
+ for (i = 0; i < ARRAY_SIZE(cmdq_tx_timeout_map); i++)
+ if (cmdq_tx_timeout_map[i].opcode == opcode)
+ return cmdq_tx_timeout_map[i].tx_timeout;
+
+ return tx_timeout;
+}
+
+static void hclge_comm_wait_for_resp(struct hclge_comm_hw *hw, u16 opcode,
bool *is_completed)
{
+ u32 cmdq_tx_timeout = hclge_get_cmdq_tx_timeout(opcode,
+ hw->cmq.tx_timeout);
u32 timeout = 0;
do {
@@ -343,7 +359,7 @@ static void hclge_comm_wait_for_resp(struct hclge_comm_hw *hw,
}
udelay(1);
timeout++;
- } while (timeout < hw->cmq.tx_timeout);
+ } while (timeout < cmdq_tx_timeout);
}
static int hclge_comm_cmd_convert_err_code(u16 desc_ret)
@@ -407,7 +423,8 @@ static int hclge_comm_cmd_check_result(struct hclge_comm_hw *hw,
* if multi descriptors to be sent, use the first one to check
*/
if (HCLGE_COMM_SEND_SYNC(le16_to_cpu(desc->flag)))
- hclge_comm_wait_for_resp(hw, &is_completed);
+ hclge_comm_wait_for_resp(hw, le16_to_cpu(desc->opcode),
+ &is_completed);
if (!is_completed)
ret = -EBADE;
@@ -529,7 +546,7 @@ int hclge_comm_cmd_queue_init(struct pci_dev *pdev, struct hclge_comm_hw *hw)
cmdq->crq.desc_num = HCLGE_COMM_NIC_CMQ_DESC_NUM;
/* Setup Tx write back timeout */
- cmdq->tx_timeout = HCLGE_COMM_CMDQ_TX_TIMEOUT;
+ cmdq->tx_timeout = HCLGE_COMM_CMDQ_TX_TIMEOUT_DEFAULT;
/* Setup queue rings */
ret = hclge_comm_alloc_cmd_queue(hw, HCLGE_COMM_TYPE_CSQ);
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 de72ecbfd5ad..18f1b4bf362d 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
@@ -54,7 +54,8 @@
#define HCLGE_COMM_NIC_SW_RST_RDY BIT(HCLGE_COMM_NIC_SW_RST_RDY_B)
#define HCLGE_COMM_NIC_CMQ_DESC_NUM_S 3
#define HCLGE_COMM_NIC_CMQ_DESC_NUM 1024
-#define HCLGE_COMM_CMDQ_TX_TIMEOUT 30000
+#define HCLGE_COMM_CMDQ_TX_TIMEOUT_DEFAULT 30000
+#define HCLGE_COMM_CMDQ_TX_TIMEOUT_500MS 500000
enum hclge_opcode_type {
/* Generic commands */
@@ -360,6 +361,11 @@ struct hclge_comm_caps_bit_map {
u16 local_bit;
};
+struct hclge_cmdq_tx_timeout_map {
+ u32 opcode;
+ u32 tx_timeout;
+};
+
struct hclge_comm_firmware_compat_cmd {
__le32 compat;
u8 rsv[20];
--
2.30.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH net 0/4] net: hns3: There are some bugfixes for the HNS3 ethernet driver
2023-05-12 10:00 [PATCH net 0/4] net: hns3: There are some bugfixes for the HNS3 ethernet driver Hao Lan
` (3 preceding siblings ...)
2023-05-12 10:00 ` [PATCH net 4/4] net: hns3: fix reset timeout when enable full VF Hao Lan
@ 2023-05-13 16:30 ` patchwork-bot+netdevbpf
4 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-05-13 16:30 UTC (permalink / raw)
To: Hao Lan
Cc: netdev, yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni,
huangguangbin2, simon.horman, shaojijie, chenhao418, shenjian15,
liuyonglong, wangjie125, yuanjilin, cai.huoqing, xiujianfeng,
tanhuazhong
Hello:
This series was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:
On Fri, 12 May 2023 18:00:10 +0800 you wrote:
> There are some bugfixes for the HNS3 ethernet driver.
> Patch#1 fix output information incomplete for dumping tx queue info
> with debugfs.
> Patch#2 fix sending pfc frames after reset issue.
> Patch#3 fix reset delay time to avoid configuration timeout.
> Patch#4 fix reset timeout when enable full VF.
>
> [...]
Here is the summary with links:
- [net,1/4] net: hns3: fix output information incomplete for dumping tx queue info with debugfs
https://git.kernel.org/netdev/net/c/89f6bfb07118
- [net,2/4] net: hns3: fix sending pfc frames after reset issue
https://git.kernel.org/netdev/net/c/f14db0706472
- [net,3/4] net: hns3: fix reset delay time to avoid configuration timeout
https://git.kernel.org/netdev/net/c/814d0c786068
- [net,4/4] net: hns3: fix reset timeout when enable full VF
https://git.kernel.org/netdev/net/c/6b45d5ff8c2c
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-05-13 16:30 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-12 10:00 [PATCH net 0/4] net: hns3: There are some bugfixes for the HNS3 ethernet driver Hao Lan
2023-05-12 10:00 ` [PATCH net 1/4] net: hns3: fix output information incomplete for dumping tx queue info with debugfs Hao Lan
2023-05-12 10:00 ` [PATCH net 2/4] net: hns3: fix sending pfc frames after reset issue Hao Lan
2023-05-12 10:00 ` [PATCH net 3/4] net: hns3: fix reset delay time to avoid configuration timeout Hao Lan
2023-05-12 10:00 ` [PATCH net 4/4] net: hns3: fix reset timeout when enable full VF Hao Lan
2023-05-13 16:30 ` [PATCH net 0/4] net: hns3: There are some bugfixes for the HNS3 ethernet driver patchwork-bot+netdevbpf
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).