Skip to content

vhost: add dequeue zero copy support

Yuanhan Liu dpdk-dev 3 versions – Applied

Status from this message: Applied to dpdk-next-virtio.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest7 patches 4 repliesApplied
  2. v27 patches 12 repliesSuperseded
  3. v16 patches 36 repliesSuperseded

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/7vhost: simplify memory regions handlinglib/librte_vhost/vhost.h lib/librte_vhost/vhost_user.c+91 -1310 replies
2/7vhost: get guest/host physical address mappingslib/librte_vhost/vhost.h lib/librte_vhost/vhost_user.c+128 -22 replies
3/7vhost: introduce last avail idx for dequeuelib/librte_vhost/vhost.h lib/librte_vhost/vhost_user.c lib/librte_vhost/virtio_net.c+16 -110 replies
4/7vhost: add dequeue zero copylib/librte_vhost/vhost.c lib/librte_vhost/vhost.h lib/librte_vhost/vhost_user.c +1 more+224 -210 replies
5/7vhost: add a flag to enable dequeue zero copydoc/guides/prog_guide/vhost_lib.rst doc/guides/rel_notes/release_16_11.rst lib/librte_vhost/rte_virtio_net.h +3 more+64 -10 replies
6/7examples/vhost: add an option to enable dequeue zero copyexamples/vhost/main.c+18 -10 replies
7/7net/vhost: add an option to enable dequeue zero copydrivers/net/vhost/rte_eth_vhost.c+13 -00 replies

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by.

PatchMaxime CoquelinQian Xu
SeriesT-b
1/7R-b
2/7R-b
3/7R-b
4/7R-b
5/7R-b
6/7R-b
7/7R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/7] vhost: add dequeue zero copy support

This patch set enables vhost dequeue zero copy. The majority work goes to patch 4: "vhost: add dequeue zero copy".

The basic idea of dequeue zero copy is, instead of copying data from the desc buf, here we let the mbuf reference the desc buf addr directly.

The major issue behind that is how and when to update the used ring. You could check the commit log of patch 4 for more details.

Patch 5 introduces a new flag, RTE_VHOST_USER_DEQUEUE_ZERO_COPY, to enable dequeue zero copy, which is disabled by default.

The performance gain is quite impressive. For a simple dequeue workload (running rxonly in vhost-pmd and runnin txonly in guest testpmd), it yields 50+% performance boost for packet size 1500B. For VM2VM iperf test case, it's even better: about 70% boost.

For small packets, the performance is worse (it's expected, as the extra overhead introduced by zero copy outweighs the benefits from saving few bytes copy).

v3: - rebase: mainly for removing conflicts with the Tx indirect patch
- don't update last_used_idx twice for zero-copy mode
- handle two mssiing "Tx -> dequeue" renames in log and usage

v2: - renamed "tx zero copy" to "dequeue zero copy", to reduce confusions.
- hnadle the case that a desc buf might across 2 host phys pages
- use MAP_POPULATE to let kernel populate the page tables
- updated release note
- doc-ed the limitations for the vm2nic case
- merge 2 continuous guest phys memory region
- and few more trivial changes, please see them in the corresponding patches

---
Yuanhan Liu (7):
vhost: simplify memory regions handling
vhost: get guest/host physical address mappings
vhost: introduce last avail idx for dequeue
vhost: add dequeue zero copy
vhost: add a flag to enable dequeue zero copy examples/vhost: add an option to enable dequeue zero copy net/vhost: add an option to enable dequeue zero copy

 doc/guides/prog_guide/vhost_lib.rst    |  35 +++-
 doc/guides/rel_notes/release_16_11.rst |  13 ++
 drivers/net/vhost/rte_eth_vhost.c      |  13 ++
 examples/vhost/main.c                  |  19 +-
 lib/librte_vhost/rte_virtio_net.h      |   1 +
 lib/librte_vhost/socket.c              |   5 +
 lib/librte_vhost/vhost.c               |  12 ++
 lib/librte_vhost/vhost.h               | 102 ++++++++---
 lib/librte_vhost/vhost_user.c          | 315 ++++++++++++++++++++++-----------
 lib/librte_vhost/virtio_net.c          | 196 +++++++++++++++++---
 10 files changed, 549 insertions(+), 162 deletions(-)
Signature · 1 line
1.9.0