diff options
| author | Haiyang Zhang <haiyangz@microsoft.com> | 2020-02-21 08:32:18 -0800 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2020-02-23 16:32:37 -0800 |
| commit | f6f13c125e05603f68f5bf31f045b95e6d493598 (patch) | |
| tree | 3a9bb0f93b7bfa15f5be922144d0bb48968ea475 /drivers/net/hyperv/netvsc.c | |
| parent | eae7172f8141eb98e64e6e81acc9e9d5b2add127 (diff) | |
| download | linux-next-f6f13c125e05603f68f5bf31f045b95e6d493598.tar.gz linux-next-f6f13c125e05603f68f5bf31f045b95e6d493598.zip | |
hv_netvsc: Fix unwanted wakeup in netvsc_attach()
When netvsc_attach() is called by operations like changing MTU, etc.,
an extra wakeup may happen while netvsc_attach() calling
rndis_filter_device_add() which sends rndis messages when queue is
stopped in netvsc_detach(). The completion message will wake up queue 0.
We can reproduce the issue by changing MTU etc., then the wake_queue
counter from "ethtool -S" will increase beyond stop_queue counter:
stop_queue: 0
wake_queue: 1
The issue causes queue wake up, and counter increment, no other ill
effects in current code. So we didn't see any network problem for now.
To fix this, initialize tx_disable to true, and set it to false when
the NIC is ready to be attached or registered.
Fixes: 7b2ee50c0cd5 ("hv_netvsc: common detach logic")
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/hyperv/netvsc.c')
| -rw-r--r-- | drivers/net/hyperv/netvsc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index ae3f3084c2ed..1b320bcf150a 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -99,7 +99,7 @@ static struct netvsc_device *alloc_net_device(void) init_waitqueue_head(&net_device->wait_drain); net_device->destroy = false; - net_device->tx_disable = false; + net_device->tx_disable = true; net_device->max_pkt = RNDIS_MAX_PKT_DEFAULT; net_device->pkt_align = RNDIS_PKT_ALIGN_DEFAULT; |
