linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] vDPA driver for legacy virtio-pci device
@ 2021-09-08 12:20 Wu Zongyong
  2021-09-08 12:20 ` [PATCH 1/6] virtio-pci: introduce legacy device module Wu Zongyong
                   ` (7 more replies)
  0 siblings, 8 replies; 151+ messages in thread
From: Wu Zongyong @ 2021-09-08 12:20 UTC (permalink / raw)
  To: wuzongyong, jasowang, virtualization, linux-kernel, mst; +Cc: wei.yang1

This series implements the vDPA driver for legacy virtio-pci device.
Currently we already have the vDPA driver for modern virtio-pci device
only, but there are some legacy virtio-pci devices conforming to the
virtio-pci specifications of 0.9.x or older versions. For example,
ENI(Elastic Network Interface) of Alibaba ECS baremetal instance is a
hardware virtio network device which follows the Virtio PCI Card 0.9.5
Draft specification. Such legacy virtio-pci devices have some
inconsistent behaviour with modern virtio-pci devices, so some common
codes are split out and modern device specific codes are moved to a
separated file.

For legacy devices, it is not supported to negotiate the virtqueue size
by the specification. So a new callback get_vq_num_unchangeable is
introduced to indicate user not to try change the virtqueue size of the
legacy vdpa device. For example, QEMU should not allocate memory for
virtqueue according to the properties tx_queue_size and rx_queue_size if
we use legacy virtio-pci device as the vhost-vdpa backend. Instead, QEMU
should use the new callback get_vq_num_unchangeable first to check if
the vdpa device support to change virtqueue size. If not, QEMU should
call the callback get_vq_num_max to get the static virtqueue size then
allocate the same size memory for the virtqueue.

This series have been tested with the ENI in Alibaba ECS baremetal
instance.

These patches may under consideration, welcome for comments.


Wu Zongyong (6):
  virtio-pci: introduce legacy device module
  vdpa: fix typo
  vp_vdpa: add vq irq offloading support
  vp_vdpa: split out reusable and device specific codes to separate file
  vdpa: add get_vq_num_unchangeable callback in vdpa_config_ops
  vp_vdpa: introduce legacy virtio pci driver

 drivers/vdpa/Kconfig                     |   7 +
 drivers/vdpa/virtio_pci/Makefile         |   3 +
 drivers/vdpa/virtio_pci/vp_vdpa.c        |   8 +
 drivers/vdpa/virtio_pci/vp_vdpa_common.c | 220 ++++++++++++++
 drivers/vdpa/virtio_pci/vp_vdpa_common.h |  67 +++++
 drivers/vdpa/virtio_pci/vp_vdpa_legacy.c | 346 +++++++++++++++++++++++
 drivers/vdpa/virtio_pci/vp_vdpa_modern.c | 327 +++++++++++++++++++++
 drivers/vhost/vdpa.c                     |  19 ++
 drivers/virtio/Kconfig                   |  10 +
 drivers/virtio/Makefile                  |   1 +
 drivers/virtio/virtio_pci_common.c       |  10 +-
 drivers/virtio/virtio_pci_common.h       |   9 +-
 drivers/virtio/virtio_pci_legacy.c       | 101 ++-----
 drivers/virtio/virtio_pci_legacy_dev.c   | 220 ++++++++++++++
 drivers/virtio/virtio_vdpa.c             |   5 +-
 include/linux/vdpa.h                     |   6 +-
 include/linux/virtio_pci_legacy.h        |  44 +++
 include/uapi/linux/vhost.h               |   2 +
 18 files changed, 1320 insertions(+), 85 deletions(-)
 create mode 100644 drivers/vdpa/virtio_pci/vp_vdpa_common.c
 create mode 100644 drivers/vdpa/virtio_pci/vp_vdpa_common.h
 create mode 100644 drivers/vdpa/virtio_pci/vp_vdpa_legacy.c
 create mode 100644 drivers/vdpa/virtio_pci/vp_vdpa_modern.c
 create mode 100644 drivers/virtio/virtio_pci_legacy_dev.c
 create mode 100644 include/linux/virtio_pci_legacy.h

-- 
2.31.1


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

end of thread, other threads:[~2021-11-01 11:12 UTC | newest]

