]> git.baikalelectronics.ru Git - kernel.git/commit
netvsc: fix race on sub channel creation
authorstephen hemminger <stephen@networkplumber.org>
Fri, 4 Aug 2017 00:13:54 +0000 (17:13 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 7 Aug 2017 04:23:21 +0000 (21:23 -0700)
commit95f09f6df6e111710cd0eb70e15ce1fb63acbfdc
tree5d000b7307ee1935be7492297897bf4bbb30c6ca
parent5ec7ad30bd55ba4265c7c5db2194987f1e2fad8d
netvsc: fix race on sub channel creation

The existing sub channel code did not wait for all the sub-channels
to completely initialize. This could lead to race causing crash
in napi_netif_del() from bad list. The existing code would send
an init message, then wait only for the initial response that
the init message was received. It thought it was waiting for
sub channels but really the init response did the wakeup.

The new code keeps track of the number of open channels and
waits until that many are open.

Other issues here were:
  * host might return less sub-channels than was requested.
  * the new init status is not valid until after init was completed.

Fixes: 04e2dc0757d3 ("hv_netvsc: Wait for sub-channels to be processed during probe")
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/hyperv/hyperv_net.h
drivers/net/hyperv/netvsc.c
drivers/net/hyperv/rndis_filter.c