Skip to content

virtio and vhost-net performance enhancements

Michael S. Tsirkin kvm linux-s390 lkml netdev virtualization 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest18 patches 54 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/18virtio: 64 bit featuresdrivers/lguest/lguest_device.c drivers/s390/kvm/kvm_virtio.c drivers/virtio/virtio.c +5 more+60 -260 replies
1/18virtio: 64 bit featuresdrivers/lguest/lguest_device.c drivers/s390/kvm/kvm_virtio.c drivers/virtio/virtio.c +5 more+60 -260 replies
2/18virtio_test: update for 64 bit featurestools/virtio/virtio_test.c+6 -20 replies
3/18vhost: fix 64 bit featuresdrivers/vhost/vhost.h+4 -40 replies
4/18virtio: don't delay avail index updatedrivers/virtio/virtio_ring.c+5 -100 replies
4/18virtio: don't delay avail index updatedrivers/virtio/virtio_ring.c+5 -100 replies
5/18virtio: used event index interfaceinclude/linux/virtio_ring.h+9 -04 replies
6/18virtio_ring: avail event index interfaceinclude/linux/virtio_ring.h+8 -310 replies
7/18virtio ring: inline function to check for eventsinclude/linux/virtio_ring.h+14 -04 replies
7/18virtio ring: inline function to check for eventsinclude/linux/virtio_ring.h+14 -00 replies
8/18virtio_ring: support for used_event idx featuredrivers/virtio/virtio_ring.c+14 -04 replies
9/18virtio: use avail_event indexdrivers/virtio/virtio_ring.c+38 -120 replies
10/18vhost: utilize used_event indexdrivers/vhost/vhost.c drivers/vhost/vhost.h+63 -180 replies
11/18vhost: support avail_event idxdrivers/vhost/net.c drivers/vhost/test.c drivers/vhost/vhost.c +1 more+67 -330 replies
12/18virtio_test: support used_event indextools/virtio/virtio_test.c+16 -20 replies
13/18virtio_test: avail_event index supporttools/virtio/virtio_test.c+15 -20 replies
13/18virtio_test: avail_event index supporttools/virtio/virtio_test.c+15 -20 replies
14/18virtio: add api for delayed callbacksdrivers/virtio/virtio_ring.c include/linux/virtio.h+36 -010 replies
15/18virtio_net: delay TX callbacksdrivers/net/virtio_net.c+1 -10 replies
15/18virtio_net: delay TX callbacksdrivers/net/virtio_net.c+1 -10 replies
16/18virtio_ring: Add capacity check APIdrivers/virtio/virtio_ring.c include/linux/virtio.h+13 -00 replies
17/18virtio_net: fix TX capacity checks using new APIdrivers/net/virtio_net.c+4 -50 replies
18/18virtio_net: limit xmit pollingdrivers/net/virtio_net.c+11 -70 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/18] virtio and vhost-net performance enhancements

OK, here's a large patchset that implements the virtio spec update that I sent earlier. It supercedes the PUBLISH_USED_IDX patches
I sent out earlier.

I know it's a lot to ask but please test, and please consider for 2.6.40 :)

I see nice performance improvements: one run showed going from 12 to 18 Gbit/s host to guest with netperf, but I did not spend a lot of time testing performance, so no guarantees it's not a fluke, I hope others will try this out and report.
Pls note I will be away from keyboard for the next week.

Essentially we change virtio ring notification hand-off to work like the one in Xen -
each side publishes an event index, the other one notifies when it reaches that value -
With the one difference that event index starts at 0, same as request index (in xen event index starts at 1).

Each side of the handoff has a feature bit independent of the other one, so we can have e.g. interrupts handled in the new way and exits in the old one.

This is actually what made the patchset larger:
we run out of feature bits so I had to add some more. I tested various combinations of hosts and guests and this code seems to be solid.

With the indexes in place it becomes possbile to request an event after many requests (and not just on the next one as done now). This shall fix the TX queue overrun which currently triggers a storm of interrupts.

The patches are mostly independent and can also be cherry-picked, hopefully there won't be much need of that.

One dependency I'd like to note is on two cleanup patches:
the patch removing batching of available index updates and the patch fixing ring capability checks in virtio-net. This simplified code a bit and made the following patch simpler.

I could unwrap the dependency but prefer as is.

The patchset is on top of net-next which at the time I last rebased was 15ecd03 - so roughly 2.6.39-rc2.

qemu patch will follow shortly.

Rusty, I think (in the hope it will come to that) it will be easier to merge vhost and virtio bits in one go. Can all go in through your tree (Dave in the past acked a very similar patch so should not be a problem) or from me to Dave Miller.

I see nice performance improvements: e.g. from 12 to 18 Gbit/s host to guest with netperf, but did not spend a lot of time testing performance, and I will be away from keyboard for the next week. I hope others will try this out and report.

Michael S. Tsirkin (17):
virtio: 64 bit features
virtio_test: update for 64 bit features
vhost: fix 64 bit features
virtio: don't delay avail index update
virtio: used event index interface
virtio_ring: avail event index interface virtio ring: inline function to check for events
virtio_ring: support for used_event idx feature
virtio: use avail_event index
vhost: utilize used_event index
vhost: support avail_event idx
virtio_test: support used_event index
virtio_test: avail_event index support
virtio: add api for delayed callbacks
virtio_net: delay TX callbacks
virtio_net: fix TX capacity checks using new API
virtio_net: limit xmit polling

Shirley Ma (1):
virtio_ring: Add capacity check API

 drivers/lguest/lguest_device.c |    8 +-
 drivers/net/virtio_net.c       |   25 ++++---
 drivers/s390/kvm/kvm_virtio.c  |    8 +-
 drivers/vhost/net.c            |   12 ++--
 drivers/vhost/test.c           |    6 +-
 drivers/vhost/vhost.c          |  139 ++++++++++++++++++++++++++++++----------
 drivers/vhost/vhost.h          |   30 ++++++---
 drivers/virtio/virtio.c        |    8 +-
 drivers/virtio/virtio_pci.c    |   34 ++++++++--
 drivers/virtio/virtio_ring.c   |  105 +++++++++++++++++++++++++++---
 include/linux/virtio.h         |   16 ++++-
 include/linux/virtio_config.h  |   15 +++--
 include/linux/virtio_pci.h     |    9 ++-
 include/linux/virtio_ring.h    |   30 ++++++++-
 tools/virtio/virtio_test.c     |   39 ++++++++++-
 15 files changed, 377 insertions(+), 107 deletions(-)
Signature · 1 line
1.7.5.53.gc233e