All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] VIRTIO: Provision maximum MSI-X vectors for a VF
@ 2022-01-24  9:39 Max Gurtovoy
  2022-01-24  9:39 ` [PATCH v2 1/4] Add virtio Admin Virtqueue Max Gurtovoy
                   ` (3 more replies)
  0 siblings, 4 replies; 69+ messages in thread
From: Max Gurtovoy @ 2022-01-24  9:39 UTC (permalink / raw)
  To: virtio-comment, mst, cohuck, virtio-dev, jasowang
  Cc: parav, shahafs, oren, stefanha, Max Gurtovoy

Hi,

In a PCI SR-IOV configuration, MSI-X vectors of the device is precious
device resource. Hence making efficient use of it based on the use case
that aligns to the VM configuration is desired for best system
performance.

For example, today's static assignment of the amount of MSI-X vectors
doesn't allow sophisticated utilization of resources.

A typical cloud provider SR-IOV use case is to create many VFs for
use by guest VMs. Each VM might have a different purpose and different
amount of resources accordingly (e.g. number of CPUs). A common driver
usage of device's MSI-X vectors is proportional to the number of CPUs in
the VM. Since the system administrator might know the amount of CPUs in
the requested VM, he can also configure the VF's MSI-X vectors amount
proportional to the number of CPUs in the VM. In this way, the
utilization of the physical hardware will be improved.

Today we have some operating systems that support provisioning MSI-X
vectors for PCI VFs.

Update the specification to have a method to change the number of MSI-X
vectors supported by a VF using the PF admin virtqueue interface. For that,
create a generic infrastructure for managing PCI resources of the managed
VF by its parent PF.

The admin virtqueue interface will be extended in the future with more and more
features that some of them already in discussions. Some of these features don't
fit to MMIO/config_space characteristics, therefore a queue is selected to address
admin commands.

Motivation for choosing admin queue:
1. It is anticipated that admin queue will be used for managing and configuring
   many different type of resources. For example,
   a. PCI PF configuring PCI VF attributes in [1].
   b. virtio device creating/destroying/configuring subfunctions discussed in [2]
   c. composing device config space of VF or SF such as mac address, number of VQs, virtio features

Mapping all of them as configuration registers to MMIO will require large MMIO space, if done for
each VF/SF. Such MMIO implementation in physical devices such as PCI PF and VF requires on-chip
resources to complete within MMIO access latencies. Such resources are very expensive.

2. Such limitation can be overcome by having smaller MMIO register set to build
   a command request response interface. However, such MMIO based command interface
   will be limited to serve single outstanding command execution. Such limitation can
   resulting in high device creation and composing time which can affect VM startup time.
   Often device can queue and service multiple commands in parallel, such command interface
   cannot use parallelism offered by the device.

3. When a command wants to DMA data from one or more physical addresses, for example in the future a
   live migration command may need to fetch device state consist of config space, tens of
   VQs state, VLAN and MAC table, per VQ partial outstanding block IO list database and more.
   Packing one or more DMA addresses over new command interface will be burden some and continue
   to suffer single outstanding command execution latencies. Such limitation is not good for time
   sensitive live migration use cases.

4. A virtio queue overcomes all the above limitations. It also supports DMA and multiple outstanding
   descriptors. Similar mechanism exist today for device specific configuration - the control VQ.

[1] This proposal
[2] https://lists.oasis-open.org/archives/virtio-comment/202108/msg00025.html

Patches (1/4) introduce the admin virtqueue concept and feature bit.
Patches (2/4)-(3/4) add the admin virtq to virtio-blk and virtio-net
devices.
Patch (4/4) introduce MSI-X control support.

---

changes from V1:

1. Addressed below comments from MST:
 - updated cover letter for admin queue motivation
 - removed VIRTIO_F_ADMIN_PCI_VIRT_MANAGER
 - simplified admin queue interface by removing 
   VIRTIO_F_ADMIN_VQ_INDIRECT_DESC/VIRTIO_F_ADMIN_VQ_IN_ORDER feature bits
 - added a subsection for VF MSI-X control capability in PCI section
 - re-designed interrupt vector management admin commands
 - added a mandatory admin command to expose admin capabilities
 - improved commit messages
 - described error code for unsupported command
 - described error code for errors on invalid VF
 - described system software requirements for supporting MSI-X configuration

2. Addressed comments from Parav
 - extended command opcode to 16-bit
 - improve commit messages

3. Added more command specific error codes

---

Max Gurtovoy (4):
  Add virtio Admin Virtqueue
  virtio-blk: add support for VIRTIO_F_ADMIN_VQ
  virtio-net: add support for VIRTIO_F_ADMIN_VQ
  Add support for MSI-X vectors configuration for PCI VFs

 admin-virtq.tex | 235 ++++++++++++++++++++++++++++++++++++++++++++++++
 content.tex     |  67 +++++++++++++-
 2 files changed, 299 insertions(+), 3 deletions(-)
 create mode 100644 admin-virtq.tex

