qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v2 00/18] Net Control VQ support with asid in vDPA SVQ
@ 2022-03-17 18:23 Eugenio Pérez
  2022-03-17 18:23 ` [RFC PATCH v2 01/18] vdpa: Add x-svq to NetdevVhostVDPAOptions Eugenio Pérez
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: Eugenio Pérez @ 2022-03-17 18:23 UTC (permalink / raw)
  To: qemu-devel
  Cc: Laurent Vivier, Parav Pandit, Cindy Lu, Michael S. Tsirkin,
	Jason Wang, Gautam Dawar, Harpreet Singh Anand, Eli Cohen,
	Zhu Lingshan, Liuxiangdong

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 are not tested. Some details like error control are
not 100% tested neither.

Comments are welcomed on every aspect of the patch.

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 (18):
  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: use g_memdup2() instead of unsafe g_memdup()
  virtio-net: Expose ctrl virtqueue logic
  vdpa: Extract get geatures 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
  vdpa: Add asid attribute to vdpa device
  vdpa: Add x-cvq-svq

 qapi/net.json                                |  13 +-
 hw/virtio/vhost-iova-tree.h                  |   2 +
 hw/virtio/vhost-shadow-virtqueue.h           |  46 ++-
 include/hw/virtio/vhost-vdpa.h               |   5 +
 include/hw/virtio/virtio-net.h               |   3 +
 include/hw/virtio/virtio.h                   |   1 +
 include/net/net.h                            |   2 +
 include/standard-headers/linux/vhost_types.h |  11 +-
 linux-headers/linux/vhost.h                  |  25 +-
 hw/net/vhost_net.c                           |   4 +
 hw/net/virtio-net.c                          |  82 +++--
 hw/virtio/vhost-iova-tree.c                  |  14 +
 hw/virtio/vhost-shadow-virtqueue.c           | 236 +++++++++---
 hw/virtio/vhost-vdpa.c                       |  70 +++-
 hw/virtio/virtio.c                           |   2 +-
 net/vhost-vdpa.c                             | 368 +++++++++++++++++--
 16 files changed, 760 insertions(+), 124 deletions(-)

-- 
2.27.0




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

end of thread, other threads:[~2022-03-17 18:51 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-17 18:23 [RFC PATCH v2 00/18] Net Control VQ support with asid in vDPA SVQ Eugenio Pérez
2022-03-17 18:23 ` [RFC PATCH v2 01/18] vdpa: Add x-svq to NetdevVhostVDPAOptions Eugenio Pérez
2022-03-17 18:23 ` [RFC PATCH v2 02/18] vhost: move descriptor translation to vhost_svq_vring_write_descs Eugenio Pérez
2022-03-17 18:23 ` [RFC PATCH v2 03/18] vdpa: Fix index calculus at vhost_vdpa_svqs_start Eugenio Pérez
2022-03-17 18:23 ` [RFC PATCH v2 04/18] virtio-net: use g_memdup2() instead of unsafe g_memdup() Eugenio Pérez
2022-03-17 18:23 ` [RFC PATCH v2 05/18] virtio-net: Expose ctrl virtqueue logic Eugenio Pérez
2022-03-17 18:23 ` [RFC PATCH v2 06/18] vdpa: Extract get geatures part from vhost_vdpa_get_max_queue_pairs Eugenio Pérez
2022-03-17 18:23 ` [RFC PATCH v2 07/18] virtio: Make virtqueue_alloc_element non-static Eugenio Pérez
2022-03-17 18:23 ` [RFC PATCH v2 08/18] vhost: Add SVQElement Eugenio Pérez
2022-03-17 18:23 ` [RFC PATCH v2 09/18] vhost: Add custom used buffer callback Eugenio Pérez
2022-03-17 18:23 ` [RFC PATCH v2 10/18] vdpa: control virtqueue support on shadow virtqueue Eugenio Pérez
2022-03-17 18:23 ` [RFC PATCH v2 11/18] vhost: Add vhost_iova_tree_find Eugenio Pérez
2022-03-17 18:23 ` [RFC PATCH v2 12/18] vdpa: Add map/unmap operation callback to SVQ Eugenio Pérez
2022-03-17 18:23 ` [RFC PATCH v2 13/18] vhost: Add vhost_svq_inject Eugenio Pérez
2022-03-17 18:23 ` [RFC PATCH v2 14/18] vdpa: add NetClientState->start() callback Eugenio Pérez
2022-03-17 18:23 ` [RFC PATCH v2 15/18] vdpa: Add vhost_vdpa_start_control_svq Eugenio Pérez
2022-03-17 18:23 ` [RFC PATCH v2 16/18] vhost: Update kernel headers Eugenio Pérez
2022-03-17 18:23 ` [RFC PATCH v2 17/18] vdpa: Add asid attribute to vdpa device Eugenio Pérez
2022-03-17 18:23 ` [RFC PATCH v2 18/18] vdpa: Add x-cvq-svq 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).