提交 0a282538 编写于 作者: H Haiyang Zhang 提交者: David S. Miller

net/hyperv: Use netif_tx_disable() instead of netif_stop_queue() when necessary

For code path not on the xmit, use netif_tx_disable() instead of
netif_stop_queue() to ensure other CPUs are not doing xmit.
Signed-off-by: NHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: NK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 cb0a178c
...@@ -123,7 +123,7 @@ static int netvsc_close(struct net_device *net) ...@@ -123,7 +123,7 @@ static int netvsc_close(struct net_device *net)
struct hv_device *device_obj = net_device_ctx->device_ctx; struct hv_device *device_obj = net_device_ctx->device_ctx;
int ret; int ret;
netif_stop_queue(net); netif_tx_disable(net);
ret = rndis_filter_close(device_obj); ret = rndis_filter_close(device_obj);
if (ret != 0) if (ret != 0)
...@@ -256,7 +256,7 @@ void netvsc_linkstatus_callback(struct hv_device *device_obj, ...@@ -256,7 +256,7 @@ void netvsc_linkstatus_callback(struct hv_device *device_obj,
schedule_delayed_work(&ndev_ctx->dwork, msecs_to_jiffies(20)); schedule_delayed_work(&ndev_ctx->dwork, msecs_to_jiffies(20));
} else { } else {
netif_carrier_off(net); netif_carrier_off(net);
netif_stop_queue(net); netif_tx_disable(net);
} }
} }
...@@ -337,7 +337,7 @@ static int netvsc_change_mtu(struct net_device *ndev, int mtu) ...@@ -337,7 +337,7 @@ static int netvsc_change_mtu(struct net_device *ndev, int mtu)
nvdev->start_remove = true; nvdev->start_remove = true;
cancel_delayed_work_sync(&ndevctx->dwork); cancel_delayed_work_sync(&ndevctx->dwork);
netif_stop_queue(ndev); netif_tx_disable(ndev);
rndis_filter_device_remove(hdev); rndis_filter_device_remove(hdev);
ndev->mtu = mtu; ndev->mtu = mtu;
...@@ -460,7 +460,7 @@ static int netvsc_remove(struct hv_device *dev) ...@@ -460,7 +460,7 @@ static int netvsc_remove(struct hv_device *dev)
cancel_delayed_work_sync(&ndev_ctx->dwork); cancel_delayed_work_sync(&ndev_ctx->dwork);
/* Stop outbound asap */ /* Stop outbound asap */
netif_stop_queue(net); netif_tx_disable(net);
unregister_netdev(net); unregister_netdev(net);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册