netvsc: signal host if receive ring is emptied
authorstephen hemminger <stephen@networkplumber.org>
Fri, 28 Jul 2017 15:59:47 +0000 (08:59 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 29 Jul 2017 22:25:43 +0000 (15:25 -0700)
Latency improvement related to NAPI conversion.
If all packets are processed from receive ring then need
to signal host.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/hyperv/netvsc.c

index db95487..c64934c 100644 (file)
@@ -1195,10 +1195,15 @@ int netvsc_poll(struct napi_struct *napi, int budget)
                nvchan->desc = hv_pkt_iter_next(channel, nvchan->desc);
        }
 
-       /* If send of  pending receive completions suceeded
-        *   and did not exhaust NAPI budget
+       /* if ring is empty, signal host */
+       if (!nvchan->desc)
+               hv_pkt_iter_close(channel);
+
+       /* If send of pending receive completions suceeded
+        *   and did not exhaust NAPI budget this time
         *   and not doing busy poll
-        * then reschedule if more data has arrived from host
+        * then re-enable host interrupts
+        *     and reschedule if ring is not empty.
         */
        if (send_recv_completions(nvchan) == 0 &&
            work_done < budget &&