net: hns: Clean rx fbd when ae stopped.
authorYonglong Liu <liuyonglong@huawei.com>
Sat, 15 Dec 2018 03:53:24 +0000 (11:53 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 16 Dec 2018 20:07:32 +0000 (12:07 -0800)
If there are packets in hardware when changing the speed or duplex,
it may cause hardware hang up.

This patch adds the code to wait rx fbd clean up when ae stopped.

Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c

index b52029e26d15323b98811c5180a3d78ac288bf52..ad1779fc410e64b668bf9bdf5dc037eb46a737fa 100644 (file)
@@ -379,6 +379,9 @@ static void hns_ae_stop(struct hnae_handle *handle)
 
        hns_ae_ring_enable_all(handle, 0);
 
+       /* clean rx fbd. */
+       hns_rcb_wait_fbd_clean(handle->qs, handle->q_num, RCB_INT_FLAG_RX);
+
        (void)hns_mac_vm_config_bc_en(mac_cb, 0, false);
 }