hv_netvsc: Fix the real number of queues of non-vRSS cases
authorHaiyang Zhang <haiyangz@microsoft.com>
Mon, 14 May 2018 22:32:00 +0000 (15:32 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 May 2018 14:17:25 +0000 (16:17 +0200)
[ Commit 6450f8f269a9271985e4a8c13920b7e4cf21c0f3 upstream. ]

For older hosts without multi-channel (vRSS) support, and some error
cases, we still need to set the real number of queues to one.
This patch adds this missing setting.

Fixes: 8195b1396ec8 ("hv_netvsc: fix deadlock on hotplug")
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/hyperv/netvsc_drv.c

index 444e560d928b5b2ff36e60d9bd8614a9722e4560..dff93f682435e22ad69bb9d0b5626b218346ec10 100644 (file)
@@ -1932,6 +1932,12 @@ static int netvsc_probe(struct hv_device *dev,
        /* We always need headroom for rndis header */
        net->needed_headroom = RNDIS_AND_PPI_SIZE;
 
+       /* Initialize the number of queues to be 1, we may change it if more
+        * channels are offered later.
+        */
+       netif_set_real_num_tx_queues(net, 1);
+       netif_set_real_num_rx_queues(net, 1);
+
        /* Notify the netvsc driver of the new device */
        memset(&device_info, 0, sizeof(device_info));
        device_info.ring_size = ring_size;