]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
hv_netvsc: Fix unwanted wakeup in netvsc_attach()
authorHaiyang Zhang <haiyangz@microsoft.com>
Fri, 21 Feb 2020 16:32:18 +0000 (08:32 -0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 7 Apr 2020 08:51:35 +0000 (10:51 +0200)
commit39c938e418666284306d99a9179e25e4bf8ca2a1
tree9c3c761a626043ef2fa28c9ab2d0a32ee3f02d0d
parent1d8a4817a6ce17c7a4db7dac7cbb1fe41398404e
hv_netvsc: Fix unwanted wakeup in netvsc_attach()

BugLink: https://bugs.launchpad.net/bugs/1868623
commit f6f13c125e05603f68f5bf31f045b95e6d493598 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/hyperv/netvsc.c
drivers/net/hyperv/netvsc_drv.c