Skip to content

Support enabling virtqueue after DRIVER_OK

Parav Pandit virtio-comment 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2conformance: Add missing virtqueue reset conformance referencesconformance.tex+2 -01 reply
2/2content: Support enabling virtqueue after DRIVER_OK stageconformance.tex content.tex+53 -34 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchXuan Zhuo
1/2R-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [virtio-comment] [PATCH 0/2] Support enabling virtqueue after DRIVER_OK

Summary:
========
This patch enables driver to create virtqueues after DRIVER_OK status bit is set.

This patch take the inspiration from the thread [2] with credits to Eugenio PÃrez.

Details:
========
Currently, a virtqueue must be enabled before driver has set the DRIVER_OK status bit.

spec citation to section "Driver Requirements: Device Initialization"

"Perform device-specific setup, including discovery of virtqueues for the device, optional per-bus setup, reading and possibly writing the device’s virtio configuration space, and population of virtqueues."

This implies that a virtqueue must be enabled before reaching the DRIVER_OK stage. There was no explicit mention about ability to enable the virtqueue after DRIVER_OK stage.

In following usecases, creating a virtqueue after DRIVER_OK phase is desired.

Use cases:
=========
1. Dynamically create aq when administrative commands to be used.
2. Dynamically create the net device tx/rxq when device is opened when deploying for a container.
In a container, number of virtqueues to be used may be <= max queues.
3. Dynamically create flow filter queues of netdevice when ARFS or ethtool filters are enabled as listed in [1].
4. Dynamically create rtc functionality related read virtqueue only when net device when timestamping to be used.
5. When XDP program is set, one can create additional XDP specific queues without affecting existing queues.

Hence, This patch introduces an existing queue enable and disable (aka reset) facility and a new feature bit to explicitly indicate such support by the device.

With this feature, drivers can skip optional queues creation during driver init time. For example, a Linux net device driver can create/destroy the transmit and receive queues when net device's ndo_open() and ndo_stop() callbacks are invoked respectively.

As side effect, it also enables driver to not consume MSI-X vectors for the PCI device at driver load time and utilize(enable) individual vector when needed. This further helps on some cpus at high scale where a interrupt line may not be available from the platform.

[1] https://lists.oasis-open.org/archives/virtio-comment/202308/msg00263.html
[2] https://lists.oasis-open.org/archives/virtio-comment/202306/msg00097.html

Patch summary:
==============
patch-1 fixes to add virtqueue reset conformance references patch-2 adds VIRTIO_F_RING_DYNAMIC feature bit, requirements

Please review.

Parav Pandit (2):
conformance: Add missing virtqueue reset conformance references
content: Support enabling virtqueue after DRIVER_OK stage

 conformance.tex |  4 ++++
 content.tex     | 54 ++++++++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 55 insertions(+), 3 deletions(-)
Signature · 18 lines
2.34.1


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/