oasis-tcs / virtio-spec

OASIS Virtual I/O Device TC: Source code for the VIRTIO (Virtual I/O) Specification maintained by the OASIS Virtual I/O Device (VIRTIO) Technical Committee

Home Page:https://github.com/oasis-tcs/virtio-spec

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support virtqueue creation(enablement) after DRIVER_OK stage

paravmellanox opened this issue · comments

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 use cases, 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 time stamping to be used.
  5. When XDP program is set, one can create additional XDP specific
    queues without affecting existing queues.

Solution:
https://lists.oasis-open.org/archives/virtio-comment/202310/msg00183.html
Patches link for automation:
https://lore.kernel.org/virtio-comment/20231017143135.758523-1-parav@nvidia.com/T/#t