Thread overview: 151+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-08 12:20 [PATCH 0/6] vDPA driver for legacy virtio-pci device Wu Zongyong
2021-09-08 12:20 ` [PATCH 1/6] virtio-pci: introduce legacy device module Wu Zongyong
2021-09-08 12:20 ` [PATCH 2/6] vdpa: fix typo Wu Zongyong
2021-09-08 12:20 ` [PATCH 3/6] vp_vdpa: add vq irq offloading support Wu Zongyong
2021-09-09  2:53   ` Jason Wang
2021-09-08 12:20 ` [PATCH 4/6] vp_vdpa: split out reusable and device specific codes to separate file Wu Zongyong
2021-09-08 12:20 ` [PATCH 5/6] vdpa: add get_vq_num_unchangeable callback in vdpa_config_ops Wu Zongyong
2021-09-09  2:55   ` Jason Wang
2021-09-09  8:01     ` Wu Zongyong
2021-09-09  9:28       ` Jason Wang
2021-09-09  9:57         ` Wu Zongyong
2021-09-10  1:45           ` Jason Wang
2021-09-10  7:32             ` Wu Zongyong
2021-09-10  8:25               ` Cindy Lu
2021-09-10  9:20                 ` Wu Zongyong
2021-09-10 15:10                   ` Cindy Lu
2021-09-13  1:43                     ` Jason Wang
2021-09-13  2:59                       ` Wu Zongyong
2021-09-13  3:13                         ` Jason Wang
2021-09-13  6:22                           ` Cindy Lu
2021-09-09  9:18     ` Michael S. Tsirkin
2021-09-09  9:32       ` Jason Wang
2021-09-08 12:20 ` [PATCH 6/6] vp_vdpa: introduce legacy virtio pci driver Wu Zongyong
2021-09-09 13:57   ` Michael S. Tsirkin
2021-09-10  2:28     ` Wu Zongyong
2021-09-10  9:57       ` Michael S. Tsirkin
2021-09-10 10:01         ` Wu Zongyong
2021-10-22  9:37         ` Michael S. Tsirkin
2021-09-09  3:05 ` [PATCH 0/6] vDPA driver for legacy virtio-pci device Jason Wang
2021-09-09  3:20   ` Jason Wang
2021-09-09  8:12   ` Wu Zongyong
2021-09-09  9:29     ` Jason Wang
2021-09-09  9:21   ` Michael S. Tsirkin
2021-09-09  9:31     ` Jason Wang
2021-09-09 12:53   ` Wu Zongyong
2021-09-10  1:44     ` Jason Wang
2021-09-14 12:24 ` [PATCH v2 0/5] vDPA driver for Alibaba ENI Wu Zongyong
2021-09-14 12:24   ` Wu Zongyong
2021-09-14 12:24   ` [PATCH v2 1/5] virtio-pci: introduce legacy device module Wu Zongyong
2021-09-14 22:37     ` Randy Dunlap
2021-09-14 12:24   ` [PATCH v2 2/5] vdpa: fix typo Wu Zongyong
2021-09-15  3:15     ` Jason Wang
2021-09-14 12:24   ` [PATCH v2 3/5] vp_vdpa: add vq irq offloading support Wu Zongyong
2021-09-15  3:16     ` Jason Wang
2021-09-15  3:31       ` Wu Zongyong
2021-09-15  4:13         ` Jason Wang
2021-09-14 12:24   ` [PATCH v2 4/5] vdpa: add new vdpa attribute VDPA_ATTR_DEV_F_VERSION_1 Wu Zongyong
2021-09-14 12:58     ` Michael S. Tsirkin
2021-09-15  3:18       ` Jason Wang
2021-09-15  7:38         ` Michael S. Tsirkin
2021-09-15  8:06           ` Jason Wang
2021-09-15 11:08             ` Michael S. Tsirkin
2021-09-15 12:12               ` Wu Zongyong
2021-09-16  1:11                 ` Jason Wang
2021-09-16  1:05               ` Jason Wang
2021-09-17  2:34                 ` Wu Zongyong
2021-09-17  7:51                   ` Jason Wang
2021-09-15  3:24       ` Wu Zongyong
2021-09-15  7:30         ` Michael S. Tsirkin
2021-09-15  8:05           ` Jason Wang
2021-09-15 11:10             ` Michael S. Tsirkin
2021-09-14 12:24   ` [PATCH v2 5/5] eni_vdpa: add vDPA driver for Alibaba ENI Wu Zongyong
2021-09-14 22:35     ` Randy Dunlap
2021-09-15  3:14     ` Jason Wang
2021-09-15  3:47       ` Wu Zongyong
2021-09-15 13:36     ` kernel test robot
2021-09-22 12:46   ` [PATCH v3 0/7] " Wu Zongyong
2021-09-22 12:46     ` [PATCH v3 1/7] virtio-pci: introduce legacy device module Wu Zongyong
2021-09-22 12:46     ` [PATCH v3 2/7] vdpa: fix typo Wu Zongyong
2021-09-22 12:46     ` [PATCH v3 3/7] vp_vdpa: add vq irq offloading support Wu Zongyong
2021-09-22 12:46     ` [PATCH v3 4/7] vdpa: add new callback get_vq_num_min in vdpa_config_ops Wu Zongyong
2021-09-22 12:46     ` [PATCH v3 5/7] virtio_vdpa: setup correct vq size with callbacks get_vq_num_{max,min} Wu Zongyong
2021-09-22 12:46     ` [PATCH v3 6/7] vdpa: add new attribute VDPA_ATTR_DEV_MIN_VQ_SIZE Wu Zongyong
2021-09-22 12:46     ` [PATCH v3 7/7] eni_vdpa: add vDPA driver for Alibaba ENI Wu Zongyong
2021-09-26  2:24       ` Jason Wang
2021-09-26  3:24         ` Wu Zongyong
2021-09-26  4:18           ` Jason Wang
2021-09-27 10:36             ` Michael S. Tsirkin
2021-09-28  2:17               ` Jason Wang
2021-09-26  2:26       ` Jason Wang
2021-09-26  3:27         ` Wu Zongyong
2021-09-26  4:19           ` Jason Wang
2021-09-29 12:54       ` kernel test robot
2021-09-29  6:11     ` [PATCH v4 0/7] " Wu Zongyong
2021-09-29  6:11       ` [PATCH v4 1/7] virtio-pci: introduce legacy device module Wu Zongyong
2021-10-11  3:00         ` Jason Wang
2021-10-11  3:02         ` Jason Wang
2021-09-29  6:11       ` [PATCH v4 2/7] vdpa: fix typo Wu Zongyong
2021-10-11  3:03         ` Jason Wang
2021-09-29  6:11       ` [PATCH v4 3/7] vp_vdpa: add vq irq offloading support Wu Zongyong
2021-09-29  6:11       ` [PATCH v4 4/7] vdpa: add new callback get_vq_num_min in vdpa_config_ops Wu Zongyong
2021-10-11  3:04         ` Jason Wang
2021-09-29  6:11       ` [PATCH v4 5/7] virtio_vdpa: setup correct vq size with callbacks get_vq_num_{max,min} Wu Zongyong
2021-10-11  3:06         ` Jason Wang
2021-09-29  6:11       ` [PATCH v4 6/7] vdpa: add new attribute VDPA_ATTR_DEV_MIN_VQ_SIZE Wu Zongyong
2021-10-11  3:10         ` Jason Wang
2021-09-29  6:11       ` [PATCH v4 7/7] eni_vdpa: add vDPA driver for Alibaba ENI Wu Zongyong
2021-10-11  3:18         ` Jason Wang
2021-10-15  7:14       ` [PATCH v5 0/8] " Wu Zongyong
2021-10-15  7:14         ` [PATCH v5 1/8] virtio-pci: introduce legacy device module Wu Zongyong
2021-10-15  8:22           ` Jason Wang
2021-10-15  7:14         ` [PATCH v5 2/8] vdpa: fix typo Wu Zongyong
2021-10-15  7:14         ` [PATCH v5 3/8] vp_vdpa: add vq irq offloading support Wu Zongyong
2021-10-15  7:14         ` [PATCH v5 4/8] vdpa: add new callback get_vq_num_min in vdpa_config_ops Wu Zongyong
2021-10-15  8:22           ` Jason Wang
2021-10-15  7:14         ` [PATCH v5 5/8] vdpa: min vq num of vdpa device cannot be greater than max vq num Wu Zongyong
2021-10-15  8:24           ` Jason Wang
2021-10-15  7:14         ` [PATCH v5 6/8] virtio_vdpa: setup correct vq size with callbacks get_vq_num_{max,min} Wu Zongyong
2021-10-15  8:30           ` Jason Wang
2021-10-15  7:15         ` [PATCH v5 7/8] vdpa: add new attribute VDPA_ATTR_DEV_MIN_VQ_SIZE Wu Zongyong
2021-10-15  7:15         ` [PATCH v5 8/8] eni_vdpa: add vDPA driver for Alibaba ENI Wu Zongyong
2021-10-15  8:18           ` Jason Wang
2021-10-15 19:13           ` Randy Dunlap
2021-10-22  2:44         ` [PATCH v6 0/8] " Wu Zongyong
2021-10-22  2:44           ` [PATCH v6 1/8] virtio-pci: introduce legacy device module Wu Zongyong
2021-10-25  1:30             ` Jason Wang
2021-10-22  2:44           ` [PATCH v6 2/8] vdpa: fix typo Wu Zongyong
2021-10-22  2:44           ` [PATCH v6 3/8] vp_vdpa: add vq irq offloading support Wu Zongyong
2021-10-22  2:44           ` [PATCH v6 4/8] vdpa: add new callback get_vq_num_min in vdpa_config_ops Wu Zongyong
2021-10-25  2:17             ` Jason Wang
2021-10-22  2:44           ` [PATCH v6 5/8] vdpa: min vq num of vdpa device cannot be greater than max vq num Wu Zongyong
2021-10-25  2:18             ` Jason Wang
2021-10-22  2:44           ` [PATCH v6 6/8] virtio_vdpa: setup correct vq size with callbacks get_vq_num_{max,min} Wu Zongyong
2021-10-25  2:22             ` Jason Wang
     [not found]               ` <20211025024403.GA3684@L-PF27918B-1352.localdomain>
