diff options
author | Mark Brown <broonie@kernel.org> | 2018-07-25 17:34:06 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-07-25 17:34:06 +0100 |
commit | ec665af5dd517c60ea1fbe791f6c8ecc443a61b6 (patch) | |
tree | adfe7a2578ecde6d65e927afe65b289efb458ab1 /drivers/net/hyperv/netvsc.c | |
parent | 46543af4c9edc5701729b24dd395c23a40871aa9 (diff) | |
parent | f952480a8fc14ea24a4de9582e425924f98c92d3 (diff) |
Merge tag 'v4.14.58' into linux-linaro-lsk-v4.14lsk-v4.14-18.07
This is the 4.14.58 stable release
Diffstat (limited to 'drivers/net/hyperv/netvsc.c')
-rw-r--r-- | drivers/net/hyperv/netvsc.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index 701be5d81062..806239b89990 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -1250,6 +1250,7 @@ int netvsc_poll(struct napi_struct *napi, int budget) struct hv_device *device = netvsc_channel_to_device(channel); struct net_device *ndev = hv_get_drvdata(device); int work_done = 0; + int ret; /* If starting a new interval */ if (!nvchan->desc) @@ -1261,16 +1262,18 @@ 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 this time - * and not doing busy poll + /* Send any pending receive completions */ + ret = send_recv_completions(ndev, net_device, nvchan); + + /* If it did not exhaust NAPI budget this time + * and not doing busy poll * then re-enable host interrupts - * and reschedule if ring is not empty. + * and reschedule if ring is not empty + * or sending receive completion failed. */ - if (send_recv_completions(ndev, net_device, nvchan) == 0 && - work_done < budget && + if (work_done < budget && napi_complete_done(napi, work_done) && - hv_end_read(&channel->inbound) && + (ret || hv_end_read(&channel->inbound)) && napi_schedule_prep(napi)) { hv_begin_read(&channel->inbound); __napi_schedule(napi); |