]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net: hns3: reset tqp while doing DOWN operation
authorHuazhong Tan <tanhuazhong@huawei.com>
Thu, 20 Dec 2018 03:52:02 +0000 (11:52 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 Dec 2018 07:47:58 +0000 (23:47 -0800)
While doing DOWN operation, the driver will reclaim the memory which has
already used for TX. If the hardware is processing this memory, it will
cause a RCB error to the hardware. According the hardware's description,
the driver should reset the tqp before reclaim the memory during DOWN.

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

index 0b04d042633221498896bdeb8f6c4fcf14937d51..98ae2820e00196108e971c08baf4d83f1489a3a6 100644 (file)
@@ -5331,6 +5331,7 @@ static void hclge_ae_stop(struct hnae3_handle *handle)
 {
        struct hclge_vport *vport = hclge_get_vport(handle);
        struct hclge_dev *hdev = vport->back;
+       int i;
 
        set_bit(HCLGE_STATE_DOWN, &hdev->state);
 
@@ -5343,6 +5344,9 @@ static void hclge_ae_stop(struct hnae3_handle *handle)
                return;
        }
 
+       for (i = 0; i < handle->kinfo.num_tqps; i++)
+               hclge_reset_tqp(handle, i);
+
        /* Mac disable */
        hclge_cfg_mac_mode(hdev, false);
 
index 919c3aa87228139af28fdcd132ee6014e2caea5e..156242f96a8e1d45db4f3173ef2617ed290ad426 100644 (file)
@@ -1870,9 +1870,13 @@ static int hclgevf_ae_start(struct hnae3_handle *handle)
 static void hclgevf_ae_stop(struct hnae3_handle *handle)
 {
        struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle);
+       int i;
 
        set_bit(HCLGEVF_STATE_DOWN, &hdev->state);
 
+       for (i = 0; i < handle->kinfo.num_tqps; i++)
+               hclgevf_reset_tqp(handle, i);
+
        /* reset tqp stats */
        hclgevf_reset_tqp_stats(handle);
        hclgevf_update_link_status(hdev, 0);