netvsc: need napi scheduled during removal
authorstephen hemminger <stephen@networkplumber.org>
Thu, 9 Mar 2017 23:04:14 +0000 (15:04 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 13 Mar 2017 06:15:43 +0000 (23:15 -0700)
Since rndis_halt_device waits until all outstanding sends and
receives are completed. Netvsc device needs to still schedule
NAPI to see those completions.

Fixes: 2506b1dc4bbe ("netvsc: implement NAPI")
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/hyperv/netvsc.c

index b1328cef9d5a0064473d4a4496b09b4cfc865ae3..0e0c757c168101dc7f4d5a0574fb6c90804bf742 100644 (file)
@@ -91,15 +91,6 @@ static void free_netvsc_device(struct netvsc_device *nvdev)
 }
 
 
-static inline bool netvsc_channel_idle(const struct netvsc_device *net_device,
-                                      u16 q_idx)
-{
-       const struct netvsc_channel *nvchan = &net_device->chan_table[q_idx];
-
-       return atomic_read(&net_device->num_outstanding_recvs) == 0 &&
-               atomic_read(&nvchan->queue_sends) == 0;
-}
-
 static struct netvsc_device *get_outbound_net_device(struct hv_device *device)
 {
        struct netvsc_device *net_device = hv_device_to_netvsc_device(device);
@@ -1273,13 +1264,10 @@ void netvsc_channel_cb(void *context)
        if (unlikely(!ndev))
                return;
 
-       net_device = net_device_to_netvsc_device(ndev);
-       if (unlikely(net_device->destroy) &&
-           netvsc_channel_idle(net_device, q_idx))
-               return;
-
        /* disable interupts from host */
        hv_begin_read(&channel->inbound);
+
+       net_device = net_device_to_netvsc_device(ndev);
        napi_schedule(&net_device->chan_table[q_idx].napi);
 }