All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH v7 00/25] Net Control VQ support with asid in vDPA SVQ
@ 2022-04-13 16:31 Eugenio Pérez
  2022-04-13 16:31 ` [RFC PATCH v7 01/25] vhost: Track descriptor chain in private at SVQ Eugenio Pérez
                   ` (24 more replies)
  0 siblings, 25 replies; 50+ messages in thread
From: Eugenio Pérez @ 2022-04-13 16:31 UTC (permalink / raw)
  To: qemu-devel
  Cc: Laurent Vivier, Parav Pandit, Cindy Lu, Michael S. Tsirkin,
	Jason Wang, Gautam Dawar, Harpreet Singh Anand, Gonglei (Arei),
	Eli Cohen, Liuxiangdong, Zhu Lingshan

Control virtqueue is used by networking device for accepting various
commands from the driver. It's a must to support multiqueue and other
configurations.

Shadow VirtQueue (SVQ) already makes possible migration of virtqueue
states, effectively intercepting them so qemu can track what regions of memory
are dirty because device action and needs migration. However, this does not
solve networking device state seen by the driver because CVQ messages, like
changes on MAC addresses from the driver.

To solve that, this series uses SVQ infraestructure proposed at SVQ to
intercept networking control messages used by the device. This way, qemu is
able to update VirtIONet device model and to migrate it.

You can run qemu in two modes after applying this series: only intercepting
cvq with x-cvq-svq=on or intercept all the virtqueues adding cmdline x-svq=on:

-netdev type=vhost-vdpa,vhostdev=/dev/vhost-vdpa-0,id=vhost-vdpa0,x-cvq-svq=on,x-svq=on

The most updated kernel part of ASID is proposed at [1].

Other modes without x-cvq-svq have been not tested with this series. Other vq
cmd commands than set mac or mq are not tested. Some details like error control
are not 100% tested neither.

The firsts 5 patches will be or have already been proposed sepratedly. Patch 6
and 7 enable some pre-requisites. Patch 8 add cmdline parameter to shadow all
virtqueues. The rest of commits introduce the actual functionality.

Comments are welcomed.

Changes from rfc v6:
* Fix bad iotlb updates order when batching was enabled
* Add reference counting to iova_tree so cleaning is simpler.

Changes from rfc v5:
* Fixes bad calculus of cvq end group when MQ is not acked by the guest.

Changes from rfc v4:
* Add missing tracing
* Add multiqueue support
* Use already sent version for replacing g_memdup
* Care with memory management

Changes from rfc v3:
* Fix bad returning of descriptors to SVQ list.

Changes from rfc v2:
* Fix use-after-free.

Changes from rfc v1:
* Rebase to latest master.
* Configure ASID instead of assuming cvq asid != data vqs asid.
* Update device model so (MAC) state can be migrated too.

[1] https://lkml.kernel.org/kvm/20220224212314.1326-1-gdawar@xilinx.com/

Eugenio Pérez (24):
  vhost: Track descriptor chain in private at SVQ
  vdpa: Add missing tracing to batch mapping functions
  vdpa: Fix bad index calculus at vhost_vdpa_get_vring_base
  util: Return void on iova_tree_remove
  vdpa: Send all updates in memory listener commit
  vhost: Add reference counting to vhost_iova_tree
  vdpa: Add x-svq to NetdevVhostVDPAOptions
  vhost: move descriptor translation to vhost_svq_vring_write_descs
  vdpa: Fix index calculus at vhost_vdpa_svqs_start
  virtio-net: Expose ctrl virtqueue logic
  vdpa: Extract get features part from vhost_vdpa_get_max_queue_pairs
  virtio: Make virtqueue_alloc_element non-static
  vhost: Add SVQElement
  vhost: Add custom used buffer callback
  vdpa: control virtqueue support on shadow virtqueue
  vhost: Add vhost_iova_tree_find
  vdpa: Add map/unmap operation callback to SVQ
  vhost: Add vhost_svq_inject
  vdpa: add NetClientState->start() callback
  vdpa: Add vhost_vdpa_start_control_svq
  vhost: Update kernel headers
  vhost: Make possible to check for device exclusive vq group
  vdpa: Add asid attribute to vdpa device
  vdpa: Add x-cvq-svq

Philippe Mathieu-Daudé (1):
  hw/virtio: Replace g_memdup() by g_memdup2()

 qapi/net.json                                |  13 +-
 hw/virtio/vhost-iova-tree.h                  |   7 +-
 hw/virtio/vhost-shadow-virtqueue.h           |  52 +++-
 include/hw/virtio/vhost-vdpa.h               |   4 +-
 include/hw/virtio/vhost.h                    |   6 +
 include/hw/virtio/virtio-net.h               |   3 +
 include/hw/virtio/virtio.h                   |   1 +
 include/net/net.h                            |   2 +
 include/qemu/iova-tree.h                     |   4 +-
 include/standard-headers/linux/vhost_types.h |  11 +-
 linux-headers/linux/vhost.h                  |  25 +-
 hw/net/vhost_net.c                           |  13 +-
 hw/net/virtio-net.c                          |  82 ++---
 hw/virtio/vhost-iova-tree.c                  |  35 ++-
 hw/virtio/vhost-shadow-virtqueue.c           | 265 +++++++++++++---
 hw/virtio/vhost-vdpa.c                       | 262 ++++++++++++----
 hw/virtio/virtio-crypto.c                    |   6 +-
 hw/virtio/virtio.c                           |   2 +-
 net/vhost-vdpa.c                             | 305 +++++++++++++++++--
 util/iova-tree.c                             |   4 +-
 hw/virtio/trace-events                       |   8 +-
 21 files changed, 930 insertions(+), 180 deletions(-)

