]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: hns3: add interrupts re-initialization while doing VF FLR
authorJie Wang <wangjie125@huawei.com>
Thu, 22 Dec 2022 06:43:41 +0000 (14:43 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:41:57 +0000 (11:41 +0100)
[ Upstream commit 09e6b30eeb254f1818a008cace3547159e908dfd ]

Currently keep alive message between PF and VF may be lost and the VF is
unalive in PF. So the VF will not do reset during PF FLR reset process.
This would make the allocated interrupt resources of VF invalid and VF
would't receive or respond to PF any more.

So this patch adds VF interrupts re-initialization during VF FLR for VF
recovery in above cases.

Fixes: 13fcfd88669f ("net: hns3: do VF's pci re-initialization while PF doing FLR")
Signed-off-by: Jie Wang <wangjie125@huawei.com>
Signed-off-by: Hao Lan <lanhao@huawei.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c

index 403c1b9cf6ab823321ab6d0266b37ae68dd1a6d9..48956c30d2eeef1e099061b4f8ad164f40a3be84 100644 (file)
@@ -2592,7 +2592,8 @@ static int hclgevf_pci_reset(struct hclgevf_dev *hdev)
        struct pci_dev *pdev = hdev->pdev;
        int ret = 0;
 
-       if (hdev->reset_type == HNAE3_VF_FULL_RESET &&
+       if ((hdev->reset_type == HNAE3_VF_FULL_RESET ||
+            hdev->reset_type == HNAE3_FLR_RESET) &&
            test_bit(HCLGEVF_STATE_IRQ_INITED, &hdev->state)) {
                hclgevf_misc_irq_uninit(hdev);
                hclgevf_uninit_msi(hdev);