Skip to contentSkip to conversation

Support enabling virtqueue after DRIVER_OK

PATCH Superseded Parav Pandit 5 participants 48 messages Oct 2, 2023 – Oct 27, 2023

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover 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. ate 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.

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

---
changelog:
v2->v3:
- github issue link updated
v1->v2:
- fixed comments from Michael
- reduced device and driver normatives (simplified)
- replace 'a virtqueue' to 'the virtqueues'
- reworded to remove 'interested'
- avoided repeated 'device initialization text', replaced with DRIVER_OK status bit language
- avoided confusing text around 'MAY' in the requirements
- replaced 'the queue' to 'specific virtqueues'
- replaced queue to virtqueue
- simplified commit log to talk about msix
v0->v1:
- fixed comments from Xuan
- removed blank lines
- fixed wrong requirement link to device in driver section

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

 conformance.tex |  4 ++++
 content.tex     | 49 ++++++++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 50 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/
#1 lore raw

PATCH v3 1/2 conformance: Add missing virtqueue reset conformance references

Add the missing references to the virtqueue reset related conformance requirements.

---
 conformance.tex | 2 ++
 1 file changed, 2 insertions(+)
conformance.tex +2 -0
index dc00e84..863f9c5 100644
@@ -76,6 +76,7 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets}
 \item \ref{drivernormative:Basic Facilities of a Virtio Device / Device Reset}
 \item \ref{drivernormative:Basic Facilities of a Virtio Device / Device Configuration Space}
 \item \ref{drivernormative:Basic Facilities of a Virtio Device / Virtqueues}
+\item \ref{drivernormative:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}
 \item \ref{drivernormative:Basic Facilities of a Virtio Device / Message Framing}
 \item \ref{drivernormative:Basic Facilities of a Virtio Device / Virtqueues / The Virtqueue Descriptor Table}
 \item \ref{drivernormative:Basic Facilities of a Virtio Device / Virtqueues / The Virtqueue Descriptor Table / Indirect Descriptors}
@@ -162,6 +163,7 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets}
 \item \ref{devicenormative:Basic Facilities of a Virtio Device / Feature Bits}
 \item \ref{devicenormative:Basic Facilities of a Virtio Device / Device Reset}
 \item \ref{devicenormative:Basic Facilities of a Virtio Device / Device Configuration Space}
+\item \ref{devicenormative:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}
 \item \ref{devicenormative:Basic Facilities of a Virtio Device / Message Framing}
 \item \ref{devicenormative:Basic Facilities of a Virtio Device / Virtqueues / The Virtqueue Descriptor Table}
 \item \ref{devicenormative:Basic Facilities of a Virtio Device / Virtqueues / The Virtqueue Descriptor Table / Indirect Descriptors}
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/
#3 lore raw

PATCH v3 2/2 content: Support enabling virtqueue after DRIVER_OK stage

In reply to Parav Pandit

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.

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.

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

---
changelog:
v2->v3:
- github fixes tag added
v1->v2:
- fixed comments from Michael
- reduced device and driver normatives (simplified)
- replace 'a virtqueue' to 'the virtqueues'
- reworded to remove 'interested'
- avoided repeated 'device initialization text', replaced with DRIVER_OK status bit language
- avoided confusing text around 'MAY' in the requirements
- replaced 'the queue' to 'specific virtqueues'
- replaced queue to virtqueue
- simplified commit log to talk about msix
v0->v1:
- fixed comments from Xuan
- removed blank lines
- fixed wrong requirement link to device in driver section

---
 conformance.tex |  2 ++
 content.tex     | 49 ++++++++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 48 insertions(+), 3 deletions(-)
conformance.tex +2 -0
index 863f9c5..75de58c 100644
@@ -77,6 +77,7 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets}
 \item \ref{drivernormative:Basic Facilities of a Virtio Device / Device Configuration Space}
 \item \ref{drivernormative:Basic Facilities of a Virtio Device / Virtqueues}
 \item \ref{drivernormative:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}
+\item \ref{drivernormative:Basic Facilities of a Virtio Device / Virtqueues / Dynamic Virtqueues / Enable Virtqueues}
 \item \ref{drivernormative:Basic Facilities of a Virtio Device / Message Framing}
 \item \ref{drivernormative:Basic Facilities of a Virtio Device / Virtqueues / The Virtqueue Descriptor Table}
 \item \ref{drivernormative:Basic Facilities of a Virtio Device / Virtqueues / The Virtqueue Descriptor Table / Indirect Descriptors}
@@ -164,6 +165,7 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets}
 \item \ref{devicenormative:Basic Facilities of a Virtio Device / Device Reset}
 \item \ref{devicenormative:Basic Facilities of a Virtio Device / Device Configuration Space}
 \item \ref{devicenormative:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}
+\item \ref{devicenormative:Basic Facilities of a Virtio Device / Virtqueues / Dynamic Virtqueues / Enable Virtqueues}
 \item \ref{devicenormative:Basic Facilities of a Virtio Device / Message Framing}
 \item \ref{devicenormative:Basic Facilities of a Virtio Device / Virtqueues / The Virtqueue Descriptor Table}
 \item \ref{devicenormative:Basic Facilities of a Virtio Device / Virtqueues / The Virtqueue Descriptor Table / Indirect Descriptors}
content.tex +46 -3

85 lines not on this page · raw message

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/
#43 lore raw
In reply to Parav Pandit

Hi Michael, Cornelia,

Quoted 72 lines

From: Parav Pandit <[email protected]>
Sent: Monday, October 2, 2023 10:46 AM

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

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

---
changelog:
v2->v3:
- github issue link updated
v1->v2:
- fixed comments from Michael
- reduced device and driver normatives (simplified)
- replace 'a virtqueue' to 'the virtqueues'
- reworded to remove 'interested'
- avoided repeated 'device initialization text', replaced with DRIVER_OK status bit language

Quoted 9 lines

- avoided confusing text around 'MAY' in the requirements
- replaced 'the queue' to 'specific virtqueues'
- replaced queue to virtqueue
- simplified commit log to talk about msix v0->v1:
- fixed comments from Xuan
- removed blank lines
- fixed wrong requirement link to device in driver section

I have updated v3 to link to the github issue.
Now that this small feature was up for few weeks, can you please create the ballot review?

Acked-by on v3 2/2
#4 lore raw

Re: [virtio-comment] [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

In reply to Parav Pandit
Quoted 32 lines · Parav Pandit

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.

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.

Quoted 8 lines

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.

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

Quoted 151 lines

---
changelog:
v2->v3:
- github fixes tag added
v1->v2:
- fixed comments from Michael
- reduced device and driver normatives (simplified)
- replace 'a virtqueue' to 'the virtqueues'
- reworded to remove 'interested'
- avoided repeated 'device initialization text', replaced with DRIVER_OK status bit language
- avoided confusing text around 'MAY' in the requirements
- replaced 'the queue' to 'specific virtqueues'
- replaced queue to virtqueue
- simplified commit log to talk about msix
v0->v1:
- fixed comments from Xuan
- removed blank lines
- fixed wrong requirement link to device in driver section

---
 conformance.tex |  2 ++
 content.tex     | 49 ++++++++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 48 insertions(+), 3 deletions(-)
conformance.tex +2 -0
index 863f9c5..75de58c 100644
@@ -77,6 +77,7 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets}
 \item \ref{drivernormative:Basic Facilities of a Virtio Device / Device Configuration Space}
 \item \ref{drivernormative:Basic Facilities of a Virtio Device / Virtqueues}
 \item \ref{drivernormative:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}
+\item \ref{drivernormative:Basic Facilities of a Virtio Device / Virtqueues / Dynamic Virtqueues / Enable Virtqueues}
 \item \ref{drivernormative:Basic Facilities of a Virtio Device / Message Framing}
 \item \ref{drivernormative:Basic Facilities of a Virtio Device / Virtqueues / The Virtqueue Descriptor Table}
 \item \ref{drivernormative:Basic Facilities of a Virtio Device / Virtqueues / The Virtqueue Descriptor Table / Indirect Descriptors}
@@ -164,6 +165,7 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets}
 \item \ref{devicenormative:Basic Facilities of a Virtio Device / Device Reset}
 \item \ref{devicenormative:Basic Facilities of a Virtio Device / Device Configuration Space}
 \item \ref{devicenormative:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}
+\item \ref{devicenormative:Basic Facilities of a Virtio Device / Virtqueues / Dynamic Virtqueues / Enable Virtqueues}
 \item \ref{devicenormative:Basic Facilities of a Virtio Device / Message Framing}
 \item \ref{devicenormative:Basic Facilities of a Virtio Device / Virtqueues / The Virtqueue Descriptor Table}
 \item \ref{devicenormative:Basic Facilities of a Virtio Device / Virtqueues / The Virtqueue Descriptor Table / Indirect Descriptors}