-- 
2.27.0




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

end of thread, other threads:[~2022-04-22 14:18 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-13 16:31 [RFC PATCH v7 00/25] Net Control VQ support with asid in vDPA SVQ Eugenio Pérez
2022-04-13 16:31 ` [RFC PATCH v7 01/25] vhost: Track descriptor chain in private at SVQ Eugenio Pérez
2022-04-14  3:48   ` Jason Wang
2022-04-22 14:16     ` Eugenio Perez Martin
2022-04-13 16:31 ` [RFC PATCH v7 02/25] vdpa: Add missing tracing to batch mapping functions Eugenio Pérez
2022-04-14  3:49   ` Jason Wang
2022-04-13 16:31 ` [RFC PATCH v7 03/25] vdpa: Fix bad index calculus at vhost_vdpa_get_vring_base Eugenio Pérez
2022-04-14  3:50   ` Jason Wang
2022-04-13 16:31 ` [RFC PATCH v7 04/25] util: Return void on iova_tree_remove Eugenio Pérez
2022-04-14  3:50   ` Jason Wang
2022-04-13 16:31 ` [RFC PATCH v7 05/25] hw/virtio: Replace g_memdup() by g_memdup2() Eugenio Pérez
2022-04-14  3:51   ` Jason Wang
2022-04-14  4:01   ` Jason Wang
2022-04-13 16:31 ` [RFC PATCH v7 06/25] vdpa: Send all updates in memory listener commit Eugenio Pérez
2022-04-14  4:11   ` Jason Wang
2022-04-22  9:17     ` Eugenio Perez Martin
2022-04-13 16:31 ` [RFC PATCH v7 07/25] vhost: Add reference counting to vhost_iova_tree Eugenio Pérez
2022-04-14  5:30   ` Jason Wang
2022-04-13 16:31 ` [RFC PATCH v7 08/25] vdpa: Add x-svq to NetdevVhostVDPAOptions Eugenio Pérez
2022-04-14  5:32   ` Jason Wang
2022-04-18 10:36     ` Eugenio Perez Martin
2022-04-13 16:31 ` [RFC PATCH v7 09/25] vhost: move descriptor translation to vhost_svq_vring_write_descs Eugenio Pérez
2022-04-14  5:48   ` Jason Wang
2022-04-13 16:31 ` [RFC PATCH v7 10/25] vdpa: Fix index calculus at vhost_vdpa_svqs_start Eugenio Pérez
2022-04-14  5:59   ` Jason Wang
2022-04-13 16:31 ` [RFC PATCH v7 11/25] virtio-net: Expose ctrl virtqueue logic Eugenio Pérez
2022-04-13 16:31 ` [RFC PATCH v7 12/25] vdpa: Extract get features part from vhost_vdpa_get_max_queue_pairs Eugenio Pérez
2022-04-13 16:31 ` [RFC PATCH v7 13/25] virtio: Make virtqueue_alloc_element non-static Eugenio Pérez
2022-04-13 16:31 ` [RFC PATCH v7 14/25] vhost: Add SVQElement Eugenio Pérez
2022-04-13 16:31 ` [RFC PATCH v7 15/25] vhost: Add custom used buffer callback Eugenio Pérez
2022-04-13 16:31 ` [RFC PATCH v7 16/25] vdpa: control virtqueue support on shadow virtqueue Eugenio Pérez
2022-04-14  9:10   ` Jason Wang
2022-04-18 10:55     ` Eugenio Perez Martin
2022-04-13 16:31 ` [RFC PATCH v7 17/25] vhost: Add vhost_iova_tree_find Eugenio Pérez
2022-04-13 16:31 ` [RFC PATCH v7 18/25] vdpa: Add map/unmap operation callback to SVQ Eugenio Pérez
2022-04-14  9:13   ` Jason Wang
2022-04-13 16:32 ` [RFC PATCH v7 19/25] vhost: Add vhost_svq_inject Eugenio Pérez
2022-04-14  9:09   ` Jason Wang
2022-04-18 13:58     ` Eugenio Perez Martin
2022-04-13 16:32 ` [RFC PATCH v7 20/25] vdpa: add NetClientState->start() callback Eugenio Pérez
2022-04-14  9:14   ` Jason Wang
2022-04-13 16:32 ` [RFC PATCH v7 21/25] vdpa: Add vhost_vdpa_start_control_svq Eugenio Pérez
2022-04-13 16:32 ` [RFC PATCH v7 22/25] vhost: Update kernel headers Eugenio Pérez
2022-04-13 16:32 ` [RFC PATCH v7 23/25] vhost: Make possible to check for device exclusive vq group Eugenio Pérez
2022-04-13 16:32 ` [RFC PATCH v7 24/25] vdpa: Add asid attribute to vdpa device Eugenio Pérez
2022-04-14  9:10   ` Jason Wang
2022-04-18 14:03     ` Eugenio Perez Martin
2022-04-13 16:32 ` [RFC PATCH v7 25/25] vdpa: Add x-cvq-svq Eugenio Pérez
2022-04-14  9:09   ` Jason Wang
2022-04-18 14:16     ` Eugenio Perez Martin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.