Skip to content

Commit

Permalink
netvsc: signal host if receive ring is emptied
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
stephen hemminger authored and David S. Miller committed Jul 29, 2017
1 parent 4939334 commit f4e4036
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions drivers/net/hyperv/netvsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down

0 comments on commit f4e4036

Please sign in to comment.