content.tex +46 -4
index 0a62dce..1a296a9 100644
@@ -102,7 +102,7 @@ \section{Feature Bits}\label{sec:Basic Facilities of a Virtio Device / Feature B
 \item[24 to 41] Feature bits reserved for extensions to the queue and
   feature negotiation mechanisms
 
-\item[42 to 49, and 128 and above] Feature bits reserved for future extensions.
+\item[43 to 49, and 128 and above] Feature bits reserved for future extensions.
 \end{description}
 
 \begin{note}
@@ -440,6 +440,38 @@ \subsubsection{Virtqueue Re-enable}\label{sec:Basic Facilities of a Virtio Devic
 as during initial virtqueue discovery, but optionally with different
 parameters.
 
+\subsection{Dynamic Virtqueues}\label{sec:Basic Facilities of a Virtio Device / Virtqueues / Dynamic Virtqueues}
+
+When VIRTIO_F_RING_DYNAMIC is not negotiated, the driver enables the virtqueues
+during the device initialization sequence, i.e. after the device sets the
+FEATURES_OK status bit and before the driver setting the DRIVER_OK status bit.
+
+When VIRTIO_F_RING_DYNAMIC is negotiated, the driver can avoid enabling the
+virtqueues before setting the DRIVER_OK status bit; the driver can enable the
+specific virtqueues after the driver has set the DRIVER_OK status bit.
+The virtqueue enable mechanism is transport specific.
+
+\devicenormative{\paragraph}{Enable Virtqueues}{Basic Facilities of a Virtio Device / Virtqueues / Dynamic Virtqueues / Enable Virtqueues}
+
+When VIRTIO_F_RING_DYNAMIC is negotiated, the device MUST allow enabling the
+virtqueue which was not enabled during the device initialization phase
+i.e. after the device has set the FEATURES_OK status bit and before the
+driver has set the DRIVER_OK status bit.
+
+\drivernormative{\paragraph}{Enable Virtqueues}{Basic Facilities of a Virtio Device / Virtqueues / Dynamic Virtqueues / Enable Virtqueues}
+
+When VIRTIO_F_RING_DYNAMIC is negotiated,
+\begin{itemize}
+\item the driver MAY enable some or all the virtqueues after the driver has set the
+      DRIVER_OK status bit.
+
+\item the driver MAY enable some of the virtqueues or all the virtqueues or none of
+      the virtqueues before the driver has set the DRIVER_OK status bit.
+\end{itemize}
+
+When VIRTIO_F_RING_DYNAMIC is not negotiated, the driver MUST enable the
+required number of virtqueues before setting the DRIVER_OK status bit.
+
 \input{split-ring.tex}
 
 \input{packed-ring.tex}
@@ -537,7 +569,9 @@ \section{Device Initialization}\label{sec:General Initialization And Device Oper
 
 \item\label{itm:General Initialization And Device Operation / Device Initialization / Device-specific Setup} 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.
+   device's virtio configuration space.
+
+\item\label{itm:General Initialization And Device Operation / Device Initialization / Virtqueue Setup} Configure and enable the virtqueues.
 
 \item\label{itm:General Initialization And Device Operation / Device Initialization / Set DRIVER-OK} Set the DRIVER_OK status bit.  At this point the device is
    ``live''.
@@ -551,6 +585,10 @@ \section{Device Initialization}\label{sec:General Initialization And Device Oper
 The driver MUST NOT send any buffer available notifications to
 the device before setting DRIVER_OK.
 
+The driver MAY skip step
+\ref{itm:General Initialization And Device Operation / Device Initialization / Virtqueue Setup}
+when driver has negotiated VIRTIO_F_RING_DYNAMIC feature.
+
 \subsection{Legacy Interface: Device Initialization}\label{sec:General Initialization And Device Operation / Device Initialization / Legacy Interface: Device Initialization}
 Legacy devices did not support the FEATURES_OK status bit, and thus did
 not have a graceful way for the device to indicate unsupported feature
@@ -569,7 +607,7 @@ \subsection{Legacy Interface: Device Initialization}\label{sec:General Initializ
 Initialization / Re-read FEATURES-OK} were omitted, and steps
 \ref{itm:General Initialization And Device Operation /
 Device Initialization / Read feature bits},
-\ref{itm:General Initialization And Device Operation / Device Initialization / Device-specific Setup} and \ref{itm:General Initialization And Device Operation / Device Initialization / Set DRIVER-OK}
+\ref{itm:General Initialization And Device Operation / Device Initialization / Device-specific Setup}, \ref{itm:General Initialization And Device Operation / Device Initialization / Virtqueue Setup} and \ref{itm:General Initialization And Device Operation / Device Initialization / Set DRIVER-OK}
 were conflated.
 
 Therefore, when using the legacy interface:
@@ -872,6 +910,11 @@ \chapter{Reserved Feature Bits}\label{sec:Reserved Feature Bits}
        \ref{devicenormative:Basic Facilities of a Virtio Device / Feature Bits} for
        handling features reserved for future use.
 
+  \item[VIRTIO_F_RING_DYNAMIC(42)] This feature indicates
+  that the driver can enable the virtqueues individually after the driver has
+  set the status bit of DRIVER_OK.
+  See \ref{sec:Basic Facilities of a Virtio Device / Virtqueues / Dynamic Virtqueues}.
+
 \end{description}
 
 \drivernormative{\section}{Reserved Feature Bits}{Reserved Feature Bits}
--

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.

Quoted 9 lines

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/

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/

Acked-by on v3 1/2
#2 lore raw

Re: [virtio-comment] [PATCH v3 1/2] conformance: Add missing virtqueue reset conformance references

In reply to Parav Pandit
Quoted 4 lines · Parav Pandit

Add the missing references to the virtqueue reset related conformance requirements.

acked-by was not carried from v1:

Quoted 37 lines
---
 conformance.tex | 2 ++
 1 file changed, 2 insertions(+)
conformance.tex +2 -1
index dc00e84..863f9c5 100644
@@ -76,6 +76,7 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets}
 \item \ref{drivernormative:Basic Facilities of a Virtio Device / Device Reset}
 \item \ref{drivernormative:Basic Facilities of a Virtio Device / Device Configuration Space}
 \item \ref{drivernormative:Basic Facilities of a Virtio Device / Virtqueues}
+\item \ref{drivernormative:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}
 \item \ref{drivernormative:Basic Facilities of a Virtio Device / Message Framing}
 \item \ref{drivernormative:Basic Facilities of a Virtio Device / Virtqueues / The Virtqueue Descriptor Table}
 \item \ref{drivernormative:Basic Facilities of a Virtio Device / Virtqueues / The Virtqueue Descriptor Table / Indirect Descriptors}
@@ -162,6 +163,7 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets}
 \item \ref{devicenormative:Basic Facilities of a Virtio Device / Feature Bits}
 \item \ref{devicenormative:Basic Facilities of a Virtio Device / Device Reset}
 \item \ref{devicenormative:Basic Facilities of a Virtio Device / Device Configuration Space}
+\item \ref{devicenormative:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}
 \item \ref{devicenormative:Basic Facilities of a Virtio Device / Message Framing}
 \item \ref{devicenormative:Basic Facilities of a Virtio Device / Virtqueues / The Virtqueue Descriptor Table}
 \item \ref{devicenormative:Basic Facilities of a Virtio Device / Virtqueues / The Virtqueue Descriptor Table / Indirect Descriptors}
--

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.

Quoted 9 lines

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/

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/

#44 lore raw
In reply to Parav Pandit

Hi Michael, Cornelia,

Quoted 51 lines

From: [email protected] <[email protected] open.org> On Behalf Of Parav Pandit
Sent: Monday, October 2, 2023 10:50 AM

Hi Michael, Cornelia,

Quoted 6 lines

From: Parav Pandit <[email protected]>
Sent: Monday, October 2, 2023 10:46 AM

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

set.

Quoted 2 lines

This patch take the inspiration from the thread [2] with credits to Eugenio

PÃrez.

Quoted 15 lines

Use cases:
=========
1. Dynamically create aq when administrative commands to be used. ate 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.

Quoted 2 lines

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.

Quoted 16 lines

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.

[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

Quoted 7 lines
Quoted 3 lines

Please review.

I have updated v3 to link to the github issue.
Now that this small feature was up for few weeks, can you please create the ballot review?

Can you please create ballot review for 1.4?

Acked-by on v3 2/2
#5 lore raw

[virtio-comment] Re: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

In reply to Parav Pandit
Quoted 36 lines · Parav Pandit

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.

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.

Quoted 4 lines

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

Quoted 140 lines

---
changelog:
v2->v3:
- github fixes tag added
v1->v2:
- fixed comments from Michael
- reduced device and driver normatives (simplified)
- replace 'a virtqueue' to 'the virtqueues'
- reworded to remove 'interested'
- avoided repeated 'device initialization text', replaced with DRIVER_OK status bit language
- avoided confusing text around 'MAY' in the requirements
- replaced 'the queue' to 'specific virtqueues'
- replaced queue to virtqueue
- simplified commit log to talk about msix
v0->v1:
- fixed comments from Xuan
- removed blank lines
- fixed wrong requirement link to device in driver section

---
 conformance.tex |  2 ++
 content.tex     | 49 ++++++++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 48 insertions(+), 3 deletions(-)
conformance.tex +2 -0
index 863f9c5..75de58c 100644
@@ -77,6 +77,7 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets}
 \item \ref{drivernormative:Basic Facilities of a Virtio Device / Device Configuration Space}
 \item \ref{drivernormative:Basic Facilities of a Virtio Device / Virtqueues}
 \item \ref{drivernormative:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}
+\item \ref{drivernormative:Basic Facilities of a Virtio Device / Virtqueues / Dynamic Virtqueues / Enable Virtqueues}
 \item \ref{drivernormative:Basic Facilities of a Virtio Device / Message Framing}
 \item \ref{drivernormative:Basic Facilities of a Virtio Device / Virtqueues / The Virtqueue Descriptor Table}
 \item \ref{drivernormative:Basic Facilities of a Virtio Device / Virtqueues / The Virtqueue Descriptor Table / Indirect Descriptors}
@@ -164,6 +165,7 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets}
 \item \ref{devicenormative:Basic Facilities of a Virtio Device / Device Reset}
 \item \ref{devicenormative:Basic Facilities of a Virtio Device / Device Configuration Space}
 \item \ref{devicenormative:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}
+\item \ref{devicenormative:Basic Facilities of a Virtio Device / Virtqueues / Dynamic Virtqueues / Enable Virtqueues}
 \item \ref{devicenormative:Basic Facilities of a Virtio Device / Message Framing}
 \item \ref{devicenormative:Basic Facilities of a Virtio Device / Virtqueues / The Virtqueue Descriptor Table}
 \item \ref{devicenormative:Basic Facilities of a Virtio Device / Virtqueues / The Virtqueue Descriptor Table / Indirect Descriptors}
content.tex +46 -4
index 0a62dce..1a296a9 100644
@@ -102,7 +102,7 @@ \section{Feature Bits}\label{sec:Basic Facilities of a Virtio Device / Feature B
 \item[24 to 41] Feature bits reserved for extensions to the queue and
   feature negotiation mechanisms
 
-\item[42 to 49, and 128 and above] Feature bits reserved for future extensions.
+\item[43 to 49, and 128 and above] Feature bits reserved for future extensions.
 \end{description}
 
 \begin{note}
@@ -440,6 +440,38 @@ \subsubsection{Virtqueue Re-enable}\label{sec:Basic Facilities of a Virtio Devic
 as during initial virtqueue discovery, but optionally with different
 parameters.
 
+\subsection{Dynamic Virtqueues}\label{sec:Basic Facilities of a Virtio Device / Virtqueues / Dynamic Virtqueues}
+
+When VIRTIO_F_RING_DYNAMIC is not negotiated, the driver enables the virtqueues
+during the device initialization sequence, i.e. after the device sets the
+FEATURES_OK status bit and before the driver setting the DRIVER_OK status bit.
+
+When VIRTIO_F_RING_DYNAMIC is negotiated, the driver can avoid enabling the
+virtqueues before setting the DRIVER_OK status bit; the driver can enable the
+specific virtqueues after the driver has set the DRIVER_OK status bit.
+The virtqueue enable mechanism is transport specific.
+
+\devicenormative{\paragraph}{Enable Virtqueues}{Basic Facilities of a Virtio Device / Virtqueues / Dynamic Virtqueues / Enable Virtqueues}
+
+When VIRTIO_F_RING_DYNAMIC is negotiated, the device MUST allow enabling the
+virtqueue which was not enabled during the device initialization phase
+i.e. after the device has set the FEATURES_OK status bit and before the
+driver has set the DRIVER_OK status bit.
+
+\drivernormative{\paragraph}{Enable Virtqueues}{Basic Facilities of a Virtio Device / Virtqueues / Dynamic Virtqueues / Enable Virtqueues}
+
+When VIRTIO_F_RING_DYNAMIC is negotiated,
+\begin{itemize}
+\item the driver MAY enable some or all the virtqueues after the driver has set the
+      DRIVER_OK status bit.
+
+\item the driver MAY enable some of the virtqueues or all the virtqueues or none of
+      the virtqueues before the driver has set the DRIVER_OK status bit.
+\end{itemize}
+
+When VIRTIO_F_RING_DYNAMIC is not negotiated, the driver MUST enable the
+required number of virtqueues before setting the DRIVER_OK status bit.
+
 \input{split-ring.tex}
 
 \input{packed-ring.tex}
@@ -537,7 +569,9 @@ \section{Device Initialization}\label{sec:General Initialization And Device Oper
 
 \item\label{itm:General Initialization And Device Operation / Device Initialization / Device-specific Setup} 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.
+   device's virtio configuration space.
+
+\item\label{itm:General Initialization And Device Operation / Device Initialization / Virtqueue Setup} Configure and enable the virtqueues.
 
 \item\label{itm:General Initialization And Device Operation / Device Initialization / Set DRIVER-OK} Set the DRIVER_OK status bit.  At this point the device is
    ``live''.
@@ -551,6 +585,10 @@ \section{Device Initialization}\label{sec:General Initialization And Device Oper
 The driver MUST NOT send any buffer available notifications to
 the device before setting DRIVER_OK.
 
+The driver MAY skip step
+\ref{itm:General Initialization And Device Operation / Device Initialization / Virtqueue Setup}
+when driver has negotiated VIRTIO_F_RING_DYNAMIC feature.
+
 \subsection{Legacy Interface: Device Initialization}\label{sec:General Initialization And Device Operation / Device Initialization / Legacy Interface: Device Initialization}
 Legacy devices did not support the FEATURES_OK status bit, and thus did
 not have a graceful way for the device to indicate unsupported feature
@@ -569,7 +607,7 @@ \subsection{Legacy Interface: Device Initialization}\label{sec:General Initializ
 Initialization / Re-read FEATURES-OK} were omitted, and steps
 \ref{itm:General Initialization And Device Operation /
 Device Initialization / Read feature bits},
-\ref{itm:General Initialization And Device Operation / Device Initialization / Device-specific Setup} and \ref{itm:General Initialization And Device Operation / Device Initialization / Set DRIVER-OK}
+\ref{itm:General Initialization And Device Operation / Device Initialization / Device-specific Setup}, \ref{itm:General Initialization And Device Operation / Device Initialization / Virtqueue Setup} and \ref{itm:General Initialization And Device Operation / Device Initialization / Set DRIVER-OK}
 were conflated.
 
 Therefore, when using the legacy interface:
@@ -872,6 +910,11 @@ \chapter{Reserved Feature Bits}\label{sec:Reserved Feature Bits}
 	\ref{devicenormative:Basic Facilities of a Virtio Device / Feature Bits} for
 	handling features reserved for future use.
 
+  \item[VIRTIO_F_RING_DYNAMIC(42)] This feature indicates
+  that the driver can enable the virtqueues individually after the driver has
+  set the status bit of DRIVER_OK.
+  See \ref{sec:Basic Facilities of a Virtio Device / Virtqueues / Dynamic Virtqueues}.
+
 \end{description}
 
 \drivernormative{\section}{Reserved Feature Bits}{Reserved Feature Bits}
--
Quoted 2 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/

#45 lore raw
In reply to Parav Pandit

+ virtio TC.

Hi Michael, Cornelia,

Its been many days, the voting request is not raised for this small patch.

Are you receiving this email?
By any chance, this email has gone to spam/junk directory in your mailbox?

Xuan, Eugenio acked so I at least two mailboxes received in non-junk directory.
I noticed ballot request created 5 days ago for github issue 175, https://www.oasis-open.org/committees/ballot.php?id=3798.

I suspect that, this email is not reaching you for some reason.

Added virtio TC to see if the 3rd ping reaches you.

Flow filters feature is waiting for a while now which depends on this series as users are not able to scale their performance.

Is there anything more to take care in this patch? Please let me know if I need to fix something in this patch.

Quoted 75 lines

-----Original Message-----
From: Parav Pandit <[email protected]>
Sent: Tuesday, October 10, 2023 10:27 AM
To: Parav Pandit <[email protected]>; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; Shahaf Shuler <[email protected]>
Subject: RE: [PATCH v3 0/2] Support enabling virtqueue after DRIVER_OK

Hi Michael, Cornelia,

Quoted 55 lines

From: [email protected] <[email protected] open.org> On Behalf Of Parav Pandit
Sent: Monday, October 2, 2023 10:50 AM

Hi Michael, Cornelia,

Quoted 7 lines

From: Parav Pandit <[email protected]>
Sent: Monday, October 2, 2023 10:46 AM

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

set.

Quoted 3 lines

This patch take the inspiration from the thread [2] with credits to Eugenio

PÃrez.

Quoted 15 lines

Use cases:
=========
1. Dynamically create aq when administrative commands to be used. ate 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.

Quoted 4 lines

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.

Quoted 16 lines

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.

[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

Quoted 7 lines
Quoted 3 lines

Please review.

I have updated v3 to link to the github issue.
Now that this small feature was up for few weeks, can you please create the ballot review?

Can you please create ballot review for 1.4?

#46 lore raw
Quoted 12 lines · Parav Pandit

+ virtio TC.

Hi Michael, Cornelia,

Its been many days, the voting request is not raised for this small patch.

Are you receiving this email?
By any chance, this email has gone to spam/junk directory in your mailbox?

Xuan, Eugenio acked so I at least two mailboxes received in non-junk directory.
I noticed ballot request created 5 days ago for github issue 175, https://www.oasis-open.org/committees/ballot.php?id=3798.

Quoted 8 lines

I suspect that, this email is not reaching you for some reason.

Added virtio TC to see if the 3rd ping reaches you.

Flow filters feature is waiting for a while now which depends on this series as users are not able to scale their performance.

Is there anything more to take care in this patch? Please let me know if I need to fix something in this patch.

This is the first time I noticed this, let me check.

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/

#6 lore raw

[virtio-comment] Re: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

In reply to Parav Pandit
Quoted 64 lines · Parav Pandit

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.

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.

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

---
changelog:
v2->v3:
- github fixes tag added
v1->v2:
- fixed comments from Michael
- reduced device and driver normatives (simplified)
- replace 'a virtqueue' to 'the virtqueues'
- reworded to remove 'interested'
- avoided repeated 'device initialization text', replaced with DRIVER_OK status bit language
- avoided confusing text around 'MAY' in the requirements
- replaced 'the queue' to 'specific virtqueues'
- replaced queue to virtqueue
- simplified commit log to talk about msix
v0->v1:
- fixed comments from Xuan
- removed blank lines
- fixed wrong requirement link to device in driver section

---
 conformance.tex |  2 ++
 content.tex     | 49 ++++++++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 48 insertions(+), 3 deletions(-)

(...)

content.tex \subsubsection{Virtqueue Re-enable}\label{sec:Basic Facilities of a Virtio Devic · line 447

Quoted 9 lines
content.tex +5 -0
@@ -440,6 +440,38 @@ \subsubsection{Virtqueue Re-enable}\label{sec:Basic Facilities of a Virtio Devic
 as during initial virtqueue discovery, but optionally with different
 parameters.
 
+\subsection{Dynamic Virtqueues}\label{sec:Basic Facilities of a Virtio Device / Virtqueues / Dynamic Virtqueues}
+
+When VIRTIO_F_RING_DYNAMIC is not negotiated, the driver enables the virtqueues
+during the device initialization sequence, i.e. after the device sets the
+FEATURES_OK status bit and before the driver setting the DRIVER_OK status bit.

_Or_ if a virtqueue has been reset and the driver wants to re-enable it, right?

content.tex \subsubsection{Virtqueue Re-enable}\label{sec:Basic Facilities of a Virtio Devic · line 451

Quoted 4 lines
content.tex +4 -0
+
+When VIRTIO_F_RING_DYNAMIC is negotiated, the driver can avoid enabling the
+virtqueues before setting the DRIVER_OK status bit; the driver can enable the
+specific virtqueues after the driver has set the DRIVER_OK status bit.

"the driver is not required to enable every virtqueue it wants to use before setting the DRIVER_OK status bit; it can choose to enable a virtqueue even after it has set the DRIVER_OK status bit."

content.tex \subsubsection{Virtqueue Re-enable}\label{sec:Basic Facilities of a Virtio Devic · line 452

Quoted 1 line
content.tex +1 -0
+The virtqueue enable mechanism is transport specific.

Would that be the same mechanism as for re-enabling a queue after a queue reset? I guess I'm missing the relationship here...

content.tex \subsubsection{Virtqueue Re-enable}\label{sec:Basic Facilities of a Virtio Devic · line 457

Quoted 5 lines
content.tex +5 -0
+
+\devicenormative{\paragraph}{Enable Virtqueues}{Basic Facilities of a Virtio Device / Virtqueues / Dynamic Virtqueues / Enable Virtqueues}
+
+When VIRTIO_F_RING_DYNAMIC is negotiated, the device MUST allow enabling the
+virtqueue which was not enabled during the device initialization phase

s/the virtqueue/a virtqueue/

content.tex \subsubsection{Virtqueue Re-enable}\label{sec:Basic Facilities of a Virtio Devic · line 470

Quoted 13 lines
content.tex +13 -0
+i.e. after the device has set the FEATURES_OK status bit and before the
+driver has set the DRIVER_OK status bit.
+
+\drivernormative{\paragraph}{Enable Virtqueues}{Basic Facilities of a Virtio Device / Virtqueues / Dynamic Virtqueues / Enable Virtqueues}
+
+When VIRTIO_F_RING_DYNAMIC is negotiated,
+\begin{itemize}
+\item the driver MAY enable some or all the virtqueues after the driver has set the
+      DRIVER_OK status bit.
+
+\item the driver MAY enable some of the virtqueues or all the virtqueues or none of
+      the virtqueues before the driver has set the DRIVER_OK status bit.
+\end{itemize}

Can we write this more concisely as

"When VIRTIO_F_RING_DYNAMIC is negotiated, the driver MAY enable any virtqueue either before or after it has set the DRIVER_OK status bit."

?

content.tex \subsubsection{Virtqueue Re-enable}\label{sec:Basic Facilities of a Virtio Devic · line 473

Quoted 3 lines
content.tex +3 -0
+
+When VIRTIO_F_RING_DYNAMIC is not negotiated, the driver MUST enable the
+required number of virtqueues before setting the DRIVER_OK status bit.

What does "required" mean here? It just chooses to enable the queues it wants to use, right?

I'm also still not quite clear how this relates to re-enabling queues after queue reset.

Quoted 16 lines
content.tex +4 -1
+
 \input{split-ring.tex}
 
 \input{packed-ring.tex}
@@ -537,7 +569,9 @@ \section{Device Initialization}\label{sec:General Initialization And Device Oper
 
 \item\label{itm:General Initialization And Device Operation / Device Initialization / Device-specific Setup} 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.
+   device's virtio configuration space.
+
+\item\label{itm:General Initialization And Device Operation / Device Initialization / Virtqueue Setup} Configure and enable the virtqueues.
 
 \item\label{itm:General Initialization And Device Operation / Device Initialization / Set DRIVER-OK} Set the DRIVER_OK status bit.  At this point the device is
    ``live''.

content.tex \section{Device Initialization}\label{sec:General Initialization And Device Oper · line 590

Quoted 6 lines
content.tex +3 -0
@@ -551,6 +585,10 @@ \section{Device Initialization}\label{sec:General Initialization And Device Oper
 The driver MUST NOT send any buffer available notifications to
 the device before setting DRIVER_OK.
 
+The driver MAY skip step
+\ref{itm:General Initialization And Device Operation / Device Initialization / Virtqueue Setup}
+when driver has negotiated VIRTIO_F_RING_DYNAMIC feature.

That's confusing: It may not only skip it, but also enable only a subset of the queues it wants to use later.

Quoted 14 lines
content.tex +2 -1
+
 \subsection{Legacy Interface: Device Initialization}\label{sec:General Initialization And Device Operation / Device Initialization / Legacy Interface: Device Initialization}
 Legacy devices did not support the FEATURES_OK status bit, and thus did
 not have a graceful way for the device to indicate unsupported feature
@@ -569,7 +607,7 @@ \subsection{Legacy Interface: Device Initialization}\label{sec:General Initializ
 Initialization / Re-read FEATURES-OK} were omitted, and steps
 \ref{itm:General Initialization And Device Operation /
 Device Initialization / Read feature bits},
-\ref{itm:General Initialization And Device Operation / Device Initialization / Device-specific Setup} and \ref{itm:General Initialization And Device Operation / Device Initialization / Set DRIVER-OK}
+\ref{itm:General Initialization And Device Operation / Device Initialization / Device-specific Setup}, \ref{itm:General Initialization And Device Operation / Device Initialization / Virtqueue Setup} and \ref{itm:General Initialization And Device Operation / Device Initialization / Set DRIVER-OK}
 were conflated.
 
 Therefore, when using the legacy interface:

content.tex \chapter{Reserved Feature Bits}\label{sec:Reserved Feature Bits} · line 914

Quoted 5 lines
content.tex +2 -0
@@ -872,6 +910,11 @@ \chapter{Reserved Feature Bits}\label{sec:Reserved Feature Bits}
 	\ref{devicenormative:Basic Facilities of a Virtio Device / Feature Bits} for
 	handling features reserved for future use.
 
+  \item[VIRTIO_F_RING_DYNAMIC(42)] This feature indicates
+  that the driver can enable the virtqueues individually after the driver has

s/the virtqueues/virtqueues/

content.tex \chapter{Reserved Feature Bits}\label{sec:Reserved Feature Bits} · line 920

Quoted 6 lines
content.tex +3 -0
+  set the status bit of DRIVER_OK.
+  See \ref{sec:Basic Facilities of a Virtio Device / Virtqueues / Dynamic Virtqueues}.
+
 \end{description}
 
 \drivernormative{\section}{Reserved Feature Bits}{Reserved Feature Bits}

We currently have a device normative statement:

"The device MUST NOT consume buffers or send any used buffer notifications to the driver before DRIVER_OK."

I guess we need to extend that to not doing that for not-yet-enabled queues in the dynamic virtqueue case? There's a (transport-specific) point in time when the driver tells the device that the queue is ready, right?

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/

#7 lore raw

[virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 88 lines

From: Cornelia Huck <[email protected]>
Sent: Tuesday, October 17, 2023 5:55 PM

Quoted 61 lines · Parav Pandit

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.

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.

[1]
https://lists.oasis-open.org/archives/virtio-comment/202308/msg00263.h
tml

---
changelog:
v2->v3:
- github fixes tag added
v1->v2:
- fixed comments from Michael
- reduced device and driver normatives (simplified)
- replace 'a virtqueue' to 'the virtqueues'
- reworded to remove 'interested'
- avoided repeated 'device initialization text', replaced with DRIVER_OK status bit language
- avoided confusing text around 'MAY' in the requirements
- replaced 'the queue' to 'specific virtqueues'
- replaced queue to virtqueue
- simplified commit log to talk about msix
v0->v1:
- fixed comments from Xuan
- removed blank lines
- fixed wrong requirement link to device in driver section

Quoted 3 lines
---
 conformance.tex |  2 ++
 content.tex     | 49 ++++++++++++++++++++++++++++++++++++++++++++++--

-

Quoted 2 lines
 2 files changed, 48 insertions(+), 3 deletions(-)

(...)

Review

Quoted 10 lines
(quoted diff) +0 -0
@@ -440,6 +440,38 @@ \subsubsection{Virtqueue

Re-enable}\label{sec:Basic Facilities of a Virtio Devic as during initial virtqueue discovery, but optionally with different parameters.

+\subsection{Dynamic Virtqueues}\label{sec:Basic Facilities of a

(quoted diff) +5 -0
+Virtio Device / Virtqueues / Dynamic Virtqueues}
+
+When VIRTIO_F_RING_DYNAMIC is not negotiated, the driver enables the
+virtqueues during the device initialization sequence, i.e. after the
+device sets the FEATURES_OK status bit and before the driver setting the

DRIVER_OK status bit.

Quoted 2 lines

_Or_ if a virtqueue has been reset and the driver wants to re-enable it, right?

Well no. Because above text is for "enablement", and not re-enablement.
If the driver want to reset and re-enable, it must be enabled in first place before setting driver_ok. VQ not enabled before driver ok, cannot be reset, and hence cannot be re-enabled.

So I think above text is fine because it says about "enables" and not "re-enables".

Quoted 10 lines

Review

Quoted 4 lines
(quoted diff) +4 -0
+
+When VIRTIO_F_RING_DYNAMIC is negotiated, the driver can avoid
+enabling the virtqueues before setting the DRIVER_OK status bit; the
+driver can enable the specific virtqueues after the driver has set the

DRIVER_OK status bit.

"the driver is not required to enable every virtqueue it wants to use before setting the DRIVER_OK status bit; it can choose to enable a virtqueue even after it has set the DRIVER_OK status bit."

Sounds good. Will change it.

Quoted 5 lines
Quoted 1 line

+The virtqueue enable mechanism is transport specific.

Would that be the same mechanism as for re-enabling a queue after a queue reset? I guess I'm missing the relationship here...

Yes, it is same.
There is no change in enabling/re-enabling the virtqueue after/before DRIVER_OK with/without _dynamic bit. So no extra text added here.

Quoted 10 lines

Review

Quoted 7 lines
(quoted diff) +7 -0
+
+\devicenormative{\paragraph}{Enable Virtqueues}{Basic Facilities of a
+Virtio Device / Virtqueues / Dynamic Virtqueues / Enable Virtqueues}
+
+When VIRTIO_F_RING_DYNAMIC is negotiated, the device MUST allow
+enabling the virtqueue which was not enabled during the device
+initialization phase

s/the virtqueue/a virtqueue/

Ack.

Quoted 15 lines

Review

Quoted 11 lines
(quoted diff) +11 -0
+i.e. after the device has set the FEATURES_OK status bit and before
+the driver has set the DRIVER_OK status bit.
+
+\drivernormative{\paragraph}{Enable Virtqueues}{Basic Facilities of a
+Virtio Device / Virtqueues / Dynamic Virtqueues / Enable Virtqueues}
+
+When VIRTIO_F_RING_DYNAMIC is negotiated, \begin{itemize} \item the
+driver MAY enable some or all the virtqueues after the driver has set the
+      DRIVER_OK status bit.
+
+\item the driver MAY enable some of the virtqueues or all the virtqueues or

none of

Quoted 2 lines

+ the virtqueues before the driver has set the DRIVER_OK status bit.
+\end{itemize}

Quoted 6 lines

Can we write this more concisely as

"When VIRTIO_F_RING_DYNAMIC is negotiated, the driver MAY enable any virtqueue either before or after it has set the DRIVER_OK status bit."

?

Looks fine to me. Will change.

Quoted 7 lines

Review

Quoted 4 lines
(quoted diff) +3 -0
+
+When VIRTIO_F_RING_DYNAMIC is not negotiated, the driver MUST enable
+the required number of virtqueues before setting the DRIVER_OK status bit.

What does "required" mean here? It just chooses to enable the queues it wants to use, right?

Right.
Required meaning, whatever number of queues that driver choose to enable, those must be enabled before driver_ok. So it is "required by the driver".
Would that be ok?

Quoted 3 lines

I'm also still not quite clear how this relates to re-enabling queues after queue reset.

Queue can be renabled (after queue reset) only if it was enabled before driver_ok.
This feature bit allows driver to not do such workaround to enable the queue before driver_ok, that it does not want to use in first place. Not sure I answered, what you ask.
Did I?

Quoted 26 lines
Quoted 9 lines
content.tex +1 -0
+
 \input{split-ring.tex}
 
 \input{packed-ring.tex}
@@ -537,7 +569,9 @@ \section{Device Initialization}\label{sec:General

Initialization And Device Oper

\item\label{itm:General Initialization And Device Operation / Device

Initialization / Device-specific Setup} Perform device-specific setup, including discovery of virtqueues for the

content.tex \section{Device Initialization}\label{sec:General Initialization And Device Oper

Quoted 5 lines

device, optional per-bus setup, reading and possibly writing the

content.tex +3 -1
-   device's virtio configuration space, and population of virtqueues.
+   device's virtio configuration space.
+
+\item\label{itm:General Initialization And Device Operation / Device

Initialization / Virtqueue Setup} Configure and enable the virtqueues.

Quoted 2 lines

\item\label{itm:General Initialization And Device Operation / Device

Initialization / Set DRIVER-OK} Set the DRIVER_OK status bit. At this point the device is

Quoted 5 lines
    ``live''.
(quoted diff) +0 -0
@@ -551,6 +585,10 @@ \section{Device Initialization}\label{sec:General

Initialization And Device Oper The driver MUST NOT send any buffer available notifications to the device before setting DRIVER_OK.

Quoted 8 lines

Review

Quoted 3 lines
(quoted diff) +3 -0
+The driver MAY skip step
+\ref{itm:General Initialization And Device Operation / Device
+Initialization / Virtqueue Setup} when driver has negotiated

VIRTIO_F_RING_DYNAMIC feature.

That's confusing: It may not only skip it, but also enable only a subset of the queues it wants to use later.

I will add this extra text, that driver may skip or may enable subset of the queues.

Quoted 24 lines

Review \chapter{Reserved Feature Bits}\label{sec:Reserved

Quoted 23 lines

+
\subsection{Legacy Interface: Device
Initialization}\label{sec:General Initialization And Device Operation / Device Initialization / Legacy Interface: Device Initialization} Legacy devices did not support the FEATURES_OK status bit, and thus did not have a graceful way for the device to indicate unsupported feature @@ -569,7 +607,7 @@ \subsection{Legacy Interface: Device Initialization}\label{sec:General Initializ Initialization / Re-read FEATURES-OK} were omitted, and steps \ref{itm:General Initialization And Device Operation / Device Initialization / Read feature bits}, -\ref{itm:General Initialization And Device Operation / Device Initialization / Device-specific Setup} and \ref{itm:General Initialization And Device Operation / Device Initialization / Set DRIVER-OK}
+\ref{itm:General Initialization And Device Operation / Device

(quoted diff) +4 -0
+Initialization / Device-specific Setup}, \ref{itm:General
+Initialization And Device Operation / Device Initialization /
+Virtqueue Setup} and \ref{itm:General Initialization And Device
+Operation / Device Initialization / Set DRIVER-OK}
 were conflated.
 
 Therefore, when using the legacy interface:
@@ -872,6 +910,11 @@ \chapter{Reserved Feature Bits}\label{sec:Reserved

Feature Bits}

Quoted 8 lines

Review \chapter{Reserved Feature Bits}\label{sec:Reserved · line 910

Quoted 1 line
(quoted diff) +0 -0
 	\ref{devicenormative:Basic Facilities of a Virtio Device / Feature Bits}

for

content.tex \chapter{Reserved Feature Bits}\label{sec:Reserved Feature Bits}

Quoted 4 lines
content.tex +2 -0
 	handling features reserved for future use.
 
+  \item[VIRTIO_F_RING_DYNAMIC(42)] This feature indicates  that the
+ driver can enable the virtqueues individually after the driver has

s/the virtqueues/virtqueues/

Ack

Quoted 10 lines

Review \chapter{Reserved Feature Bits}\label{sec:Reserved · line 916

Quoted 3 lines
(quoted diff) +2 -0
+  set the status bit of DRIVER_OK.
+  See \ref{sec:Basic Facilities of a Virtio Device / Virtqueues / Dynamic

Virtqueues}.

Quoted 5 lines
content.tex +1 -0
+
 \end{description}
 
 \drivernormative{\section}{Reserved Feature Bits}{Reserved Feature

Bits}

Quoted 8 lines

We currently have a device normative statement:

"The device MUST NOT consume buffers or send any used buffer notifications to the driver before DRIVER_OK."

I guess we need to extend that to not doing that for not-yet-enabled queues in the dynamic virtqueue case? There's a (transport-specific) point in time when the driver tells the device that the queue is ready, right?

We don’t need extend this text because device does not know anything about the disabled queue, so it cannot consume any buffer from it anyway. Above line only applied to the enabled virtqueue.

#47 lore raw
In reply to Cornelia Huck
Quoted 24 lines

From: Cornelia Huck <[email protected]>
Sent: Tuesday, October 17, 2023 5:28 PM

Quoted 10 lines · Parav Pandit

+ virtio TC.

Hi Michael, Cornelia,

Its been many days, the voting request is not raised for this small patch.

Are you receiving this email?
By any chance, this email has gone to spam/junk directory in your mailbox?

Xuan, Eugenio acked so I at least two mailboxes received in non-junk

directory.

Quoted 1 line

I noticed ballot request created 5 days ago for github issue 175,

https://www.oasis-open.org/committees/ballot.php?id=3798.

Quoted 5 lines

I suspect that, this email is not reaching you for some reason.

Added virtio TC to see if the 3rd ping reaches you.

Quoted 7 lines
Quoted 1 line

Flow filters feature is waiting for a while now which depends on this series as

users are not able to scale their performance.

Quoted 3 lines

Is there anything more to take care in this patch? Please let me know if I need to fix something in this patch.

This is the first time I noticed this, let me check.

Can you please confirm, if you notice this on virtio list or virtio-comment list in your email client. So that we can identify and fix the problem.
Eugenio and Xuan were able to see the email on virtio-comment.
It is also present on two mail bots too. So trying to find out what is wrong here.

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/

#8 lore raw

Re: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

In reply to Parav Pandit
Quoted 36 lines · Parav Pandit
Quoted 16 lines

From: Cornelia Huck <[email protected]>
Sent: Tuesday, October 17, 2023 5:55 PM

Review

Quoted 10 lines · Parav Pandit
(quoted diff) +0 -0
@@ -440,6 +440,38 @@ \subsubsection{Virtqueue

Re-enable}\label{sec:Basic Facilities of a Virtio Devic as during initial virtqueue discovery, but optionally with different parameters.

+\subsection{Dynamic Virtqueues}\label{sec:Basic Facilities of a

(quoted diff) +5 -0
+Virtio Device / Virtqueues / Dynamic Virtqueues}
+
+When VIRTIO_F_RING_DYNAMIC is not negotiated, the driver enables the
+virtqueues during the device initialization sequence, i.e. after the
+device sets the FEATURES_OK status bit and before the driver setting the

DRIVER_OK status bit.

Quoted 2 lines

_Or_ if a virtqueue has been reset and the driver wants to re-enable it, right?

Well no. Because above text is for "enablement", and not re-enablement.
If the driver want to reset and re-enable, it must be enabled in first place before setting driver_ok. VQ not enabled before driver ok, cannot be reset, and hence cannot be re-enabled.

So I think above text is fine because it says about "enables" and not "re-enables".

Quoted 10 lines

Review

Quoted 4 lines
(quoted diff) +4 -0
+
+When VIRTIO_F_RING_DYNAMIC is negotiated, the driver can avoid
+enabling the virtqueues before setting the DRIVER_OK status bit; the
+driver can enable the specific virtqueues after the driver has set the

DRIVER_OK status bit.

"the driver is not required to enable every virtqueue it wants to use before setting the DRIVER_OK status bit; it can choose to enable a virtqueue even after it has set the DRIVER_OK status bit."

Sounds good. Will change it.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

+The virtqueue enable mechanism is transport specific.

Would that be the same mechanism as for re-enabling a queue after a queue reset? I guess I'm missing the relationship here...

Yes, it is same.
There is no change in enabling/re-enabling the virtqueue after/before DRIVER_OK with/without _dynamic bit. So no extra text added here.

This is not really clear to me just from this text, especially if you just wrote above that enabling or re-enabling is something different... my understanding would be:

- if neither dynamic vqs nor queue reset are supported or negotiated, the only way to enable a vq is before DRIVER_OK, during setup
- both of these features rely on the transport supporting enabling individual queues (either a queue that has not been enabled before, or a queue that has been reset)
- the transport is supposed to use the same mechanism for either

Did I get it right? If so, I think we should make it a bit more clear.

(...)

Quoted 9 lines
Quoted 5 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+When VIRTIO_F_RING_DYNAMIC is not negotiated, the driver MUST enable
+the required number of virtqueues before setting the DRIVER_OK status bit.

What does "required" mean here? It just chooses to enable the queues it wants to use, right?

Right.
Required meaning, whatever number of queues that driver choose to enable, those must be enabled before driver_ok. So it is "required by the driver".
Would that be ok?

I'd write it as "the driver MUST enable any virtqueue it plans to use" or something like that.

(...)

Quoted 11 lines
Quoted 8 lines

We currently have a device normative statement:

"The device MUST NOT consume buffers or send any used buffer notifications to the driver before DRIVER_OK."

I guess we need to extend that to not doing that for not-yet-enabled queues in the dynamic virtqueue case? There's a (transport-specific) point in time when the driver tells the device that the queue is ready, right?

We don’t need extend this text because device does not know anything about the disabled queue, so it cannot consume any buffer from it anyway. Above line only applied to the enabled virtqueue.

My point is: DRIVER_OK signals that the driver is done with its setup and the device may start to interact with the queue. Depending on the mechanism the transport uses for enabling the queue, it may "know" about the queue before the driver is ready -- it might need to wait until the driver has completed enabling of the queue. Not sure if that is worth spelling out.

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/

#9 lore raw

Re: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 72 lines · Cornelia Huck
Quoted 36 lines · Parav Pandit
Quoted 16 lines

From: Cornelia Huck <[email protected]>
Sent: Tuesday, October 17, 2023 5:55 PM

Review

Quoted 10 lines · Parav Pandit
(quoted diff) +0 -0
@@ -440,6 +440,38 @@ \subsubsection{Virtqueue

Re-enable}\label{sec:Basic Facilities of a Virtio Devic as during initial virtqueue discovery, but optionally with different parameters.

+\subsection{Dynamic Virtqueues}\label{sec:Basic Facilities of a

(quoted diff) +5 -0
+Virtio Device / Virtqueues / Dynamic Virtqueues}
+
+When VIRTIO_F_RING_DYNAMIC is not negotiated, the driver enables the
+virtqueues during the device initialization sequence, i.e. after the
+device sets the FEATURES_OK status bit and before the driver setting the

DRIVER_OK status bit.

Quoted 2 lines

_Or_ if a virtqueue has been reset and the driver wants to re-enable it, right?

Well no. Because above text is for "enablement", and not re-enablement.
If the driver want to reset and re-enable, it must be enabled in first place before setting driver_ok. VQ not enabled before driver ok, cannot be reset, and hence cannot be re-enabled.

So I think above text is fine because it says about "enables" and not "re-enables".

Quoted 10 lines

Review

Quoted 4 lines
(quoted diff) +4 -0
+
+When VIRTIO_F_RING_DYNAMIC is negotiated, the driver can avoid
+enabling the virtqueues before setting the DRIVER_OK status bit; the
+driver can enable the specific virtqueues after the driver has set the

DRIVER_OK status bit.

"the driver is not required to enable every virtqueue it wants to use before setting the DRIVER_OK status bit; it can choose to enable a virtqueue even after it has set the DRIVER_OK status bit."

Sounds good. Will change it.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

+The virtqueue enable mechanism is transport specific.

Would that be the same mechanism as for re-enabling a queue after a queue reset? I guess I'm missing the relationship here...

Yes, it is same.
There is no change in enabling/re-enabling the virtqueue after/before DRIVER_OK with/without _dynamic bit. So no extra text added here.

This is not really clear to me just from this text, especially if you just wrote above that enabling or re-enabling is something different... my understanding would be:

- if neither dynamic vqs nor queue reset are supported or negotiated, the only way to enable a vq is before DRIVER_OK, during setup
- both of these features rely on the transport supporting enabling individual queues (either a queue that has not been enabled before, or a queue that has been reset)
- the transport is supposed to use the same mechanism for either

Did I get it right? If so, I think we should make it a bit more clear.

(...)

Quoted 9 lines
Quoted 5 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+When VIRTIO_F_RING_DYNAMIC is not negotiated, the driver MUST enable
+the required number of virtqueues before setting the DRIVER_OK status bit.

What does "required" mean here? It just chooses to enable the queues it wants to use, right?

Right.
Required meaning, whatever number of queues that driver choose to enable, those must be enabled before driver_ok. So it is "required by the driver".
Would that be ok?

Quoted 4 lines

I'd write it as "the driver MUST enable any virtqueue it plans to use" or something like that.

(...)

It would have to be SHOULD - we can't add new MUST requirements not contingent on a feature bit, we can give recommendation based on existing installed base.

Quoted 12 lines
Quoted 11 lines
Quoted 8 lines

We currently have a device normative statement:

"The device MUST NOT consume buffers or send any used buffer notifications to the driver before DRIVER_OK."

I guess we need to extend that to not doing that for not-yet-enabled queues in the dynamic virtqueue case? There's a (transport-specific) point in time when the driver tells the device that the queue is ready, right?

We don’t need extend this text because device does not know anything about the disabled queue, so it cannot consume any buffer from it anyway. Above line only applied to the enabled virtqueue.

Quoted 6 lines

My point is: DRIVER_OK signals that the driver is done with its setup and the device may start to interact with the queue. Depending on the mechanism the transport uses for enabling the queue, it may "know" about the queue before the driver is ready -- it might need to wait until the driver has completed enabling of the queue. Not sure if that is worth spelling out.

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/

#10 lore raw

Re: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 17 lines · Michael S. Tsirkin
Quoted 16 lines · Cornelia Huck
Quoted 13 lines · Parav Pandit
Quoted 9 lines

From: Cornelia Huck <[email protected]>
Sent: Tuesday, October 17, 2023 5:55 PM

Review

Quoted 2 lines · Parav Pandit
(quoted diff) +2 -0
+When VIRTIO_F_RING_DYNAMIC is not negotiated, the driver MUST enable
+the required number of virtqueues before setting the DRIVER_OK status bit.

What does "required" mean here? It just chooses to enable the queues it wants to use, right?

Right.
Required meaning, whatever number of queues that driver choose to enable, those must be enabled before driver_ok. So it is "required by the driver".
Would that be ok?

Quoted 8 lines
Quoted 4 lines

I'd write it as "the driver MUST enable any virtqueue it plans to use" or something like that.

(...)

It would have to be SHOULD - we can't add new MUST requirements not contingent on a feature bit, we can give recommendation based on existing installed base.

Then I wonder whether we need to add any normative statement at all -- prior to the introduction of this new feature, the driver had to enable anything it wanted to use before DRIVER_OK, and if it does not negotiate the new feature, nothing changes. Spelling that out in non-normative sections should be enough?

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/

#11 lore raw

Re: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 28 lines · Cornelia Huck
Quoted 17 lines · Michael S. Tsirkin
Quoted 16 lines · Cornelia Huck
Quoted 13 lines · Parav Pandit
Quoted 9 lines

From: Cornelia Huck <[email protected]>
Sent: Tuesday, October 17, 2023 5:55 PM

Review

Quoted 2 lines · Parav Pandit
(quoted diff) +2 -0
+When VIRTIO_F_RING_DYNAMIC is not negotiated, the driver MUST enable
+the required number of virtqueues before setting the DRIVER_OK status bit.

What does "required" mean here? It just chooses to enable the queues it wants to use, right?

Right.
Required meaning, whatever number of queues that driver choose to enable, those must be enabled before driver_ok. So it is "required by the driver".
Would that be ok?

Quoted 8 lines
Quoted 4 lines

I'd write it as "the driver MUST enable any virtqueue it plans to use" or something like that.

(...)

It would have to be SHOULD - we can't add new MUST requirements not contingent on a feature bit, we can give recommendation based on existing installed base.

Quoted 5 lines

Then I wonder whether we need to add any normative statement at all -- prior to the introduction of this new feature, the driver had to enable anything it wanted to use before DRIVER_OK, and if it does not negotiate the new feature, nothing changes. Spelling that out in non-normative sections should be enough?

I think it's not a bad thing to be clearer, but I don't care much.

Signature · 18 lines
MST


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/
#12 lore raw

RE: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

In reply to Cornelia Huck
Quoted 18 lines

From: Cornelia Huck <[email protected]>
Sent: Wednesday, October 18, 2023 4:34 PM

Quoted 9 lines · Michael S. Tsirkin
Quoted 8 lines · Cornelia Huck
Quoted 6 lines · Parav Pandit
Quoted 6 lines

From: Cornelia Huck <[email protected]>
Sent: Tuesday, October 17, 2023 5:55 PM

Review

Quoted 2 lines · Parav Pandit
(quoted diff) +2 -0
+When VIRTIO_F_RING_DYNAMIC is not negotiated, the driver MUST
+enable the required number of virtqueues before setting the

DRIVER_OK status bit.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 17 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

What does "required" mean here? It just chooses to enable the queues it wants to use, right?

Right.
Required meaning, whatever number of queues that driver choose to

enable, those must be enabled before driver_ok.

Quoted 11 lines
Quoted 7 lines
Quoted 2 lines

So it is "required by the driver".
Would that be ok?

I'd write it as "the driver MUST enable any virtqueue it plans to use" or something like that.

(...)

It would have to be SHOULD - we can't add new MUST requirements not contingent on a feature bit, we can give recommendation based on existing installed base.

It is not just installed base.
Spec clearly says that:
"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."

There is no feature bit or any text that says "population of virtqueues" can be done later outside of the device initialization phase. Only reference is _F_RESET bit which is only for re-enabling. (not enabling).

Quoted 5 lines

Then I wonder whether we need to add any normative statement at all -- prior to the introduction of this new feature, the driver had to enable anything it wanted to use before DRIVER_OK, and if it does not negotiate the new feature, nothing changes. Spelling that out in non-normative sections should be enough?

It is already implied in the spec that queues must be enabled before DRIVER_OK. So what is written in normative is not changing any behavior.
It is only making the implied behavior explicit.

If it says SHOULD, that means, one can enable the queue for the first time after DRIVER_OK stage too. And that would violate the "Driver Requirements: Device Initialization".

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/

#13 lore raw

RE: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Hi Cornelia, Michael,

Quoted 52 lines

From: [email protected] <[email protected] open.org> On Behalf Of Parav Pandit
Sent: Wednesday, October 18, 2023 4:43 PM

Quoted 16 lines

From: Cornelia Huck <[email protected]>
Sent: Wednesday, October 18, 2023 4:34 PM

Quoted 9 lines · Michael S. Tsirkin
Quoted 8 lines · Cornelia Huck
Quoted 6 lines · Parav Pandit
Quoted 6 lines

From: Cornelia Huck <[email protected]>
Sent: Tuesday, October 17, 2023 5:55 PM

Review

Quoted 2 lines · Parav Pandit
(quoted diff) +2 -0
+When VIRTIO_F_RING_DYNAMIC is not negotiated, the driver MUST
+enable the required number of virtqueues before setting the

DRIVER_OK status bit.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 17 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

What does "required" mean here? It just chooses to enable the queues it wants to use, right?

Right.
Required meaning, whatever number of queues that driver choose to

enable, those must be enabled before driver_ok.

Quoted 11 lines
Quoted 7 lines
Quoted 2 lines

So it is "required by the driver".
Would that be ok?

I'd write it as "the driver MUST enable any virtqueue it plans to use" or something like that.

(...)

It would have to be SHOULD - we can't add new MUST requirements not contingent on a feature bit, we can give recommendation based on existing installed base.

It is not just installed base.
Spec clearly says that:
"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."

There is no feature bit or any text that says "population of virtqueues" can be done later outside of the device initialization phase.
Only reference is _F_RESET bit which is only for re-enabling. (not enabling).

Quoted 5 lines

Then I wonder whether we need to add any normative statement at all -- prior to the introduction of this new feature, the driver had to enable anything it wanted to use before DRIVER_OK, and if it does not negotiate the new feature, nothing changes. Spelling that out in non-normative sections should be enough?

Quoted 9 lines

It is already implied in the spec that queues must be enabled before DRIVER_OK.
So what is written in normative is not changing any behavior. It is only making the implied behavior explicit.

If it says SHOULD, that means, one can enable the queue for the first time after DRIVER_OK stage too.
And that would violate the "Driver Requirements: Device Initialization".

I have addressed the comments of v3 in v4 at [1].
The device requirement is kept as MUST to keep it aligned with the "driver requirements section".'

[1] https://lore.kernel.org/virtio-comment/[email protected]/T/#mc49b6e54186c5f1b1e8c743bc440ca0cc0938212

Please review.

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/

#14 lore raw

RE: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Hi Michael, Cornelia,

Quoted 69 lines

From: Parav Pandit
Sent: Thursday, October 19, 2023 7:27 PM

Hi Cornelia, Michael,

Quoted 54 lines

From: [email protected] <[email protected] open.org> On Behalf Of Parav Pandit
Sent: Wednesday, October 18, 2023 4:43 PM

Quoted 17 lines

From: Cornelia Huck <[email protected]>
Sent: Wednesday, October 18, 2023 4:34 PM

Quoted 10 lines · Michael S. Tsirkin
Quoted 9 lines · Cornelia Huck
Quoted 7 lines · Parav Pandit
Quoted 7 lines

From: Cornelia Huck <[email protected]>
Sent: Tuesday, October 17, 2023 5:55 PM

Review

Quoted 3 lines · Parav Pandit
(quoted diff) +3 -0
+When VIRTIO_F_RING_DYNAMIC is not negotiated, the driver
+MUST enable the required number of virtqueues before
+setting the

DRIVER_OK status bit.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 18 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

What does "required" mean here? It just chooses to enable the queues it wants to use, right?

Right.
Required meaning, whatever number of queues that driver choose to

enable, those must be enabled before driver_ok.

Quoted 11 lines
Quoted 7 lines
Quoted 2 lines

So it is "required by the driver".
Would that be ok?

I'd write it as "the driver MUST enable any virtqueue it plans to use" or something like that.

(...)

It would have to be SHOULD - we can't add new MUST requirements not contingent on a feature bit, we can give recommendation based on existing installed base.

It is not just installed base.
Spec clearly says that:
"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."

There is no feature bit or any text that says "population of virtqueues" can be done later outside of the device initialization phase. Only reference is _F_RESET bit which is only for re-enabling. (not enabling).

Quoted 5 lines

Then I wonder whether we need to add any normative statement at all -- prior to the introduction of this new feature, the driver had to enable anything it wanted to use before DRIVER_OK, and if it does not negotiate the new feature, nothing changes. Spelling that out in non-normative sections should be enough?

Quoted 9 lines

It is already implied in the spec that queues must be enabled before DRIVER_OK.
So what is written in normative is not changing any behavior. It is only making the implied behavior explicit.

If it says SHOULD, that means, one can enable the queue for the first time after DRIVER_OK stage too.
And that would violate the "Driver Requirements: Device Initialization".

Quoted 8 lines

I have addressed the comments of v3 in v4 at [1].
The device requirement is kept as MUST to keep it aligned with the "driver requirements section".'

[1] https://lore.kernel.org/virtio-comment/20231017143135.758523-1-
[email protected]/T/#mc49b6e54186c5f1b1e8c743bc440ca0cc0938212

Please review.

If no comments in v4 which was a week ago, please raise the voting ballot.

[1] https://lists.oasis-open.org/archives/virtio-comment/202310/msg00183.html

Parav

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/

#15 lore raw

RE: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 75 lines · Parav Pandit

Hi Michael, Cornelia,

Quoted 73 lines

From: Parav Pandit
Sent: Thursday, October 19, 2023 7:27 PM

Hi Cornelia, Michael,

Quoted 54 lines

From: [email protected] <[email protected] open.org> On Behalf Of Parav Pandit
Sent: Wednesday, October 18, 2023 4:43 PM

Quoted 17 lines

From: Cornelia Huck <[email protected]>
Sent: Wednesday, October 18, 2023 4:34 PM

Quoted 10 lines · Michael S. Tsirkin
Quoted 9 lines · Cornelia Huck
Quoted 7 lines · Parav Pandit
Quoted 7 lines

From: Cornelia Huck <[email protected]>
Sent: Tuesday, October 17, 2023 5:55 PM

Review

Quoted 3 lines · Parav Pandit
(quoted diff) +3 -0
+When VIRTIO_F_RING_DYNAMIC is not negotiated, the driver
+MUST enable the required number of virtqueues before
+setting the

DRIVER_OK status bit.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 18 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

What does "required" mean here? It just chooses to enable the queues it wants to use, right?

Right.
Required meaning, whatever number of queues that driver choose to

enable, those must be enabled before driver_ok.

Quoted 11 lines
Quoted 7 lines
Quoted 2 lines

So it is "required by the driver".
Would that be ok?

I'd write it as "the driver MUST enable any virtqueue it plans to use" or something like that.

(...)

It would have to be SHOULD - we can't add new MUST requirements not contingent on a feature bit, we can give recommendation based on existing installed base.

It is not just installed base.
Spec clearly says that:
"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."

There is no feature bit or any text that says "population of virtqueues" can be done later outside of the device initialization phase. Only reference is _F_RESET bit which is only for re-enabling. (not enabling).

Quoted 5 lines

Then I wonder whether we need to add any normative statement at all -- prior to the introduction of this new feature, the driver had to enable anything it wanted to use before DRIVER_OK, and if it does not negotiate the new feature, nothing changes. Spelling that out in non-normative sections should be enough?

Quoted 9 lines

It is already implied in the spec that queues must be enabled before DRIVER_OK.
So what is written in normative is not changing any behavior. It is only making the implied behavior explicit.

If it says SHOULD, that means, one can enable the queue for the first time after DRIVER_OK stage too.
And that would violate the "Driver Requirements: Device Initialization".

I have addressed the comments of v3 in v4 at [1].
The device requirement is kept as MUST to keep it aligned with the "driver requirements section".'

Quoted 6 lines
Quoted 4 lines

[1] https://lore.kernel.org/virtio-comment/20231017143135.758523-1-
[email protected]/T/#mc49b6e54186c5f1b1e8c743bc440ca0cc0938212

Please review.

If no comments in v4 which was a week ago, please raise the voting ballot.

Well, there are still comments from me here that post-date v4 (please wait for a bit before posting another version!), so I'll continue waiting for them to be addressed first.

Quoted 4 lines

[1] https://lists.oasis-open.org/archives/virtio-comment/202310/msg00183.html

Parav

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/

#16 lore raw

RE: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 8 lines

From: [email protected] <[email protected] open.org> On Behalf Of Cornelia Huck
Sent: Monday, October 23, 2023 7:27 PM

Well, there are still comments from me here that post-date v4 (please wait for a bit before posting another version!), so I'll continue waiting for them to be addressed first.

The last one was [1].
Which I replied few days ago at [2].

[1] https://lists.oasis-open.org/archives/virtio-comment/202310/msg00240.html
[2] https://lists.oasis-open.org/archives/virtio-comment/202310/msg00242.html

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/

#17 lore raw

RE: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 4 lines · Parav Pandit
Quoted 3 lines

From: [email protected] <[email protected] open.org> On Behalf Of Cornelia Huck
Sent: Monday, October 23, 2023 7:27 PM

Quoted 8 lines
Quoted 3 lines

Well, there are still comments from me here that post-date v4 (please wait for a bit before posting another version!), so I'll continue waiting for them to be addressed first.

The last one was [1].
Which I replied few days ago at [2].

[1] https://lists.oasis-open.org/archives/virtio-comment/202310/msg00240.html
[2] https://lists.oasis-open.org/archives/virtio-comment/202310/msg00242.html

I still have some open questions from <[email protected]> (first and last paragraph.)

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/

#18 lore raw

RE: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 15 lines

From: Cornelia Huck <[email protected]>
Sent: Monday, October 23, 2023 7:58 PM

Quoted 10 lines · Parav Pandit
Quoted 7 lines

From: [email protected] <[email protected] open.org> On Behalf Of Cornelia Huck
Sent: Monday, October 23, 2023 7:27 PM

Well, there are still comments from me here that post-date v4 (please wait for a bit before posting another version!), so I'll continue waiting for them to be addressed first.

The last one was [1].
Which I replied few days ago at [2].

Quoted 8 lines
Quoted 5 lines

[1]
https://lists.oasis-open.org/archives/virtio-comment/202310/msg00240.h
tml [2]
https://lists.oasis-open.org/archives/virtio-comment/202310/msg00242.h
tml

I still have some open questions from <[email protected]> (first and last paragraph.)

Above link is not accessible to me. ☹
I addressed your comments/questions in v4.
Can you please check v4 if they are addressed? I rewrote as you suggested in v3.

#19 lore raw

RE: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 21 lines · Parav Pandit
Quoted 21 lines

From: Cornelia Huck <[email protected]>
Sent: Monday, October 23, 2023 7:58 PM

Quoted 15 lines · Parav Pandit
Quoted 7 lines

From: [email protected] <[email protected] open.org> On Behalf Of Cornelia Huck
Sent: Monday, October 23, 2023 7:27 PM

Well, there are still comments from me here that post-date v4 (please wait for a bit before posting another version!), so I'll continue waiting for them to be addressed first.

The last one was [1].
Which I replied few days ago at [2].

[1]
https://lists.oasis-open.org/archives/virtio-comment/202310/msg00240.h
tml [2]
https://lists.oasis-open.org/archives/virtio-comment/202310/msg00242.h
tml

Quoted 4 lines
Quoted 2 lines

I still have some open questions from <[email protected]> (first and last paragraph.)

Above link is not accessible to me. ☹

That's not a link, but a message id... many mail clients support searching by it, and you can also get it from lore:

https://lore.kernel.org/all/[email protected]/

Quoted 2 lines

I addressed your comments/questions in v4.
Can you please check v4 if they are addressed? I rewrote as you suggested in v3.

This was for points you did not agree with. (Again, it might be helpful to wait with posting a new version until discussion has somewhat concluded.)

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/

#20 lore raw

RE: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 40 lines

From: [email protected] <[email protected] open.org> On Behalf Of Cornelia Huck
Sent: Monday, October 23, 2023 8:31 PM

Quoted 23 lines · Parav Pandit
Quoted 23 lines

From: Cornelia Huck <[email protected]>
Sent: Monday, October 23, 2023 7:58 PM

Quoted 17 lines · Parav Pandit
Quoted 7 lines

From: [email protected] <[email protected] open.org> On Behalf Of Cornelia Huck
Sent: Monday, October 23, 2023 7:27 PM

Well, there are still comments from me here that post-date v4 (please wait for a bit before posting another version!), so I'll continue waiting for them to be addressed first.

The last one was [1].
Which I replied few days ago at [2].

[1]
https://lists.oasis-open.org/archives/virtio-comment/202310/msg0024
0.h
tml [2]
https://lists.oasis-open.org/archives/virtio-comment/202310/msg0024
2.h
tml

Quoted 4 lines
Quoted 2 lines

I still have some open questions from <[email protected]> (first and last paragraph.)

Above link is not accessible to me. ☹

That's not a link, but a message id... many mail clients support searching by it, and you can also get it from lore:

https://lore.kernel.org/all/[email protected]/

Quoted 7 lines
Quoted 2 lines

I addressed your comments/questions in v4.
Can you please check v4 if they are addressed? I rewrote as you suggested in

v3.

This was for points you did not agree with. (Again, it might be helpful to wait with posting a new version until discussion has somewhat concluded.)

Sure, will wait next time.

Your comment was,
=====
This is not really clear to me just from this text, especially if you just wrote above that enabling or re-enabling is something different... my understanding would be:

- if neither dynamic vqs nor queue reset are supported or negotiated, the only way to enable a vq is before DRIVER_OK, during setup
- both of these features rely on the transport supporting enabling individual queues (either a queue that has not been enabled before, or a queue that has been reset)
- the transport is supposed to use the same mechanism for either

Did I get it right? If so, I think we should make it a bit more clear.
=====

Above is clarified in below wording without complicating the queue_reset here.

Does that look ok to you?

+When VIRTIO_F_RING_DYNAMIC is not negotiated, the driver enables the virtqueues +during the device initialization sequence, i.e. after the device sets the +FEATURES_OK status bit and before the driver setting the DRIVER_OK status bit. +
+When VIRTIO_F_RING_DYNAMIC is negotiated, the driver is not required to enable +every virtqueue it wants to use before setting the DRIVER_OK status bit; the +driver can choose to enable a virtqueue even after the driver has set the +DRIVER_OK status bit. The virtqueue enable mechanism is transport specific. +

#21 lore raw

RE: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Hi Cornelia,

Quoted 92 lines

From: Parav Pandit <[email protected]>
Sent: Monday, October 23, 2023 8:52 PM
To: Cornelia Huck <[email protected]>; Michael S. Tsirkin <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Shahaf Shuler <[email protected]>
Subject: RE: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 45 lines

From: [email protected] <[email protected] open.org> On Behalf Of Cornelia Huck
Sent: Monday, October 23, 2023 8:31 PM

Quoted 26 lines · Parav Pandit
Quoted 26 lines

From: Cornelia Huck <[email protected]>
Sent: Monday, October 23, 2023 7:58 PM

Quoted 20 lines · Parav Pandit
Quoted 8 lines

From: [email protected] <[email protected] open.org> On Behalf Of Cornelia Huck
Sent: Monday, October 23, 2023 7:27 PM

Well, there are still comments from me here that post-date v4 (please wait for a bit before posting another version!), so I'll continue waiting for them to be addressed first.

The last one was [1].
Which I replied few days ago at [2].

[1]
https://lists.oasis-open.org/archives/virtio-comment/202310/msg00
24
0.h
tml [2]
https://lists.oasis-open.org/archives/virtio-comment/202310/msg00
24
2.h
tml

Quoted 4 lines
Quoted 2 lines

I still have some open questions from <[email protected]> (first and last paragraph.)

Above link is not accessible to me. ☹

That's not a link, but a message id... many mail clients support searching by it, and you can also get it from lore:

https://lore.kernel.org/all/[email protected]/

Quoted 3 lines

I addressed your comments/questions in v4.
Can you please check v4 if they are addressed? I rewrote as you suggested in

Quoted 6 lines

v3.

This was for points you did not agree with. (Again, it might be helpful to wait with posting a new version until discussion has somewhat
concluded.)

Sure, will wait next time.

Your comment was,
=====
This is not really clear to me just from this text, especially if you just wrote above that enabling or re-enabling is something different... my understanding would be:

- if neither dynamic vqs nor queue reset are supported or negotiated, the only way to enable a vq is before DRIVER_OK, during setup
- both of these features rely on the transport supporting enabling individual queues (either a queue that has not been enabled before, or a queue that has been reset)
- the transport is supposed to use the same mechanism for either

Did I get it right? If so, I think we should make it a bit more clear.
=====

Above is clarified in below wording without complicating the queue_reset here.

Does that look ok to you?

(quoted diff) +3 -0
+When VIRTIO_F_RING_DYNAMIC is not negotiated, the driver enables the
+virtqueues during the device initialization sequence, i.e. after the
+device sets the FEATURES_OK status bit and before the driver setting the

DRIVER_OK status bit.

(quoted diff) +5 -0
+
+When VIRTIO_F_RING_DYNAMIC is negotiated, the driver is not required to
+enable every virtqueue it wants to use before setting the DRIVER_OK
+status bit; the driver can choose to enable a virtqueue even after the
+driver has set the DRIVER_OK status bit. The virtqueue enable mechanism is
Quoted 2 lines

transport specific.
+

Can you please respond?
We must make progress with this and the flow filters which are depending on this for a long time now.

#22 lore raw

RE: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 85 lines · Parav Pandit

Hi Cornelia,

Quoted 83 lines

From: Parav Pandit <[email protected]>
Sent: Monday, October 23, 2023 8:52 PM
To: Cornelia Huck <[email protected]>; Michael S. Tsirkin <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Shahaf Shuler <[email protected]>
Subject: RE: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 45 lines

From: [email protected] <[email protected] open.org> On Behalf Of Cornelia Huck
Sent: Monday, October 23, 2023 8:31 PM

Quoted 26 lines · Parav Pandit
Quoted 26 lines

From: Cornelia Huck <[email protected]>
Sent: Monday, October 23, 2023 7:58 PM

Quoted 20 lines · Parav Pandit
Quoted 8 lines

From: [email protected] <[email protected] open.org> On Behalf Of Cornelia Huck
Sent: Monday, October 23, 2023 7:27 PM

Well, there are still comments from me here that post-date v4 (please wait for a bit before posting another version!), so I'll continue waiting for them to be addressed first.

The last one was [1].
Which I replied few days ago at [2].

[1]
https://lists.oasis-open.org/archives/virtio-comment/202310/msg00
24
0.h
tml [2]
https://lists.oasis-open.org/archives/virtio-comment/202310/msg00
24
2.h
tml

Quoted 4 lines
Quoted 2 lines

I still have some open questions from <[email protected]> (first and last paragraph.)

Above link is not accessible to me. ☹

That's not a link, but a message id... many mail clients support searching by it, and you can also get it from lore:

https://lore.kernel.org/all/[email protected]/

Quoted 3 lines

I addressed your comments/questions in v4.
Can you please check v4 if they are addressed? I rewrote as you suggested in

Quoted 6 lines

v3.

This was for points you did not agree with. (Again, it might be helpful to wait with posting a new version until discussion has somewhat
concluded.)

Sure, will wait next time.

Your comment was,
=====
This is not really clear to me just from this text, especially if you just wrote above that enabling or re-enabling is something different... my understanding would be:

- if neither dynamic vqs nor queue reset are supported or negotiated, the only way to enable a vq is before DRIVER_OK, during setup
- both of these features rely on the transport supporting enabling individual queues (either a queue that has not been enabled before, or a queue that has been reset)
- the transport is supposed to use the same mechanism for either

Did I get it right? If so, I think we should make it a bit more clear.
=====

Above is clarified in below wording without complicating the queue_reset here.

Does that look ok to you?

Quoted 14 lines
Quoted 11 lines
(quoted diff) +3 -0
+When VIRTIO_F_RING_DYNAMIC is not negotiated, the driver enables the
+virtqueues during the device initialization sequence, i.e. after the
+device sets the FEATURES_OK status bit and before the driver setting the

DRIVER_OK status bit.

(quoted diff) +5 -0
+
+When VIRTIO_F_RING_DYNAMIC is negotiated, the driver is not required to
+enable every virtqueue it wants to use before setting the DRIVER_OK
+status bit; the driver can choose to enable a virtqueue even after the
+driver has set the DRIVER_OK status bit. The virtqueue enable mechanism is

transport specific.
+

Can you please respond?
We must make progress with this and the flow filters which are depending on this for a long time now.

I will not be able to look at this before Friday.

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/

#23 lore raw

RE: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 110 lines

From: Cornelia Huck <[email protected]>
Sent: Wednesday, October 25, 2023 3:48 PM

Quoted 84 lines · Parav Pandit

Hi Cornelia,

Quoted 82 lines

From: Parav Pandit <[email protected]>
Sent: Monday, October 23, 2023 8:52 PM
To: Cornelia Huck <[email protected]>; Michael S. Tsirkin <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Shahaf Shuler <[email protected]>
Subject: RE: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 47 lines

From: [email protected] <[email protected] open.org> On Behalf Of Cornelia Huck
Sent: Monday, October 23, 2023 8:31 PM

Quoted 28 lines · Parav Pandit
Quoted 28 lines

From: Cornelia Huck <[email protected]>
Sent: Monday, October 23, 2023 7:58 PM

Quoted 22 lines · Parav Pandit
Quoted 8 lines

From: [email protected] <[email protected] open.org> On Behalf Of Cornelia Huck
Sent: Monday, October 23, 2023 7:27 PM

Well, there are still comments from me here that post-date v4 (please wait for a bit before posting another version!), so I'll continue waiting for them to be addressed first.

The last one was [1].
Which I replied few days ago at [2].

[1]
https://lists.oasis-open.org/archives/virtio-comment/202310/ms
g00
24
0.h
tml [2]
https://lists.oasis-open.org/archives/virtio-comment/202310/ms
g00
24
2.h
tml

Quoted 4 lines
Quoted 2 lines

I still have some open questions from <[email protected]> (first and last paragraph.)

Above link is not accessible to me. ☹

That's not a link, but a message id... many mail clients support searching by it, and you can also get it from lore:

https://lore.kernel.org/all/[email protected]/

Quoted 3 lines

I addressed your comments/questions in v4.
Can you please check v4 if they are addressed? I rewrote as you suggested in

Quoted 6 lines

v3.

This was for points you did not agree with. (Again, it might be helpful to wait with posting a new version until discussion has somewhat
concluded.)

Sure, will wait next time.

Your comment was,
=====
This is not really clear to me just from this text, especially if you just wrote above that enabling or re-enabling is something different... my understanding would be:

- if neither dynamic vqs nor queue reset are supported or negotiated, the only way to enable a vq is before DRIVER_OK, during setup
- both of these features rely on the transport supporting enabling individual queues (either a queue that has not been enabled before, or a queue that has been reset)
- the transport is supposed to use the same mechanism for either

Did I get it right? If so, I think we should make it a bit more clear.
=====

Above is clarified in below wording without complicating the queue_reset

here.

Quoted 19 lines
Quoted 14 lines

Does that look ok to you?

(quoted diff) +4 -0
+When VIRTIO_F_RING_DYNAMIC is not negotiated, the driver enables the
+virtqueues during the device initialization sequence, i.e. after the
+device sets the FEATURES_OK status bit and before the driver setting
+the

DRIVER_OK status bit.

(quoted diff) +6 -0
+
+When VIRTIO_F_RING_DYNAMIC is negotiated, the driver is not required
+to enable every virtqueue it wants to use before setting the
+DRIVER_OK status bit; the driver can choose to enable a virtqueue
+even after the driver has set the DRIVER_OK status bit. The
+virtqueue enable mechanism is
Quoted 2 lines

transport specific.
+

Can you please respond?
We must make progress with this and the flow filters which are depending on

Quoted 3 lines

this for a long time now.

I will not be able to look at this before Friday.

Ok. Thanks for the update.
Will seek for your response on Friday.

#24 lore raw

Re: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

In reply to Parav Pandit
Quoted 81 lines · Parav Pandit

Hi Cornelia,

Quoted 79 lines

From: Parav Pandit <[email protected]>
Sent: Monday, October 23, 2023 8:52 PM
To: Cornelia Huck <[email protected]>; Michael S. Tsirkin <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Shahaf Shuler <[email protected]>
Subject: RE: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 45 lines

From: [email protected] <[email protected] open.org> On Behalf Of Cornelia Huck
Sent: Monday, October 23, 2023 8:31 PM

Quoted 26 lines · Parav Pandit
Quoted 26 lines

From: Cornelia Huck <[email protected]>
Sent: Monday, October 23, 2023 7:58 PM

Quoted 20 lines · Parav Pandit
Quoted 8 lines

From: [email protected] <[email protected] open.org> On Behalf Of Cornelia Huck
Sent: Monday, October 23, 2023 7:27 PM

Well, there are still comments from me here that post-date v4 (please wait for a bit before posting another version!), so I'll continue waiting for them to be addressed first.

The last one was [1].
Which I replied few days ago at [2].

[1]
https://lists.oasis-open.org/archives/virtio-comment/202310/msg00
24
0.h
tml [2]
https://lists.oasis-open.org/archives/virtio-comment/202310/msg00
24
2.h
tml

Quoted 4 lines
Quoted 2 lines

I still have some open questions from <[email protected]> (first and last paragraph.)

Above link is not accessible to me. ☹

That's not a link, but a message id... many mail clients support searching by it, and you can also get it from lore:

https://lore.kernel.org/all/[email protected]/

Quoted 3 lines

I addressed your comments/questions in v4.
Can you please check v4 if they are addressed? I rewrote as you suggested in

Quoted 6 lines

v3.

This was for points you did not agree with. (Again, it might be helpful to wait with posting a new version until discussion has somewhat
concluded.)

Sure, will wait next time.

Your comment was,
=====
This is not really clear to me just from this text, especially if you just wrote above that enabling or re-enabling is something different... my understanding would be:

- if neither dynamic vqs nor queue reset are supported or negotiated, the only way to enable a vq is before DRIVER_OK, during setup
- both of these features rely on the transport supporting enabling individual queues (either a queue that has not been enabled before, or a queue that has been reset)
- the transport is supposed to use the same mechanism for either

Did I get it right? If so, I think we should make it a bit more clear.
=====

Quoted 7 lines

Review

Quoted 7 lines

Above is clarified in below wording without complicating the queue_reset here.

Does that look ok to you?

(quoted diff) +3 -0
+When VIRTIO_F_RING_DYNAMIC is not negotiated, the driver enables the
+virtqueues during the device initialization sequence, i.e. after the
+device sets the FEATURES_OK status bit

all status bits are set by driver

Quoted 1 line

and before the driver setting the

setting -> sets

Quoted 3 lines

Review

Quoted 3 lines

DRIVER_OK status bit.

(quoted diff) +2 -0
+
+When VIRTIO_F_RING_DYNAMIC is negotiated, the driver is not required to

try to avoid "required" outside conformance sections though pls. And when used, we upper-case it.

Quoted 8 lines
Quoted 5 lines
(quoted diff) +3 -0
+enable every virtqueue it wants to use before setting the DRIVER_OK
+status bit; the driver can choose to enable a virtqueue even after the
+driver has set the DRIVER_OK status bit. The virtqueue enable mechanism is

transport specific.
+

Can you please respond?
We must make progress with this and the flow filters which are depending on this for a long time now.

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/

#25 lore raw

RE: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 92 lines

From: [email protected] <[email protected] open.org> On Behalf Of Michael S. Tsirkin
Sent: Wednesday, October 25, 2023 3:54 PM

Quoted 84 lines · Parav Pandit

Hi Cornelia,

Quoted 82 lines

From: Parav Pandit <[email protected]>
Sent: Monday, October 23, 2023 8:52 PM
To: Cornelia Huck <[email protected]>; Michael S. Tsirkin <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Shahaf Shuler <[email protected]>
Subject: RE: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 47 lines

From: [email protected] <[email protected] open.org> On Behalf Of Cornelia Huck
Sent: Monday, October 23, 2023 8:31 PM

Quoted 28 lines · Parav Pandit
Quoted 28 lines

From: Cornelia Huck <[email protected]>
Sent: Monday, October 23, 2023 7:58 PM

Quoted 22 lines · Parav Pandit
Quoted 8 lines

From: [email protected] <[email protected] open.org> On Behalf Of Cornelia Huck
Sent: Monday, October 23, 2023 7:27 PM

Well, there are still comments from me here that post-date v4 (please wait for a bit before posting another version!), so I'll continue waiting for them to be addressed first.

The last one was [1].
Which I replied few days ago at [2].

[1]
https://lists.oasis-open.org/archives/virtio-comment/202310/m
sg00
24
0.h
tml [2]
https://lists.oasis-open.org/archives/virtio-comment/202310/m
sg00
24
2.h
tml

Quoted 4 lines
Quoted 2 lines

I still have some open questions from <[email protected]> (first and last paragraph.)

Above link is not accessible to me. ☹

That's not a link, but a message id... many mail clients support searching by it, and you can also get it from lore:

https://lore.kernel.org/all/[email protected]/

Quoted 3 lines

I addressed your comments/questions in v4.
Can you please check v4 if they are addressed? I rewrote as you suggested in

Quoted 6 lines

v3.

This was for points you did not agree with. (Again, it might be helpful to wait with posting a new version until discussion has somewhat
concluded.)

Sure, will wait next time.

Your comment was,
=====
This is not really clear to me just from this text, especially if you just wrote above that enabling or re-enabling is something different... my understanding would be:

- if neither dynamic vqs nor queue reset are supported or negotiated, the only way to enable a vq is before DRIVER_OK, during setup
- both of these features rely on the transport supporting enabling individual queues (either a queue that has not been enabled before, or a queue that has been reset)
- the transport is supposed to use the same mechanism for either

Did I get it right? If so, I think we should make it a bit more clear.
=====

Above is clarified in below wording without complicating the queue_reset

here.

Quoted 1 line
Quoted 1 line
Quoted 8 lines
Quoted 5 lines

Review

Quoted 5 lines

Does that look ok to you?

(quoted diff) +3 -0
+When VIRTIO_F_RING_DYNAMIC is not negotiated, the driver enables
+the virtqueues during the device initialization sequence, i.e.
+after the device sets the FEATURES_OK status bit

all status bits are set by driver

Well device clears it if it does not like the features.

Yes. I will rewrite it as,

i.e. after the driver has verified that FEATURES_OK bit is set and before the driver sets DRIVER_OK bit.

Quoted 5 lines
Quoted 1 line

and before the driver setting the

setting -> sets

Quoted 8 lines
Quoted 4 lines

Review

Quoted 4 lines

DRIVER_OK status bit.

(quoted diff) +3 -0
+
+When VIRTIO_F_RING_DYNAMIC is negotiated, the driver is not
+required to

try to avoid "required" outside conformance sections though pls. And when used, we upper-case it.

Ok.
How about a rewrite as,

When VIRTIO_F_RING_DYNAMIC is negotiated, the driver may not enable every virtqueue, which the driver wants to use before setting the DRIVER_OK...

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
(quoted diff) +4 -0
+enable every virtqueue it wants to use before setting the DRIVER_OK
+status bit; the driver can choose to enable a virtqueue even after
+the driver has set the DRIVER_OK status bit. The virtqueue enable
+mechanism is

transport specific.
+

#26 lore raw

Re: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 100 lines · Parav Pandit
Quoted 92 lines

From: [email protected] <[email protected] open.org> On Behalf Of Michael S. Tsirkin
Sent: Wednesday, October 25, 2023 3:54 PM

Quoted 84 lines · Parav Pandit

Hi Cornelia,

Quoted 82 lines

From: Parav Pandit <[email protected]>
Sent: Monday, October 23, 2023 8:52 PM
To: Cornelia Huck <[email protected]>; Michael S. Tsirkin <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Shahaf Shuler <[email protected]>
Subject: RE: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 47 lines

From: [email protected] <[email protected] open.org> On Behalf Of Cornelia Huck
Sent: Monday, October 23, 2023 8:31 PM

Quoted 28 lines · Parav Pandit
Quoted 28 lines

From: Cornelia Huck <[email protected]>
Sent: Monday, October 23, 2023 7:58 PM

Quoted 22 lines · Parav Pandit
Quoted 8 lines

From: [email protected] <[email protected] open.org> On Behalf Of Cornelia Huck
Sent: Monday, October 23, 2023 7:27 PM

Well, there are still comments from me here that post-date v4 (please wait for a bit before posting another version!), so I'll continue waiting for them to be addressed first.

The last one was [1].
Which I replied few days ago at [2].

[1]
https://lists.oasis-open.org/archives/virtio-comment/202310/m
sg00
24
0.h
tml [2]
https://lists.oasis-open.org/archives/virtio-comment/202310/m
sg00
24
2.h
tml

Quoted 4 lines
Quoted 2 lines

I still have some open questions from <[email protected]> (first and last paragraph.)

Above link is not accessible to me. ☹

That's not a link, but a message id... many mail clients support searching by it, and you can also get it from lore:

https://lore.kernel.org/all/[email protected]/

Quoted 3 lines

I addressed your comments/questions in v4.
Can you please check v4 if they are addressed? I rewrote as you suggested in

Quoted 6 lines

v3.

This was for points you did not agree with. (Again, it might be helpful to wait with posting a new version until discussion has somewhat
concluded.)

Sure, will wait next time.

Your comment was,
=====
This is not really clear to me just from this text, especially if you just wrote above that enabling or re-enabling is something different... my understanding would be:

- if neither dynamic vqs nor queue reset are supported or negotiated, the only way to enable a vq is before DRIVER_OK, during setup
- both of these features rely on the transport supporting enabling individual queues (either a queue that has not been enabled before, or a queue that has been reset)
- the transport is supposed to use the same mechanism for either

Did I get it right? If so, I think we should make it a bit more clear.
=====

Above is clarified in below wording without complicating the queue_reset

here.

Quoted 1 line
Quoted 1 line
Quoted 8 lines
Quoted 5 lines

Review

Quoted 5 lines

Does that look ok to you?

(quoted diff) +3 -0
+When VIRTIO_F_RING_DYNAMIC is not negotiated, the driver enables
+the virtqueues during the device initialization sequence, i.e.
+after the device sets the FEATURES_OK status bit

all status bits are set by driver

Quoted 5 lines

Well device clears it if it does not like the features.

Yes. I will rewrite it as,

i.e. after the driver has verified that FEATURES_OK bit is set and before the driver sets DRIVER_OK bit.

shorter: i.e. after FEATURES_OK is set and before DRIVER_OK is set.

Quoted 13 lines
Quoted 5 lines
Quoted 1 line

and before the driver setting the

setting -> sets

Quoted 8 lines
Quoted 4 lines

Review

Quoted 4 lines

DRIVER_OK status bit.

(quoted diff) +3 -0
+
+When VIRTIO_F_RING_DYNAMIC is negotiated, the driver is not
+required to

try to avoid "required" outside conformance sections though pls. And when used, we upper-case it.

Quoted 4 lines

Ok.
How about a rewrite as,

When VIRTIO_F_RING_DYNAMIC is negotiated, the driver may not enable every virtqueue, which the driver wants to use before setting the DRIVER_OK...

This repetition does not buy us much - verbose and "when" is confusing too, you just mean "if". So simply:

If VIRTIO_F_RING_DYNAMIC is negotiated,
the driver can choose to enable some virtqueues
after DRIVER_OK is set.

Quoted 11 lines
Quoted 11 lines
Quoted 4 lines

Review

Quoted 4 lines
(quoted diff) +3 -0
+enable every virtqueue it wants to use before setting the DRIVER_OK
+status bit; the driver can choose to enable a virtqueue even after
+the driver has set the DRIVER_OK status bit.

The virtqueue enable

Quoted 2 lines
Quoted 2 lines

+mechanism is
transport specific.

I still feel there is no real explanation in a transport agnostic manner what does it mean to "enable" virtqueue. Do you maybe just mean "configure virtqueue"?

Can we just avoid talking about "enabling"?
Is it true that you can basically change anything you want about the vq not just the enable bit? If so talking about enabling is just confusing I think.

Signature · 18 lines
MST


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/
#27 lore raw

RE: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 7 lines

From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, October 26, 2023 11:10 AM

shorter: i.e. after FEATURES_OK is set and before DRIVER_OK is set.

Ok.

Quoted 2 lines

If VIRTIO_F_RING_DYNAMIC is negotiated,
the driver can choose to enable some virtqueues after DRIVER_OK is set.

Ok. will take this simpler version.

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 6 lines

Review

Quoted 6 lines
(quoted diff) +3 -0
+enable every virtqueue it wants to use before setting the
+DRIVER_OK status bit; the driver can choose to enable a
+virtqueue even after the driver has set the DRIVER_OK status bit.

The virtqueue enable

Quoted 9 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

+mechanism is
transport specific.

I still feel there is no real explanation in a transport agnostic manner what does it mean to "enable" virtqueue. Do you maybe just mean "configure virtqueue"?

There is explanation of "re-enabling" a virtqueue in section " Virtqueue Re-enable".

There is no good example of "configured" in generic section either, other than cleanup and mmio section.

Quoted 4 lines

Can we just avoid talking about "enabling"?
Is it true that you can basically change anything you want about the vq not just the enable bit? If so talking about enabling is just confusing I think.

Not really.
Enabling sequence of a virtqueue for pci and mmio transport is:

1. select a q
2. program the addresses
3. set the enable bit

However, as I think more, this one-way interface of driver instructing the device without any error code and without any response is just too limiting interface. I will be dropping this series that misuses the config registers beyond its intended init time use.

Let me work on more mature interface that solves following challenges.
1. ability to create a virtqueue dynamically after driver_ok
2. ability to create virtqueue with one or multiple physical addresses
3. ability for the device to return error if it cannot create dynamic vq creation

The question is, do we need this generic facility beyond virtio-net?

#28 lore raw

Re: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 52 lines · Parav Pandit
Quoted 7 lines

From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, October 26, 2023 11:10 AM

shorter: i.e. after FEATURES_OK is set and before DRIVER_OK is set.

Ok.

Quoted 2 lines

If VIRTIO_F_RING_DYNAMIC is negotiated,
the driver can choose to enable some virtqueues after DRIVER_OK is set.

Ok. will take this simpler version.

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 6 lines

Review

Quoted 6 lines
(quoted diff) +3 -0
+enable every virtqueue it wants to use before setting the
+DRIVER_OK status bit; the driver can choose to enable a
+virtqueue even after the driver has set the DRIVER_OK status bit.

The virtqueue enable

Quoted 9 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

+mechanism is
transport specific.

I still feel there is no real explanation in a transport agnostic manner what does it mean to "enable" virtqueue. Do you maybe just mean "configure virtqueue"?

There is explanation of "re-enabling" a virtqueue in section " Virtqueue Re-enable".

There is no good example of "configured" in generic section either, other than cleanup and mmio section.

Quoted 4 lines

Can we just avoid talking about "enabling"?
Is it true that you can basically change anything you want about the vq not just the enable bit? If so talking about enabling is just confusing I think.

Not really.
Enabling sequence of a virtqueue for pci and mmio transport is:

1. select a q
2. program the addresses
3. set the enable bit

However, as I think more, this one-way interface of driver instructing the device without any error code and without any response is just too limiting interface. I will be dropping this series that misuses the config registers beyond its intended init time use.

Quoted 6 lines

Let me work on more mature interface that solves following challenges.
1. ability to create a virtqueue dynamically after driver_ok
2. ability to create virtqueue with one or multiple physical addresses
3. ability for the device to return error if it cannot create dynamic vq creation

The question is, do we need this generic facility beyond virtio-net?

Wow, sounds rather complex.

Signature · 18 lines
MST


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/
#29 lore raw

RE: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 11 lines

From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, October 26, 2023 11:54 AM

Quoted 6 lines

Let me work on more mature interface that solves following challenges.
1. ability to create a virtqueue dynamically after driver_ok 2. ability to create virtqueue with one or multiple physical addresses 3. ability for the device to return error if it cannot create dynamic vq creation

Quoted 3 lines
Quoted 1 line

The question is, do we need this generic facility beyond virtio-net?

Wow, sounds rather complex.

Yes and no.

It is if there is any use case for generic devices.
For all the devices which already has cvq, it is fairly straightforward. All dynamic vqs can be created and destroyed using a simple cvq commands.

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/

#30 lore raw

Re: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

In reply to Parav Pandit
Quoted 50 lines · Parav Pandit
Quoted 8 lines

From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, October 26, 2023 11:10 AM

shorter: i.e. after FEATURES_OK is set and before DRIVER_OK is set.

Ok.

Quoted 2 lines

If VIRTIO_F_RING_DYNAMIC is negotiated,
the driver can choose to enable some virtqueues after DRIVER_OK is set.

Ok. will take this simpler version.

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 6 lines

Review

Quoted 6 lines
(quoted diff) +3 -0
+enable every virtqueue it wants to use before setting the
+DRIVER_OK status bit; the driver can choose to enable a
+virtqueue even after the driver has set the DRIVER_OK status bit.

The virtqueue enable

Quoted 9 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

+mechanism is
transport specific.

I still feel there is no real explanation in a transport agnostic manner what does it mean to "enable" virtqueue. Do you maybe just mean "configure virtqueue"?

There is explanation of "re-enabling" a virtqueue in section " Virtqueue Re-enable".

There is no good example of "configured" in generic section either, other than cleanup and mmio section.

Quoted 4 lines

Can we just avoid talking about "enabling"?
Is it true that you can basically change anything you want about the vq not just the enable bit? If so talking about enabling is just confusing I think.

Not really.
Enabling sequence of a virtqueue for pci and mmio transport is:

1. select a q
2. program the addresses
3. set the enable bit

Quoted 8 lines

However, as I think more, this one-way interface of driver instructing the device without any error code and without any response is just too limiting interface. I will be dropping this series that misuses the config registers beyond its intended init time use.

Let me work on more mature interface that solves following challenges.
1. ability to create a virtqueue dynamically after driver_ok
2. ability to create virtqueue with one or multiple physical addresses
3. ability for the device to return error if it cannot create dynamic vq creation

I think 1 is very complex for the simpler use case of delaying the enabling of the dataplane, especially because virtio-net already assigns "the last queue" for CVQ. It would require changes to it too.

2 can be solved if we allow resetting a queue before DRIVER_OK, as MST proposed previously IIRC. Would that work for the use case you have in mind?

3 can be solved by re-reading the queue_enable field? This is the way we're already using for checking DRIVER_OK in the PCI transport.

Quoted 1 line

The question is, do we need this generic facility beyond virtio-net?

I would try to avoid solutions specific for virtio-net, as other devices may need to reuse them and it would be bad to need to add quirks for that.

Thanks!

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/

#31 lore raw

RE: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 10 lines

From: Eugenio Perez Martin <[email protected]>
Sent: Thursday, October 26, 2023 1:58 PM

Quoted 6 lines

Let me work on more mature interface that solves following challenges.
1. ability to create a virtqueue dynamically after driver_ok 2. ability to create virtqueue with one or multiple physical addresses 3. ability for the device to return error if it cannot create dynamic vq creation

Quoted 3 lines

I think 1 is very complex for the simpler use case of delaying the enabling of the dataplane, especially because virtio-net already assigns "the last queue" for CVQ. It would require changes to it too.

Vq numbers do not change for virtio-net when enabled dynamically after driver_ok. This is because max_virtqueue_pair is RO parameter.

It is not complex because is it only about defining a command format for create and destroy a vq to run on the cvq. It is actually the opposite because there is good protocol and handshake.

Many devices has simple array of physical addresses for queue creation. So command is straightforward.

Quoted 2 lines

2 can be solved if we allow resetting a queue before DRIVER_OK,

This is just the hack of enabling and reset for no apparent gain.
Future devices may have many queues and enabling 1000 queues, resetting them is just an ugly interface.

Quoted 1 line

Would that work for the use case you have in mind?

It works but not spec worthy method to build which just delays the whole device init flow with no gain.

Quoted 3 lines

3 can be solved by re-reading the queue_enable field? This is the way we're already using for checking DRIVER_OK in the PCI transport.

Only polarity is not enough. An error code such as out of resource/busy/success is needed.

The whole point is to not abuse these basic init time registers at run time.

Quoted 5 lines
Quoted 2 lines

The question is, do we need this generic facility beyond virtio-net?

I would try to avoid solutions specific for virtio-net, as other devices may need to reuse them and it would be bad to need to add quirks for that.

No need to add the quirk.
But I would like to listen if there is any concrete requirement.
And if there is, possibly such device can add the cvq at that point for dynamic work. So, this will still provide the unified approach when/if needed on other devices.

#32 lore raw

Re: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 9 lines · Parav Pandit
Quoted 5 lines
Quoted 2 lines

The question is, do we need this generic facility beyond virtio-net?

I would try to avoid solutions specific for virtio-net, as other devices may need to reuse them and it would be bad to need to add quirks for that.

No need to add the quirk.
But I would like to listen if there is any concrete requirement.
And if there is, possibly such device can add the cvq at that point for dynamic work. So, this will still provide the unified approach when/if needed on other devices.

What do you want to know? Whether dynamically adding/deleting queues is useful generally? For example, queue per CPU is not uncommon to avoid need for locks. In the presence of CPU hotplug, the natural thing to do is to add/delete them.

Signature · 18 lines
MST


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/
#40 lore raw

Re: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

In reply to Parav Pandit
Quoted 3 lines · Parav Pandit
Quoted 1 line

2 can be solved if we allow resetting a queue before DRIVER_OK,

This is just the hack of enabling and reset for no apparent gain.
Future devices may have many queues and enabling 1000 queues, resetting them is just an ugly interface.

Yes I can't say I love it either. The main driver is to try and make it possible for device to know in advance the max # of queues that will be used. We could alternatively just add this in a config register maybe?

Signature · 18 lines
MST


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/
#41 lore raw

RE: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 5 lines

From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, October 26, 2023 2:48 PM

On Thu, Oct 26, 2023 at 08:38:51AM +0000, Parav Pandit wrote:

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

2 can be solved if we allow resetting a queue before DRIVER_OK,

This is just the hack of enabling and reset for no apparent gain. Future devices may have many queues and enabling 1000 queues, resetting

them is just an ugly interface.

Yes I can't say I love it either. The main driver is to try and make it possible for device to know in advance the max # of queues that will be used. We could alternatively just add this in a config register maybe?

I didn't follow your suggestion - what you want to add in the config register?

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/

#33 lore raw

RE: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

In reply to Michael S. Tsirkin
Quoted 11 lines

From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, October 26, 2023 2:46 PM

Quoted 1 line

So, this will still provide the unified approach when/if needed on other

devices.

What do you want to know? Whether dynamically adding/deleting queues is useful generally? For example, queue per CPU is not uncommon to avoid need for locks. In the presence of CPU hotplug, the natural thing to do is to add/delete them.

So for those devices who care for such performance, it is reasonable for them to have the cvq providing channel for complex and dynamic commands.

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/

#42 lore raw

Re: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

In reply to Parav Pandit
Quoted 8 lines · Parav Pandit
Quoted 8 lines

From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, October 26, 2023 2:48 PM

Quoted 3 lines · Parav Pandit
Quoted 1 line

2 can be solved if we allow resetting a queue before DRIVER_OK,

This is just the hack of enabling and reset for no apparent gain. Future devices may have many queues and enabling 1000 queues, resetting

Quoted 7 lines
Quoted 5 lines

them is just an ugly interface.

Yes I can't say I love it either. The main driver is to try and make it possible for device to know in advance the max # of queues that will be used. We could alternatively just add this in a config register maybe?

I didn't follow your suggestion - what you want to add in the config register?

The reason devices want vqs to be enabled before DRIVER_OK is so that they can preallocate device resources. Problems with this:
- no way to fail
- wasting driver resources too

Idea: a new writeable common config space register max_vqs + a way for device to fail. Maybe set it before FEATURES_OK?

Signature · 18 lines
MST


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/
#34 lore raw

Re: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

In reply to Parav Pandit
Quoted 4 lines · Parav Pandit
Quoted 3 lines

From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, October 26, 2023 2:46 PM

Quoted 8 lines
Quoted 7 lines
Quoted 1 line

So, this will still provide the unified approach when/if needed on other

devices.

What do you want to know? Whether dynamically adding/deleting queues is useful generally? For example, queue per CPU is not uncommon to avoid need for locks. In the presence of CPU hotplug, the natural thing to do is to add/delete them.

So for those devices who care for such performance, it is reasonable for them to have the cvq providing channel for complex and dynamic commands.

Again, let's please not waste time adding this piecemeal to each device type, this is clearly a generic thing that belongs in the core.

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/

#35 lore raw

RE: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 17 lines

From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, October 26, 2023 2:58 PM

Quoted 12 lines · Parav Pandit
Quoted 12 lines

From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, October 26, 2023 2:46 PM

Quoted 2 lines

So, this will still provide the unified approach when/if needed on other

devices.

What do you want to know? Whether dynamically adding/deleting queues is useful generally? For example, queue per CPU is not uncommon to avoid need for locks. In the presence of CPU hotplug, the natural thing to do is to add/delete them.

Quoted 5 lines
Quoted 1 line

So for those devices who care for such performance, it is reasonable for them

to have the cvq providing channel for complex and dynamic commands.

Again, let's please not waste time adding this piecemeal to each device type, this is clearly a generic thing that belongs in the core.

Maybe I didn't explain well.

I am proposing a generic way for all device types as following.
1. create cvq as main communication channel for resource create/destroy
2. create resource dynamically using this cvq

These are common commands defined across all device types in basic facilities section.
Those devices which has cvq, they define how to transport these generic defined commands. Those devices which do not have cvq, but when they need dynamic resources, they will define and create one cvq. As such devices will likely need more than just dynamic vq creation, for which it will need cvq anyway.

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/

#36 lore raw

RE: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 24 lines · Parav Pandit
Quoted 16 lines

From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, October 26, 2023 2:58 PM

Quoted 12 lines · Parav Pandit
Quoted 12 lines

From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, October 26, 2023 2:46 PM

Quoted 2 lines

So, this will still provide the unified approach when/if needed on other

devices.

What do you want to know? Whether dynamically adding/deleting queues is useful generally? For example, queue per CPU is not uncommon to avoid need for locks. In the presence of CPU hotplug, the natural thing to do is to add/delete them.

Quoted 5 lines
Quoted 1 line

So for those devices who care for such performance, it is reasonable for them

to have the cvq providing channel for complex and dynamic commands.

Again, let's please not waste time adding this piecemeal to each device type, this is clearly a generic thing that belongs in the core.

Maybe I didn't explain well.

Quoted 8 lines

I am proposing a generic way for all device types as following.
1. create cvq as main communication channel for resource create/destroy
2. create resource dynamically using this cvq

These are common commands defined across all device types in basic facilities section.
Those devices which has cvq, they define how to transport these generic defined commands. Those devices which do not have cvq, but when they need dynamic resources, they will define and create one cvq. As such devices will likely need more than just dynamic vq creation, for which it will need cvq anyway.

I think that is too complicated: not all devices will want to add a control vq for resource management, especially if other mechanisms are already in use. Just using a generic mechanism guarded by a feature bit seems much simpler.

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/

#37 lore raw

RE: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 7 lines

From: Cornelia Huck <[email protected]>
Sent: Friday, October 27, 2023 3:43 PM

Quoted 1 line

These are common commands defined across all device types in basic

facilities section.

Quoted 1 line

Those devices which has cvq, they define how to transport these generic

defined commands.

Quoted 8 lines
Quoted 1 line

Those devices which do not have cvq, but when they need dynamic resources,

they will define and create one cvq.

Quoted 1 line

As such devices will likely need more than just dynamic vq creation, for which

it will need cvq anyway.

I think that is too complicated: not all devices will want to add a control vq for resource management, especially if other mechanisms are already in use. Just using a generic mechanism guarded by a feature bit seems much simpler.

Not really, if a complex device has dynamic resource management, it is likely to have more functionality than just q creation. And for some reason, even if it does not, having efficient control channel for non_init is needed anyway.

It not about device wants to add/not_add a control vq. It is about how device a should offer dynamic resource management.
From device point of view, it is equally complex for the hw device to build dynamic config registers for N VQs which it never knows whether it will be used or not.

Out of 19 devices, 6 devices already has cvq.
Out of remaining 13 devices, 12 devices have fixed number of queues as they small enough in functionality that won't need a scale and dynamism either. So for dynamic resource management reusing the existing cvq is more efficient for the devices.

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/

#38 lore raw

RE: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 12 lines · Parav Pandit
Quoted 12 lines

From: Cornelia Huck <[email protected]>
Sent: Friday, October 27, 2023 3:43 PM

Quoted 1 line

These are common commands defined across all device types in basic

facilities section.

Quoted 1 line

Those devices which has cvq, they define how to transport these generic

defined commands.

Quoted 1 line

Those devices which do not have cvq, but when they need dynamic resources,

they will define and create one cvq.

Quoted 1 line

As such devices will likely need more than just dynamic vq creation, for which

it will need cvq anyway.

Quoted 8 lines
Quoted 3 lines

I think that is too complicated: not all devices will want to add a control vq for resource management, especially if other mechanisms are already in use. Just using a generic mechanism guarded by a feature bit seems much simpler.

Not really, if a complex device has dynamic resource management, it is likely to have more functionality than just q creation. And for some reason, even if it does not, having efficient control channel for non_init is needed anyway.

It not about device wants to add/not_add a control vq. It is about how device a should offer dynamic resource management.
From device point of view, it is equally complex for the hw device to build dynamic config registers for N VQs which it never knows whether it will be used or not.

"config registers" are transport specific. If they aren't an efficient method, then the transport needs to come up with something else -- but it's the task of the *transport* to provide something useful. The device should not need to do anything beyond specifying that it can support adding vqs dynamically, and exposing the upper boundary to the number of queues.

Quoted 4 lines

Out of 19 devices, 6 devices already has cvq.
Out of remaining 13 devices, 12 devices have fixed number of queues as they small enough in functionality that won't need a scale and dynamism either. So for dynamic resource management reusing the existing cvq is more efficient for the devices.

They have a device-specific cvq, which is used in a device-specific way for device-specific purposes. I don't see how turning them into frankencvqs is "efficient".

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/

#39 lore raw

RE: [virtio-comment] RE: [PATCH v3 2/2] content: Support enabling virtqueue after DRIVER_OK stage

Quoted 10 lines

From: Cornelia Huck <[email protected]>
Sent: Friday, October 27, 2023 5:16 PM

"config registers" are transport specific. If they aren't an efficient method, then the transport needs to come up with something else -- but it's the task of the *transport* to provide something useful. The device should not need to do anything beyond specifying that it can support adding vqs dynamically, and exposing the upper boundary to the number of queues.

You are welcome to propose to PCI-SIG such enhancements. :)
We cannot keep blind eye to transport and say, virtio will expand infinity registers without caring about underlying transport limitations and efficiencies.

There have been many discussions in past across many device + cpu vendors in various virtio and non virtio forums.
I would like to share that the industry does not prefer to put things as infinite set of registers unless its most fundamental thing needed to bootstrap the device.

Quoted 10 lines
Quoted 3 lines

Out of 19 devices, 6 devices already has cvq.
Out of remaining 13 devices, 12 devices have fixed number of queues as they

small enough in functionality that won't need a scale and dynamism either.

Quoted 1 line

So for dynamic resource management reusing the existing cvq is more

efficient for the devices.

They have a device-specific cvq, which is used in a device-specific way for device-specific purposes. I don't see how turning them into frankencvqs is "efficient".

Sure, they are device specific, but we can define generic set of commands in basic facilities, which each device type can send via their cvq. It is only matter of drafting it.

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/