]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: hns3: Set STATE_DOWN bit of hdev state when stopping net
authorFuyun Liang <liangfuyun1@huawei.com>
Wed, 19 Sep 2018 17:29:52 +0000 (18:29 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 Sep 2018 04:20:22 +0000 (21:20 -0700)
We clear STATE_DOWN bit of hdev state when starting net, but do not set
it again when stopping net. It causes that the net is down, but hdev state
is still up. STATE_DOWN bit of hdev state should be set when stopping net.

Fixes: 22c0e2ce21dd ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
Fixes: efa29b6d502b ("net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support")
Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c

index ad15ba720b5108991cd05e13d1f9ff1388fa16f1..66b31d13d08fdf06c6cff2b0a7a313f499a55167 100644 (file)
@@ -3519,6 +3519,8 @@ static void hclge_ae_stop(struct hnae3_handle *handle)
        struct hclge_dev *hdev = vport->back;
        int i;
 
+       set_bit(HCLGE_STATE_DOWN, &hdev->state);
+
        del_timer_sync(&hdev->service_timer);
        cancel_work_sync(&hdev->service_task);
        clear_bit(HCLGE_STATE_SERVICE_SCHED, &hdev->state);
index 9c0091f2addfcff7bd565963c43003b210c3d571..47fc3cd1cdda56def5c1f927f4ae66b065fe9f1e 100644 (file)
@@ -1448,6 +1448,8 @@ static void hclgevf_ae_stop(struct hnae3_handle *handle)
        struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle);
        int i, queue_id;
 
+       set_bit(HCLGEVF_STATE_DOWN, &hdev->state);
+
        for (i = 0; i < hdev->num_tqps; i++) {
                /* Ring disable */
                queue_id = hclgevf_get_queue_id(handle->kinfo.tqp[i]);