Skip to content

RFC vhost: ring format independence

Michael S. Tsirkin kvm lkml netdev virtualization 11 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 RFC Latest11 patches 40 repliesIn review
  2. v7 RFC14 patches 12 repliesSuperseded
  3. v6 RFC11 patches 8 repliesSuperseded
Earlier versions · 8
VersionPostedPatchesRepliesStatus
v5 RFC13 patches7 repliesSuperseded
v4 RFC posting 2/25 patches2 repliesSuperseded
v4 RFC posting 1/20 of 5 patches0 repliesSuperseded
v3 RFC posting 2/24 patches0 repliesSuperseded
v3 RFC posting 1/20 of 4 patches0 repliesSuperseded
v2 RFC posting 2/22 patches0 repliesSuperseded
v2 RFC posting 1/20 of 2 patches0 repliesSuperseded
v1 RFC2 patches24 repliesSuperseded

changes from v8 from the cover letter

- squashed in fixes. no longer hangs but still known to cause data corruption for some people. under debug.

Patches in v8 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11vhost: option to fetch descriptors through an independent structdrivers/vhost/vhost.c drivers/vhost/vhost.h+320 -10 replies
2/11vhost: use batched get_vq_desc versiondrivers/vhost/test.c drivers/vhost/vhost.c drivers/vhost/vhost.h+61 -26238 replies
3/11vhost/net: pass net specific struct pointerdrivers/vhost/net.c+7 -71 reply
4/11vhost: reorder functionsdrivers/vhost/vhost.c+13 -130 replies
5/11vhost: format-independent API for used buffersdrivers/vhost/vhost.c drivers/vhost/vhost.h+79 -111 reply
6/11vhost/net: convert to new API: heads->bufsdrivers/vhost/net.c+82 -720 replies
7/11vhost/net: avoid iov length mathdrivers/vhost/net.c+3 -50 replies
8/11vhost/test: convert to the buf APIdrivers/vhost/test.c+11 -90 replies
9/11vhost/scsi: switch to buf APIsdrivers/vhost/scsi.c+44 -290 replies
10/11vhost/vsock: switch to the buf APIdrivers/vhost/vsock.c+18 -120 replies
11/11vhost: drop head based APIsdrivers/vhost/vhost.c drivers/vhost/vhost.h+8 -680 replies

Reviews trailers per patch

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

Read the v8 thread

Cover letter [PATCH RFC v8 00/11] vhost: ring format independence

This still causes corruption issues for people so don't try to use in production please. Posting to expedite debugging.

This adds infrastructure required for supporting
multiple ring formats.

The idea is as follows: we convert descriptors to an independent format first, and process that converting to iov later.

Used ring is similar: we fetch into an independent struct first, convert that to IOV later.

The point is that we have a tight loop that fetches descriptors, which is good for cache utilization. This will also allow all kind of batching tricks - e.g. it seems possible to keep SMAP disabled while we are fetching multiple descriptors.

For used descriptors, this allows keeping track of the buffer length without need to rescan IOV.

This seems to perform exactly the same as the original code based on a microbenchmark.
Lightly tested.
More testing would be very much appreciated.

changes from v8:
- squashed in fixes. no longer hangs but still known to cause data corruption for some people. under debug.

changes from v6:
- fixes some bugs introduced in v6 and v5

changes from v5:
- addressed comments by Jason: squashed API changes, fixed up discard

changes from v4:
- added used descriptor format independence
- addressed comments by jason
- fixed a crash detected by the lkp robot.

changes from v3:
- fixed error handling in case of indirect descriptors
- add BUG_ON to detect buffer overflow in case of bugs in response to comment by Jason Wang
- minor code tweaks

Changes from v2:
- fixed indirect descriptor batching
reported by Jason Wang

Changes from v1:
- typo fixes

Michael S. Tsirkin (14):
vhost: option to fetch descriptors through an independent struct fixup! vhost: option to fetch descriptors through an independent
struct

Michael S. Tsirkin (11):
vhost: option to fetch descriptors through an independent struct
vhost: use batched get_vq_desc version
vhost/net: pass net specific struct pointer
vhost: reorder functions
vhost: format-independent API for used buffers vhost/net: convert to new API: heads->bufs
vhost/net: avoid iov length math
vhost/test: convert to the buf API
vhost/scsi: switch to buf APIs
vhost/vsock: switch to the buf API
vhost: drop head based APIs

 drivers/vhost/net.c   | 174 +++++++++----------
 drivers/vhost/scsi.c  |  73 ++++----
 drivers/vhost/test.c  |  22 +--
 drivers/vhost/vhost.c | 378 +++++++++++++++++++++++++++---------------
 drivers/vhost/vhost.h |  44 +++--
 drivers/vhost/vsock.c |  30 ++--
 6 files changed, 439 insertions(+), 282 deletions(-)
Signature · 1 line
MST