2021-10-25  4:45                 ` Jason Wang
     [not found]                   ` <20211025062454.GA4832@L-PF27918B-1352.localdomain>
2021-10-26  4:46                     ` Jason Wang
2021-10-22  2:44           ` [PATCH v6 7/8] vdpa: add new attribute VDPA_ATTR_DEV_MIN_VQ_SIZE Wu Zongyong
2021-10-25  2:23             ` Jason Wang
2021-10-22  2:44           ` [PATCH v6 8/8] eni_vdpa: add vDPA driver for Alibaba ENI Wu Zongyong
2021-10-25  2:27             ` Jason Wang
     [not found]               ` <20211025032146.GC3684@L-PF27918B-1352.localdomain>
2021-10-25  4:40                 ` Jason Wang
2021-10-27  2:47                   ` Wu Zongyong
2021-10-27  3:55                     ` Jason Wang
2021-10-27  7:04                       ` Wu Zongyong
2021-10-29  9:14           ` [PATCH v7 0/9] " Wu Zongyong
2021-10-29  9:14             ` [PATCH v7 1/9] virtio-pci: introduce legacy device module Wu Zongyong
2021-10-29  9:14             ` [PATCH v7 2/9] vdpa: fix typo Wu Zongyong
2021-10-29  9:14             ` [PATCH v7 3/9] vp_vdpa: add vq irq offloading support Wu Zongyong
2021-10-29  9:14             ` [PATCH v7 4/9] vdpa: add new callback get_vq_num_min in vdpa_config_ops Wu Zongyong
2021-10-29  9:14             ` [PATCH v7 5/9] vdpa: min vq num of vdpa device cannot be greater than max vq num Wu Zongyong
2021-10-29  9:14             ` [PATCH v7 6/9] virtio_vdpa: setup correct vq size with callbacks get_vq_num_{max,min} Wu Zongyong
2021-10-29  9:14             ` [PATCH v7 7/9] vdpa: add new attribute VDPA_ATTR_DEV_MIN_VQ_SIZE Wu Zongyong
2021-10-29  9:14             ` [PATCH v7 8/9] eni_vdpa: add vDPA driver for Alibaba ENI Wu Zongyong
2021-10-29  9:14             ` [PATCH v7 9/9] eni_vdpa: alibaba: fix Kconfig typo Wu Zongyong
2021-11-01  8:18               ` Michael S. Tsirkin
2021-11-01  3:31             ` [PATCH v7 0/9] vDPA driver for Alibaba ENI Jason Wang
2021-11-01  6:22               ` Wu Zongyong
2021-11-01  7:02                 ` Jason Wang
2021-11-01  8:11                   ` Wu Zongyong
2021-11-01 11:12                     ` Michael S. Tsirkin
2021-11-01  8:19             ` Michael S. Tsirkin

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).