-- 
2.21.0


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

end of thread, other threads:[~2022-02-09 11:43 UTC | newest]

Thread overview: 69+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-24  9:39 [PATCH v2 0/4] VIRTIO: Provision maximum MSI-X vectors for a VF Max Gurtovoy
2022-01-24  9:39 ` [PATCH v2 1/4] Add virtio Admin Virtqueue Max Gurtovoy
2022-01-26 14:40   ` Michael S. Tsirkin
2022-01-26 14:54     ` [virtio-comment] " Max Gurtovoy
2022-01-26 15:03       ` Michael S. Tsirkin
2022-01-26 15:16         ` [virtio-comment] " Max Gurtovoy
2022-01-27  3:56         ` Parav Pandit
2022-01-27  3:55     ` Parav Pandit
2022-01-27  3:56       ` Jason Wang
2022-01-27  3:14   ` [virtio-comment] " Jason Wang
2022-01-27 10:25     ` Max Gurtovoy
2022-01-27 13:03       ` Jason Wang
2022-01-27 14:46         ` Max Gurtovoy
2022-01-28  3:18           ` Jason Wang
2022-01-30 10:31             ` Max Gurtovoy
2022-02-09  2:45               ` Jason Wang
2022-02-09 11:43                 ` Max Gurtovoy
2022-01-28 12:14   ` [virtio-comment] " Cornelia Huck
2022-01-28 12:47     ` Michael S. Tsirkin
2022-01-28 15:49       ` [virtio-comment] " Cornelia Huck
2022-01-28 15:52         ` Michael S. Tsirkin
2022-01-28 16:14           ` [virtio-dev] " Cornelia Huck
2022-01-28 16:16             ` Michael S. Tsirkin
2022-01-28 16:23               ` [virtio-dev] " Cornelia Huck
2022-01-29  3:53           ` Jason Wang
2022-01-30  9:13             ` Max Gurtovoy
2022-01-30  9:40               ` Michael S. Tsirkin
2022-01-30  9:56                 ` Max Gurtovoy
2022-01-30 14:41                   ` Michael S. Tsirkin
2022-01-30 15:12                     ` Max Gurtovoy
2022-01-30 15:30                       ` Michael S. Tsirkin
2022-01-30 18:23                         ` [virtio-comment] " Max Gurtovoy
2022-01-30 21:15                           ` Michael S. Tsirkin
2022-01-31  9:16                         ` [virtio-dev] " Cornelia Huck
2022-01-31 13:40                           ` Michael S. Tsirkin
2022-01-31 14:26                             ` [virtio-comment] " Cornelia Huck
2022-01-31 14:52                               ` Michael S. Tsirkin
2022-01-31 15:48                                 ` [virtio-dev] " Cornelia Huck
2022-01-31 16:00                                   ` Michael S. Tsirkin
2022-01-31 16:12                                 ` Halil Pasic
2022-01-31 17:10                                   ` [virtio-dev] " Cornelia Huck
2022-01-31 17:22                                     ` Michael S. Tsirkin
2022-02-01 11:53                                     ` [virtio-dev] " Halil Pasic
2022-02-01 17:01                                       ` Cornelia Huck
2022-02-01 18:34                                         ` Michael S. Tsirkin
2022-01-31 15:47                           ` Halil Pasic
2022-01-31 16:01                             ` Michael S. Tsirkin
2022-01-31 16:12                             ` Cornelia Huck
2022-02-09  2:27                         ` Jason Wang
2022-02-09  7:46                           ` Michael S. Tsirkin
2022-01-30  9:39             ` Michael S. Tsirkin
2022-01-30 11:21     ` [virtio-comment] " Max Gurtovoy
2022-01-30 14:37       ` Michael S. Tsirkin
2022-01-24  9:39 ` [virtio-comment] [PATCH v2 2/4] virtio-blk: add support for VIRTIO_F_ADMIN_VQ Max Gurtovoy
2022-01-24  9:39 ` [PATCH v2 3/4] virtio-net: " Max Gurtovoy
2022-01-24  9:39 ` [PATCH v2 4/4] Add support for MSI-X vectors configuration for PCI VFs Max Gurtovoy
2022-01-25 11:53   ` Michael S. Tsirkin
2022-01-26 13:03     ` Parav Pandit
2022-01-26 14:08       ` [virtio-comment] " Michael S. Tsirkin
2022-01-27  3:40         ` Parav Pandit
2022-01-27 12:39           ` Michael S. Tsirkin
2022-01-27 14:16             ` Parav Pandit
2022-01-27 17:28               ` Michael S. Tsirkin
2022-01-27  3:36   ` Jason Wang
2022-01-27  5:22     ` Parav Pandit
2022-01-28  3:23       ` [virtio-comment] " Jason Wang
2022-01-28  3:30         ` Parav Pandit
2022-01-28  3:35           ` Jason Wang
2022-01-28  3:45             ` Parav Pandit

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.