Skip to content

Commit feb8892

Browse files
jasowangdavem330
authored andcommitted
vhost_net: conditionally enable tx polling
We always poll tx for socket, this is sub optimal since this will slightly increase the waitqueue traversing time and more important, vhost could not benefit from commit 9e641bd ("net-tun: restructure tun_do_read for better sleep/wakeup efficiency") even if we've stopped rx polling during handle_rx(), tx poll were still left in the waitqueue. Pktgen from a remote host to VM over mlx4 on two 2.00GHz Xeon E5-2650 shows 11.7% improvements on rx PPS. (from 1.28Mpps to 1.44Mpps) Cc: Wei Xu <wexu@redhat.com> Cc: Matthew Rosato <mjrosato@linux.vnet.ibm.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 0eef304 commit feb8892

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/vhost/net.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,7 @@ static void handle_tx(struct vhost_net *net)
471471
goto out;
472472

473473
vhost_disable_notify(&net->dev, vq);
474+
vhost_net_disable_vq(net, vq);
474475

475476
hdr_size = nvq->vhost_hlen;
476477
zcopy = nvq->ubufs;
@@ -556,6 +557,7 @@ static void handle_tx(struct vhost_net *net)
556557
% UIO_MAXIOV;
557558
}
558559
vhost_discard_vq_desc(vq, 1);
560+
vhost_net_enable_vq(net, vq);
559561
break;
560562
}
561563
if (err != len)

0 commit comments

Comments
 (0)