]> git.baikalelectronics.ru Git - 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)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Feb 2020 00:32:37 +0000 (16:32 -0800)
commitea09905b62359eca33ac0cd341350e83d068c740
tree3a9bb0f93b7bfa15f5be922144d0bb48968ea475
parent3a292d5eba274a5b65126083a5e466a1b1ee47b9
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: cb3aa3606eeb ("hv_netvsc: common detach logic")
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/hyperv/netvsc.c
drivers/net/hyperv/netvsc_drv.c