summaryrefslogtreecommitdiffstats
path: root/drivers/net/hyperv
diff options
context:
space:
mode:
authorstephen hemminger <stephen@networkplumber.org>2017-07-28 17:59:47 +0200
committerDavid S. Miller <davem@davemloft.net>2017-07-30 00:25:43 +0200
commitf4e403633bcd290a4db2568364657d07b42ff890 (patch)
treebcd7f9aa7c5ec08698a1aafa93b64fe161492e39 /drivers/net/hyperv
parentnetvsc: fix error unwind on device setup failure (diff)
downloadlinux-f4e403633bcd290a4db2568364657d07b42ff890.tar.xz
linux-f4e403633bcd290a4db2568364657d07b42ff890.zip
netvsc: signal host if receive ring is emptied
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>
Diffstat (limited to 'drivers/net/hyperv')
-rw-r--r--drivers/net/hyperv/netvsc.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index db95487807fd..c64934c64dca 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -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 &&