net: hns3: refine the handle for hns3_nic_net_open/stop()
authorJian Shen <shenjian15@huawei.com>
Thu, 20 Dec 2018 03:51:58 +0000 (11:51 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 Dec 2018 07:47:58 +0000 (23:47 -0800)
commit8cdb992f0dc36d6382840b1a6320e0c327a7d644
tree2462a45651f930fb4415d7941ff7d2d2f03d7f2f
parent754d5da63145852736f34cfc762164f5d8d6537b
net: hns3: refine the handle for hns3_nic_net_open/stop()

When triggering nic down, there is a time window between bringing down
the protocol stack and stopping the work task. If the net is up in the
time window, it may bring up the protocol stack again.

This patch fixes it by stop the work task at the beginning of
hns3_nic_net_stop(). To keep symmetrical, start the work task at the
end of hns3_nic_net_open().

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hnae3.h
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c