net: hns3: add cmdq check for vf periodic service task
authorJie Wang <wangjie125@huawei.com>
Mon, 18 Sep 2023 07:48:36 +0000 (15:48 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 19 Sep 2023 10:13:08 +0000 (12:13 +0200)
When the vf cmdq is disabled, there is no need to keep these task running.
So this patch skip these task when the cmdq is disabled.

Fixes: ff200099d271 ("net: hns3: remove unnecessary work in hclgevf_main")
Signed-off-by: Jie Wang <wangjie125@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c

index 7a2f923..a4d68fb 100644 (file)
@@ -1855,7 +1855,8 @@ static void hclgevf_periodic_service_task(struct hclgevf_dev *hdev)
        unsigned long delta = round_jiffies_relative(HZ);
        struct hnae3_handle *handle = &hdev->nic;
 
-       if (test_bit(HCLGEVF_STATE_RST_FAIL, &hdev->state))
+       if (test_bit(HCLGEVF_STATE_RST_FAIL, &hdev->state) ||
+           test_bit(HCLGE_COMM_STATE_CMD_DISABLE, &hdev->hw.hw.comm_state))
                return;
 
        if (time_is_after_jiffies(hdev->last_serv_processed + HZ)) {