net: hns3: not reset TQP in the DOWN while VF resetting
authorHuazhong Tan <tanhuazhong@huawei.com>
Thu, 25 Apr 2019 12:42:51 +0000 (20:42 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 26 Apr 2019 16:13:28 +0000 (12:13 -0400)
Since the hardware does not handle mailboxes and the hardware
reset include TQP reset, so it is unnecessary to reset TQP
in the hclgevf_ae_stop() while doing VF reset. Also it is
unnecessary to reset the remaining TQP when one reset fails.

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>
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c

index 7672cab5464307c5dc00da33ca28994301eae045..6ce5b036fbf43a8f55034b71e08871cc88796c88 100644 (file)
@@ -2050,8 +2050,10 @@ static void hclgevf_ae_stop(struct hnae3_handle *handle)
 
        set_bit(HCLGEVF_STATE_DOWN, &hdev->state);
 
-       for (i = 0; i < handle->kinfo.num_tqps; i++)
-               hclgevf_reset_tqp(handle, i);
+       if (hdev->reset_type != HNAE3_VF_RESET)
+               for (i = 0; i < handle->kinfo.num_tqps; i++)
+                       if (hclgevf_reset_tqp(handle, i))
+                               break;
 
        /* reset tqp stats */
        hclgevf_reset_tqp_stats(handle);