summaryrefslogtreecommitdiff
path: root/drivers/net/hyperv/hyperv_net.h
diff options
context:
space:
mode:
authorKY Srinivasan <kys@microsoft.com>2015-07-22 21:42:32 +0300
committerDavid S. Miller <davem@davemloft.net>2015-07-27 02:40:36 +0300
commitb3e6b82a0099dfef038e40c630a554ed1e402504 (patch)
tree2b0faa141fac0208fe8e0d74bd15dc53a76a0b29 /drivers/net/hyperv/hyperv_net.h
parent402b764533e9d973952573df7ff96c41189e1a14 (diff)
downloadlinux-b3e6b82a0099dfef038e40c630a554ed1e402504.tar.xz
hv_netvsc: Wait for sub-channels to be processed during probe
The current code returns from probe without waiting for the proper handling of subchannels that may be requested. If the netvsc driver were to be rapidly loaded/unloaded, we can trigger a panic as the unload will be tearing down state that may not have been fully setup yet. We fix this issue by making sure that we return from the probe call only after ensuring that the sub-channel offers in flight are properly handled. Reviewed-and-tested-by: Haiyang Zhang <haiyangz@microsoft.com Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/hyperv/hyperv_net.h')
-rw-r--r--drivers/net/hyperv/hyperv_net.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
index 26cd14ccf4d5..925b75d4d910 100644
--- a/drivers/net/hyperv/hyperv_net.h
+++ b/drivers/net/hyperv/hyperv_net.h
@@ -671,6 +671,8 @@ struct netvsc_device {
u32 send_table[VRSS_SEND_TAB_SIZE];
u32 max_chn;
u32 num_chn;
+ spinlock_t sc_lock; /* Protects num_sc_offered variable */
+ u32 num_sc_offered;
atomic_t queue_sends[NR_CPUS];
/* Holds rndis device info */