netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC v9 00/11] vhost: ring format independence
@ 2020-06-19 18:22 Eugenio Pérez
  2020-06-19 18:22 ` [RFC v9 01/11] vhost: option to fetch descriptors through an independent struct Eugenio Pérez
                   ` (10 more replies)
  0 siblings, 11 replies; 16+ messages in thread
From: Eugenio Pérez @ 2020-06-19 18:22 UTC (permalink / raw)
  To: mst
  Cc: kvm list, Stefano Garzarella, virtualization, linux-kernel,
	netdev, Stefan Hajnoczi, Jason Wang

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 better on UDP stream tests, but a little bit worse on
RR tests and TCP streams, based on a microbenchmark.
More testing would be very much appreciated.

changes from v8:
        - fixes fetch_descs returning "no descriptors available" when
          only few descriptors were available, stalling the communications.
        - minor syntax errors in intermediate commits.
        - skipping checking for sane max_descs if vhost device is not going to
          use worker like vDPA devices.

changes from v7:
        - 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 (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 | 372 +++++++++++++++++++++++++++---------------
 drivers/vhost/vhost.h |  44 +++--
 drivers/vhost/vsock.c |  30 ++--
 6 files changed, 435 insertions(+), 280 deletions(-)

-- 
2.18.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2020-06-23 16:46 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-19 18:22 [RFC v9 00/11] vhost: ring format independence Eugenio Pérez
2020-06-19 18:22 ` [RFC v9 01/11] vhost: option to fetch descriptors through an independent struct Eugenio Pérez
2020-06-19 18:22 ` [RFC v9 02/11] vhost: use batched get_vq_desc version Eugenio Pérez
2020-06-23 14:42   ` Michael S. Tsirkin
2020-06-23 16:45     ` Eugenio Perez Martin
2020-06-19 18:22 ` [RFC v9 03/11] vhost/net: pass net specific struct pointer Eugenio Pérez
2020-06-19 18:22 ` [RFC v9 04/11] vhost: reorder functions Eugenio Pérez
2020-06-19 18:22 ` [RFC v9 05/11] vhost: format-independent API for used buffers Eugenio Pérez
2020-06-19 18:22 ` [RFC v9 06/11] vhost/net: convert to new API: heads->bufs Eugenio Pérez
2020-06-19 18:22 ` [RFC v9 07/11] vhost/net: avoid iov length math Eugenio Pérez
2020-06-19 18:22 ` [RFC v9 08/11] vhost/test: convert to the buf API Eugenio Pérez
2020-06-19 18:23 ` [RFC v9 09/11] vhost/scsi: switch to buf APIs Eugenio Pérez
2020-06-22 10:01   ` Stefan Hajnoczi
2020-06-19 18:23 ` [RFC v9 10/11] vhost/vsock: switch to the buf API Eugenio Pérez
2020-06-22  9:59   ` Stefan Hajnoczi
2020-06-19 18:23 ` [RFC v9 11/11] vhost: drop head based APIs Eugenio Pérez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).