aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/vhost/net.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/vhost/net.c')
-rw-r--r--drivers/vhost/net.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 1f21d2a1e528..853db7a08a26 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -166,7 +166,7 @@ static void handle_tx(struct vhost_net *net)
166 if (wmem < sock->sk->sk_sndbuf / 2) 166 if (wmem < sock->sk->sk_sndbuf / 2)
167 tx_poll_stop(net); 167 tx_poll_stop(net);
168 hdr_size = vq->vhost_hlen; 168 hdr_size = vq->vhost_hlen;
169 zcopy = vhost_sock_zcopy(sock); 169 zcopy = vq->ubufs;
170 170
171 for (;;) { 171 for (;;) {
172 /* Release DMAs done buffers first */ 172 /* Release DMAs done buffers first */
@@ -257,7 +257,8 @@ static void handle_tx(struct vhost_net *net)
257 UIO_MAXIOV; 257 UIO_MAXIOV;
258 } 258 }
259 vhost_discard_vq_desc(vq, 1); 259 vhost_discard_vq_desc(vq, 1);
260 tx_poll_start(net, sock); 260 if (err == -EAGAIN || err == -ENOBUFS)
261 tx_poll_start(net, sock);
261 break; 262 break;
262 } 263 }
263 if (err != len) 264 if (err != len)
@@ -265,6 +266,8 @@ static void handle_tx(struct vhost_net *net)
265 " len %d != %zd\n", err, len); 266 " len %d != %zd\n", err, len);
266 if (!zcopy) 267 if (!zcopy)
267 vhost_add_used_and_signal(&net->dev, vq, head, 0); 268 vhost_add_used_and_signal(&net->dev, vq, head, 0);
269 else
270 vhost_zerocopy_signal_used(vq);
268 total_len += len; 271 total_len += len;
269 if (unlikely(total_len >= VHOST_NET_WEIGHT)) { 272 if (unlikely(total_len >= VHOST_NET_WEIGHT)) {
270 vhost_poll_queue(&vq->poll); 273 vhost_poll_queue(&vq->poll);