[PATCH net] net: hns3: clear VF down state bit before request link status

Subsystems: hisilicon network subsystem 3 driver (hns3), hisilicon network subsystem driver, networking drivers, the rest

STALE1994d

2 messages, 2 authors, 2021-04-06 · open the first message on its own page

[PATCH net] net: hns3: clear VF down state bit before request link status

From: Huazhong Tan <hidden>
Date: 2021-04-06 13:10:33

From: Guangbin Huang <redacted>

Currently, the VF down state bit is cleared after VF sending
link status request command. There is problem that when VF gets
link status replied from PF, the down state bit may still set
as 1. In this case, the link status replied from PF will be
ignored and always set VF link status to down.

To fix this problem, clear VF down state bit before VF requests
link status.

Fixes: e2cb1dec9779 ("net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support")
Signed-off-by: Guangbin Huang <redacted>
Signed-off-by: Huazhong Tan <redacted>
---
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
index 700e068..14b83ec 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
@@ -2624,14 +2624,14 @@ static int hclgevf_ae_start(struct hnae3_handle *handle)
 {
 	struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle);
 
+	clear_bit(HCLGEVF_STATE_DOWN, &hdev->state);
+
 	hclgevf_reset_tqp_stats(handle);
 
 	hclgevf_request_link_info(hdev);
 
 	hclgevf_update_link_mode(hdev);
 
-	clear_bit(HCLGEVF_STATE_DOWN, &hdev->state);
-
 	return 0;
 }
 
-- 
2.7.4

Re: [PATCH net] net: hns3: clear VF down state bit before request link status

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-04-06 23:50:18

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Tue, 6 Apr 2021 21:10:43 +0800 you wrote:
From: Guangbin Huang <redacted>

Currently, the VF down state bit is cleared after VF sending
link status request command. There is problem that when VF gets
link status replied from PF, the down state bit may still set
as 1. In this case, the link status replied from PF will be
ignored and always set VF link status to down.

[...]
Here is the summary with links:
  - [net] net: hns3: clear VF down state bit before request link status
    https://git.kernel.org/netdev/net/c/ed7bedd2c3ca

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help