Blob Blame History Raw
From: Huazhong Tan <tanhuazhong@huawei.com>
Date: Sat, 6 Apr 2019 15:43:27 +0800
Subject: net: hns3: not reset vport who not alive when PF reset
Patch-mainline: v5.2-rc1
Git-commit: cc645dfa89a747382beaf62d69daafe60fd1cd94
References: bsc#1104353 FATE#326415 bsc#1137201

If a vport is not alive, it is unnecessary to notify it to reset
before PF asserting a reset. So before inform vport to reset,
we need to check its alive state firstly.

Fixes: aa5c4f175be6 ("net: hns3: add reset handling for VF when doing PF reset")
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -2677,7 +2677,7 @@ static int hclge_set_all_vf_rst(struct h
 			return ret;
 		}
 
-		if (!reset)
+		if (!reset || !test_bit(HCLGE_VPORT_STATE_ALIVE, &vport->state))
 			continue;
 
 		/* Inform VF to process the reset.