Introduce device group and device management
v10 cover Introduce device group and device management
Thanks to everyone who commented! Here's v10 after a longish hiccup - I hope this is close to being ready. I'm especially interested to hear whether this is in a good enough shape to serve as basis for vq transport.
Thanks!
Change log:
since v9:
addressed review comments:
multiple typo fixes
made command list array 64 bit - easier future proofing clarifications around group type and admin command concepts lots of clarifications around structure
trucation for forwards and backwards compatibility - hopefully things are clear now
since v8:
addressed comments by Cornelia - as we agreed on list
since v7:
make high level error codes match linux, with virtio specific codes
in a separate field
renamed _ACCEPT to _USE since that's what it does clarified forward compatibility and non pci transports support multiple admin vqs
conformance statements
lots of changes all over the place to I changed author from Max to myself. Don't need to take credit but also don't want to blame Max for my mistakes.
since v6:
- removed some extentions intended for future use. We'll do them when we get there.
- brought back command list query from v5 in a simplified form - it's here to address the case where a single parent can address multiple groups, such as PF addressing transport vq and sriov vfs.
- attempt to make terminology more formal. In particular a term for whoever controls the group. I am still going back
and forth between "parent" and "owner" - owner might be better after all since it will work if we ever have a self group. For now it's parent.
TODO (maybe?) - probably ok to defer until this part is upstream:
Add "all members" member id.
Add commands for MSI, feature discovery.
Add commands for transport vq.
My intent is to try and support both SR-IOV and SIOV usecases with the same structure and maybe even the same VQ.
For example, it might make sense to split creating/destroying SIOV devices from the transport passing data from the guest - the driver would then not negotiate VIRTIO_F_SR_IOV (which then means auto-provisioning).
This is out of RFC, since we have two commands which are useful to discover supported group types (ATM can be none or SR-IOV).
Michael S. Tsirkin (10):
virtio: document forward compatibility guarantees
admin: introduce device group and related concepts
admin: introduce group administration commands
admin: introduce virtio admin virtqueues
pci: add admin vq registers to virtio over pci
mmio: document ADMIN_VQ as reserved
ccw: document ADMIN_VQ as reserved
admin: command list discovery
admin: conformance clauses
ccw: document more reserved features
admin.tex | 501 ++++++++++++++++++++++++++++++++++++++++++++++++++++ content.tex | 111 +++++++++++- 2 files changed, 610 insertions(+), 2 deletions(-) create mode 100644 admin.tex
Signature · 6 lines
MST --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
PATCH v10 1/10 virtio: document forward compatibility guarantees
Feature negotiation forms the basis of forward compatibility guarantees of virtio but has never been properly documented. Do it now.
--- content.tex | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+)
content.tex +42 -0
@@ -114,21 +114,63 @@ \section{Feature Bits}\label{sec:Basic Facilities of a Virtio Device / Feature B In particular, new fields in the device configuration space are indicated by offering a new feature bit. +To keep the feature negotiation mechanism extensible, it is important +that devices \em{do not} offer any feature bits that they would not be +able to handle if the driver accepted them (even though drivers are not +supposed to accept them in the first place even if offered, according to +this version of the specification.) Likewise, it is important that +drivers \em{do not} accept feature bits they do not know how to handle +(even though devices are not supposed to offer them in the first place, +according to this version of the specification.) The preferred way for +handling reserved and unexpected features is that the driver ignores +them. + +In particular, this is +especially important for features limited to specific transports, +as enabling these for more transports in future versions of the +specification is highly likely to require changing the behaviour +from drivers and devices. Drivers and devices supporting +multiple transports need to carefully maintain per-transport +lists of allowed features. + \drivernormative{\subsection}{Feature Bits}{Basic Facilities of a Virtio Device / Feature Bits} The driver MUST NOT accept a feature which the device did not offer, and MUST NOT accept a feature which requires another feature which was not accepted. +The driver MUST validate the feature bits offered by the device. +The driver MUST ignore and MUST NOT accept any feature bit that is +\begin{itemize} +\item not described in this specification, +\item marked as reserved, +\item not supported for the specific transport, +\item not defined for the device type. +\end{itemize} + The driver SHOULD go into backwards compatibility mode if the device does not offer a feature it understands, otherwise MUST set the FAILED \field{device status} bit and cease initialization. +By contrast, the driver MUST NOT fail solely because a feature +it does not understand has been offered by the device. + \devicenormative{\subsection}{Feature Bits}{Basic Facilities of a Virtio Device / Feature Bits} The device MUST NOT offer a feature which requires another feature which was not offered. The device SHOULD accept any valid subset of features the driver accepts, otherwise it MUST fail to set the FEATURES_OK \field{device status} bit when the driver writes it. +The device MUST NOT offer feature bits corresponding to features +it would not support if accepted by the driver (even if the +driver is prohibited from accepting the feature bits by the +specification); for the sake of clarity, this refers to feature +bits not described in this specification, reserved feature bits +and feature bits reserved or not supported for the specific +transport or the specific device type, but this does not preclude +devices written to a future version of this specification from +offering such feature bits should such a specification have a +provision for devices to support the corresponding features. + If a device has successfully negotiated a set of features at least once (by accepting the FEATURES_OK \field{device status} bit during device initialization), then it SHOULD
Signature · 1 line
MST
[virtio-comment] Re: [virtio-dev] [PATCH v10 01/10] virtio: document forward compatibility guarantees
Quoted 24 lines · Michael S. Tsirkin
Feature negotiation forms the basis of forward compatibility guarantees of virtio but has never been properly documented. Do it now.
Suggested-by Halil Pasic <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>--- content.tex | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+)content.tex +6
-0@@ -114,21 +114,63 @@ \section{Feature Bits}\label{sec:Basic Facilities of a Virtio Device / Feature B In particular, new fields in the device configuration space are indicated by offering a new feature bit. +To keep the feature negotiation mechanism extensible, it is important +that devices \em{do not} offer any feature bits that they would not be +able to handle if the driver accepted them (even though drivers are not +supposed to accept them in the first place even if offered, according to +this version of the specification.) Likewise, it is important that +drivers \em{do not} accept feature bits they do not know how to handle
content.tex \section{Feature Bits}\label{sec:Basic Facilities of a Virtio Device / Feature B · line 132
Quoted 10 lines
content.tex +10
-0+(even though devices are not supposed to offer them in the first place, +according to this version of the specification.) The preferred way for +handling reserved and unexpected features is that the driver ignores +them. + +In particular, this is +especially important for features limited to specific transports, +as enabling these for more transports in future versions of the +specification is highly likely to require changing the behaviour +from drivers and devices. Drivers and devices supporting
"changing the behaviour of" or "changed behaviour from" (prefer the former).
Quoted 4 lines
content.tex +3
-0+multiple transports need to carefully maintain per-transport +lists of allowed features. + \drivernormative{\subsection}{Feature Bits}{Basic Facilities of a Virtio Device / Feature Bits}
content.tex \section{Feature Bits}\label{sec:Basic Facilities of a Virtio Device / Feature B · line 146
Quoted 10 lines
content.tex +6
-0The driver MUST NOT accept a feature which the device did not offer, and MUST NOT accept a feature which requires another feature which was not accepted. +The driver MUST validate the feature bits offered by the device. +The driver MUST ignore and MUST NOT accept any feature bit that is +\begin{itemize} +\item not described in this specification, +\item marked as reserved, +\item not supported for the specific transport,
What does "supported" mean here? By the driver? By the specification in respect of this transport?
Quoted 30 lines
content.tex +17
-0+\item not defined for the device type. +\end{itemize} + The driver SHOULD go into backwards compatibility mode if the device does not offer a feature it understands, otherwise MUST set the FAILED \field{device status} bit and cease initialization. +By contrast, the driver MUST NOT fail solely because a feature +it does not understand has been offered by the device. + \devicenormative{\subsection}{Feature Bits}{Basic Facilities of a Virtio Device / Feature Bits} The device MUST NOT offer a feature which requires another feature which was not offered. The device SHOULD accept any valid subset of features the driver accepts, otherwise it MUST fail to set the FEATURES_OK \field{device status} bit when the driver writes it. +The device MUST NOT offer feature bits corresponding to features +it would not support if accepted by the driver (even if the +driver is prohibited from accepting the feature bits by the +specification); for the sake of clarity, this refers to feature +bits not described in this specification, reserved feature bits +and feature bits reserved or not supported for the specific +transport or the specific device type, but this does not preclude +devices written to a future version of this specification from +offering such feature bits should such a specification have a +provision for devices to support the corresponding features. + If a device has successfully negotiated a set of features at least once (by accepting the FEATURES_OK \field{device status} bit during device initialization), then it SHOULD
Signature · 17 lines
Maybe then I'll fade away and not have to face the facts. 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/
[virtio-dev] Re: [virtio-comment] Re: [virtio-dev] [PATCH v10 01/10] virtio: document forward compatibility guarantees
Quoted 9 lines · David Edmondson
content.tex \section{Feature Bits}\label{sec:Basic Facilities of a Virtio Device / Feature B · line 132
Quoted 5 lines · Michael S. Tsirkin
content.tex +5
-0+In particular, this is +especially important for features limited to specific transports, +as enabling these for more transports in future versions of the +specification is highly likely to require changing the behaviour +from drivers and devices. Drivers and devices supporting"changing the behaviour of" or "changed behaviour from" (prefer the former).
Agreed, I'd prefer the former as well.
Quoted 9 lines
Quoted 9 lines
content.tex +3
-0+multiple transports need to carefully maintain per-transport +lists of allowed features. + \drivernormative{\subsection}{Feature Bits}{Basic Facilities of a Virtio Device / Feature Bits} The driver MUST NOT accept a feature which the device did not offer, and MUST NOT accept a feature which requires another feature which was not accepted.
Quoted 9 lines
content.tex \section{Feature Bits}\label{sec:Basic Facilities of a Virtio Device / Feature B · line 146
Quoted 6 lines
content.tex +6
-0+The driver MUST validate the feature bits offered by the device. +The driver MUST ignore and MUST NOT accept any feature bit that is +\begin{itemize} +\item not described in this specification, +\item marked as reserved, +\item not supported for the specific transport,What does "supported" mean here? By the driver? By the specification in respect of this transport?
Maybe "not specified for the specific transport"?
Quoted 3 lines
Quoted 3 lines
+\item not defined for the device type.
+\end{itemize}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [virtio-comment] Re: [virtio-dev] [PATCH v10 01/10] virtio: document forward compatibility guarantees
Quoted 33 lines · Cornelia Huck
Quoted 9 lines · David Edmondson
content.tex \section{Feature Bits}\label{sec:Basic Facilities of a Virtio Device / Feature B · line 132
Quoted 5 lines · Michael S. Tsirkin
content.tex +5
-0+In particular, this is +especially important for features limited to specific transports, +as enabling these for more transports in future versions of the +specification is highly likely to require changing the behaviour +from drivers and devices. Drivers and devices supporting"changing the behaviour of" or "changed behaviour from" (prefer the former).
Agreed, I'd prefer the former as well.
Quoted 9 lines
Quoted 9 lines
content.tex +3
-0+multiple transports need to carefully maintain per-transport +lists of allowed features. + \drivernormative{\subsection}{Feature Bits}{Basic Facilities of a Virtio Device / Feature Bits} The driver MUST NOT accept a feature which the device did not offer, and MUST NOT accept a feature which requires another feature which was not accepted.Quoted 9 lines
content.tex \section{Feature Bits}\label{sec:Basic Facilities of a Virtio Device / Feature B · line 146
Quoted 6 lines
content.tex +6
-0+The driver MUST validate the feature bits offered by the device. +The driver MUST ignore and MUST NOT accept any feature bit that is +\begin{itemize} +\item not described in this specification, +\item marked as reserved, +\item not supported for the specific transport,What does "supported" mean here? By the driver? By the specification in respect of this transport?
Quoted 1 line
Maybe "not specified for the specific transport"?
given in mmio and ccw sections we say things like
+At this time, devices and drivers utilizing Virtio Over MMIO +do not support the following features:
I tend to agree.
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
+\item not defined for the device type.
+\end{itemize}
[virtio-dev] RE: [PATCH v10 01/10] virtio: document forward compatibility guarantees
In reply to Michael S. TsirkinQuoted 78 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, February 9, 2023 7:14 AMFeature negotiation forms the basis of forward compatibility guarantees of virtio but has never been properly documented.
Do it now.Suggested-by Halil Pasic <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>--- content.tex | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+)content.tex +0
-0@@ -114,21 +114,63 @@ \section{Feature Bits}\label{sec:Basic Facilities of aVirtio Device / Feature B In particular, new fields in the device configuration space are indicated by offering a new feature bit.
content.tex +19
-0+To keep the feature negotiation mechanism extensible, it is important +that devices \em{do not} offer any feature bits that they would not be +able to handle if the driver accepted them (even though drivers are not +supposed to accept them in the first place even if offered, according +to this version of the specification.) Likewise, it is important that +drivers \em{do not} accept feature bits they do not know how to handle +(even though devices are not supposed to offer them in the first place, +according to this version of the specification.) The preferred way for +handling reserved and unexpected features is that the driver ignores +them. + +In particular, this is +especially important for features limited to specific transports, as +enabling these for more transports in future versions of the +specification is highly likely to require changing the behaviour from +drivers and devices. Drivers and devices supporting multiple +transports need to carefully maintain per-transport lists of allowed +features. + \drivernormative{\subsection}{Feature Bits}{Basic Facilities of a Virtio Device /Feature Bits} The driver MUST NOT accept a feature which the device did not offer, and MUST NOT accept a feature which requires another feature which was not accepted.
content.tex +7
-0+The driver MUST validate the feature bits offered by the device. +The driver MUST ignore and MUST NOT accept any feature bit that is +\begin{itemize} \item not described in this specification, \item marked +as reserved, \item not supported for the specific transport, \item not +defined for the device type. +\end{itemize} + The driver SHOULD go into backwards compatibility mode if the device doesnot offer a feature it understands, otherwise MUST set the FAILED \field{device status} bit and cease initialization.
content.tex +3
-0+By contrast, the driver MUST NOT fail solely because a feature it does +not understand has been offered by the device. + \devicenormative{\subsection}{Feature Bits}{Basic Facilities of a Virtio Device /Feature Bits} The device MUST NOT offer a feature which requires another feature which was not offered. The device SHOULD accept any valid subset of features the driver accepts, otherwise it MUST fail to set the
FEATURES_OK\field{device status} bit when the driver writes it.content.tex +11
-0+The device MUST NOT offer feature bits corresponding to features it +would not support if accepted by the driver (even if the driver is +prohibited from accepting the feature bits by the specification); for +the sake of clarity, this refers to feature bits not described in this +specification, reserved feature bits and feature bits reserved or not +supported for the specific transport or the specific device type, but +this does not preclude devices written to a future version of this +specification from offering such feature bits should such a +specification have a provision for devices to support the corresponding +features. + If a device has successfully negotiated a set of features at least once (by
Quoted 4 lines
accepting the
FEATURES_OK\field{device status} bit during device initialization), then it SHOULD
--
MST
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
PATCH v10 2/10 admin: introduce device group and related concepts
In reply to Michael S. TsirkinEach device group has a type. For now, define one initial group:
SR-IOV type - PCI SR-IOV virtual functions (VFs) of a given PCI SR-IOV physical function (PF). This group may contain one or more virtio devices.
Each device within a group has a unique identifier. This identifier is the group member identifier.
Note: one can argue both ways whether the new device group handling functionality (this and following patches) is closer
to a new device type or a new transport type.
However, I expect that we will add more features in the near future. To facilitate this as much as possible of the text is located in the new admin chapter.
I did my best to minimize transport-specific text.
--- admin.tex | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ content.tex | 2 ++ 2 files changed, 51 insertions(+) create mode 100644 admin.tex
admin.tex new file +49 -0
@@ -0,0 +1,49 @@ +\section{Device groups}\label{sec:Basic Facilities of a Virtio Device / Device groups} + +It is occasionally useful to have a device control a group of +other devices. Terminology used in such cases: + +\begin{description} +\item[Device group] + or just group, includes zero or more devices. +\item[Owner device] + or owner, the device controlling the group. +\item[Member device] + a device within a group. The owner device itself is not + a member of the group. +\item[Member identifier] + each member has this identifier, unique within the group + and used to address it through the owner device. +\item[Group type identifier] + specifies what kind of member devices there are in a + group, how is the member identifier is interpreted + and what kind of control the owner has. + A given owner can control a single group of a given type, + thus the type and the owner together identify the group. + \footnote{Even though some group types only support + specific transports, group type identifiers + are global rather than transport-specific - + we don't expect a flood of new group types.} +\end{description} + +The following group types, and their identifiers, are currently specified): +\begin{description} +\item[SR-IOV group type (0x1)] +This device group has a PCI Single Root I/O Virtualization +(SR-IOV) physical function (PF) device as the owner and includes +all its SR-IOV virtual functions (VFs) as members (see +\hyperref[intro:PCIe]{[PCIe]}). + +The PF device itself is not a member of the group. + +The group type identifier for this group is 0x1. + +A member identifier for this group can have a value 0x1 to 0xFFFF +and equals the SR-IOV VF number of the member device (see +\hyperref[intro:PCIe]{[PCIe]}). + +Both owner and member devices for this group type use the Virtio +PCI transport (see \ref{sec:Virtio Transport Options / Virtio Over PCI Bus}). +\end{description} + +
content.tex +2 -0
@@ -491,6 +491,8 @@ \section{Exporting Objects}\label{sec:Basic Facilities of a Virtio Device / Expo types. It is RECOMMENDED that devices generate version 4 UUIDs as specified by \hyperref[intro:rfc4122]{[RFC4122]}. +\input{admin.tex} + \chapter{General Initialization And Device Operation}\label{sec:General Initialization And Device Operation} We start with an overview of device initialization, then expand on the
Signature · 1 line
MST
Re: [virtio-comment] [PATCH v10 02/10] admin: introduce device group and related concepts
Quoted 5 lines · Michael S. Tsirkin
Each device group has a type. For now, define one initial group:
SR-IOV type - PCI SR-IOV virtual functions (VFs) of a given PCI SR-IOV physical function (PF). This group may contain one or more virtio devices.
The specification says zero or more generally and nothing to refine that for SR-IOV groups.
Quoted 90 lines
Each device within a group has a unique identifier. This identifier is the group member identifier.
Note: one can argue both ways whether the new device group handling functionality (this and following patches) is closer
to a new device type or a new transport type.However, I expect that we will add more features in the near future. To facilitate this as much as possible of the text is located in the new admin chapter.
I did my best to minimize transport-specific text.
Signed-off-by Max Gurtovoy <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>--- admin.tex | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ content.tex | 2 ++ 2 files changed, 51 insertions(+) create mode 100644 admin.texadmin.tex new file +49
-0@@ -0,0 +1,49 @@ +\section{Device groups}\label{sec:Basic Facilities of a Virtio Device / Device groups} + +It is occasionally useful to have a device control a group of +other devices. Terminology used in such cases: + +\begin{description} +\item[Device group] + or just group, includes zero or more devices. +\item[Owner device] + or owner, the device controlling the group. +\item[Member device] + a device within a group. The owner device itself is not + a member of the group. +\item[Member identifier] + each member has this identifier, unique within the group + and used to address it through the owner device. +\item[Group type identifier] + specifies what kind of member devices there are in a + group, how is the member identifier is interpreted + and what kind of control the owner has. + A given owner can control a single group of a given type, + thus the type and the owner together identify the group. + \footnote{Even though some group types only support + specific transports, group type identifiers + are global rather than transport-specific - + we don't expect a flood of new group types.} +\end{description} + +The following group types, and their identifiers, are currently specified): +\begin{description} +\item[SR-IOV group type (0x1)] +This device group has a PCI Single Root I/O Virtualization +(SR-IOV) physical function (PF) device as the owner and includes +all its SR-IOV virtual functions (VFs) as members (see +\hyperref[intro:PCIe]{[PCIe]}). + +The PF device itself is not a member of the group. + +The group type identifier for this group is 0x1. + +A member identifier for this group can have a value 0x1 to 0xFFFF +and equals the SR-IOV VF number of the member device (see +\hyperref[intro:PCIe]{[PCIe]}). + +Both owner and member devices for this group type use the Virtio +PCI transport (see \ref{sec:Virtio Transport Options / Virtio Over PCI Bus}). +\end{description} + +content.tex +2
-0@@ -491,6 +491,8 @@ \section{Exporting Objects}\label{sec:Basic Facilities of a Virtio Device / Expo types. It is RECOMMENDED that devices generate version 4 UUIDs as specified by \hyperref[intro:rfc4122]{[RFC4122]}. +\input{admin.tex} + \chapter{General Initialization And Device Operation}\label{sec:General Initialization And Device Operation} We start with an overview of device initialization, then expand on the
Signature · 1 line
Tell her I'll be waiting, in the usual place.
Re: [virtio-comment] [PATCH v10 02/10] admin: introduce device group and related concepts
Quoted 10 lines · David Edmondson
Quoted 5 lines · Michael S. Tsirkin
Each device group has a type. For now, define one initial group:
SR-IOV type - PCI SR-IOV virtual functions (VFs) of a given PCI SR-IOV physical function (PF). This group may contain one or more virtio devices.
The specification says zero or more generally and nothing to refine that for SR-IOV groups.
Well it says:
(SR-IOV) physical function (PF) device as the owner and includes all its SR-IOV virtual functions (VFs) as members (see \hyperref[intro:PCIe]{[PCIe]}).
how can that be zero?
Quoted 92 lines
Quoted 90 lines
Each device within a group has a unique identifier. This identifier is the group member identifier.
Note: one can argue both ways whether the new device group handling functionality (this and following patches) is closer
to a new device type or a new transport type.However, I expect that we will add more features in the near future. To facilitate this as much as possible of the text is located in the new admin chapter.
I did my best to minimize transport-specific text.
Signed-off-by Max Gurtovoy <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>--- admin.tex | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ content.tex | 2 ++ 2 files changed, 51 insertions(+) create mode 100644 admin.texadmin.tex new file +49
-0@@ -0,0 +1,49 @@ +\section{Device groups}\label{sec:Basic Facilities of a Virtio Device / Device groups} + +It is occasionally useful to have a device control a group of +other devices. Terminology used in such cases: + +\begin{description} +\item[Device group] + or just group, includes zero or more devices. +\item[Owner device] + or owner, the device controlling the group. +\item[Member device] + a device within a group. The owner device itself is not + a member of the group. +\item[Member identifier] + each member has this identifier, unique within the group + and used to address it through the owner device. +\item[Group type identifier] + specifies what kind of member devices there are in a + group, how is the member identifier is interpreted + and what kind of control the owner has. + A given owner can control a single group of a given type, + thus the type and the owner together identify the group. + \footnote{Even though some group types only support + specific transports, group type identifiers + are global rather than transport-specific - + we don't expect a flood of new group types.} +\end{description} + +The following group types, and their identifiers, are currently specified): +\begin{description} +\item[SR-IOV group type (0x1)] +This device group has a PCI Single Root I/O Virtualization +(SR-IOV) physical function (PF) device as the owner and includes +all its SR-IOV virtual functions (VFs) as members (see +\hyperref[intro:PCIe]{[PCIe]}). + +The PF device itself is not a member of the group. + +The group type identifier for this group is 0x1. + +A member identifier for this group can have a value 0x1 to 0xFFFF +and equals the SR-IOV VF number of the member device (see +\hyperref[intro:PCIe]{[PCIe]}). + +Both owner and member devices for this group type use the Virtio +PCI transport (see \ref{sec:Virtio Transport Options / Virtio Over PCI Bus}). +\end{description} + +content.tex +2
-0@@ -491,6 +491,8 @@ \section{Exporting Objects}\label{sec:Basic Facilities of a Virtio Device / Expo types. It is RECOMMENDED that devices generate version 4 UUIDs as specified by \hyperref[intro:rfc4122]{[RFC4122]}. +\input{admin.tex} + \chapter{General Initialization And Device Operation}\label{sec:General Initialization And Device Operation} We start with an overview of device initialization, then expand on theSignature · 1 line
Tell her I'll be waiting, in the usual place.
Re: [virtio-comment] [PATCH v10 02/10] admin: introduce device group and related concepts
Quoted 12 lines · Michael S. Tsirkin
Quoted 10 lines · David Edmondson
Quoted 5 lines · Michael S. Tsirkin
Each device group has a type. For now, define one initial group:
SR-IOV type - PCI SR-IOV virtual functions (VFs) of a given PCI SR-IOV physical function (PF). This group may contain one or more virtio devices.
The specification says zero or more generally and nothing to refine that for SR-IOV groups.
Quoted 7 lines
Well it says:
(SR-IOV) physical function (PF) device as the owner and includes all its SR-IOV virtual functions (VFs) as members (see \hyperref[intro:PCIe]{[PCIe]}).
how can that be zero?
If I remove all of the VFs of a PF, does the group implicitly disappear? How about the converse?
Quoted 93 lines
Quoted 93 lines
Quoted 91 lines
Each device within a group has a unique identifier. This identifier is the group member identifier.
Note: one can argue both ways whether the new device group handling functionality (this and following patches) is closer
to a new device type or a new transport type.However, I expect that we will add more features in the near future. To facilitate this as much as possible of the text is located in the new admin chapter.
I did my best to minimize transport-specific text.
Signed-off-by Max Gurtovoy <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>--- admin.tex | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ content.tex | 2 ++ 2 files changed, 51 insertions(+) create mode 100644 admin.texadmin.tex new file +49
-0@@ -0,0 +1,49 @@ +\section{Device groups}\label{sec:Basic Facilities of a Virtio Device / Device groups} + +It is occasionally useful to have a device control a group of +other devices. Terminology used in such cases: + +\begin{description} +\item[Device group] + or just group, includes zero or more devices. +\item[Owner device] + or owner, the device controlling the group. +\item[Member device] + a device within a group. The owner device itself is not + a member of the group. +\item[Member identifier] + each member has this identifier, unique within the group + and used to address it through the owner device. +\item[Group type identifier] + specifies what kind of member devices there are in a + group, how is the member identifier is interpreted + and what kind of control the owner has. + A given owner can control a single group of a given type, + thus the type and the owner together identify the group. + \footnote{Even though some group types only support + specific transports, group type identifiers + are global rather than transport-specific - + we don't expect a flood of new group types.} +\end{description} + +The following group types, and their identifiers, are currently specified): +\begin{description} +\item[SR-IOV group type (0x1)] +This device group has a PCI Single Root I/O Virtualization +(SR-IOV) physical function (PF) device as the owner and includes +all its SR-IOV virtual functions (VFs) as members (see +\hyperref[intro:PCIe]{[PCIe]}). + +The PF device itself is not a member of the group. + +The group type identifier for this group is 0x1. + +A member identifier for this group can have a value 0x1 to 0xFFFF +and equals the SR-IOV VF number of the member device (see +\hyperref[intro:PCIe]{[PCIe]}). + +Both owner and member devices for this group type use the Virtio +PCI transport (see \ref{sec:Virtio Transport Options / Virtio Over PCI Bus}). +\end{description} + +content.tex +2
-0@@ -491,6 +491,8 @@ \section{Exporting Objects}\label{sec:Basic Facilities of a Virtio Device / Expo types. It is RECOMMENDED that devices generate version 4 UUIDs as specified by \hyperref[intro:rfc4122]{[RFC4122]}. +\input{admin.tex} + \chapter{General Initialization And Device Operation}\label{sec:General Initialization And Device Operation} We start with an overview of device initialization, then expand on theSignature · 1 line
Tell her I'll be waiting, in the usual place.
Signature · 17 lines
Do not leave the building. 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/
Re: [virtio-comment] [PATCH v10 02/10] admin: introduce device group and related concepts
Quoted 10 lines · David Edmondson
Quoted 9 lines · Michael S. Tsirkin
Quoted 8 lines · David Edmondson
Quoted 5 lines · Michael S. Tsirkin
Each device group has a type. For now, define one initial group:
SR-IOV type - PCI SR-IOV virtual functions (VFs) of a given PCI SR-IOV physical function (PF). This group may contain one or more virtio devices.
The specification says zero or more generally and nothing to refine that for SR-IOV groups.
Quoted 8 lines
Quoted 7 lines
Well it says:
(SR-IOV) physical function (PF) device as the owner and includes all its SR-IOV virtual functions (VFs) as members (see \hyperref[intro:PCIe]{[PCIe]}).
how can that be zero?
If I remove all of the VFs of a PF, does the group implicitly disappear?
Enable/Disable SR-IOV are dynamic operations controlled by NumVFs register.
We can mention that a group include all virtual functions indicated by *TotalVFs*RO register.
This group exist as long as the owner PF supports SR-IOV and has admin capabilities.
****
Quoted 93 lines
How about the converse?
Quoted 91 lines
Quoted 91 lines
Quoted 89 lines
Each device within a group has a unique identifier. This identifier is the group member identifier.
Note: one can argue both ways whether the new device group handling functionality (this and following patches) is closer
to a new device type or a new transport type.However, I expect that we will add more features in the near future. To facilitate this as much as possible of the text is located in the new admin chapter.
I did my best to minimize transport-specific text.
Signed-off-by Max Gurtovoy<[email protected]>Signed-off-by Michael S. Tsirkin<[email protected]>--- admin.tex | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ content.tex | 2 ++ 2 files changed, 51 insertions(+)create mode 100644 admin.tex
admin.tex new file +49
-0@@ -0,0 +1,49 @@ +\section{Device groups}\label{sec:Basic Facilities of a Virtio Device / Device groups} + +It is occasionally useful to have a device control a group of +other devices. Terminology used in such cases: + +\begin{description} +\item[Device group] + or just group, includes zero or more devices. +\item[Owner device] + or owner, the device controlling the group. +\item[Member device] + a device within a group. The owner device itself is not + a member of the group. +\item[Member identifier] + each member has this identifier, unique within the group + and used to address it through the owner device. +\item[Group type identifier] + specifies what kind of member devices there are in a + group, how is the member identifier is interpreted + and what kind of control the owner has. + A given owner can control a single group of a given type, + thus the type and the owner together identify the group. + \footnote{Even though some group types only support + specific transports, group type identifiers + are global rather than transport-specific - + we don't expect a flood of new group types.} +\end{description} + +The following group types, and their identifiers, are currently specified): +\begin{description} +\item[SR-IOV group type (0x1)] +This device group has a PCI Single Root I/O Virtualization +(SR-IOV) physical function (PF) device as the owner and includes +all its SR-IOV virtual functions (VFs) as members (see +\hyperref[intro:PCIe]{[PCIe]}). + +The PF device itself is not a member of the group. + +The group type identifier for this group is 0x1. + +A member identifier for this group can have a value 0x1 to 0xFFFF +and equals the SR-IOV VF number of the member device (see +\hyperref[intro:PCIe]{[PCIe]}). + +Both owner and member devices for this group type use the Virtio +PCI transport (see \ref{sec:Virtio Transport Options / Virtio Over PCI Bus}). +\end{description} + +content.tex +2
-0@@ -491,6 +491,8 @@ \section{Exporting Objects}\label{sec:Basic Facilities of a Virtio Device / Expo types. It is RECOMMENDED that devices generate version 4 UUIDs as specified by \hyperref[intro:rfc4122]{[RFC4122]}. +\input{admin.tex} + \chapter{General Initialization And Device Operation}\label{sec:General Initialization And Device Operation} We start with an overview of device initialization, then expand on theSignature · 1 line
Tell her I'll be waiting, in the usual place.
Re: [virtio-comment] [PATCH v10 02/10] admin: introduce device group and related concepts
Quoted 24 lines · Max Gurtovoy
On 09/02/2023 17:22, David Edmondson wrote:
On Thursday, 2023-02-09 at 10:13:46 -05, Michael S. Tsirkin wrote:
On Thu, Feb 09, 2023 at 03:00:58PM +0000, David Edmondson wrote:
On Thursday, 2023-02-09 at 07:13:36 -05, Michael S. Tsirkin wrote:
Each device group has a type. For now, define one initial group:
SR-IOV type - PCI SR-IOV virtual functions (VFs) of a given PCI SR-IOV physical function (PF). This group may contain one or more virtio devices.
The specification says zero or more generally and nothing to refine that for SR-IOV groups.
Well it says:
(SR-IOV) physical function (PF) device as the owner and includes all its SR-IOV virtual functions (VFs) as members (see \hyperref[intro:PCIe]{[PCIe]}).
Quoted 5 lines
how can that be zero?
If I remove all of the VFs of a PF, does the group implicitly disappear?
Enable/Disable SR-IOV are dynamic operations controlled by NumVFs register.
Are you sure? Not by VF Enable?
Quoted 2 lines
We can mention that a group include all virtual functions indicated by TotalVFs RO register.
TotalVFs indicates the maximum number of VFs that could be associated with the PF but not all of these exist. If we use this we get into issues of discovering whether VFs can actually be used. I'd rather avoid that.
Quoted 2 lines
This group exist as long as the owner PF supports SR-IOV and has admin capabilities.
SRIOV spec says:
NumVFs controls the number of VFs that are visible.
And one can not play with NumVFs dynamically:
NumVFs may only be written while VF Enable is Clear. If NumVFs is written when VF Enable is Set, the results are undefined.
one has to kill all VFs then enable them all again. As long as we are doing that, we can just unload the driver.
So I would say we should just ask that VF Enable is set before poking at admin vq, and prohibit clearing VF Enable.
There's also the concern of VF migration under MRIOV where VFs might not exit. I'm guessing
trying to include that right now is overthinking. So maybe this should mention that VF Migration Capable should be clear.
I will add all this to the spec.
Quoted 96 lines
How about the converse?
Each device within a group has a unique identifier. This identifier is the group member identifier.
Note: one can argue both ways whether the new device group handling functionality (this and following patches) is closer to a new device type or a new transport type.
However, I expect that we will add more features in the near future. To facilitate this as much as possible of the text is located in the new admin chapter.
I did my best to minimize transport-specific text.
Signed-off-by Max Gurtovoy <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>---
admin.tex | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
content.tex | 2 ++
2 files changed, 51 insertions(+) create mode 100644 admin.texdiff --git a/admin.tex b/admin.tex
new file mode 100644
index 0000000..2bc7322
---/dev/null
+++ b/admin.tex
@@ -0,0 +1,49 @@
+\section{Device groups}\label{sec:Basic Facilities of a Virtio Device / Device groups} +
+It is occasionally useful to have a device control a group of
+other devices. Terminology used in such cases:
+
+\begin{description}
+\item[Device group]
+ or just group, includes zero or more devices.
+\item[Owner device]
+ or owner, the device controlling the group.
+\item[Member device]
+ a device within a group. The owner device itself is not
+ a member of the group.
+\item[Member identifier]
+ each member has this identifier, unique within the group
+ and used to address it through the owner device.
+\item[Group type identifier]
+ specifies what kind of member devices there are in a
+ group, how is the member identifier is interpreted
+ and what kind of control the owner has.
+ A given owner can control a single group of a given type,
+ thus the type and the owner together identify the group.
+ \footnote{Even though some group types only support
+ specific transports, group type identifiers
+ are global rather than transport-specific -
+ we don't expect a flood of new group types.}
+\end{description}
+
+The following group types, and their identifiers, are currently specified):
+\begin{description}
+\item[SR-IOV group type (0x1)]
+This device group has a PCI Single Root I/O Virtualization
+(SR-IOV) physical function (PF) device as the owner and includes
+all its SR-IOV virtual functions (VFs) as members (see +\hyperref[intro:PCIe]{[PCIe]}).
+
+The PF device itself is not a member of the group.
+
+The group type identifier for this group is0x1.
+
+A member identifier for this group can have a value0x1to0xFFFF
+and equals the SR-IOV VF number of the member device (see +\hyperref[intro:PCIe]{[PCIe]}).
+
+Both owner and member devices for this group type use the Virtio
+PCI transport (see \ref{sec:Virtio Transport Options / Virtio Over PCI Bus}). +\end{description}
+
+
diff --git a/content.tex b/content.tex
index 0c2d917..ffe45c4 100644
--- a/content.tex
+++ b/content.tex
@@ -491,6 +491,8 @@ \section{Exporting Objects}\label{sec:Basic Facilities of a Virtio Device / Expo
types. It is RECOMMENDED that devices generate version 4
UUIDs as specified by \hyperref[intro:rfc4122]{[RFC4122]}.+\input{admin.tex}
+
\chapter{General Initialization And Device Operation}\label{sec:General Initialization And Device Operation}We start with an overview of device initialization, then expand on the
--
Tell her I'll be waiting, in the usual place.
Re: [virtio-comment] [PATCH v10 02/10] admin: introduce device group and related concepts
Quoted 25 lines · Michael S. Tsirkin
Quoted 24 lines · Max Gurtovoy
On 09/02/2023 17:22, David Edmondson wrote:
On Thursday, 2023-02-09 at 10:13:46 -05, Michael S. Tsirkin wrote:
On Thu, Feb 09, 2023 at 03:00:58PM +0000, David Edmondson wrote:
On Thursday, 2023-02-09 at 07:13:36 -05, Michael S. Tsirkin wrote:
Each device group has a type. For now, define one initial group:
SR-IOV type - PCI SR-IOV virtual functions (VFs) of a given PCI SR-IOV physical function (PF). This group may contain one or more virtio devices.
The specification says zero or more generally and nothing to refine that for SR-IOV groups.
Well it says:
(SR-IOV) physical function (PF) device as the owner and includes all its SR-IOV virtual functions (VFs) as members (see \hyperref[intro:PCIe]{[PCIe]}).
Quoted 7 lines
Quoted 5 lines
how can that be zero?
If I remove all of the VFs of a PF, does the group implicitly disappear?
Enable/Disable SR-IOV are dynamic operations controlled by NumVFs register.
Are you sure? Not by VF Enable?
Right. It's a combination of the VF_Enable and numVfs.
...
"The NumVFs field defines the number of VFs that are enabled when VF Enable is Set in the associated PF."
Quoted 15 lines
Quoted 3 lines
We can mention that a group include all virtual functions indicated by TotalVFs RO register.
TotalVFs indicates the maximum number of VFs that could be associated with the PF but not all of these exist. If we use this we get into issues of discovering whether VFs can actually be used. I'd rather avoid that.
Quoted 2 lines
This group exist as long as the owner PF supports SR-IOV and has admin capabilities.
SRIOV spec says:
NumVFs controls the number of VFs that are visible.
Quoted 7 lines
And one can not play with NumVFs dynamically:
NumVFs may only be written while VF Enable is Clear. If NumVFs is written when VF Enable is Set, the results are undefined.
one has to kill all VFs then enable them all again. As long as we are doing that, we can just unload the driver.
what driver to unload ? Not sure I'm following..
Quoted 4 lines
So I would say we should just ask that VF Enable is set before poking at admin vq, and prohibit clearing VF Enable.
Sending admin commands shouldn't be restricted and should be allowed always. Device should react to incoming command.
We can say that an SR-IOV group is empty while the VF enable is unset and is not empty when it's set. The size of the non empty SR-IOV group is equal to the numVFs and the VF index is equal to the member identifier in this group. I had this definition in my patches.
Sending admin command to a non existing member will result in an ERROR VIRTIO_ADMIN_STATUS_Q_INVALID_MEM.
Quoted 107 lines
There's also the concern of VF migration under MRIOV where VFs might not exit. I'm guessing
trying to include that right now is overthinking. So maybe this should mention that VF Migration Capable should be clear.I will add all this to the spec.
Quoted 96 lines
How about the converse?
Each device within a group has a unique identifier. This identifier is the group member identifier.
Note: one can argue both ways whether the new device group handling functionality (this and following patches) is closer to a new device type or a new transport type.
However, I expect that we will add more features in the near future. To facilitate this as much as possible of the text is located in the new admin chapter.
I did my best to minimize transport-specific text.
Signed-off-by Max Gurtovoy <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>---
admin.tex | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
content.tex | 2 ++
2 files changed, 51 insertions(+) create mode 100644 admin.texdiff --git a/admin.tex b/admin.tex
new file mode 100644
index 0000000..2bc7322
---/dev/null
+++ b/admin.tex
@@ -0,0 +1,49 @@
+\section{Device groups}\label{sec:Basic Facilities of a Virtio Device / Device groups} +
+It is occasionally useful to have a device control a group of
+other devices. Terminology used in such cases:
+
+\begin{description}
+\item[Device group]
+ or just group, includes zero or more devices.
+\item[Owner device]
+ or owner, the device controlling the group.
+\item[Member device]
+ a device within a group. The owner device itself is not
+ a member of the group.
+\item[Member identifier]
+ each member has this identifier, unique within the group
+ and used to address it through the owner device.
+\item[Group type identifier]
+ specifies what kind of member devices there are in a
+ group, how is the member identifier is interpreted
+ and what kind of control the owner has.
+ A given owner can control a single group of a given type,
+ thus the type and the owner together identify the group.
+ \footnote{Even though some group types only support
+ specific transports, group type identifiers
+ are global rather than transport-specific -
+ we don't expect a flood of new group types.}
+\end{description}
+
+The following group types, and their identifiers, are currently specified):
+\begin{description}
+\item[SR-IOV group type (0x1)]
+This device group has a PCI Single Root I/O Virtualization
+(SR-IOV) physical function (PF) device as the owner and includes
+all its SR-IOV virtual functions (VFs) as members (see +\hyperref[intro:PCIe]{[PCIe]}).
+
+The PF device itself is not a member of the group.
+
+The group type identifier for this group is0x1.
+
+A member identifier for this group can have a value0x1to0xFFFF
+and equals the SR-IOV VF number of the member device (see +\hyperref[intro:PCIe]{[PCIe]}).
+
+Both owner and member devices for this group type use the Virtio
+PCI transport (see \ref{sec:Virtio Transport Options / Virtio Over PCI Bus}). +\end{description}
+
+
diff --git a/content.tex b/content.tex
index 0c2d917..ffe45c4 100644
--- a/content.tex
+++ b/content.tex
@@ -491,6 +491,8 @@ \section{Exporting Objects}\label{sec:Basic Facilities of a Virtio Device / Expo
types. It is RECOMMENDED that devices generate version 4
UUIDs as specified by \hyperref[intro:rfc4122]{[RFC4122]}.+\input{admin.tex}
+
\chapter{General Initialization And Device Operation}\label{sec:General Initialization And Device Operation}We start with an overview of device initialization, then expand on the
--
Tell her I'll be waiting, in the usual place.
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/
Re: [virtio-comment] [PATCH v10 02/10] admin: introduce device group and related concepts
Quoted 57 lines · Max Gurtovoy
Quoted 25 lines · Michael S. Tsirkin
Quoted 24 lines · Max Gurtovoy
On 09/02/2023 17:22, David Edmondson wrote:
On Thursday, 2023-02-09 at 10:13:46 -05, Michael S. Tsirkin wrote:
On Thu, Feb 09, 2023 at 03:00:58PM +0000, David Edmondson wrote:
On Thursday, 2023-02-09 at 07:13:36 -05, Michael S. Tsirkin wrote:
Each device group has a type. For now, define one initial group:
SR-IOV type - PCI SR-IOV virtual functions (VFs) of a given PCI SR-IOV physical function (PF). This group may contain one or more virtio devices.
The specification says zero or more generally and nothing to refine that for SR-IOV groups.
Well it says:
(SR-IOV) physical function (PF) device as the owner and includes all its SR-IOV virtual functions (VFs) as members (see \hyperref[intro:PCIe]{[PCIe]}).
Quoted 7 lines
Quoted 5 lines
how can that be zero?
If I remove all of the VFs of a PF, does the group implicitly disappear?
Enable/Disable SR-IOV are dynamic operations controlled by NumVFs register.
Are you sure? Not by VF Enable?
Right. It's a combination of the
VF_Enableand numVfs....
"The NumVFs field defines the number of VFs that are enabled when VF Enable is Set in the associated PF."Quoted 15 lines
Quoted 3 lines
We can mention that a group include all virtual functions indicated by TotalVFs RO register.
TotalVFs indicates the maximum number of VFs that could be associated with the PF but not all of these exist. If we use this we get into issues of discovering whether VFs can actually be used. I'd rather avoid that.
Quoted 2 lines
This group exist as long as the owner PF supports SR-IOV and has admin capabilities.
SRIOV spec says:
NumVFs controls the number of VFs that are visible.
Quoted 8 lines
Quoted 7 lines
And one can not play with NumVFs dynamically:
NumVFs may only be written while VF Enable is Clear. If NumVFs is written when VF Enable is Set, the results are undefined.
one has to kill all VFs then enable them all again. As long as we are doing that, we can just unload the driver.
what driver to unload ? Not sure I'm following..
Basically I am saying that if VFs are disabled this destroys all VFs so it is not
clear that it makes sense to keep some of the configuration for previous VFs around.
My idea is to say that reset is required to disable VFs.
Quoted 8 lines
Quoted 4 lines
So I would say we should just ask that VF Enable is set before poking at admin vq, and prohibit clearing VF Enable.
Sending admin commands shouldn't be restricted and should be allowed always. Device should react to incoming command.
Quoted 7 lines
We can say that an SR-IOV group is empty while the VF enable is unset and is not empty when it's set. The size of the non empty SR-IOV group is equal to the numVFs and the VF index is equal to the member identifier in this group. I had this definition in my patches.
Sending admin command to a non existing member will result in an ERROR
VIRTIO_ADMIN_STATUS_Q_INVALID_MEM.
just an example:
- assign resource X to VF 16
- set NumVFs to 8
Does VF 16 keep resource X? I note that
resource X can not be taken back because VF 16
is not accessible.
For sure, all this is solvable but I'd rather just forbid changes to VF enable for now.
Quoted 108 lines
Quoted 108 lines
There's also the concern of VF migration under MRIOV where VFs might not exit. I'm guessing
trying to include that right now is overthinking. So maybe this should mention that VF Migration Capable should be clear.I will add all this to the spec.
Quoted 96 lines
How about the converse?
Each device within a group has a unique identifier. This identifier is the group member identifier.
Note: one can argue both ways whether the new device group handling functionality (this and following patches) is closer to a new device type or a new transport type.
However, I expect that we will add more features in the near future. To facilitate this as much as possible of the text is located in the new admin chapter.
I did my best to minimize transport-specific text.
Signed-off-by Max Gurtovoy <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>---
admin.tex | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
content.tex | 2 ++
2 files changed, 51 insertions(+) create mode 100644 admin.texdiff --git a/admin.tex b/admin.tex
new file mode 100644
index 0000000..2bc7322
---/dev/null
+++ b/admin.tex
@@ -0,0 +1,49 @@
+\section{Device groups}\label{sec:Basic Facilities of a Virtio Device / Device groups} +
+It is occasionally useful to have a device control a group of
+other devices. Terminology used in such cases:
+
+\begin{description}
+\item[Device group]
+ or just group, includes zero or more devices.
+\item[Owner device]
+ or owner, the device controlling the group.
+\item[Member device]
+ a device within a group. The owner device itself is not
+ a member of the group.
+\item[Member identifier]
+ each member has this identifier, unique within the group
+ and used to address it through the owner device.
+\item[Group type identifier]
+ specifies what kind of member devices there are in a
+ group, how is the member identifier is interpreted
+ and what kind of control the owner has.
+ A given owner can control a single group of a given type,
+ thus the type and the owner together identify the group.
+ \footnote{Even though some group types only support
+ specific transports, group type identifiers
+ are global rather than transport-specific -
+ we don't expect a flood of new group types.}
+\end{description}
+
+The following group types, and their identifiers, are currently specified):
+\begin{description}
+\item[SR-IOV group type (0x1)]
+This device group has a PCI Single Root I/O Virtualization
+(SR-IOV) physical function (PF) device as the owner and includes
+all its SR-IOV virtual functions (VFs) as members (see +\hyperref[intro:PCIe]{[PCIe]}).
+
+The PF device itself is not a member of the group.
+
+The group type identifier for this group is0x1.
+
+A member identifier for this group can have a value0x1to0xFFFF
+and equals the SR-IOV VF number of the member device (see +\hyperref[intro:PCIe]{[PCIe]}).
+
+Both owner and member devices for this group type use the Virtio
+PCI transport (see \ref{sec:Virtio Transport Options / Virtio Over PCI Bus}). +\end{description}
+
+
diff --git a/content.tex b/content.tex
index 0c2d917..ffe45c4 100644
--- a/content.tex
+++ b/content.tex
@@ -491,6 +491,8 @@ \section{Exporting Objects}\label{sec:Basic Facilities of a Virtio Device / Expo
types. It is RECOMMENDED that devices generate version 4
UUIDs as specified by \hyperref[intro:rfc4122]{[RFC4122]}.+\input{admin.tex}
+
\chapter{General Initialization And Device Operation}\label{sec:General Initialization And Device Operation}We start with an overview of device initialization, then expand on the
--
Tell her I'll be waiting, in the usual place.
Re: [virtio-comment] [PATCH v10 02/10] admin: introduce device group and related concepts
Quoted 65 lines · Michael S. Tsirkin
Quoted 64 lines · Max Gurtovoy
Quoted 25 lines · Michael S. Tsirkin
Quoted 24 lines · Max Gurtovoy
On 09/02/2023 17:22, David Edmondson wrote:
On Thursday, 2023-02-09 at 10:13:46 -05, Michael S. Tsirkin wrote:
On Thu, Feb 09, 2023 at 03:00:58PM +0000, David Edmondson wrote:
On Thursday, 2023-02-09 at 07:13:36 -05, Michael S. Tsirkin wrote:
Each device group has a type. For now, define one initial group:
SR-IOV type - PCI SR-IOV virtual functions (VFs) of a given PCI SR-IOV physical function (PF). This group may contain one or more virtio devices.
The specification says zero or more generally and nothing to refine that for SR-IOV groups.
Well it says:
(SR-IOV) physical function (PF) device as the owner and includes all its SR-IOV virtual functions (VFs) as members (see \hyperref[intro:PCIe]{[PCIe]}).
Quoted 7 lines
Quoted 5 lines
how can that be zero?
If I remove all of the VFs of a PF, does the group implicitly disappear?
Enable/Disable SR-IOV are dynamic operations controlled by NumVFs register.
Are you sure? Not by VF Enable?
Right. It's a combination of the
VF_Enableand numVfs....
"The NumVFs field defines the number of VFs that are enabled when VF Enable is Set in the associated PF."Quoted 22 lines
Quoted 3 lines
We can mention that a group include all virtual functions indicated by TotalVFs RO register.
TotalVFs indicates the maximum number of VFs that could be associated with the PF but not all of these exist. If we use this we get into issues of discovering whether VFs can actually be used. I'd rather avoid that.
Quoted 2 lines
This group exist as long as the owner PF supports SR-IOV and has admin capabilities.
SRIOV spec says:
NumVFs controls the number of VFs that are visible.And one can not play with NumVFs dynamically:
NumVFs may only be written while VF Enable is Clear. If NumVFs is written when VF Enable is Set, the results are undefined.
one has to kill all VFs then enable them all again. As long as we are doing that, we can just unload the driver.
Quoted 8 lines
Quoted 1 line
what driver to unload ? Not sure I'm following..
Basically I am saying that if VFs are disabled this destroys all VFs so it is not
clear that it makes sense to keep some of the configuration for previous VFs around.My idea is to say that reset is required to disable VFs.
which reset ?
VFs disabled/enabled using VF_enable PCI register. Lets follow that please.
Lets define what is happening during VF_enable = 1 and VF_enable = 0.
On VF_enable = 0 --> 1 transition the corresponding device_group, that is owned by the PF, grows and contains NumVFs members with initial features and resources.
On VF_enable = 1 --> 0 transition the corresponding device_group, that is owned by the PF, shrinks and contains 0 members and all the dynamic resources are back to the owner.
Quoted 18 lines
Quoted 9 lines
Quoted 5 lines
So I would say we should just ask that VF Enable is set before poking at admin vq, and prohibit clearing VF Enable.
Sending admin commands shouldn't be restricted and should be allowed always. Device should react to incoming command.
Quoted 7 lines
We can say that an SR-IOV group is empty while the VF enable is unset and is not empty when it's set. The size of the non empty SR-IOV group is equal to the numVFs and the VF index is equal to the member identifier in this group. I had this definition in my patches.
Sending admin command to a non existing member will result in an ERROR
VIRTIO_ADMIN_STATUS_Q_INVALID_MEM.
Quoted 7 lines
just an example:
- assign resource X to VF 16
- set NumVFs to 8Does VF 16 keep resource X? I note that
resource X can not be taken back because VF 16
is not accessible.
all dynamic resources should return to the owner when VF_enable moves 1 --> 0
Quoted 4 lines
For sure, all this is solvable but I'd rather just forbid changes to VF enable for now.
how we can forbid it ? setting this register is not related to virtio.
Quoted 111 lines
Quoted 110 lines
Quoted 110 lines
There's also the concern of VF migration under MRIOV where VFs might not exit. I'm guessing
trying to include that right now is overthinking. So maybe this should mention that VF Migration Capable should be clear.I will add all this to the spec.
Quoted 96 lines
How about the converse?
Each device within a group has a unique identifier. This identifier is the group member identifier.
Note: one can argue both ways whether the new device group handling functionality (this and following patches) is closer to a new device type or a new transport type.
However, I expect that we will add more features in the near future. To facilitate this as much as possible of the text is located in the new admin chapter.
I did my best to minimize transport-specific text.
Signed-off-by Max Gurtovoy <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>---
admin.tex | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
content.tex | 2 ++
2 files changed, 51 insertions(+) create mode 100644 admin.texdiff --git a/admin.tex b/admin.tex
new file mode 100644
index 0000000..2bc7322
---/dev/null
+++ b/admin.tex
@@ -0,0 +1,49 @@
+\section{Device groups}\label{sec:Basic Facilities of a Virtio Device / Device groups} +
+It is occasionally useful to have a device control a group of
+other devices. Terminology used in such cases:
+
+\begin{description}
+\item[Device group]
+ or just group, includes zero or more devices.
+\item[Owner device]
+ or owner, the device controlling the group.
+\item[Member device]
+ a device within a group. The owner device itself is not
+ a member of the group.
+\item[Member identifier]
+ each member has this identifier, unique within the group
+ and used to address it through the owner device.
+\item[Group type identifier]
+ specifies what kind of member devices there are in a
+ group, how is the member identifier is interpreted
+ and what kind of control the owner has.
+ A given owner can control a single group of a given type,
+ thus the type and the owner together identify the group.
+ \footnote{Even though some group types only support
+ specific transports, group type identifiers
+ are global rather than transport-specific -
+ we don't expect a flood of new group types.}
+\end{description}
+
+The following group types, and their identifiers, are currently specified):
+\begin{description}
+\item[SR-IOV group type (0x1)]
+This device group has a PCI Single Root I/O Virtualization
+(SR-IOV) physical function (PF) device as the owner and includes
+all its SR-IOV virtual functions (VFs) as members (see +\hyperref[intro:PCIe]{[PCIe]}).
+
+The PF device itself is not a member of the group.
+
+The group type identifier for this group is0x1.
+
+A member identifier for this group can have a value0x1to0xFFFF
+and equals the SR-IOV VF number of the member device (see +\hyperref[intro:PCIe]{[PCIe]}).
+
+Both owner and member devices for this group type use the Virtio
+PCI transport (see \ref{sec:Virtio Transport Options / Virtio Over PCI Bus}). +\end{description}
+
+
diff --git a/content.tex b/content.tex
index 0c2d917..ffe45c4 100644
--- a/content.tex
+++ b/content.tex
@@ -491,6 +491,8 @@ \section{Exporting Objects}\label{sec:Basic Facilities of a Virtio Device / Expo
types. It is RECOMMENDED that devices generate version 4
UUIDs as specified by \hyperref[intro:rfc4122]{[RFC4122]}.+\input{admin.tex}
+
\chapter{General Initialization And Device Operation}\label{sec:General Initialization And Device Operation}We start with an overview of device initialization, then expand on the
--
Tell her I'll be waiting, in the usual place.
Re: [virtio-comment] [PATCH v10 02/10] admin: introduce device group and related concepts
Quoted 84 lines · Max Gurtovoy
Quoted 65 lines · Michael S. Tsirkin
Quoted 64 lines · Max Gurtovoy
Quoted 25 lines · Michael S. Tsirkin
Quoted 24 lines · Max Gurtovoy
On 09/02/2023 17:22, David Edmondson wrote:
On Thursday, 2023-02-09 at 10:13:46 -05, Michael S. Tsirkin wrote:
On Thu, Feb 09, 2023 at 03:00:58PM +0000, David Edmondson wrote:
On Thursday, 2023-02-09 at 07:13:36 -05, Michael S. Tsirkin wrote:
Each device group has a type. For now, define one initial group:
SR-IOV type - PCI SR-IOV virtual functions (VFs) of a given PCI SR-IOV physical function (PF). This group may contain one or more virtio devices.
The specification says zero or more generally and nothing to refine that for SR-IOV groups.
Well it says:
(SR-IOV) physical function (PF) device as the owner and includes all its SR-IOV virtual functions (VFs) as members (see \hyperref[intro:PCIe]{[PCIe]}).
Quoted 7 lines
Quoted 5 lines
how can that be zero?
If I remove all of the VFs of a PF, does the group implicitly disappear?
Enable/Disable SR-IOV are dynamic operations controlled by NumVFs register.
Are you sure? Not by VF Enable?
Right. It's a combination of the
VF_Enableand numVfs....
"The NumVFs field defines the number of VFs that are enabled when VF Enable is Set in the associated PF."Quoted 22 lines
Quoted 3 lines
We can mention that a group include all virtual functions indicated by TotalVFs RO register.
TotalVFs indicates the maximum number of VFs that could be associated with the PF but not all of these exist. If we use this we get into issues of discovering whether VFs can actually be used. I'd rather avoid that.
Quoted 2 lines
This group exist as long as the owner PF supports SR-IOV and has admin capabilities.
SRIOV spec says:
NumVFs controls the number of VFs that are visible.And one can not play with NumVFs dynamically:
NumVFs may only be written while VF Enable is Clear. If NumVFs is written when VF Enable is Set, the results are undefined.
one has to kill all VFs then enable them all again. As long as we are doing that, we can just unload the driver.
Quoted 8 lines
Quoted 1 line
what driver to unload ? Not sure I'm following..
Basically I am saying that if VFs are disabled this destroys all VFs so it is not
clear that it makes sense to keep some of the configuration for previous VFs around.My idea is to say that reset is required to disable VFs.
which reset ?
VFs disabled/enabled using
VF_enablePCI register. Lets follow that please.Lets define what is happening during
VF_enable= 1 andVF_enable= 0.
Quoted 7 lines
On
VF_enable= 0 --> 1 transition the correspondingdevice_group, that is owned by the PF, grows and contains NumVFs members with initial features and resources.On
VF_enable= 1 --> 0 transition the correspondingdevice_group, that is owned by the PF, shrinks and contains 0 members and all the dynamic resources are back to the owner.
Maybe, it's a possible approach. As current patch set has no resources I feel we can leave this part to a patch on top just so that this one can move forward while we have a more specific example to work from.
Quoted 22 lines
Quoted 22 lines
Quoted 9 lines
Quoted 5 lines
So I would say we should just ask that VF Enable is set before poking at admin vq, and prohibit clearing VF Enable.
Sending admin commands shouldn't be restricted and should be allowed always. Device should react to incoming command.
Quoted 7 lines
We can say that an SR-IOV group is empty while the VF enable is unset and is not empty when it's set. The size of the non empty SR-IOV group is equal to the numVFs and the VF index is equal to the member identifier in this group. I had this definition in my patches.
Sending admin command to a non existing member will result in an ERROR
VIRTIO_ADMIN_STATUS_Q_INVALID_MEM.just an example:
- assign resource X to VF 16
- set NumVFs to 8
Quoted 6 lines
Quoted 3 lines
Does VF 16 keep resource X? I note that
resource X can not be taken back because VF 16
is not accessible.all dynamic resources should return to the owner when
VF_enablemoves 1 --> 0
It's a possible approach but my question would be whether we need a transport independent way to do this through VQ. And if we do it's annoying to have multiple ways.
Quoted 6 lines
Quoted 4 lines
For sure, all this is solvable but I'd rather just forbid changes to VF enable for now.
how we can forbid it ? setting this register is not related to virtio.
We can ask driver to write 0 to device reset before changing VF enable to 0. The advantage is that this kind of reset by definition frees up all resources.
Quoted 111 lines
Quoted 111 lines
Quoted 110 lines
Quoted 110 lines
There's also the concern of VF migration under MRIOV where VFs might not exit. I'm guessing
trying to include that right now is overthinking. So maybe this should mention that VF Migration Capable should be clear.I will add all this to the spec.
Quoted 96 lines
How about the converse?
Each device within a group has a unique identifier. This identifier is the group member identifier.
Note: one can argue both ways whether the new device group handling functionality (this and following patches) is closer to a new device type or a new transport type.
However, I expect that we will add more features in the near future. To facilitate this as much as possible of the text is located in the new admin chapter.
I did my best to minimize transport-specific text.
Signed-off-by Max Gurtovoy <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>---
admin.tex | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
content.tex | 2 ++
2 files changed, 51 insertions(+) create mode 100644 admin.texdiff --git a/admin.tex b/admin.tex
new file mode 100644
index 0000000..2bc7322
---/dev/null
+++ b/admin.tex
@@ -0,0 +1,49 @@
+\section{Device groups}\label{sec:Basic Facilities of a Virtio Device / Device groups} +
+It is occasionally useful to have a device control a group of
+other devices. Terminology used in such cases:
+
+\begin{description}
+\item[Device group]
+ or just group, includes zero or more devices.
+\item[Owner device]
+ or owner, the device controlling the group.
+\item[Member device]
+ a device within a group. The owner device itself is not
+ a member of the group.
+\item[Member identifier]
+ each member has this identifier, unique within the group
+ and used to address it through the owner device.
+\item[Group type identifier]
+ specifies what kind of member devices there are in a
+ group, how is the member identifier is interpreted
+ and what kind of control the owner has.
+ A given owner can control a single group of a given type,
+ thus the type and the owner together identify the group.
+ \footnote{Even though some group types only support
+ specific transports, group type identifiers
+ are global rather than transport-specific -
+ we don't expect a flood of new group types.}
+\end{description}
+
+The following group types, and their identifiers, are currently specified):
+\begin{description}
+\item[SR-IOV group type (0x1)]
+This device group has a PCI Single Root I/O Virtualization
+(SR-IOV) physical function (PF) device as the owner and includes
+all its SR-IOV virtual functions (VFs) as members (see +\hyperref[intro:PCIe]{[PCIe]}).
+
+The PF device itself is not a member of the group.
+
+The group type identifier for this group is0x1.
+
+A member identifier for this group can have a value0x1to0xFFFF
+and equals the SR-IOV VF number of the member device (see +\hyperref[intro:PCIe]{[PCIe]}).
+
+Both owner and member devices for this group type use the Virtio
+PCI transport (see \ref{sec:Virtio Transport Options / Virtio Over PCI Bus}). +\end{description}
+
+
diff --git a/content.tex b/content.tex
index 0c2d917..ffe45c4 100644
--- a/content.tex
+++ b/content.tex
@@ -491,6 +491,8 @@ \section{Exporting Objects}\label{sec:Basic Facilities of a Virtio Device / Expo
types. It is RECOMMENDED that devices generate version 4
UUIDs as specified by \hyperref[intro:rfc4122]{[RFC4122]}.+\input{admin.tex}
+
\chapter{General Initialization And Device Operation}\label{sec:General Initialization And Device Operation}We start with an overview of device initialization, then expand on the
--
Tell her I'll be waiting, in the usual place.
Re: [virtio-comment] [PATCH v10 02/10] admin: introduce device group and related concepts
Quoted 89 lines · Michael S. Tsirkin
Quoted 88 lines · Max Gurtovoy
Quoted 65 lines · Michael S. Tsirkin
Quoted 64 lines · Max Gurtovoy
Quoted 25 lines · Michael S. Tsirkin
Quoted 24 lines · Max Gurtovoy
On 09/02/2023 17:22, David Edmondson wrote:
On Thursday, 2023-02-09 at 10:13:46 -05, Michael S. Tsirkin wrote:
On Thu, Feb 09, 2023 at 03:00:58PM +0000, David Edmondson wrote:
On Thursday, 2023-02-09 at 07:13:36 -05, Michael S. Tsirkin wrote:
Each device group has a type. For now, define one initial group:
SR-IOV type - PCI SR-IOV virtual functions (VFs) of a given PCI SR-IOV physical function (PF). This group may contain one or more virtio devices.
The specification says zero or more generally and nothing to refine that for SR-IOV groups.
Well it says:
(SR-IOV) physical function (PF) device as the owner and includes all its SR-IOV virtual functions (VFs) as members (see \hyperref[intro:PCIe]{[PCIe]}).
Quoted 7 lines
Quoted 5 lines
how can that be zero?
If I remove all of the VFs of a PF, does the group implicitly disappear?
Enable/Disable SR-IOV are dynamic operations controlled by NumVFs register.
Are you sure? Not by VF Enable?
Right. It's a combination of the
VF_Enableand numVfs....
"The NumVFs field defines the number of VFs that are enabled when VF Enable is Set in the associated PF."Quoted 22 lines
Quoted 3 lines
We can mention that a group include all virtual functions indicated by TotalVFs RO register.
TotalVFs indicates the maximum number of VFs that could be associated with the PF but not all of these exist. If we use this we get into issues of discovering whether VFs can actually be used. I'd rather avoid that.
Quoted 2 lines
This group exist as long as the owner PF supports SR-IOV and has admin capabilities.
SRIOV spec says:
NumVFs controls the number of VFs that are visible.And one can not play with NumVFs dynamically:
NumVFs may only be written while VF Enable is Clear. If NumVFs is written when VF Enable is Set, the results are undefined.
one has to kill all VFs then enable them all again. As long as we are doing that, we can just unload the driver.
Quoted 8 lines
Quoted 1 line
what driver to unload ? Not sure I'm following..
Basically I am saying that if VFs are disabled this destroys all VFs so it is not
clear that it makes sense to keep some of the configuration for previous VFs around.My idea is to say that reset is required to disable VFs.
which reset ?
VFs disabled/enabled using
VF_enablePCI register. Lets follow that please.Lets define what is happening during
VF_enable= 1 andVF_enable= 0.On
VF_enable= 0 --> 1 transition the correspondingdevice_group, that is owned by the PF, grows and contains NumVFs members with initial features and resources.
Quoted 8 lines
Quoted 3 lines
On
VF_enable= 1 --> 0 transition the correspondingdevice_group, that is owned by the PF, shrinks and contains 0 members and all the dynamic resources are back to the owner.Maybe, it's a possible approach. As current patch set has no resources I feel we can leave this part to a patch on top just so that this one can move forward while we have a more specific example to work from.
we can differ the resources part but lets add the part that the group becomes empty/non-empty according to the disable/enable of VF_enable register as mentioned above.
Quoted 29 lines
Quoted 29 lines
Quoted 28 lines
Quoted 12 lines
Quoted 8 lines
So I would say we should just ask that VF Enable is set before poking at admin vq, and prohibit clearing VF Enable.
Sending admin commands shouldn't be restricted and should be allowed always. Device should react to incoming command.
Quoted 7 lines
We can say that an SR-IOV group is empty while the VF enable is unset and is not empty when it's set. The size of the non empty SR-IOV group is equal to the numVFs and the VF index is equal to the member identifier in this group. I had this definition in my patches.
Sending admin command to a non existing member will result in an ERROR
VIRTIO_ADMIN_STATUS_Q_INVALID_MEM.just an example:
- assign resource X to VF 16
- set NumVFs to 8Does VF 16 keep resource X? I note that
resource X can not be taken back because VF 16
is not accessible.
Quoted 7 lines
Quoted 2 lines
all dynamic resources should return to the owner when
VF_enablemoves 1 --> 0It's a possible approach but my question would be whether we need a transport independent way to do this through VQ. And if we do it's annoying to have multiple ways.
We are defining the existence of the SR-IOV group.
Also, the approach of sending commands to a non-existing member is valid for any group type and should return error VIRTIO_ADMIN_STATUS_Q_INVALID_MEM in that case.
why do we need more ways ?
Quoted 11 lines
Quoted 7 lines
Quoted 5 lines
For sure, all this is solvable but I'd rather just forbid changes to VF enable for now.
how we can forbid it ? setting this register is not related to virtio.
We can ask driver to write 0 to device reset before changing VF enable to 0. The advantage is that this kind of reset by definition frees up all resources.
why do we need to reset the device ? It is fully functional and should be able to run perfectly fine without any need to reset.
The PF device might have a very big role in the hypervisor, so restricting it in this way doesn't sounds mandatory.
Controlling the SR-IOV group using SR-IOV register enable/disable and NumVFs used as the number of the group size sounds simple from Spec and implementation POV.
Quoted 114 lines
Quoted 113 lines
Quoted 113 lines
Quoted 112 lines
Quoted 112 lines
There's also the concern of VF migration under MRIOV where VFs might not exit. I'm guessing
trying to include that right now is overthinking. So maybe this should mention that VF Migration Capable should be clear.I will add all this to the spec.
Quoted 96 lines
How about the converse?
Each device within a group has a unique identifier. This identifier is the group member identifier.
Note: one can argue both ways whether the new device group handling functionality (this and following patches) is closer to a new device type or a new transport type.
However, I expect that we will add more features in the near future. To facilitate this as much as possible of the text is located in the new admin chapter.
I did my best to minimize transport-specific text.
Signed-off-by Max Gurtovoy <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>---
admin.tex | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
content.tex | 2 ++
2 files changed, 51 insertions(+) create mode 100644 admin.texdiff --git a/admin.tex b/admin.tex
new file mode 100644
index 0000000..2bc7322
---/dev/null
+++ b/admin.tex
@@ -0,0 +1,49 @@
+\section{Device groups}\label{sec:Basic Facilities of a Virtio Device / Device groups} +
+It is occasionally useful to have a device control a group of
+other devices. Terminology used in such cases:
+
+\begin{description}
+\item[Device group]
+ or just group, includes zero or more devices.
+\item[Owner device]
+ or owner, the device controlling the group.
+\item[Member device]
+ a device within a group. The owner device itself is not
+ a member of the group.
+\item[Member identifier]
+ each member has this identifier, unique within the group
+ and used to address it through the owner device.
+\item[Group type identifier]
+ specifies what kind of member devices there are in a
+ group, how is the member identifier is interpreted
+ and what kind of control the owner has.
+ A given owner can control a single group of a given type,
+ thus the type and the owner together identify the group.
+ \footnote{Even though some group types only support
+ specific transports, group type identifiers
+ are global rather than transport-specific -
+ we don't expect a flood of new group types.}
+\end{description}
+
+The following group types, and their identifiers, are currently specified):
+\begin{description}
+\item[SR-IOV group type (0x1)]
+This device group has a PCI Single Root I/O Virtualization
+(SR-IOV) physical function (PF) device as the owner and includes
+all its SR-IOV virtual functions (VFs) as members (see +\hyperref[intro:PCIe]{[PCIe]}).
+
+The PF device itself is not a member of the group.
+
+The group type identifier for this group is0x1.
+
+A member identifier for this group can have a value0x1to0xFFFF
+and equals the SR-IOV VF number of the member device (see +\hyperref[intro:PCIe]{[PCIe]}).
+
+Both owner and member devices for this group type use the Virtio
+PCI transport (see \ref{sec:Virtio Transport Options / Virtio Over PCI Bus}). +\end{description}
+
+
diff --git a/content.tex b/content.tex
index 0c2d917..ffe45c4 100644
--- a/content.tex
+++ b/content.tex
@@ -491,6 +491,8 @@ \section{Exporting Objects}\label{sec:Basic Facilities of a Virtio Device / Expo
types. It is RECOMMENDED that devices generate version 4
UUIDs as specified by \hyperref[intro:rfc4122]{[RFC4122]}.+\input{admin.tex}
+
\chapter{General Initialization And Device Operation}\label{sec:General Initialization And Device Operation}We start with an overview of device initialization, then expand on the
--
Tell her I'll be waiting, in the usual place.
Re: [virtio-comment] [PATCH v10 02/10] admin: introduce device group and related concepts
Quoted 96 lines · Max Gurtovoy
Quoted 93 lines · Michael S. Tsirkin
Quoted 91 lines · Max Gurtovoy
Quoted 65 lines · Michael S. Tsirkin
Quoted 64 lines · Max Gurtovoy
Quoted 25 lines · Michael S. Tsirkin
Quoted 24 lines · Max Gurtovoy
On 09/02/2023 17:22, David Edmondson wrote:
On Thursday, 2023-02-09 at 10:13:46 -05, Michael S. Tsirkin wrote:
On Thu, Feb 09, 2023 at 03:00:58PM +0000, David Edmondson wrote:
On Thursday, 2023-02-09 at 07:13:36 -05, Michael S. Tsirkin wrote:
Each device group has a type. For now, define one initial group:
SR-IOV type - PCI SR-IOV virtual functions (VFs) of a given PCI SR-IOV physical function (PF). This group may contain one or more virtio devices.
The specification says zero or more generally and nothing to refine that for SR-IOV groups.
Well it says:
(SR-IOV) physical function (PF) device as the owner and includes all its SR-IOV virtual functions (VFs) as members (see \hyperref[intro:PCIe]{[PCIe]}).
Quoted 7 lines
Quoted 5 lines
how can that be zero?
If I remove all of the VFs of a PF, does the group implicitly disappear?
Enable/Disable SR-IOV are dynamic operations controlled by NumVFs register.
Are you sure? Not by VF Enable?
Right. It's a combination of the
VF_Enableand numVfs....
"The NumVFs field defines the number of VFs that are enabled when VF Enable is Set in the associated PF."Quoted 22 lines
Quoted 3 lines
We can mention that a group include all virtual functions indicated by TotalVFs RO register.
TotalVFs indicates the maximum number of VFs that could be associated with the PF but not all of these exist. If we use this we get into issues of discovering whether VFs can actually be used. I'd rather avoid that.
Quoted 2 lines
This group exist as long as the owner PF supports SR-IOV and has admin capabilities.
SRIOV spec says:
NumVFs controls the number of VFs that are visible.And one can not play with NumVFs dynamically:
NumVFs may only be written while VF Enable is Clear. If NumVFs is written when VF Enable is Set, the results are undefined.
one has to kill all VFs then enable them all again. As long as we are doing that, we can just unload the driver.
Quoted 8 lines
Quoted 1 line
what driver to unload ? Not sure I'm following..
Basically I am saying that if VFs are disabled this destroys all VFs so it is not
clear that it makes sense to keep some of the configuration for previous VFs around.My idea is to say that reset is required to disable VFs.
which reset ?
VFs disabled/enabled using
VF_enablePCI register. Lets follow that please.Lets define what is happening during
VF_enable= 1 andVF_enable= 0.On
VF_enable= 0 --> 1 transition the correspondingdevice_group, that is owned by the PF, grows and contains NumVFs members with initial features and resources.On
VF_enable= 1 --> 0 transition the correspondingdevice_group, that is owned by the PF, shrinks and contains 0 members and all the dynamic resources are back to the owner.
Quoted 8 lines
Quoted 4 lines
Maybe, it's a possible approach. As current patch set has no resources I feel we can leave this part to a patch on top just so that this one can move forward while we have a more specific example to work from.
we can differ the resources part but lets add the part that the group becomes empty/non-empty according to the disable/enable of
VF_enableregister as mentioned above.
Hmm. Another option is VIRTIO_ADMIN_STATUS_Q_INVALID_GROUP when VF_enable is clear - since this disables the whole group not a specific member. This allows distinguishing between id > NumVFs and VF_enable == 0 so it seems like a nicer option to me.
Quoted 37 lines
Quoted 29 lines
Quoted 29 lines
Quoted 28 lines
Quoted 12 lines
Quoted 8 lines
So I would say we should just ask that VF Enable is set before poking at admin vq, and prohibit clearing VF Enable.
Sending admin commands shouldn't be restricted and should be allowed always. Device should react to incoming command.
Quoted 7 lines
We can say that an SR-IOV group is empty while the VF enable is unset and is not empty when it's set. The size of the non empty SR-IOV group is equal to the numVFs and the VF index is equal to the member identifier in this group. I had this definition in my patches.
Sending admin command to a non existing member will result in an ERROR
VIRTIO_ADMIN_STATUS_Q_INVALID_MEM.just an example:
- assign resource X to VF 16
- set NumVFs to 8Does VF 16 keep resource X? I note that
resource X can not be taken back because VF 16
is not accessible.Quoted 7 lines
Quoted 2 lines
all dynamic resources should return to the owner when
VF_enablemoves 1 --> 0It's a possible approach but my question would be whether we need a transport independent way to do this through VQ. And if we do it's annoying to have multiple ways.
Quoted 7 lines
We are defining the existence of the SR-IOV group.
Also, the approach of sending commands to a non-existing member is valid for any group type and should return error
VIRTIO_ADMIN_STATUS_Q_INVALID_MEMin that case.why do we need more ways ?
Sorry I mean a transport independent way to destroy a group as a whole.
Quoted 15 lines
Quoted 11 lines
Quoted 7 lines
Quoted 5 lines
For sure, all this is solvable but I'd rather just forbid changes to VF enable for now.
how we can forbid it ? setting this register is not related to virtio.
We can ask driver to write 0 to device reset before changing VF enable to 0. The advantage is that this kind of reset by definition frees up all resources.
why do we need to reset the device ? It is fully functional and should be able to run perfectly fine without any need to reset.
Quoted 6 lines
The PF device might have a very big role in the hypervisor, so restricting it in this way doesn't sounds mandatory.
Controlling the SR-IOV group using SR-IOV register enable/disable and NumVFs used as the number of the group size sounds simple from Spec and implementation POV.
Simple, however
- only works for SRIOV
- also limited, for example it's impossible to report an error
I would rather not decide now until we have a use-case.
Quoted 114 lines
Quoted 114 lines
Quoted 113 lines
Quoted 113 lines
Quoted 112 lines
Quoted 112 lines
There's also the concern of VF migration under MRIOV where VFs might not exit. I'm guessing
trying to include that right now is overthinking. So maybe this should mention that VF Migration Capable should be clear.I will add all this to the spec.
Quoted 96 lines
How about the converse?
Each device within a group has a unique identifier. This identifier is the group member identifier.
Note: one can argue both ways whether the new device group handling functionality (this and following patches) is closer to a new device type or a new transport type.
However, I expect that we will add more features in the near future. To facilitate this as much as possible of the text is located in the new admin chapter.
I did my best to minimize transport-specific text.
Signed-off-by Max Gurtovoy <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>---
admin.tex | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
content.tex | 2 ++
2 files changed, 51 insertions(+) create mode 100644 admin.texdiff --git a/admin.tex b/admin.tex
new file mode 100644
index 0000000..2bc7322
---/dev/null
+++ b/admin.tex
@@ -0,0 +1,49 @@
+\section{Device groups}\label{sec:Basic Facilities of a Virtio Device / Device groups} +
+It is occasionally useful to have a device control a group of
+other devices. Terminology used in such cases:
+
+\begin{description}
+\item[Device group]
+ or just group, includes zero or more devices.
+\item[Owner device]
+ or owner, the device controlling the group.
+\item[Member device]
+ a device within a group. The owner device itself is not
+ a member of the group.
+\item[Member identifier]
+ each member has this identifier, unique within the group
+ and used to address it through the owner device.
+\item[Group type identifier]
+ specifies what kind of member devices there are in a
+ group, how is the member identifier is interpreted
+ and what kind of control the owner has.
+ A given owner can control a single group of a given type,
+ thus the type and the owner together identify the group.
+ \footnote{Even though some group types only support
+ specific transports, group type identifiers
+ are global rather than transport-specific -
+ we don't expect a flood of new group types.}
+\end{description}
+
+The following group types, and their identifiers, are currently specified):
+\begin{description}
+\item[SR-IOV group type (0x1)]
+This device group has a PCI Single Root I/O Virtualization
+(SR-IOV) physical function (PF) device as the owner and includes
+all its SR-IOV virtual functions (VFs) as members (see +\hyperref[intro:PCIe]{[PCIe]}).
+
+The PF device itself is not a member of the group.
+
+The group type identifier for this group is0x1.
+
+A member identifier for this group can have a value0x1to0xFFFF
+and equals the SR-IOV VF number of the member device (see +\hyperref[intro:PCIe]{[PCIe]}).
+
+Both owner and member devices for this group type use the Virtio
+PCI transport (see \ref{sec:Virtio Transport Options / Virtio Over PCI Bus}). +\end{description}
+
+
diff --git a/content.tex b/content.tex
index 0c2d917..ffe45c4 100644
--- a/content.tex
+++ b/content.tex
@@ -491,6 +491,8 @@ \section{Exporting Objects}\label{sec:Basic Facilities of a Virtio Device / Expo
types. It is RECOMMENDED that devices generate version 4
UUIDs as specified by \hyperref[intro:rfc4122]{[RFC4122]}.+\input{admin.tex}
+
\chapter{General Initialization And Device Operation}\label{sec:General Initialization And Device Operation}We start with an overview of device initialization, then expand on the
--
Tell her I'll be waiting, in the usual place.
Re: [virtio-dev] Re: [virtio-comment] [PATCH v10 02/10] admin: introduce device group and related concepts
Quoted 89 lines · Michael S. Tsirkin
Quoted 88 lines · Max Gurtovoy
Quoted 86 lines · Michael S. Tsirkin
Quoted 74 lines · Max Gurtovoy
Quoted 58 lines · Michael S. Tsirkin
Quoted 57 lines · Max Gurtovoy
Quoted 24 lines · Michael S. Tsirkin
Quoted 23 lines · Max Gurtovoy
On 09/02/2023 17:22, David Edmondson wrote:
On Thursday, 2023-02-09 at 10:13:46 -05, Michael S. Tsirkin wrote:
On Thu, Feb 09, 2023 at 03:00:58PM +0000, David Edmondson wrote:
On Thursday, 2023-02-09 at 07:13:36 -05, Michael S. Tsirkin wrote:
Each device group has a type. For now, define one initial group:
SR-IOV type - PCI SR-IOV virtual functions (VFs) of a given PCI SR-IOV physical function (PF). This group may contain one or more virtio devices.
The specification says zero or more generally and nothing to refine that for SR-IOV groups.
Well it says:
(SR-IOV) physical function (PF) device as the owner and includes all its SR-IOV virtual functions (VFs) as members (see \hyperref[intro:PCIe]{[PCIe]}).
Quoted 6 lines
Quoted 5 lines
how can that be zero?
If I remove all of the VFs of a PF, does the group implicitly disappear?
Enable/Disable SR-IOV are dynamic operations controlled by NumVFs register.
Are you sure? Not by VF Enable?
Right. It's a combination of the
VF_Enableand numVfs....
"The NumVFs field defines the number of VFs that are enabled when VF Enable is Set in the associated PF."Quoted 19 lines
Quoted 2 lines
We can mention that a group include all virtual functions indicated by TotalVFs RO register.
TotalVFs indicates the maximum number of VFs that could be associated with the PF but not all of these exist. If we use this we get into issues of discovering whether VFs can actually be used. I'd rather avoid that.
Quoted 2 lines
This group exist as long as the owner PF supports SR-IOV and has admin capabilities.
SRIOV spec says:
NumVFs controls the number of VFs that are visible.And one can not play with NumVFs dynamically:
NumVFs may only be written while VF Enable is Clear. If NumVFs is written when VF Enable is Set, the results are undefined.
one has to kill all VFs then enable them all again. As long as we are doing that, we can just unload the driver.
Quoted 7 lines
Quoted 1 line
what driver to unload ? Not sure I'm following..
Basically I am saying that if VFs are disabled this destroys all VFs so it is not
clear that it makes sense to keep some of the configuration for previous VFs around.My idea is to say that reset is required to disable VFs.
which reset ?
VFs disabled/enabled using
VF_enablePCI register. Lets follow that please.Lets define what is happening during
VF_enable= 1 andVF_enable= 0.Quoted 7 lines
On
VF_enable= 0 --> 1 transition the correspondingdevice_group, that is owned by the PF, grows and contains NumVFs members with initial features and resources.On
VF_enable= 1 --> 0 transition the correspondingdevice_group, that is owned by the PF, shrinks and contains 0 members and all the dynamic resources are back to the owner.Maybe, it's a possible approach. As current patch set has no resources I feel we can leave this part to a patch on top just so that this one can move forward while we have a more specific example to work from.
Quoted 7 lines
Quoted 3 lines
we can differ the resources part but lets add the part that the group becomes empty/non-empty according to the disable/enable of
VF_enableregister as mentioned above.Hmm. Another option is
VIRTIO_ADMIN_STATUS_Q_INVALID_GROUPwhenVF_enableis clear - since this disables the whole group not a specific member. This allows distinguishing between id > NumVFs andVF_enable== 0 so it seems like a nicer option to me.
How to detect whether VF_enable set to 0 or 1, pulling is not a good idea, and do we want SRIOV cap to notify the admin vq on changes?
Thanks
Quoted 168 lines
Quoted 31 lines
Quoted 25 lines
Quoted 25 lines
Quoted 25 lines
Quoted 10 lines
Quoted 7 lines
So I would say we should just ask that VF Enable is set before poking at admin vq, and prohibit clearing VF Enable.
Sending admin commands shouldn't be restricted and should be allowed always. Device should react to incoming command.
Quoted 7 lines
We can say that an SR-IOV group is empty while the VF enable is unset and is not empty when it's set. The size of the non empty SR-IOV group is equal to the numVFs and the VF index is equal to the member identifier in this group. I had this definition in my patches.
Sending admin command to a non existing member will result in an ERROR
VIRTIO_ADMIN_STATUS_Q_INVALID_MEM.just an example:
- assign resource X to VF 16
- set NumVFs to 8Does VF 16 keep resource X? I note that
resource X can not be taken back because VF 16
is not accessible.Quoted 6 lines
Quoted 2 lines
all dynamic resources should return to the owner when
VF_enablemoves 1 --> 0It's a possible approach but my question would be whether we need a transport independent way to do this through VQ. And if we do it's annoying to have multiple ways.
Quoted 7 lines
We are defining the existence of the SR-IOV group.
Also, the approach of sending commands to a non-existing member is valid for any group type and should return error
VIRTIO_ADMIN_STATUS_Q_INVALID_MEMin that case.why do we need more ways ?
Sorry I mean a transport independent way to destroy a group as a whole.
Quoted 10 lines
Quoted 7 lines
Quoted 4 lines
Quoted 3 lines
For sure, all this is solvable but I'd rather just forbid changes to VF enable for now.
how we can forbid it ? setting this register is not related to virtio.
We can ask driver to write 0 to device reset before changing VF enable to 0. The advantage is that this kind of reset by definition frees up all resources.
why do we need to reset the device ? It is fully functional and should be able to run perfectly fine without any need to reset.
Quoted 6 lines
The PF device might have a very big role in the hypervisor, so restricting it in this way doesn't sounds mandatory.
Controlling the SR-IOV group using SR-IOV register enable/disable and NumVFs used as the number of the group size sounds simple from Spec and implementation POV.
Simple, however
- only works for SRIOV
- also limited, for example it's impossible to report an errorI would rather not decide now until we have a use-case.
Quoted 104 lines
Quoted 104 lines
Quoted 104 lines
Quoted 104 lines
Quoted 104 lines
Quoted 104 lines
There's also the concern of VF migration under MRIOV where VFs might not exit. I'm guessing
trying to include that right now is overthinking. So maybe this should mention that VF Migration Capable should be clear.I will add all this to the spec.
Quoted 93 lines
How about the converse?
Each device within a group has a unique identifier. This identifier is the group member identifier.
Note: one can argue both ways whether the new device group handling functionality (this and following patches) is closer to a new device type or a new transport type.
However, I expect that we will add more features in the near future. To facilitate this as much as possible of the text is located in the new admin chapter.
I did my best to minimize transport-specific text.
Signed-off-by Max Gurtovoy <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>---
admin.tex | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
content.tex | 2 ++
2 files changed, 51 insertions(+) create mode 100644 admin.texdiff --git a/admin.tex b/admin.tex
new file mode 100644
index 0000000..2bc7322
---/dev/null
+++ b/admin.tex
@@ -0,0 +1,49 @@
+\section{Device groups}\label{sec:Basic Facilities of a Virtio Device / Device groups} +
+It is occasionally useful to have a device control a group of
+other devices. Terminology used in such cases:
+
+\begin{description}
+\item[Device group]
+ or just group, includes zero or more devices.
+\item[Owner device]
+ or owner, the device controlling the group.
+\item[Member device]
+ a device within a group. The owner device itself is not
+ a member of the group.
+\item[Member identifier]
+ each member has this identifier, unique within the group
+ and used to address it through the owner device.
+\item[Group type identifier]
+ specifies what kind of member devices there are in a
+ group, how is the member identifier is interpreted
+ and what kind of control the owner has.
+ A given owner can control a single group of a given type,
+ thus the type and the owner together identify the group.
+ \footnote{Even though some group types only support
+ specific transports, group type identifiers
+ are global rather than transport-specific -
+ we don't expect a flood of new group types.}
+\end{description}
+
+The following group types, and their identifiers, are currently specified):
+\begin{description}
+\item[SR-IOV group type (0x1)]
+This device group has a PCI Single Root I/O Virtualization
+(SR-IOV) physical function (PF) device as the owner and includes
+all its SR-IOV virtual functions (VFs) as members (see +\hyperref[intro:PCIe]{[PCIe]}).
+
+The PF device itself is not a member of the group.
+
+The group type identifier for this group is0x1.
+
+A member identifier for this group can have a value0x1to0xFFFF
+and equals the SR-IOV VF number of the member device (see +\hyperref[intro:PCIe]{[PCIe]}).
+
+Both owner and member devices for this group type use the Virtio
+PCI transport (see \ref{sec:Virtio Transport Options / Virtio Over PCI Bus}). +\end{description}
+
+
diff --git a/content.tex b/content.tex
index 0c2d917..ffe45c4 100644
--- a/content.tex
+++ b/content.tex
@@ -491,6 +491,8 @@ \section{Exporting Objects}\label{sec:Basic Facilities of a Virtio Device / Expo
types. It is RECOMMENDED that devices generate version 4
UUIDs as specified by \hyperref[intro:rfc4122]{[RFC4122]}.+\input{admin.tex}
+
\chapter{General Initialization And Device Operation}\label{sec:General Initialization And Device Operation}We start with an overview of device initialization, then expand on the
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
--
Tell her I'll be waiting, in the usual place.---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio] Re: [virtio-dev] Re: [virtio-comment] [PATCH v10 02/10] admin: introduce device group and related concepts
Quoted 99 lines · Lingshan
Quoted 89 lines · Michael S. Tsirkin
Quoted 88 lines · Max Gurtovoy
Quoted 86 lines · Michael S. Tsirkin
Quoted 74 lines · Max Gurtovoy
Quoted 58 lines · Michael S. Tsirkin
Quoted 57 lines · Max Gurtovoy
Quoted 24 lines · Michael S. Tsirkin
Quoted 23 lines · Max Gurtovoy
On 09/02/2023 17:22, David Edmondson wrote:
On Thursday, 2023-02-09 at 10:13:46 -05, Michael S. Tsirkin wrote:
On Thu, Feb 09, 2023 at 03:00:58PM +0000, David Edmondson wrote:
On Thursday, 2023-02-09 at 07:13:36 -05, Michael S. Tsirkin wrote:
Each device group has a type. For now, define one initial group:
SR-IOV type - PCI SR-IOV virtual functions (VFs) of a given PCI SR-IOV physical function (PF). This group may contain one or more virtio devices.
The specification says zero or more generally and nothing to refine that for SR-IOV groups.
Well it says:
(SR-IOV) physical function (PF) device as the owner and includes all its SR-IOV virtual functions (VFs) as members (see \hyperref[intro:PCIe]{[PCIe]}).
Quoted 6 lines
Quoted 5 lines
how can that be zero?
If I remove all of the VFs of a PF, does the group implicitly disappear?
Enable/Disable SR-IOV are dynamic operations controlled by NumVFs register.
Are you sure? Not by VF Enable?
Right. It's a combination of the
VF_Enableand numVfs....
"The NumVFs field defines the number of VFs that are enabled when VF Enable is Set in the associated PF."Quoted 19 lines
Quoted 2 lines
We can mention that a group include all virtual functions indicated by TotalVFs RO register.
TotalVFs indicates the maximum number of VFs that could be associated with the PF but not all of these exist. If we use this we get into issues of discovering whether VFs can actually be used. I'd rather avoid that.
Quoted 2 lines
This group exist as long as the owner PF supports SR-IOV and has admin capabilities.
SRIOV spec says:
NumVFs controls the number of VFs that are visible.And one can not play with NumVFs dynamically:
NumVFs may only be written while VF Enable is Clear. If NumVFs is written when VF Enable is Set, the results are undefined.
one has to kill all VFs then enable them all again. As long as we are doing that, we can just unload the driver.
Quoted 7 lines
Quoted 1 line
what driver to unload ? Not sure I'm following..
Basically I am saying that if VFs are disabled this destroys all VFs so it is not
clear that it makes sense to keep some of the configuration for previous VFs around.My idea is to say that reset is required to disable VFs.
which reset ?
VFs disabled/enabled using
VF_enablePCI register. Lets follow that please.Lets define what is happening during
VF_enable= 1 andVF_enable= 0.Quoted 7 lines
On
VF_enable= 0 --> 1 transition the correspondingdevice_group, that is owned by the PF, grows and contains NumVFs members with initial features and resources.On
VF_enable= 1 --> 0 transition the correspondingdevice_group, that is owned by the PF, shrinks and contains 0 members and all the dynamic resources are back to the owner.Maybe, it's a possible approach. As current patch set has no resources I feel we can leave this part to a patch on top just so that this one can move forward while we have a more specific example to work from.
Quoted 7 lines
Quoted 3 lines
we can differ the resources part but lets add the part that the group becomes empty/non-empty according to the disable/enable of
VF_enableregister as mentioned above.Hmm. Another option is
VIRTIO_ADMIN_STATUS_Q_INVALID_GROUPwhenVF_enableis clear - since this disables the whole group not a specific member. This allows distinguishing between id > NumVFs andVF_enable== 0 so it seems like a nicer option to me.
Quoted 5 lines
How to detect whether
VF_enableset to 0 or 1, pulling is not a good idea, and do we want
SRIOV cap to notify the admin vq on changes?Thanks
I don't understand the question.
Who wants to detect this? It's the driver itself setting this bit - just call some function, there's no reason to involve the spec.
Quoted 168 lines
Quoted 168 lines
Quoted 31 lines
Quoted 25 lines
Quoted 25 lines
Quoted 25 lines
Quoted 10 lines
Quoted 7 lines
So I would say we should just ask that VF Enable is set before poking at admin vq, and prohibit clearing VF Enable.
Sending admin commands shouldn't be restricted and should be allowed always. Device should react to incoming command.
Quoted 7 lines
We can say that an SR-IOV group is empty while the VF enable is unset and is not empty when it's set. The size of the non empty SR-IOV group is equal to the numVFs and the VF index is equal to the member identifier in this group. I had this definition in my patches.
Sending admin command to a non existing member will result in an ERROR
VIRTIO_ADMIN_STATUS_Q_INVALID_MEM.just an example:
- assign resource X to VF 16
- set NumVFs to 8Does VF 16 keep resource X? I note that
resource X can not be taken back because VF 16
is not accessible.Quoted 6 lines
Quoted 2 lines
all dynamic resources should return to the owner when
VF_enablemoves 1 --> 0It's a possible approach but my question would be whether we need a transport independent way to do this through VQ. And if we do it's annoying to have multiple ways.
Quoted 7 lines
We are defining the existence of the SR-IOV group.
Also, the approach of sending commands to a non-existing member is valid for any group type and should return error
VIRTIO_ADMIN_STATUS_Q_INVALID_MEMin that case.why do we need more ways ?
Sorry I mean a transport independent way to destroy a group as a whole.
Quoted 10 lines
Quoted 7 lines
Quoted 4 lines
Quoted 3 lines
For sure, all this is solvable but I'd rather just forbid changes to VF enable for now.
how we can forbid it ? setting this register is not related to virtio.
We can ask driver to write 0 to device reset before changing VF enable to 0. The advantage is that this kind of reset by definition frees up all resources.
why do we need to reset the device ? It is fully functional and should be able to run perfectly fine without any need to reset.
Quoted 6 lines
The PF device might have a very big role in the hypervisor, so restricting it in this way doesn't sounds mandatory.
Controlling the SR-IOV group using SR-IOV register enable/disable and NumVFs used as the number of the group size sounds simple from Spec and implementation POV.
Simple, however
- only works for SRIOV
- also limited, for example it's impossible to report an errorI would rather not decide now until we have a use-case.
Quoted 104 lines
Quoted 104 lines
Quoted 104 lines
Quoted 104 lines
Quoted 104 lines
Quoted 104 lines
There's also the concern of VF migration under MRIOV where VFs might not exit. I'm guessing
trying to include that right now is overthinking. So maybe this should mention that VF Migration Capable should be clear.I will add all this to the spec.
Quoted 93 lines
How about the converse?
Each device within a group has a unique identifier. This identifier is the group member identifier.
Note: one can argue both ways whether the new device group handling functionality (this and following patches) is closer to a new device type or a new transport type.
However, I expect that we will add more features in the near future. To facilitate this as much as possible of the text is located in the new admin chapter.
I did my best to minimize transport-specific text.
Signed-off-by Max Gurtovoy <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>---
admin.tex | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
content.tex | 2 ++
2 files changed, 51 insertions(+) create mode 100644 admin.texdiff --git a/admin.tex b/admin.tex
new file mode 100644
index 0000000..2bc7322
---/dev/null
+++ b/admin.tex
@@ -0,0 +1,49 @@
+\section{Device groups}\label{sec:Basic Facilities of a Virtio Device / Device groups} +
+It is occasionally useful to have a device control a group of
+other devices. Terminology used in such cases:
+
+\begin{description}
+\item[Device group]
+ or just group, includes zero or more devices.
+\item[Owner device]
+ or owner, the device controlling the group.
+\item[Member device]
+ a device within a group. The owner device itself is not
+ a member of the group.
+\item[Member identifier]
+ each member has this identifier, unique within the group
+ and used to address it through the owner device.
+\item[Group type identifier]
+ specifies what kind of member devices there are in a
+ group, how is the member identifier is interpreted
+ and what kind of control the owner has.
+ A given owner can control a single group of a given type,
+ thus the type and the owner together identify the group.
+ \footnote{Even though some group types only support
+ specific transports, group type identifiers
+ are global rather than transport-specific -
+ we don't expect a flood of new group types.}
+\end{description}
+
+The following group types, and their identifiers, are currently specified):
+\begin{description}
+\item[SR-IOV group type (0x1)]
+This device group has a PCI Single Root I/O Virtualization
+(SR-IOV) physical function (PF) device as the owner and includes
+all its SR-IOV virtual functions (VFs) as members (see +\hyperref[intro:PCIe]{[PCIe]}).
+
+The PF device itself is not a member of the group.
+
+The group type identifier for this group is0x1.
+
+A member identifier for this group can have a value0x1to0xFFFF
+and equals the SR-IOV VF number of the member device (see +\hyperref[intro:PCIe]{[PCIe]}).
+
+Both owner and member devices for this group type use the Virtio
+PCI transport (see \ref{sec:Virtio Transport Options / Virtio Over PCI Bus}). +\end{description}
+
+
diff --git a/content.tex b/content.tex
index 0c2d917..ffe45c4 100644
--- a/content.tex
+++ b/content.tex
@@ -491,6 +491,8 @@ \section{Exporting Objects}\label{sec:Basic Facilities of a Virtio Device / Expo
types. It is RECOMMENDED that devices generate version 4
UUIDs as specified by \hyperref[intro:rfc4122]{[RFC4122]}.+\input{admin.tex}
+
\chapter{General Initialization And Device Operation}\label{sec:General Initialization And Device Operation}We start with an overview of device initialization, then expand on the
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
--
Tell her I'll be waiting, in the usual place.---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe from this mail list, you must leave the OASIS TC that generates this mail. Follow this link to all your TCs in OASIS at:
https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php
Re: [virtio-comment] [PATCH v10 02/10] admin: introduce device group and related concepts
In reply to Michael S. TsirkinQuoted 102 lines · Michael S. Tsirkin
Quoted 101 lines · Max Gurtovoy
Quoted 97 lines · Michael S. Tsirkin
Quoted 84 lines · Max Gurtovoy
Quoted 65 lines · Michael S. Tsirkin
Quoted 64 lines · Max Gurtovoy
Quoted 25 lines · Michael S. Tsirkin
Quoted 24 lines · Max Gurtovoy
On 09/02/2023 17:22, David Edmondson wrote:
On Thursday, 2023-02-09 at 10:13:46 -05, Michael S. Tsirkin wrote:
On Thu, Feb 09, 2023 at 03:00:58PM +0000, David Edmondson wrote:
On Thursday, 2023-02-09 at 07:13:36 -05, Michael S. Tsirkin wrote:
Each device group has a type. For now, define one initial group:
SR-IOV type - PCI SR-IOV virtual functions (VFs) of a given PCI SR-IOV physical function (PF). This group may contain one or more virtio devices.
The specification says zero or more generally and nothing to refine that for SR-IOV groups.
Well it says:
(SR-IOV) physical function (PF) device as the owner and includes all its SR-IOV virtual functions (VFs) as members (see \hyperref[intro:PCIe]{[PCIe]}).
Quoted 7 lines
Quoted 5 lines
how can that be zero?
If I remove all of the VFs of a PF, does the group implicitly disappear?
Enable/Disable SR-IOV are dynamic operations controlled by NumVFs register.
Are you sure? Not by VF Enable?
Right. It's a combination of the
VF_Enableand numVfs....
"The NumVFs field defines the number of VFs that are enabled when VF Enable is Set in the associated PF."Quoted 22 lines
Quoted 3 lines
We can mention that a group include all virtual functions indicated by TotalVFs RO register.
TotalVFs indicates the maximum number of VFs that could be associated with the PF but not all of these exist. If we use this we get into issues of discovering whether VFs can actually be used. I'd rather avoid that.
Quoted 2 lines
This group exist as long as the owner PF supports SR-IOV and has admin capabilities.
SRIOV spec says:
NumVFs controls the number of VFs that are visible.And one can not play with NumVFs dynamically:
NumVFs may only be written while VF Enable is Clear. If NumVFs is written when VF Enable is Set, the results are undefined.
one has to kill all VFs then enable them all again. As long as we are doing that, we can just unload the driver.
Quoted 8 lines
Quoted 1 line
what driver to unload ? Not sure I'm following..
Basically I am saying that if VFs are disabled this destroys all VFs so it is not
clear that it makes sense to keep some of the configuration for previous VFs around.My idea is to say that reset is required to disable VFs.
which reset ?
VFs disabled/enabled using
VF_enablePCI register. Lets follow that please.Lets define what is happening during
VF_enable= 1 andVF_enable= 0.Quoted 7 lines
On
VF_enable= 0 --> 1 transition the correspondingdevice_group, that is owned by the PF, grows and contains NumVFs members with initial features and resources.On
VF_enable= 1 --> 0 transition the correspondingdevice_group, that is owned by the PF, shrinks and contains 0 members and all the dynamic resources are back to the owner.Maybe, it's a possible approach. As current patch set has no resources I feel we can leave this part to a patch on top just so that this one can move forward while we have a more specific example to work from.
Quoted 8 lines
Quoted 3 lines
we can differ the resources part but lets add the part that the group becomes empty/non-empty according to the disable/enable of
VF_enableregister as mentioned above.Hmm. Another option is
VIRTIO_ADMIN_STATUS_Q_INVALID_GROUPwhenVF_enableis clear - since this disables the whole group not a specific member. This allows distinguishing between id > NumVFs andVF_enable== 0 so it seems like a nicer option to me.
The group will be created on VF_enable = 1 and will be destroyed on VF_enable = 0. Members with index >= 1 and index <= NumVFs are part of the group.
sounds good to me.
Quoted 41 lines
Quoted 41 lines
Quoted 31 lines
Quoted 31 lines
Quoted 30 lines
Quoted 14 lines
Quoted 10 lines
So I would say we should just ask that VF Enable is set before poking at admin vq, and prohibit clearing VF Enable.
Sending admin commands shouldn't be restricted and should be allowed always. Device should react to incoming command.
Quoted 7 lines
We can say that an SR-IOV group is empty while the VF enable is unset and is not empty when it's set. The size of the non empty SR-IOV group is equal to the numVFs and the VF index is equal to the member identifier in this group. I had this definition in my patches.
Sending admin command to a non existing member will result in an ERROR
VIRTIO_ADMIN_STATUS_Q_INVALID_MEM.just an example:
- assign resource X to VF 16
- set NumVFs to 8Does VF 16 keep resource X? I note that
resource X can not be taken back because VF 16
is not accessible.Quoted 7 lines
Quoted 2 lines
all dynamic resources should return to the owner when
VF_enablemoves 1 --> 0It's a possible approach but my question would be whether we need a transport independent way to do this through VQ. And if we do it's annoying to have multiple ways.
We are defining the existence of the SR-IOV group.
Quoted 7 lines
Quoted 5 lines
Also, the approach of sending commands to a non-existing member is valid for any group type and should return error
VIRTIO_ADMIN_STATUS_Q_INVALID_MEMin that case.why do we need more ways ?
Sorry I mean a transport independent way to destroy a group as a whole.
Your proposal above to create/destroy a group during vf_enable = 1/0 is transport specific and its ok since the SR-IOV group is only for PCI transport.
Quoted 20 lines
Quoted 20 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
For sure, all this is solvable but I'd rather just forbid changes to VF enable for now.
how we can forbid it ? setting this register is not related to virtio.
We can ask driver to write 0 to device reset before changing VF enable to 0. The advantage is that this kind of reset by definition frees up all resources.
why do we need to reset the device ? It is fully functional and should be able to run perfectly fine without any need to reset.
The PF device might have a very big role in the hypervisor, so restricting it in this way doesn't sounds mandatory.
Quoted 7 lines
Quoted 3 lines
Controlling the SR-IOV group using SR-IOV register enable/disable and NumVFs used as the number of the group size sounds simple from Spec and implementation POV.
Simple, however
- only works for SRIOV
- also limited, for example it's impossible to report an error
what error is impossible to report and why ?
Quoted 119 lines
I would rather not decide now until we have a use-case.
Quoted 114 lines
Quoted 114 lines
Quoted 113 lines
Quoted 113 lines
Quoted 112 lines
Quoted 112 lines
There's also the concern of VF migration under MRIOV where VFs might not exit. I'm guessing
trying to include that right now is overthinking. So maybe this should mention that VF Migration Capable should be clear.I will add all this to the spec.
Quoted 96 lines
How about the converse?
Each device within a group has a unique identifier. This identifier is the group member identifier.
Note: one can argue both ways whether the new device group handling functionality (this and following patches) is closer to a new device type or a new transport type.
However, I expect that we will add more features in the near future. To facilitate this as much as possible of the text is located in the new admin chapter.
I did my best to minimize transport-specific text.
Signed-off-by Max Gurtovoy <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>---
admin.tex | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
content.tex | 2 ++
2 files changed, 51 insertions(+) create mode 100644 admin.texdiff --git a/admin.tex b/admin.tex
new file mode 100644
index 0000000..2bc7322
---/dev/null
+++ b/admin.tex
@@ -0,0 +1,49 @@
+\section{Device groups}\label{sec:Basic Facilities of a Virtio Device / Device groups} +
+It is occasionally useful to have a device control a group of
+other devices. Terminology used in such cases:
+
+\begin{description}
+\item[Device group]
+ or just group, includes zero or more devices.
+\item[Owner device]
+ or owner, the device controlling the group.
+\item[Member device]
+ a device within a group. The owner device itself is not
+ a member of the group.
+\item[Member identifier]
+ each member has this identifier, unique within the group
+ and used to address it through the owner device.
+\item[Group type identifier]
+ specifies what kind of member devices there are in a
+ group, how is the member identifier is interpreted
+ and what kind of control the owner has.
+ A given owner can control a single group of a given type,
+ thus the type and the owner together identify the group.
+ \footnote{Even though some group types only support
+ specific transports, group type identifiers
+ are global rather than transport-specific -
+ we don't expect a flood of new group types.}
+\end{description}
+
+The following group types, and their identifiers, are currently specified):
+\begin{description}
+\item[SR-IOV group type (0x1)]
+This device group has a PCI Single Root I/O Virtualization
+(SR-IOV) physical function (PF) device as the owner and includes
+all its SR-IOV virtual functions (VFs) as members (see +\hyperref[intro:PCIe]{[PCIe]}).
+
+The PF device itself is not a member of the group.
+
+The group type identifier for this group is0x1.
+
+A member identifier for this group can have a value0x1to0xFFFF
+and equals the SR-IOV VF number of the member device (see +\hyperref[intro:PCIe]{[PCIe]}).
+
+Both owner and member devices for this group type use the Virtio
+PCI transport (see \ref{sec:Virtio Transport Options / Virtio Over PCI Bus}). +\end{description}
+
+
diff --git a/content.tex b/content.tex
index 0c2d917..ffe45c4 100644
--- a/content.tex
+++ b/content.tex
@@ -491,6 +491,8 @@ \section{Exporting Objects}\label{sec:Basic Facilities of a Virtio Device / Expo
types. It is RECOMMENDED that devices generate version 4
UUIDs as specified by \hyperref[intro:rfc4122]{[RFC4122]}.+\input{admin.tex}
+
\chapter{General Initialization And Device Operation}\label{sec:General Initialization And Device Operation}We start with an overview of device initialization, then expand on the
--
Tell her I'll be waiting, in the usual place.
RE: [virtio-comment] [PATCH v10 02/10] admin: introduce device group and related concepts
In reply to Michael S. TsirkinQuoted 8 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, February 9, 2023 2:58 PMThere's also the concern of VF migration under MRIOV where VFs might not exit. I'm guessing trying to include that right now is overthinking. So maybe this should mention that VF Migration Capable should be clear.
MRIOV is already deprecated in PCI spec.
We can ignore VF migration capable wording.
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/
RE: [PATCH v10 02/10] admin: introduce device group and related concepts
In reply to Michael S. TsirkinQuoted 6 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, February 9, 2023 7:14 AMEach device group has a type. For now, define one initial group:
+The following group types, and their identifiers, are currently specified):
Above "):" is that needed?
Quoted 2 lines
+\begin{description}
+\item[SR-IOV group type (0x1)]
Above 0x1 is duplicate of below.
Better to mention at single place.
admin.tex line 40
Quoted 9 lines
admin.tex new file +9
-0+This device group has a PCI Single Root I/O Virtualization +(SR-IOV) physical function (PF) device as the owner and includes all +its SR-IOV virtual functions (VFs) as members (see +\hyperref[intro:PCIe]{[PCIe]}). + +The PF device itself is not a member of the group. + +The group type identifier for this group is 0x1. +
Current spce for device ID style is better than writing above lines repeatedly. Something like,
\subsection{Group Type identifier }\label{sec: ... /Group Type Identifier} 1
RE: [PATCH v10 02/10] admin: introduce device group and related concepts
In reply to Michael S. TsirkinQuoted 3 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, February 9, 2023 7:14 AM
[..]
Quoted 29 lines
+\section{Device groups}\label{sec:Basic Facilities of a Virtio Device /
admin.tex new file +26
-0+Device groups} + +It is occasionally useful to have a device control a group of other +devices. Terminology used in such cases: + +\begin{description} +\item[Device group] + or just group, includes zero or more devices. +\item[Owner device] + or owner, the device controlling the group. +\item[Member device] + a device within a group. The owner device itself is not + a member of the group. +\item[Member identifier] + each member has this identifier, unique within the group + and used to address it through the owner device. +\item[Group type identifier] + specifies what kind of member devices there are in a + group, how is the member identifier is interpreted + and what kind of control the owner has. + A given owner can control a single group of a given type, + thus the type and the owner together identify the group. + \footnote{Even though some group types only support + specific transports, group type identifiers + are global rather than transport-specific - + we don't expect a flood of new group types.}\end{description}
admin.tex new file +1
-0+
admin.tex line 38
Quoted 10 lines
admin.tex new file +10
-0+The following group types, and their identifiers, are currently specified): +\begin{description} +\item[SR-IOV group type (0x1)] +This device group has a PCI Single Root I/O Virtualization +(SR-IOV) physical function (PF) device as the owner and includes all +its SR-IOV virtual functions (VFs) as members (see +\hyperref[intro:PCIe]{[PCIe]}). + +The PF device itself is not a member of the group. +
We already mention PC as owner and in 'Owner' definition it is clarifies above line. It duplicate info, may be can be removed, but doesn't hurt much.
Quoted 27 lines
admin.tex new file +11
-0+The group type identifier for this group is 0x1. + +A member identifier for this group can have a value 0x1 to 0xFFFF and +equals the SR-IOV VF number of the member device (see +\hyperref[intro:PCIe]{[PCIe]}). + +Both owner and member devices for this group type use the Virtio PCI +transport (see \ref{sec:Virtio Transport Options / Virtio Over PCI Bus}). +\end{description} + +content.tex +0
-0@@ -491,6 +491,8 @@ \section{Exporting Objects}\label{sec:Basic Facilities ofa Virtio Device / Expo types. It is RECOMMENDED that devices generate version 4 UUIDs as specified by \hyperref[intro:rfc4122]{[RFC4122]}.
+\input{admin.tex}
+
\chapter{General Initialization And Device Operation}\label{sec:General
Initialization And Device Operation}We start with an overview of device initialization, then expand on the
--
MST
[virtio] Re: [PATCH v10 02/10] admin: introduce device group and related concepts
In reply to Michael S. Tsirkinadmin.tex line 43
Quoted 3 lines · Michael S. Tsirkin
admin.tex new file +3
-0+A member identifier for this group can have a value 0x1 to 0xFFFF +and equals the SR-IOV VF number of the member device (see +\hyperref[intro:PCIe]{[PCIe]}).
Maybe
"a value from 0x1 to 0xFFFF"
or
"a value between 0x1 and 0xFFFF inclusive"
?
---------------------------------------------------------------------
To unsubscribe from this mail list, you must leave the OASIS TC that generates this mail. Follow this link to all your TCs in OASIS at:
https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php
Re: [PATCH v10 02/10] admin: introduce device group and related concepts
Quoted 9 lines · Cornelia Huck
admin.tex line 43
Quoted 3 lines · Michael S. Tsirkin
admin.tex new file +3
-0+A member identifier for this group can have a value 0x1 to 0xFFFF +and equals the SR-IOV VF number of the member device (see +\hyperref[intro:PCIe]{[PCIe]}).Maybe
"a value from
0x1to0xFFFF"
I prefer this one, for brevity.
Quoted 5 lines
or
"a value between
0x1and0xFFFFinclusive"?
PATCH v10 3/10 admin: introduce group administration commands
In reply to Michael S. TsirkinThis introduces a general structure for group administration commands, used to control device groups through their owner.
Following patches will introduce specific commands and an interface for submitting these commands to the owner.
--- admin.tex | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+)
admin.tex +101 -0
@@ -46,4 +46,105 @@ \section{Device groups}\label{sec:Basic Facilities of a Virtio Device / Device g PCI transport (see \ref{sec:Virtio Transport Options / Virtio Over PCI Bus}). \end{description} +\subsection{Group administration commands}\label{sec:Basic Facilities of a Virtio Device / Device groups / Group administration commands} +Group administration commands can be issued through an owner +device to control member devices of a group. This mechanism can +be used, for example, to configure a member device before it is +initialized by its driver. +\footnote{The term "administration" is intended to be interpreted +widely to include any kind of control. See specific commands +for detail.} + +All the group administration commands are of the following form: + +\begin{lstlisting} +struct virtio_admin_cmd { + /* Device-readable part */ + le16 opcode; + /* + * 1 - SR-IOV + * 2 - 65535 reserved + */ + le16 group_type; + /* unused, reserved for future extensions */ + u8 reserved1[12]; + le64 group_member_id; + u8 command_specific_data[]; + + /* Device-writable part */ + le16 status; + le16 status_qualifier; + /* unused, reserved for future extensions */ + u8 reserved2[4]; + u8 command_specific_result[]; +}; +\end{lstlisting} + +For all commands, \field{opcode}, \field{group_type} and if +necessary \field{group_member_id} and \field{command_specific_data} are +set by the driver, and the owner device sets \field{status} and if +needed \field{status_qualifier} and +\field{command_specific_result}. + +As a rule, any unused device-readable fields are set to zero by the driver +and ignored by the device. Any unused device-writeable fields are set to zero +by the device and ignored by the driver. + +\field{opcode} specifies the command. The valid +values for \field{opcode} can be found in the following table: + +\begin{tabular}{|l|l|} +\hline +opcode & Name & Command Description \\ +\hline \hline +0x0000 - 0x7FFF & - & Group administration commands \\ +\hline +0x8000 - 0xFFFF & - & Reserved \\ +\hline +\end{tabular} + +The \field{group_type} specifies the group type identifier. +The \field{group_member_id} specifies the member identifier within the group. +See section \ref{sec:Introduction / Terminology / Device group} +for the definition of the group type identifier and group member +identifier. + +The following table describes possible \field{status} values; +to simplify common implementations, they are intentionally +matching common Linux names and error numbers: + +\begin{tabular}{|l|l|l|} +\hline +Status (decimal) & Name & Description \\ +\hline \hline +00 & VIRTIO_ADMIN_STATUS_OK & successful completion \\ +\hline +22 & VIRTIO_ADMIN_STATUS_EINVAL & invalid command \\ +\hline +other & - & group administration command error \\ +\hline +\end{tabular} + +When \field{status} is VIRTIO_ADMIN_STATUS_OK, \field{status_qialifier} +is reserved and set to zero by the device. + +When \field{status} is VIRTIO_ADMIN_STATUS_EINVAL, +the following table describes possible \field{status_qialifier} values: +\begin{tabular}{|l|l|l|} +\hline +Status & Name & Description \\ +\hline \hline +0x00 & VIRTIO_ADMIN_STATUS_Q_INVALID_COMMAND & command error: no additional information \\ +\hline +0x01 & VIRTIO_ADMIN_STATUS_Q_INVALID_OPCODE & unsupported or invalid \field{opcode} \\ +\hline +0x02 & VIRTIO_ADMIN_STATUS_Q_INVALID_FIELD & unsupported or invalid field within \field{command_specific_data} \\ +\hline +0x03 & VIRTIO_ADMIN_STATUS_Q_INVALID_GROUP & unsupported or invalid \field{group_type} \\ +\hline +0x04 & VIRTIO_ADMIN_STATUS_Q_INVALID_MEM & unsupported or invalid \field{group_member_id} \\ +\hline +0x05-0xFFFF & - & reserved for future use \\ +\hline +\end{tabular}
Signature · 1 line
MST
Re: [virtio-comment] [PATCH v10 03/10] admin: introduce group administration commands
Quoted 69 lines · Michael S. Tsirkin
This introduces a general structure for group administration commands, used to control device groups through their owner.
Following patches will introduce specific commands and an interface for submitting these commands to the owner.
Signed-off-by Max Gurtovoy <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>--- admin.tex | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+)admin.tex +48
-0@@ -46,4 +46,105 @@ \section{Device groups}\label{sec:Basic Facilities of a Virtio Device / Device g PCI transport (see \ref{sec:Virtio Transport Options / Virtio Over PCI Bus}). \end{description} +\subsection{Group administration commands}\label{sec:Basic Facilities of a Virtio Device / Device groups / Group administration commands} +Group administration commands can be issued through an owner +device to control member devices of a group. This mechanism can +be used, for example, to configure a member device before it is +initialized by its driver. +\footnote{The term "administration" is intended to be interpreted +widely to include any kind of control. See specific commands +for detail.} + +All the group administration commands are of the following form: + +\begin{lstlisting} +struct virtio_admin_cmd { + /* Device-readable part */ + le16 opcode; + /* + * 1 - SR-IOV + * 2 - 65535 reserved + */ + le16 group_type; + /* unused, reserved for future extensions */ + u8 reserved1[12]; + le64 group_member_id; + u8 command_specific_data[]; + + /* Device-writable part */ + le16 status; + le16 status_qualifier; + /* unused, reserved for future extensions */ + u8 reserved2[4]; + u8 command_specific_result[]; +}; +\end{lstlisting} + +For all commands, \field{opcode}, \field{group_type} and if +necessary \field{group_member_id} and \field{command_specific_data} are +set by the driver, and the owner device sets \field{status} and if +needed \field{status_qualifier} and +\field{command_specific_result}. + +As a rule, any unused device-readable fields are set to zero by the driver +and ignored by the device. Any unused device-writeable fields are set to zero +by the device and ignored by the driver. + +\field{opcode} specifies the command. The valid +values for \field{opcode} can be found in the following table: + +\begin{tabular}{|l|l|}
admin.tex \section{Device groups}\label{sec:Basic Facilities of a Virtio Device / Device g · line 107
Quoted 10 lines
admin.tex +10
-0+\hline +opcode & Name & Command Description \\ +\hline \hline +0x0000 - 0x7FFF & - & Group administration commands \\ +\hline +0x8000 - 0xFFFF & - & Reserved \\ +\hline +\end{tabular} + +The \field{group_type} specifies the group type identifier.
Hi,
group_type here is used to address a device group, and we don't have a group_id, so this implies each type of devices belong to only one group, like there can be only one SRIOV group. Shall we add such description in patch 2 explicitly?
And there is another concern, if we use this type of command to create a SRIOV VF, do we need to sync with native PCI SRIOV?
Thanks
Quoted 33 lines
admin.tex +33
-0+The \field{group_member_id} specifies the member identifier within the group. +See section \ref{sec:Introduction / Terminology / Device group} +for the definition of the group type identifier and group member +identifier. + +The following table describes possible \field{status} values; +to simplify common implementations, they are intentionally +matching common Linux names and error numbers: + +\begin{tabular}{|l|l|l|} +\hline +Status (decimal) & Name & Description \\ +\hline \hline +00 & VIRTIO_ADMIN_STATUS_OK & successful completion \\ +\hline +22 & VIRTIO_ADMIN_STATUS_EINVAL & invalid command \\ +\hline +other & - & group administration command error \\ +\hline +\end{tabular} + +When \field{status} is VIRTIO_ADMIN_STATUS_OK, \field{status_qialifier} +is reserved and set to zero by the device. + +When \field{status} is VIRTIO_ADMIN_STATUS_EINVAL, +the following table describes possible \field{status_qialifier} values: +\begin{tabular}{|l|l|l|} +\hline +Status & Name & Description \\ +\hline \hline +0x00 & VIRTIO_ADMIN_STATUS_Q_INVALID_COMMAND & command error: no additional information \\ +\hline +0x01 & VIRTIO_ADMIN_STATUS_Q_INVALID_OPCODE & unsupported or invalid \field{opcode} \\
admin.tex \section{Device groups}\label{sec:Basic Facilities of a Virtio Device / Device g · line 150
Quoted 10 lines
admin.tex +10
-0+\hline +0x02 & VIRTIO_ADMIN_STATUS_Q_INVALID_FIELD & unsupported or invalid field within \field{command_specific_data} \\ +\hline +0x03 & VIRTIO_ADMIN_STATUS_Q_INVALID_GROUP & unsupported or invalid \field{group_type} \\ +\hline +0x04 & VIRTIO_ADMIN_STATUS_Q_INVALID_MEM & unsupported or invalid \field{group_member_id} \\ +\hline +0x05-0xFFFF & - & reserved for future use \\ +\hline +\end{tabular}
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/
RE: [PATCH v10 03/10] admin: introduce group administration commands
In reply to Michael S. TsirkinQuoted 3 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, February 9, 2023 7:14 AM
[..]
Review
Quoted 2 lines
(quoted diff) +2
-0+Group administration commands can be issued through an owner device to +control member devices of a group.
can be issued by the owner device to control ...
Quoted 31 lines
This mechanism can be used, for
admin.tex +30
-0+example, to configure a member device before it is initialized by its +driver. +\footnote{The term "administration" is intended to be interpreted +widely to include any kind of control. See specific commands for +detail.} + +All the group administration commands are of the following form: + +\begin{lstlisting} +struct virtio_admin_cmd { + /* Device-readable part */ + le16 opcode; + /* + * 1 - SR-IOV + * 2 - 65535 reserved + */ + le16 group_type; + /* unused, reserved for future extensions */ + u8 reserved1[12]; + le64 group_member_id; + u8 command_specific_data[]; + + /* Device-writable part */ + le16 status; + le16 status_qualifier; + /* unused, reserved for future extensions */ + u8 reserved2[4]; + u8 command_specific_result[]; +}; +\end{lstlisting}
admin.tex \section{Device groups}\label{sec:Basic Facilities of a Virtio Device / Device g · line 93
Quoted 10 lines
admin.tex +10
-0+ +For all commands, \field{opcode}, \field{group_type} and if necessary +\field{group_member_id} and \field{command_specific_data} are set by +the driver, and the owner device sets \field{status} and if needed +\field{status_qualifier} and \field{command_specific_result}. + +As a rule, any unused device-readable fields are set to zero by the +driver and ignored by the device. Any unused device-writeable fields +are set to zero by the device and ignored by the driver. +
General spec structure is describing the "rules" as device and driver side requirements. Can you please move above rule paragraph belongs to device and driver requirements section?
Quoted 16 lines
+\field{opcode} specifies the command. The valid values for +\field{opcode} can be found in the following table:
admin.tex +13
-0+ +\begin{tabular}{|l|l|} +\hline +opcode & Name & Command Description \\ +\hline \hline +0x0000 - 0x7FFF & - & Group administration commands \\ +\hline +0x8000 - 0xFFFF & - & Reserved \\ +\hline +\end{tabular} + +The \field{group_type} specifies the group type identifier. +The \field{group_member_id} specifies the member identifier within thegroup.
Review
Quoted 7 lines
(quoted diff) +7
-0+See section \ref{sec:Introduction / Terminology / Device group} for the +definition of the group type identifier and group member identifier. + +The following table describes possible \field{status} values; to +simplify common implementations, they are intentionally matching common +Linux names and error numbers: +
I am not sure it should be intentional and mention of Linux. Any OS would need multiple error values to know the error cause. Linux doesn't have name "OK" either for well-known value of 0.
For example
$ errno 22 EINVAL 22 Invalid argument
$ errno 0 This has not output for it and doesn't exist in errno.h.
Description is already good enough to describe what they are. Can we please drop Linux wording?
admin.tex \section{Device groups}\label{sec:Basic Facilities of a Virtio Device / Device g · line 129
Quoted 12 lines
+\begin{tabular}{|l|l|l|}
+\hlineadmin.tex +10
-0+Status (decimal) & Name & Description \\ \hline \hline +00 & VIRTIO_ADMIN_STATUS_OK & successful completion \\ +\hline +22 & VIRTIO_ADMIN_STATUS_EINVAL & invalid command \\ +\hline +other & - & group administration command error \\ +\hline +\end{tabular} + +When \field{status} is VIRTIO_ADMIN_STATUS_OK, \field{status_qialifier}
s/status_qialifier/status_qualifier
admin.tex \section{Device groups}\label{sec:Basic Facilities of a Virtio Device / Device g
Quoted 4 lines
admin.tex +4
-0+is reserved and set to zero by the device. + +When \field{status} is VIRTIO_ADMIN_STATUS_EINVAL, the following table +describes possible \field{status_qialifier} values:
s/status_qialifier/status_qualifier
Re: [PATCH v10 03/10] admin: introduce group administration commands
Quoted 9 lines · Parav Pandit
Quoted 3 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, February 9, 2023 7:14 AM[..]
Review
Quoted 2 lines
(quoted diff) +2
-0+Group administration commands can be issued through an owner device to +control member devices of a group.can be issued by the owner device to control ...
Well it's clearly the driver that issues the commands. Don't see how can a device issue them. If instead of "through an owner device" you prefer a more verbose "the driver of an owner device" then I can live with that. Let me know.
Quoted 35 lines
Quoted 35 lines
This mechanism can be used, for
admin.tex +34
-0+example, to configure a member device before it is initialized by its +driver. +\footnote{The term "administration" is intended to be interpreted +widely to include any kind of control. See specific commands for +detail.} + +All the group administration commands are of the following form: + +\begin{lstlisting} +struct virtio_admin_cmd { + /* Device-readable part */ + le16 opcode; + /* + * 1 - SR-IOV + * 2 - 65535 reserved + */ + le16 group_type; + /* unused, reserved for future extensions */ + u8 reserved1[12]; + le64 group_member_id; + u8 command_specific_data[]; + + /* Device-writable part */ + le16 status; + le16 status_qualifier; + /* unused, reserved for future extensions */ + u8 reserved2[4]; + u8 command_specific_result[]; +}; +\end{lstlisting} + +For all commands, \field{opcode}, \field{group_type} and if necessary +\field{group_member_id} and \field{command_specific_data} are set by +the driver, and the owner device sets \field{status} and if needed
Quoted 8 lines
Review
Quoted 6 lines
+\field{status_qualifier} and \field{command_specific_result}.
(quoted diff) +5
-0+ +As a rule, any unused device-readable fields are set to zero by the +driver and ignored by the device. Any unused device-writeable fields +are set to zero by the device and ignored by the driver. +General spec structure is describing the "rules" as device and driver side requirements. Can you please move above rule paragraph belongs to device and driver requirements section?
Generally we have a bit of duplication. A high level description showing how things work together. Then per-device/driver conforumance statements. So I think this should stay but I will look at adding conformance clauses too.
Quoted 27 lines
Quoted 16 lines
+\field{opcode} specifies the command. The valid values for +\field{opcode} can be found in the following table:
admin.tex +13
-0+ +\begin{tabular}{|l|l|} +\hline +opcode & Name & Command Description \\ +\hline \hline +0x0000 - 0x7FFF & - & Group administration commands \\ +\hline +0x8000 - 0xFFFF & - & Reserved \\ +\hline +\end{tabular} + +The \field{group_type} specifies the group type identifier. +The \field{group_member_id} specifies the member identifier within thegroup.
Review
Quoted 7 lines
(quoted diff) +7
-0+See section \ref{sec:Introduction / Terminology / Device group} for the +definition of the group type identifier and group member identifier. + +The following table describes possible \field{status} values; to +simplify common implementations, they are intentionally matching common +Linux names and error numbers: +I am not sure it should be intentional and mention of Linux. Any OS would need multiple error values to know the error cause. Linux doesn't have name "OK" either for well-known value of 0.
Quoted 6 lines
For example
$ errno 22 EINVAL 22 Invalid argument$ errno 0 This has not output for it and doesn't exist in errno.h.
No name OK true, but it does use 0 to signal success sometimes:
https://man7.org/linux/man-pages/man3/errno.3.html
For some system calls and library functions (e.g.,
getpriority(2)), -1 is a valid return on success. In such cases, a successful return can be distinguished from an error return by setting errno to zero before the call, and then, if the call returns a status that indicates that an error may have occurred, checking to see if errno has a nonzero value.
Quoted 2 lines
Description is already good enough to describe what they are. Can we please drop Linux wording?
But why should we? It's where 22 comes from so this way people are not wondering about the value, and it's somewhat helpful for Linux developers.
Quoted 14 lines
admin.tex \section{Device groups}\label{sec:Basic Facilities of a Virtio Device / Device g · line 129
Quoted 12 lines
+\begin{tabular}{|l|l|l|}
+\hlineadmin.tex +10
-0+Status (decimal) & Name & Description \\ \hline \hline +00 & VIRTIO_ADMIN_STATUS_OK & successful completion \\ +\hline +22 & VIRTIO_ADMIN_STATUS_EINVAL & invalid command \\ +\hline +other & - & group administration command error \\ +\hline +\end{tabular} + +When \field{status} is VIRTIO_ADMIN_STATUS_OK, \field{status_qialifier}s/status_qialifier/status_qualifier
Quoted 5 lines
admin.tex \section{Device groups}\label{sec:Basic Facilities of a Virtio Device / Device g
Quoted 4 lines
admin.tex +4
-0+is reserved and set to zero by the device. + +When \field{status} is VIRTIO_ADMIN_STATUS_EINVAL, the following table +describes possible \field{status_qialifier} values:s/status_qialifier/status_qualifier
Thanks!
Re: [PATCH v10 03/10] admin: introduce group administration commands
Quoted 112 lines · Michael S. Tsirkin
Quoted 9 lines · Parav Pandit
Quoted 3 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, February 9, 2023 7:14 AM[..]
Review
Quoted 2 lines
(quoted diff) +2
-0+Group administration commands can be issued through an owner device to +control member devices of a group.can be issued by the owner device to control ...
Well it's clearly the driver that issues the commands. Don't see how can a device issue them. If instead of "through an owner device" you prefer a more verbose "the driver of an owner device" then I can live with that. Let me know.
Quoted 35 lines
Quoted 35 lines
This mechanism can be used, for
admin.tex +34
-0+example, to configure a member device before it is initialized by its +driver. +\footnote{The term "administration" is intended to be interpreted +widely to include any kind of control. See specific commands for +detail.} + +All the group administration commands are of the following form: + +\begin{lstlisting} +struct virtio_admin_cmd { + /* Device-readable part */ + le16 opcode; + /* + * 1 - SR-IOV + * 2 - 65535 reserved + */ + le16 group_type; + /* unused, reserved for future extensions */ + u8 reserved1[12]; + le64 group_member_id; + u8 command_specific_data[]; + + /* Device-writable part */ + le16 status; + le16 status_qualifier; + /* unused, reserved for future extensions */ + u8 reserved2[4]; + u8 command_specific_result[]; +}; +\end{lstlisting} + +For all commands, \field{opcode}, \field{group_type} and if necessary +\field{group_member_id} and \field{command_specific_data} are set by +the driver, and the owner device sets \field{status} and if neededQuoted 8 lines
Review
Quoted 6 lines
+\field{status_qualifier} and \field{command_specific_result}.
(quoted diff) +5
-0+ +As a rule, any unused device-readable fields are set to zero by the +driver and ignored by the device. Any unused device-writeable fields +are set to zero by the device and ignored by the driver. +General spec structure is describing the "rules" as device and driver side requirements. Can you please move above rule paragraph belongs to device and driver requirements section?
Generally we have a bit of duplication. A high level description showing how things work together. Then per-device/driver conforumance statements. So I think this should stay but I will look at adding conformance clauses too.
Quoted 27 lines
Quoted 16 lines
+\field{opcode} specifies the command. The valid values for +\field{opcode} can be found in the following table:
admin.tex +13
-0+ +\begin{tabular}{|l|l|} +\hline +opcode & Name & Command Description \\ +\hline \hline +0x0000 - 0x7FFF & - & Group administration commands \\ +\hline +0x8000 - 0xFFFF & - & Reserved \\ +\hline +\end{tabular} + +The \field{group_type} specifies the group type identifier. +The \field{group_member_id} specifies the member identifier within thegroup.
Review
Quoted 7 lines
(quoted diff) +7
-0+See section \ref{sec:Introduction / Terminology / Device group} for the +definition of the group type identifier and group member identifier. + +The following table describes possible \field{status} values; to +simplify common implementations, they are intentionally matching common +Linux names and error numbers: +I am not sure it should be intentional and mention of Linux. Any OS would need multiple error values to know the error cause. Linux doesn't have name "OK" either for well-known value of 0.
Quoted 6 lines
For example
$ errno 22 EINVAL 22 Invalid argument$ errno 0 This has not output for it and doesn't exist in errno.h.No name OK true, but it does use 0 to signal success sometimes:
For some system calls and library functions (e.g.,
getpriority(2)), -1 is a valid return on success. In such cases, a successful return can be distinguished from an error return by setting errno to zero before the call, and then, if the call returns a status that indicates that an error may have occurred, checking to see if errno has a nonzero value.
Quoted 7 lines
Quoted 2 lines
Description is already good enough to describe what they are. Can we please drop Linux wording?
But why should we? It's where 22 comes from so this way people are not wondering about the value, and it's somewhat helpful for Linux developers.
I also think we should not mention Linux. I don't think it's mentioned currently in the spec and no good reason to do so now. Also value of 22 is not mandatory for this EINVAL status code. It can be just 1 (the first number after the OK status). Developers should be able to read the specification and find out the meaning of error code.
Quoted 24 lines
Quoted 15 lines
admin.tex \section{Device groups}\label{sec:Basic Facilities of a Virtio Device / Device g · line 129
Quoted 13 lines
+\begin{tabular}{|l|l|l|}
+\hlineadmin.tex +10
-0+Status (decimal) & Name & Description \\ \hline \hline +00 & VIRTIO_ADMIN_STATUS_OK & successful completion \\ +\hline +22 & VIRTIO_ADMIN_STATUS_EINVAL & invalid command \\ +\hline +other & - & group administration command error \\ +\hline +\end{tabular} + +When \field{status} is VIRTIO_ADMIN_STATUS_OK, \field{status_qialifier}s/status_qialifier/status_qualifier
Quoted 5 lines
admin.tex \section{Device groups}\label{sec:Basic Facilities of a Virtio Device / Device g
Quoted 4 lines
admin.tex +4
-0+is reserved and set to zero by the device. + +When \field{status} is VIRTIO_ADMIN_STATUS_EINVAL, the following table +describes possible \field{status_qialifier} values:s/status_qialifier/status_qualifier
Thanks!
Re: [PATCH v10 03/10] admin: introduce group administration commands
Quoted 12 lines · Max Gurtovoy
Quoted 12 lines
For some system calls and library functions (e.g.,
getpriority(2)), -1 is a valid return on success. In such cases, a successful return can be distinguished from an error return by setting errno to zero before the call, and then, if the call returns a status that indicates that an error may have occurred, checking to see if errno has a nonzero value.Quoted 2 lines
Description is already good enough to describe what they are. Can we please drop Linux wording?
Quoted 7 lines
Quoted 4 lines
But why should we? It's where 22 comes from so this way people are not wondering about the value, and it's somewhat helpful for Linux developers.
I also think we should not mention Linux. I don't think it's mentioned currently in the spec and no good reason to do so now.
But we do: fuse, input at least both do.
Quoted 2 lines
Also value of 22 is not mandatory for this EINVAL status code. It can be just 1 (the first number after the OK status).
22 makes it a tiny bit easier for kvm. So why not.
Quoted 2 lines
Developers should be able to read the specification and find out the meaning of error code.
I think the text does that.
Signature · 1 line
MST
[virtio-comment] Re: [PATCH v10 03/10] admin: introduce group administration commands
Quoted 21 lines · Michael S. Tsirkin
Quoted 12 lines · Max Gurtovoy
Quoted 12 lines
For some system calls and library functions (e.g.,
getpriority(2)), -1 is a valid return on success. In such cases, a successful return can be distinguished from an error return by setting errno to zero before the call, and then, if the call returns a status that indicates that an error may have occurred, checking to see if errno has a nonzero value.Quoted 2 lines
Description is already good enough to describe what they are. Can we please drop Linux wording?
Quoted 7 lines
Quoted 4 lines
But why should we? It's where 22 comes from so this way people are not wondering about the value, and it's somewhat helpful for Linux developers.
I also think we should not mention Linux. I don't think it's mentioned currently in the spec and no good reason to do so now.
Quoted 6 lines
But we do: fuse, input at least both do.
Quoted 2 lines
Also value of 22 is not mandatory for this EINVAL status code. It can be just 1 (the first number after the OK status).
22 makes it a tiny bit easier for kvm. So why not.
Because people comment on that in the review :) and because a specification should be OS independent. 22 might be EINVAL in Linux but a success in MyOS is my lucky number is 22.
not a big issue for me, but I prefer to have a cleaner spec than maybe simplify something in a very specific OS.
Quoted 6 lines
Quoted 3 lines
Developers should be able to read the specification and find out the meaning of error code.
I think the text does that.
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/
Re: [virtio-comment] Re: [PATCH v10 03/10] admin: introduce group administration commands
Quoted 27 lines · Max Gurtovoy
Quoted 26 lines · Michael S. Tsirkin
Quoted 12 lines · Max Gurtovoy
Quoted 12 lines
For some system calls and library functions (e.g.,
getpriority(2)), -1 is a valid return on success. In such cases, a successful return can be distinguished from an error return by setting errno to zero before the call, and then, if the call returns a status that indicates that an error may have occurred, checking to see if errno has a nonzero value.Quoted 2 lines
Description is already good enough to describe what they are. Can we please drop Linux wording?
Quoted 7 lines
Quoted 4 lines
But why should we? It's where 22 comes from so this way people are not wondering about the value, and it's somewhat helpful for Linux developers.
I also think we should not mention Linux. I don't think it's mentioned currently in the spec and no good reason to do so now.
But we do: fuse, input at least both do.
Quoted 2 lines
Also value of 22 is not mandatory for this EINVAL status code. It can be just 1 (the first number after the OK status).
Quoted 8 lines
Quoted 1 line
22 makes it a tiny bit easier for kvm. So why not.
Because people comment on that in the review :) and because a specification should be OS independent.
22 might be EINVAL in Linux but a success in MyOS is my lucky number is 22.not a big issue for me, but I prefer to have a cleaner spec than maybe simplify something in a very specific OS.
Well, my take is:
- we have to pick *something*
- using EINVAL == 22 is very convenient for one of the most common (the most common?) implementors
- noting that we're trying to follow what Linux uses makes it clear what to pick for any new return codes
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/
Re: [virtio-comment] Re: [PATCH v10 03/10] admin: introduce group administration commands
Quoted 38 lines · Cornelia Huck
Quoted 27 lines · Max Gurtovoy
Quoted 26 lines · Michael S. Tsirkin
Quoted 12 lines · Max Gurtovoy
Quoted 12 lines
For some system calls and library functions (e.g.,
getpriority(2)), -1 is a valid return on success. In such cases, a successful return can be distinguished from an error return by setting errno to zero before the call, and then, if the call returns a status that indicates that an error may have occurred, checking to see if errno has a nonzero value.Quoted 2 lines
Description is already good enough to describe what they are. Can we please drop Linux wording?
Quoted 7 lines
Quoted 4 lines
But why should we? It's where 22 comes from so this way people are not wondering about the value, and it's somewhat helpful for Linux developers.
I also think we should not mention Linux. I don't think it's mentioned currently in the spec and no good reason to do so now.
But we do: fuse, input at least both do.
Quoted 2 lines
Also value of 22 is not mandatory for this EINVAL status code. It can be just 1 (the first number after the OK status).
Quoted 8 lines
Quoted 1 line
22 makes it a tiny bit easier for kvm. So why not.
Because people comment on that in the review :) and because a specification should be OS independent.
22 might be EINVAL in Linux but a success in MyOS is my lucky number is 22.not a big issue for me, but I prefer to have a cleaner spec than maybe simplify something in a very specific OS.
Quoted 7 lines
Well, my take is:
- we have to pick *something*
- using EINVAL == 22 is very convenient for one of the most common (the most common?) implementors
- noting that we're trying to follow what Linux uses makes it clear what to pick for any new return codes
Can we agree on 22 without mentioning Linux ?
[virtio] Re: [virtio-comment] Re: [PATCH v10 03/10] admin: introduce group administration commands
Quoted 47 lines · Max Gurtovoy
Quoted 38 lines · Cornelia Huck
Quoted 27 lines · Max Gurtovoy
Quoted 26 lines · Michael S. Tsirkin
Quoted 12 lines · Max Gurtovoy
Quoted 12 lines
For some system calls and library functions (e.g.,
getpriority(2)), -1 is a valid return on success. In such cases, a successful return can be distinguished from an error return by setting errno to zero before the call, and then, if the call returns a status that indicates that an error may have occurred, checking to see if errno has a nonzero value.Quoted 2 lines
Description is already good enough to describe what they are. Can we please drop Linux wording?
Quoted 7 lines
Quoted 4 lines
But why should we? It's where 22 comes from so this way people are not wondering about the value, and it's somewhat helpful for Linux developers.
I also think we should not mention Linux. I don't think it's mentioned currently in the spec and no good reason to do so now.
But we do: fuse, input at least both do.
Quoted 2 lines
Also value of 22 is not mandatory for this EINVAL status code. It can be just 1 (the first number after the OK status).
Quoted 8 lines
Quoted 1 line
22 makes it a tiny bit easier for kvm. So why not.
Because people comment on that in the review :) and because a specification should be OS independent.
22 might be EINVAL in Linux but a success in MyOS is my lucky number is 22.not a big issue for me, but I prefer to have a cleaner spec than maybe simplify something in a very specific OS.
Quoted 7 lines
Well, my take is:
- we have to pick *something*
- using EINVAL == 22 is very convenient for one of the most common (the most common?) implementors
- noting that we're trying to follow what Linux uses makes it clear what to pick for any new return codes
Quoted 1 line
Can we agree on 22 without mentioning Linux ?
See my third point above: we want people to be aware why we chose 22, so any new values will match up as well.
---------------------------------------------------------------------
To unsubscribe from this mail list, you must leave the OASIS TC that generates this mail. Follow this link to all your TCs in OASIS at:
https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php
Re: [virtio-comment] Re: [PATCH v10 03/10] admin: introduce group administration commands
Quoted 49 lines · Cornelia Huck
Quoted 47 lines · Max Gurtovoy
Quoted 45 lines · Cornelia Huck
Quoted 27 lines · Max Gurtovoy
Quoted 26 lines · Michael S. Tsirkin
Quoted 12 lines · Max Gurtovoy
Quoted 12 lines
For some system calls and library functions (e.g.,
getpriority(2)), -1 is a valid return on success. In such cases, a successful return can be distinguished from an error return by setting errno to zero before the call, and then, if the call returns a status that indicates that an error may have occurred, checking to see if errno has a nonzero value.Quoted 2 lines
Description is already good enough to describe what they are. Can we please drop Linux wording?
Quoted 7 lines
Quoted 4 lines
But why should we? It's where 22 comes from so this way people are not wondering about the value, and it's somewhat helpful for Linux developers.
I also think we should not mention Linux. I don't think it's mentioned currently in the spec and no good reason to do so now.
But we do: fuse, input at least both do.
Quoted 2 lines
Also value of 22 is not mandatory for this EINVAL status code. It can be just 1 (the first number after the OK status).
Quoted 8 lines
Quoted 1 line
22 makes it a tiny bit easier for kvm. So why not.
Because people comment on that in the review :) and because a specification should be OS independent.
22 might be EINVAL in Linux but a success in MyOS is my lucky number is 22.not a big issue for me, but I prefer to have a cleaner spec than maybe simplify something in a very specific OS.
Well, my take is:
- we have to pick *something*
- using EINVAL == 22 is very convenient for one of the most common (the most common?) implementors
- noting that we're trying to follow what Linux uses makes it clear what to pick for any new return codes
Quoted 4 lines
Quoted 1 line
Can we agree on 22 without mentioning Linux ?
See my third point above: we want people to be aware why we chose 22, so any new values will match up as well.
Why we need people to be aware ?
In NVMe spec for example there are many status codes (~30-50) and people are not aware why the committee choose 0x02 for "Invalid Field in Command". And frankly, I don't think they care.
My point is that we need to make our lives, as spec developers and maintainers, easier.
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/
[virtio] Re: [virtio-comment] Re: [PATCH v10 03/10] admin: introduce group administration commands
Quoted 50 lines · Max Gurtovoy
Quoted 49 lines · Cornelia Huck
Quoted 47 lines · Max Gurtovoy
Quoted 45 lines · Cornelia Huck
Quoted 27 lines · Max Gurtovoy
Quoted 26 lines · Michael S. Tsirkin
Quoted 12 lines · Max Gurtovoy
Quoted 12 lines
For some system calls and library functions (e.g.,
getpriority(2)), -1 is a valid return on success. In such cases, a successful return can be distinguished from an error return by setting errno to zero before the call, and then, if the call returns a status that indicates that an error may have occurred, checking to see if errno has a nonzero value.Quoted 2 lines
Description is already good enough to describe what they are. Can we please drop Linux wording?
Quoted 7 lines
Quoted 4 lines
But why should we? It's where 22 comes from so this way people are not wondering about the value, and it's somewhat helpful for Linux developers.
I also think we should not mention Linux. I don't think it's mentioned currently in the spec and no good reason to do so now.
But we do: fuse, input at least both do.
Quoted 2 lines
Also value of 22 is not mandatory for this EINVAL status code. It can be just 1 (the first number after the OK status).
Quoted 8 lines
Quoted 1 line
22 makes it a tiny bit easier for kvm. So why not.
Because people comment on that in the review :) and because a specification should be OS independent.
22 might be EINVAL in Linux but a success in MyOS is my lucky number is 22.not a big issue for me, but I prefer to have a cleaner spec than maybe simplify something in a very specific OS.
Well, my take is:
- we have to pick *something*
- using EINVAL == 22 is very convenient for one of the most common (the most common?) implementors
- noting that we're trying to follow what Linux uses makes it clear what to pick for any new return codes
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Can we agree on 22 without mentioning Linux ?
See my third point above: we want people to be aware why we chose 22, so any new values will match up as well.
Why we need people to be aware ?
people == people adding new error codes
Quoted 7 lines
In NVMe spec for example there are many status codes (~30-50) and people are not aware why the committee choose
0x02for "Invalid Field in Command". And frankly, I don't think they care.My point is that we need to make our lives, as spec developers and maintainers, easier.
And that's why I think we should keep the proposed wording :) I think it will make the life of Future Me easier.
---------------------------------------------------------------------
To unsubscribe from this mail list, you must leave the OASIS TC that generates this mail. Follow this link to all your TCs in OASIS at:
https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php
Re: [virtio-comment] Re: [PATCH v10 03/10] admin: introduce group administration commands
Quoted 52 lines · Cornelia Huck
Quoted 50 lines · Max Gurtovoy
Quoted 49 lines · Cornelia Huck
Quoted 47 lines · Max Gurtovoy
Quoted 45 lines · Cornelia Huck
Quoted 27 lines · Max Gurtovoy
Quoted 26 lines · Michael S. Tsirkin
Quoted 12 lines · Max Gurtovoy
Quoted 12 lines
For some system calls and library functions (e.g.,
getpriority(2)), -1 is a valid return on success. In such cases, a successful return can be distinguished from an error return by setting errno to zero before the call, and then, if the call returns a status that indicates that an error may have occurred, checking to see if errno has a nonzero value.Quoted 2 lines
Description is already good enough to describe what they are. Can we please drop Linux wording?
Quoted 7 lines
Quoted 4 lines
But why should we? It's where 22 comes from so this way people are not wondering about the value, and it's somewhat helpful for Linux developers.
I also think we should not mention Linux. I don't think it's mentioned currently in the spec and no good reason to do so now.
But we do: fuse, input at least both do.
Quoted 2 lines
Also value of 22 is not mandatory for this EINVAL status code. It can be just 1 (the first number after the OK status).
Quoted 8 lines
Quoted 1 line
22 makes it a tiny bit easier for kvm. So why not.
Because people comment on that in the review :) and because a specification should be OS independent.
22 might be EINVAL in Linux but a success in MyOS is my lucky number is 22.not a big issue for me, but I prefer to have a cleaner spec than maybe simplify something in a very specific OS.
Well, my take is:
- we have to pick *something*
- using EINVAL == 22 is very convenient for one of the most common (the most common?) implementors
- noting that we're trying to follow what Linux uses makes it clear what to pick for any new return codes
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Can we agree on 22 without mentioning Linux ?
See my third point above: we want people to be aware why we chose 22, so any new values will match up as well.
Why we need people to be aware ?
people == people adding new error codes
These people should submit a patch for review and get comments from maintainers.
Quoted 6 lines
Quoted 6 lines
In NVMe spec for example there are many status codes (~30-50) and people are not aware why the committee choose
0x02for "Invalid Field in Command". And frankly, I don't think they care.
Quoted 6 lines
Quoted 2 lines
My point is that we need to make our lives, as spec developers and maintainers, easier.
And that's why I think we should keep the proposed wording :) I think it will make the life of Future Me easier.
I see.
Again, my stand for spec wording is not mentioning Linux and not following it's errnos.
Having said that, I don't really mind ignoring this sentence, although it wasn't part of my original patch.
[virtio] Re: [virtio-comment] Re: [PATCH v10 03/10] admin: introduce group administration commands
In reply to Cornelia HuckQuoted 49 lines · Cornelia Huck
Quoted 47 lines · Max Gurtovoy
Quoted 45 lines · Cornelia Huck
Quoted 27 lines · Max Gurtovoy
Quoted 26 lines · Michael S. Tsirkin
Quoted 12 lines · Max Gurtovoy
Quoted 12 lines
For some system calls and library functions (e.g.,
getpriority(2)), -1 is a valid return on success. In such cases, a successful return can be distinguished from an error return by setting errno to zero before the call, and then, if the call returns a status that indicates that an error may have occurred, checking to see if errno has a nonzero value.Quoted 2 lines
Description is already good enough to describe what they are. Can we please drop Linux wording?
Quoted 7 lines
Quoted 4 lines
But why should we? It's where 22 comes from so this way people are not wondering about the value, and it's somewhat helpful for Linux developers.
I also think we should not mention Linux. I don't think it's mentioned currently in the spec and no good reason to do so now.
But we do: fuse, input at least both do.
Quoted 2 lines
Also value of 22 is not mandatory for this EINVAL status code. It can be just 1 (the first number after the OK status).
Quoted 8 lines
Quoted 1 line
22 makes it a tiny bit easier for kvm. So why not.
Because people comment on that in the review :) and because a specification should be OS independent.
22 might be EINVAL in Linux but a success in MyOS is my lucky number is 22.not a big issue for me, but I prefer to have a cleaner spec than maybe simplify something in a very specific OS.
Well, my take is:
- we have to pick *something*
- using EINVAL == 22 is very convenient for one of the most common (the most common?) implementors
- noting that we're trying to follow what Linux uses makes it clear what to pick for any new return codes
Quoted 4 lines
Quoted 1 line
Can we agree on 22 without mentioning Linux ?
See my third point above: we want people to be aware why we chose 22, so any new values will match up as well.
In fact I think it is a good idea to
1. actually link to where one can see EINVAL=22 so people know where to find more values
2. ask driver to handle any other error same as EINVAL for now - we don't want new feature bits if all we do down the road is add more error codes.
I'll add this in the next version.
Signature · 7 lines
MST --------------------------------------------------------------------- To unsubscribe from this mail list, you must leave the OASIS TC that generates this mail. Follow this link to all your TCs in OASIS at: https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php
[virtio-comment] Re: [virtio] Re: [virtio-comment] Re: [PATCH v10 03/10] admin: introduce group administration commands
Quoted 55 lines · Michael S. Tsirkin
Quoted 49 lines · Cornelia Huck
Quoted 47 lines · Max Gurtovoy
Quoted 45 lines · Cornelia Huck
Quoted 27 lines · Max Gurtovoy
Quoted 26 lines · Michael S. Tsirkin
Quoted 12 lines · Max Gurtovoy
Quoted 12 lines
For some system calls and library functions (e.g.,
getpriority(2)), -1 is a valid return on success. In such cases, a successful return can be distinguished from an error return by setting errno to zero before the call, and then, if the call returns a status that indicates that an error may have occurred, checking to see if errno has a nonzero value.Quoted 2 lines
Description is already good enough to describe what they are. Can we please drop Linux wording?
Quoted 7 lines
Quoted 4 lines
But why should we? It's where 22 comes from so this way people are not wondering about the value, and it's somewhat helpful for Linux developers.
I also think we should not mention Linux. I don't think it's mentioned currently in the spec and no good reason to do so now.
But we do: fuse, input at least both do.
Quoted 2 lines
Also value of 22 is not mandatory for this EINVAL status code. It can be just 1 (the first number after the OK status).
Quoted 8 lines
Quoted 1 line
22 makes it a tiny bit easier for kvm. So why not.
Because people comment on that in the review :) and because a specification should be OS independent.
22 might be EINVAL in Linux but a success in MyOS is my lucky number is 22.not a big issue for me, but I prefer to have a cleaner spec than maybe simplify something in a very specific OS.
Well, my take is:
- we have to pick *something*
- using EINVAL == 22 is very convenient for one of the most common (the most common?) implementors
- noting that we're trying to follow what Linux uses makes it clear what to pick for any new return codesQuoted 4 lines
Quoted 1 line
Can we agree on 22 without mentioning Linux ?
See my third point above: we want people to be aware why we chose 22, so any new values will match up as well.
Quoted 7 lines
In fact I think it is a good idea to
1. actually link to where one can see EINVAL=22 so people know where to find more values
2. ask driver to handle any other error same as EINVAL for now - we don't want new feature bits if all we do down the road is add more error codes.I'll add this in the next version.
Wfm.
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/
RE: [PATCH v10 03/10] admin: introduce group administration commands
In reply to Michael S. TsirkinQuoted 11 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Sunday, February 12, 2023 4:50 AMQuoted 6 lines · Parav Pandit
Quoted 3 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, February 9, 2023 7:14 AM[..]
Quoted 8 lines
Quoted 3 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+Group administration commands can be issued through an owner device +to control member devices of a group.can be issued by the owner device to control ...
Well it's clearly the driver that issues the commands. Don't see how can a device issue them. If instead of "through an owner device" you prefer a more verbose "the driver of an owner device" then I can live with that. Let me know.
"through" wording is convoluted and it hints that someone else is preparing the command and its tunneled through the admin vq. Which is clearly not the scope here.
How about below simple statements like below?
Group administrative commands control the member devices. The driver sends group administrative commands to the owner device.
Quoted 9 lines
Quoted 1 line
General spec structure is describing the "rules" as device and driver side
requirements.
Quoted 1 line
Can you please move above rule paragraph belongs to device and driver
requirements section?
Generally we have a bit of duplication. A high level description showing how things work together. Then per-device/driver conforumance statements. So I think this should stay but I will look at adding conformance clauses too.
Ok. that will be good.
Yes. General description is good without the "rule" wording so that we have clear separation of conformance and description.
Quoted 4 lines
Quoted 4 lines
I am not sure it should be intentional and mention of Linux. Any OS would need multiple error values to know the error cause. Linux doesn't have name "OK" either for well-known value of 0.
Quoted 8 lines
Quoted 6 lines
For example
$ errno 22 EINVAL 22 Invalid argument$ errno 0 This has not output for it and doesn't exist in errno.h.No name OK true, but it does use 0 to signal success sometimes:
Yes, but the wording is "success" and not "ok". :)
Quoted 12 lines
https://man7.org/linux/man-pages/man3/errno.3.html
For some system calls and library functions (e.g.,
getpriority(2)), -1 is a valid return on success. In such cases, a successful return can be distinguished from an error return by setting errno to zero before the call, and then, if the call returns a status that indicates that an error may have occurred, checking to see if errno has a nonzero value.
Quoted 4 lines
Quoted 2 lines
Description is already good enough to describe what they are. Can we please drop Linux wording?
But why should we?
Because of following reasons.
1. If we start putting 22 with Linux annotations, in few weeks virtio Net device section will be full of annotation of ethtool, tc, ip config and more for Linux developers. For example, the current two interrupt moderation patches need to write ethtool options details to match to following this Linux example here. It is better to avoid such things and keep spec OS agnostics, even though it is addressing and fitting into the Linux use cases.
2. Virtio error code to Linux error code switch-case is simple routine to have.
3. Every time virtio spec to refer to errno.h for finding right value is opposite of what spec may want to achieve.
If an error code doesn't match to errno.h, now spec developers and reviewers to review what is not defined by errno.h to find as unique value.
3.1 And if that is taken in future by errno.h for something else?
All of this is not worth a simple switch case statement to deal with.
Re: [PATCH v10 03/10] admin: introduce group administration commands
Quoted 15 lines · Parav Pandit
Quoted 15 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Sunday, February 12, 2023 4:50 AMQuoted 9 lines · Parav Pandit
Quoted 3 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, February 9, 2023 7:14 AM[..]
Review
Quoted 2 lines
(quoted diff) +2
-0+Group administration commands can be issued through an owner device +to control member devices of a group.can be issued by the owner device to control ...
Quoted 7 lines
Quoted 4 lines
Well it's clearly the driver that issues the commands. Don't see how can a device issue them. If instead of "through an owner device" you prefer a more verbose "the driver of an owner device" then I can live with that. Let me know.
"through" wording is convoluted and it hints that someone else is preparing the command and its tunneled through the admin vq. Which is clearly not the scope here.
It is exactly someone else - the driver not the owner itself.
Quoted 6 lines
How about below simple statements like below?
Group administrative commands control the member devices.
The driver sends group administrative commands to the owner device.
The point is that it's the same group though which this misses. I think something like:
The driver sends group administration commands to the owner device of the group to control member devices of the group.
will do the trick.
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
General spec structure is describing the "rules" as device and driver side
requirements.
Quoted 1 line
Can you please move above rule paragraph belongs to device and driver
Quoted 8 lines
Quoted 6 lines
requirements section?
Generally we have a bit of duplication. A high level description showing how things work together. Then per-device/driver conforumance statements. So I think this should stay but I will look at adding conformance clauses too.
Ok. that will be good.
Yes. General description is good without the "rule" wording so that we have clear separation of conformance and description.
OK I will consider replacing "General rule" with "Generally". Not sure why it is better:
conformance uses rfc2119 which does not include any wording about rule
but oh well.
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
I am not sure it should be intentional and mention of Linux. Any OS would need multiple error values to know the error cause. Linux doesn't have name "OK" either for well-known value of 0.
For example
$ errno 22 EINVAL 22 Invalid argument
Quoted 5 lines
Quoted 4 lines
Quoted 2 lines
$ errno 0 This has not output for it and doesn't exist in errno.h.No name OK true, but it does use 0 to signal success sometimes:
Yes, but the wording is "success" and not "ok". :)
Hmm. A but wordy and we have _OK elsewhere in the spec, while Linux does not have either OK ot SUCCESS. Just informal text. Will consider how to make it clearer.
Quoted 22 lines
Quoted 12 lines
https://man7.org/linux/man-pages/man3/errno.3.html
For some system calls and library functions (e.g.,
getpriority(2)), -1 is a valid return on success. In such cases, a successful return can be distinguished from an error return by setting errno to zero before the call, and then, if the call returns a status that indicates that an error may have occurred, checking to see if errno has a nonzero value.Quoted 4 lines
Quoted 2 lines
Description is already good enough to describe what they are. Can we please drop Linux wording?
But why should we?
Because of following reasons.
1. If we start putting 22 with Linux annotations, in few weeks virtio Net device section will be full of annotation of ethtool, tc, ip config and more for Linux developers. For example, the current two interrupt moderation patches need to write ethtool options details to match to following this Linux example here. It is better to avoid such things and keep spec OS agnostics, even though it is addressing and fitting into the Linux use cases.
Quoted 8 lines
2. Virtio error code to Linux error code switch-case is simple routine to have.
3. Every time virtio spec to refer to
errno.hfor finding right value is opposite of what spec may want to achieve.
If an error code doesn't match toerrno.h, now spec developers and reviewers to review what is not defined byerrno.hto find as unique value.3.1 And if that is taken in future by
errno.hfor something else?All of this is not worth a simple switch case statement to deal with.
I think we'll have to agree to disagree here. Years working on virt taught me that matching some existing interface is usually better than coming up with our own. Even if it is a bit more work upfront it pays dividends later. Forcing some discipline in not coming up with outlandish "EFOOBAR" codes no one driver will end up using is a good idea too. And yes we can come up with crazy conventions like 0xdead for success. Does not mean we should.
Signature · 1 line
MST
RE: [PATCH v10 03/10] admin: introduce group administration commands
Quoted 9 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Tuesday, February 14, 2023 2:47 AMQuoted 6 lines
Quoted 5 lines
Well it's clearly the driver that issues the commands. Don't see how can a device issue them. If instead of "through an owner device" you prefer a more verbose "the driver of an owner device" then I can live with that. Let me know.
Quoted 5 lines
Quoted 1 line
"through" wording is convoluted and it hints that someone else is preparing
the command and its tunneled through the admin vq.
Quoted 1 line
Which is clearly not the scope here.
It is exactly someone else - the driver not the owner itself.
I completely lost you.
My understanding is below.
For a PCI PF device, AQ is on the PF (owner device who creates the AQ). PF driver is issuing the AQ command and waiting for the completion to arrive. PF driver decides which AQ to use to issue the command.
This AQ is no different than net cvq, or tx/rx virtqueue.
Only difference is, it carries generic command instead of device type specific command.
In some other use case that we need to write in the cover letter, that this queue may act as a transport for some SIOV or something. Even in such scenario, command is still issued to the AQ by the owner PF driver.
What did I miss?
If none, your below description looks good to me.
Quoted 6 lines
The driver sends group administration commands to the owner device
of
the group to control member devices of the group.will do the trick.
This looks good to me.
Quoted 31 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
I am not sure it should be intentional and mention of Linux. Any OS would need multiple error values to know the error cause. Linux doesn't have name "OK" either for well-known value of 0.
For example
$ errno 22 EINVAL 22 Invalid argumentQuoted 5 lines
Quoted 4 lines
Quoted 2 lines
$ errno 0 This has not output for it and doesn't exist in errno.h.No name OK true, but it does use 0 to signal success sometimes:
Yes, but the wording is "success" and not "ok". :)
Hmm. A but wordy and we have
_OKelsewhere in the spec, while Linux does not have either OK ot SUCCESS. Just informal text.
Will consider how to make it clearer.Quoted 13 lines
Quoted 13 lines
https://man7.org/linux/man-pages/man3/errno.3.html
For some system calls and library functions (e.g.,
getpriority(2)), -1 is a valid return on success. In such cases, a successful return can be distinguished from an error return by setting errno to zero before the call, and then, if the call returns a status that indicates that an error may have occurred, checking to see if errno has a nonzero value.Quoted 2 lines
Description is already good enough to describe what they are. Can we please drop Linux wording?
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
But why should we?
Because of following reasons.
1. If we start putting 22 with Linux annotations, in few weeks virtio Net device
section will be full of annotation of ethtool, tc, ip config and more for Linux developers.
Quoted 1 line
For example, the current two interrupt moderation patches need to write
ethtool options details to match to following this Linux example here.
This cannot be relaxed if errno.h and Linux annotation must be added. And I don't think its correct direction for the spec.
Quoted 10 lines
Quoted 1 line
It is better to avoid such things and keep spec OS agnostics, even though it is
addressing and fitting into the Linux use cases.
Quoted 4 lines
2. Virtio error code to Linux error code switch-case is simple routine to have.
3. Every time virtio spec to refer to
errno.hfor finding right value is oppositeof what spec may want to achieve.
Quoted 1 line
If an error code doesn't match to
errno.h, now spec developers and reviewersto review what is not defined by
errno.hto find as unique value.Quoted 1 line
Quoted 7 lines
Quoted 3 lines
3.1 And if that is taken in future by
errno.hfor something else?All of this is not worth a simple switch case statement to deal with.
I think we'll have to agree to disagree here. Years working on virt taught me that matching some existing interface is usually better than coming up with our own.
With all due respect to your working experience on virt, learning from existing technology, standards, and open-source software is certainly good.
However, it is a not correct to imply that virtio community will make mistake if they do not copy error codes from the errno.h file for AQ.
Quoted 3 lines
Even if it is a bit more work upfront it pays dividends later. Forcing some discipline in not coming up with outlandish "EFOOBAR" codes no one driver will end up using is a good idea too.
Copying GPLv2 errno.h is not the way to enforce that.
Community will review EFOOBAR when/if that appears.
You are implying that a new error code of AQ to be first defined in errno.h. If so, for sure reference needs to refer that like IEEE, PCI spec and more. Doesn't sound right to me.
If virtio is copying GPLv2 errno.h error codes, it must be spelled out in licensing area and generic line as errno.h and not just "Linux". I don't think this is right for virtio spec.
Quoted 2 lines
And yes we can come up with crazy conventions like
0xdeadfor success. Does not mean we should.
That is exactly not the suggestion.
Suggestion is to not to copy GPLv2 definitions to virtio spec.
Avoiding crazy definition can be easily achieved by this community is doing it in OS agnostic manner.
The question is: Can virtio community define error codes by learning from errno.h, netlink errors and by learning from other industry leading specs? I think yes, community members in this email thread can do that without annotating Linux in the spec.
My humble request is, let's spend more time to solidify the AQ on other aspects than copying error codes.
Re: [PATCH v10 03/10] admin: introduce group administration commands
Quoted 22 lines · Parav Pandit
Quoted 9 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Tuesday, February 14, 2023 2:47 AMQuoted 6 lines
Quoted 5 lines
Well it's clearly the driver that issues the commands. Don't see how can a device issue them. If instead of "through an owner device" you prefer a more verbose "the driver of an owner device" then I can live with that. Let me know.
Quoted 5 lines
Quoted 1 line
"through" wording is convoluted and it hints that someone else is preparing
the command and its tunneled through the admin vq.
Quoted 1 line
Which is clearly not the scope here.
It is exactly someone else - the driver not the owner itself.
I completely lost you.
My understanding is below.
For a PCI PF device, AQ is on the PF (owner device who creates the AQ). PF driver is issuing the AQ command and waiting for the completion to arrive. PF driver decides which AQ to use to issue the command.
This AQ is no different than net cvq, or tx/rx virtqueue.
Only difference is, it carries generic command instead of device type specific command.
Quoted 5 lines
In some other use case that we need to write in the cover letter, that this queue may act as a transport for some SIOV or something. Even in such scenario, command is still issued to the AQ by the owner PF driver.
What did I miss?
If none, your below description looks good to me.
none
Quoted 40 lines
Quoted 6 lines
The driver sends group administration commands to the owner device
of
the group to control member devices of the group.will do the trick.
This looks good to me.
Quoted 32 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
I am not sure it should be intentional and mention of Linux. Any OS would need multiple error values to know the error cause. Linux doesn't have name "OK" either for well-known value of 0.
For example
$ errno 22 EINVAL 22 Invalid argumentQuoted 5 lines
Quoted 4 lines
Quoted 2 lines
$ errno 0 This has not output for it and doesn't exist in errno.h.No name OK true, but it does use 0 to signal success sometimes:
Yes, but the wording is "success" and not "ok". :)
Hmm. A but wordy and we have
_OKelsewhere in the spec, while Linux does not have either OK ot SUCCESS. Just informal text.
Will consider how to make it clearer.Quoted 14 lines
Quoted 14 lines
https://man7.org/linux/man-pages/man3/errno.3.html
For some system calls and library functions (e.g.,
getpriority(2)), -1 is a valid return on success. In such cases, a successful return can be distinguished from an error return by setting errno to zero before the call, and then, if the call returns a status that indicates that an error may have occurred, checking to see if errno has a nonzero value.Quoted 2 lines
Description is already good enough to describe what they are. Can we please drop Linux wording?
But why should we?
Quoted 8 lines
Quoted 7 lines
Quoted 3 lines
Because of following reasons.
1. If we start putting 22 with Linux annotations, in few weeks virtio Net device
section will be full of annotation of ethtool, tc, ip config and more for Linux developers.
Quoted 1 line
For example, the current two interrupt moderation patches need to write
ethtool options details to match to following this Linux example here.
This cannot be relaxed if
errno.hand Linux annotation must be added.
I dont really know what does this mean.
Quoted 12 lines
And I don't think its correct direction for the spec.
Quoted 10 lines
Quoted 1 line
It is better to avoid such things and keep spec OS agnostics, even though it is
addressing and fitting into the Linux use cases.
Quoted 4 lines
2. Virtio error code to Linux error code switch-case is simple routine to have.
3. Every time virtio spec to refer to
errno.hfor finding right value is oppositeof what spec may want to achieve.
Quoted 1 line
If an error code doesn't match to
errno.h, now spec developers and reviewersto review what is not defined by
errno.hto find as unique value.Quoted 1 line
Quoted 8 lines
Quoted 7 lines
Quoted 3 lines
3.1 And if that is taken in future by
errno.hfor something else?All of this is not worth a simple switch case statement to deal with.
I think we'll have to agree to disagree here. Years working on virt taught me that matching some existing interface is usually better than coming up with our own.
With all due respect to your working experience on virt, learning from existing technology, standards, and open-source software is certainly good.
Glad we agree on this...
Quoted 1 line
However, it is a not correct to imply that virtio community will make mistake if they do not copy error codes from the
errno.hfile for AQ.
unfortunately you seem not to follow this to the logical conclusion.
Quoted 5 lines
Quoted 3 lines
Even if it is a bit more work upfront it pays dividends later. Forcing some discipline in not coming up with outlandish "EFOOBAR" codes no one driver will end up using is a good idea too.
Copying GPLv2
errno.his not the way to enforce that.
Quoted 7 lines
Community will review EFOOBAR when/if that appears.
You are implying that a new error code of AQ to be first defined inerrno.h. If so, for sure reference needs to refer that like IEEE, PCI spec and more. Doesn't sound right to me.If virtio is copying GPLv2
errno.herror codes, it must be spelled out in licensing area and generic line aserrno.hand not just "Linux". I don't think this is right for virtio spec.
Neither EINVAL nor the value 22 are under GPL in any way.
Quoted 11 lines
Quoted 2 lines
And yes we can come up with crazy conventions like
0xdeadfor success. Does not mean we should.That is exactly not the suggestion.
Suggestion is to not to copy GPLv2 definitions to virtio spec.Avoiding crazy definition can be easily achieved by this community is doing it in OS agnostic manner.
The question is: Can virtio community define error codes by learning from
errno.h, netlink errors and by learning from other industry leading specs? I think yes, community members in this email thread can do that without annotating Linux in the spec.My humble request is, let's spend more time to solidify the AQ on other aspects than copying error codes.
Yea I have no idea why you are wasting your and my time on this either. Repeating the same thing over and over will not make it right. And no we do not need more arguments either.
Signature · 1 line
MST
[virtio-comment] RE: [PATCH v10 03/10] admin: introduce group administration commands
Quoted 6 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Tuesday, February 14, 2023 4:58 PMQuoted 2 lines
Quoted 2 lines
Quoted 2 lines
1. If we start putting 22 with Linux annotations, in few weeks virtio Net device
Quoted 9 lines
Quoted 6 lines
Quoted 5 lines
section will be full of annotation of ethtool, tc, ip config and more for Linux developers.
Quoted 2 lines
For example, the current two interrupt moderation patches need to write
ethtool options details to match to following this Linux example here.
This cannot be relaxed if
errno.hand Linux annotation must be added.I dont really know what does this mean.
It means why should Linux annotation is limited to error codes of AQ.
Why not annotate Linux for other areas of the spec such as ethtool annotation for interrupt moderation.
Quoted 33 lines
Quoted 7 lines
And I don't think its correct direction for the spec.
Quoted 5 lines
Quoted 2 lines
It is better to avoid such things and keep spec OS agnostics, even though it is
addressing and fitting into the Linux use cases.
Quoted 2 lines
2. Virtio error code to Linux error code switch-case is simple routine to
have.
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
3. Every time virtio spec to refer to
errno.hfor finding right value is oppositeof what spec may want to achieve.
Quoted 2 lines
If an error code doesn't match to
errno.h, now spec developers and reviewersto review what is not defined by
errno.hto find as unique value.Quoted 1 line
Quoted 8 lines
Quoted 7 lines
Quoted 3 lines
3.1 And if that is taken in future by
errno.hfor something else?All of this is not worth a simple switch case statement to deal with.
I think we'll have to agree to disagree here. Years working on virt taught me that matching some existing interface is usually better than coming up with our own.
With all due respect to your working experience on virt, learning from existing
technology, standards, and open-source software is certainly good.
Glad we agree on this...
Quoted 1 line
However, it is a not correct to imply that virtio community will make mistake if
they do not copy error codes from the
errno.hfile for AQ.unfortunately you seem not to follow this to the logical conclusion.
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Even if it is a bit more work upfront it pays dividends later.
If virtio is copying GPLv2
errno.herror codes, it must be spelled out inlicensing area and generic line as
errno.hand not just "Linux".Quoted 1 line
I don't think this is right for virtio spec.
Neither EINVAL nor the value 22 are under GPL in any way.
I referred to [1] https://elixir.bootlin.com/linux/latest/source/include/uapi/asm-generic/errno-base.h#L26
And missed the sycall note at start.
Thanks for the clarification.
Quoted 6 lines
Quoted 4 lines
Quoted 3 lines
And yes we can come up with crazy conventions like
0xdeadfor success. Does not mean we should.The question is: Can virtio community define error codes by learning from
errno.h, netlink errors and by learning from other industry leading specs?Quoted 1 line
I think yes, community members in this email thread can do that without
Quoted 8 lines
annotating Linux in the spec.
Quoted 2 lines
My humble request is, let's spend more time to solidify the AQ on other
aspects than copying error codes.
Yea I have no idea why you are wasting your and my time on this either. Repeating the same thing over and over will not make it right. And no we do not need more arguments either.
Not sure what was repeated...
Anyways, if you have so strong preference to use the derivative work of "Linux",
please add the stable link of it the section 1.1 or 1.2 references sections and refer to it in the text. This will make things crystal clear for the source of existing and future error codes.
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/
Re: [PATCH v10 03/10] admin: introduce group administration commands
Quoted 10 lines · Parav Pandit
Quoted 10 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Tuesday, February 14, 2023 4:58 PMQuoted 6 lines
Quoted 6 lines
Quoted 2 lines
1. If we start putting 22 with Linux annotations, in few weeks virtio Net device
section will be full of annotation of ethtool, tc, ip config and more for Linux developers.
Quoted 2 lines
For example, the current two interrupt moderation patches need to write
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
Quoted 1 line
ethtool options details to match to following this Linux example here.
This cannot be relaxed if
errno.hand Linux annotation must be added.I dont really know what does this mean.
It means why should Linux annotation is limited to error codes of AQ.
Why not annotate Linux for other areas of the spec such as ethtool annotation for interrupt moderation.
If it is relevant somehow, bring it in.
Quoted 60 lines
Quoted 33 lines
Quoted 7 lines
And I don't think its correct direction for the spec.
Quoted 5 lines
Quoted 2 lines
It is better to avoid such things and keep spec OS agnostics, even though it is
addressing and fitting into the Linux use cases.
Quoted 2 lines
2. Virtio error code to Linux error code switch-case is simple routine to
have.
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
3. Every time virtio spec to refer to
errno.hfor finding right value is oppositeof what spec may want to achieve.
Quoted 2 lines
If an error code doesn't match to
errno.h, now spec developers and reviewersto review what is not defined by
errno.hto find as unique value.Quoted 1 line
Quoted 8 lines
Quoted 7 lines
Quoted 3 lines
3.1 And if that is taken in future by
errno.hfor something else?All of this is not worth a simple switch case statement to deal with.
I think we'll have to agree to disagree here. Years working on virt taught me that matching some existing interface is usually better than coming up with our own.
With all due respect to your working experience on virt, learning from existing
technology, standards, and open-source software is certainly good.
Glad we agree on this...
Quoted 1 line
However, it is a not correct to imply that virtio community will make mistake if
they do not copy error codes from the
errno.hfile for AQ.unfortunately you seem not to follow this to the logical conclusion.
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Even if it is a bit more work upfront it pays dividends later.
If virtio is copying GPLv2
errno.herror codes, it must be spelled out inlicensing area and generic line as
errno.hand not just "Linux".Quoted 1 line
I don't think this is right for virtio spec.
Neither EINVAL nor the value 22 are under GPL in any way.
I referred to [1] https://elixir.bootlin.com/linux/latest/source/include/uapi/asm-generic/errno-base.h#L26
And missed the sycall note at start.
Thanks for the clarification.Quoted 6 lines
Quoted 4 lines
Quoted 3 lines
And yes we can come up with crazy conventions like
0xdeadfor success. Does not mean we should.The question is: Can virtio community define error codes by learning from
errno.h, netlink errors and by learning from other industry leading specs?Quoted 1 line
I think yes, community members in this email thread can do that without
Quoted 8 lines
annotating Linux in the spec.
Quoted 2 lines
My humble request is, let's spend more time to solidify the AQ on other
aspects than copying error codes.
Yea I have no idea why you are wasting your and my time on this either. Repeating the same thing over and over will not make it right. And no we do not need more arguments either.
Quoted 5 lines
Not sure what was repeated...
Anyways, if you have so strong preference to use the derivative work of "Linux",
please add the stable link of it the section 1.1 or 1.2 references sections and refer to it in the text. This will make things crystal clear for the source of existing and future error codes.
Yea that makes sense.
Signature · 1 line
MST
[virtio-comment] Re: [virtio-dev] [PATCH v10 03/10] admin: introduce group administration commands
In reply to Michael S. TsirkinQuoted 29 lines · Michael S. Tsirkin
This introduces a general structure for group administration commands, used to control device groups through their owner.
Following patches will introduce specific commands and an interface for submitting these commands to the owner.
Signed-off-by Max Gurtovoy <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>--- admin.tex | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+)admin.tex +8
-0@@ -46,4 +46,105 @@ \section{Device groups}\label{sec:Basic Facilities of a Virtio Device / Device g PCI transport (see \ref{sec:Virtio Transport Options / Virtio Over PCI Bus}). \end{description} +\subsection{Group administration commands}\label{sec:Basic Facilities of a Virtio Device / Device groups / Group administration commands} +Group administration commands can be issued through an owner +device to control member devices of a group. This mechanism can +be used, for example, to configure a member device before it is +initialized by its driver. +\footnote{The term "administration" is intended to be interpreted +widely to include any kind of control. See specific commands +for detail.}
admin.tex \section{Device groups}\label{sec:Basic Facilities of a Virtio Device / Device g · line 67
Quoted 10 lines
admin.tex +10
-0+ +All the group administration commands are of the following form: + +\begin{lstlisting} +struct virtio_admin_cmd { + /* Device-readable part */ + le16 opcode; + /* + * 1 - SR-IOV + * 2 - 65535 reserved
This formatting is ambiguous, as a hyphen is used for both ranges and definitions. Perhaps switch to a colon for definitions? Or lose the spaces for the range?
Quoted 83 lines
admin.tex +83
-0+ */ + le16 group_type; + /* unused, reserved for future extensions */ + u8 reserved1[12]; + le64 group_member_id; + u8 command_specific_data[]; + + /* Device-writable part */ + le16 status; + le16 status_qualifier; + /* unused, reserved for future extensions */ + u8 reserved2[4]; + u8 command_specific_result[]; +}; +\end{lstlisting} + +For all commands, \field{opcode}, \field{group_type} and if +necessary \field{group_member_id} and \field{command_specific_data} are +set by the driver, and the owner device sets \field{status} and if +needed \field{status_qualifier} and +\field{command_specific_result}. + +As a rule, any unused device-readable fields are set to zero by the driver +and ignored by the device. Any unused device-writeable fields are set to zero +by the device and ignored by the driver. + +\field{opcode} specifies the command. The valid +values for \field{opcode} can be found in the following table: + +\begin{tabular}{|l|l|} +\hline +opcode & Name & Command Description \\ +\hline \hline +0x0000 - 0x7FFF & - & Group administration commands \\ +\hline +0x8000 - 0xFFFF & - & Reserved \\ +\hline +\end{tabular} + +The \field{group_type} specifies the group type identifier. +The \field{group_member_id} specifies the member identifier within the group. +See section \ref{sec:Introduction / Terminology / Device group} +for the definition of the group type identifier and group member +identifier. + +The following table describes possible \field{status} values; +to simplify common implementations, they are intentionally +matching common Linux names and error numbers: + +\begin{tabular}{|l|l|l|} +\hline +Status (decimal) & Name & Description \\ +\hline \hline +00 & VIRTIO_ADMIN_STATUS_OK & successful completion \\ +\hline +22 & VIRTIO_ADMIN_STATUS_EINVAL & invalid command \\ +\hline +other & - & group administration command error \\ +\hline +\end{tabular} + +When \field{status} is VIRTIO_ADMIN_STATUS_OK, \field{status_qialifier} +is reserved and set to zero by the device. + +When \field{status} is VIRTIO_ADMIN_STATUS_EINVAL, +the following table describes possible \field{status_qialifier} values: +\begin{tabular}{|l|l|l|} +\hline +Status & Name & Description \\ +\hline \hline +0x00 & VIRTIO_ADMIN_STATUS_Q_INVALID_COMMAND & command error: no additional information \\ +\hline +0x01 & VIRTIO_ADMIN_STATUS_Q_INVALID_OPCODE & unsupported or invalid \field{opcode} \\ +\hline +0x02 & VIRTIO_ADMIN_STATUS_Q_INVALID_FIELD & unsupported or invalid field within \field{command_specific_data} \\ +\hline +0x03 & VIRTIO_ADMIN_STATUS_Q_INVALID_GROUP & unsupported or invalid \field{group_type} \\ +\hline +0x04 & VIRTIO_ADMIN_STATUS_Q_INVALID_MEM & unsupported or invalid \field{group_member_id} \\ +\hline +0x05-0xFFFF & - & reserved for future use \\ +\hline +\end{tabular}
Signature · 17 lines
I used to worry, thought I was goin' mad in a hurry. 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/
RE: [PATCH v10 03/10] admin: introduce group administration commands
In reply to Michael S. TsirkinQuoted 5 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, February 9, 2023 7:14 AM+0x04 &
VIRTIO_ADMIN_STATUS_Q_INVALID_MEM& unsupported or invalid \field{group_member_id}
To avoid confusion with memory, better to replace INVALID_MEM to INVALID_MEMBER.
Re: [PATCH v10 03/10] admin: introduce group administration commands
Quoted 6 lines · Parav Pandit
Quoted 5 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, February 9, 2023 7:14 AM+0x04 &
VIRTIO_ADMIN_STATUS_Q_INVALID_MEM& unsupported or invalid \field{group_member_id}To avoid confusion with memory, better to replace
INVALID_MEMtoINVALID_MEMBER.
Good idea.
PATCH v10 4/10 admin: introduce virtio admin virtqueues
In reply to Michael S. TsirkinThe admin virtqueues will be the first interface to issue admin commands.
Currently virtio specification defines control virtqueue to manipulate features and configuration of the device it operates on. However, control virtqueue commands are device type specific, which makes it very difficult to extend for device agnostic commands.
To support this requirement in a more generic way, this patch introduces a new admin virtqueue interface.
We also support more than one admin virtqueue, for QoS and scalability requirements.
--- admin.tex | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++ content.tex | 7 +++-- 2 files changed, 78 insertions(+), 2 deletions(-)
admin.tex +73 -0
@@ -148,3 +148,76 @@ \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti 0x05-0xFFFF & - & reserved for future use \\ \hline \end{tabular} + +\section{Administration Virtqueues}\label{sec:Basic Facilities of a Virtio Device / Administration Virtqueues} + +An administration virtqueue of an owner device is used to submit +group administration commands. An owner device can have more +than one administration virtqueue. + +If VIRTIO_F_ADMIN_VQ has been negotiated, an owner device exposes one +or more adminstration virtqueues. The number and locations of the +administration virtqueues are exposed by the owner device in a transport +specific manner. + +The driver submits commands by queueing them to an arbitrary +administration virtqueue, and they are processed by the +device in the order in which they are queued. It is the +responsibility of the driver to ensure ordering for commands +placed on different administration virtqueues, because they will +be executed with no order constraints. + +Administration virtqueues are used as follows: +\begin{itemize} +\item The driver submits the command using the \field{struct virtio_admin_cmd} +structure using a buffer consisting of two parts: a device-readable one followed by a +device-writable one. +\item the device-readable part includes fields from \field{opcode} +through \field{command_specific_data}. +\item the device-writeable buffer includes fields from \field{status} +through \field{command_specific_result} inclusive. +\end{itemize} + +For each command, this specification describes a distinct +format structure used for \field{command_specific_data} and +\field{command_specific_result}, the length of these fields +depends on the command. + +However, to ensure forward compatibility +\begin{itemize} +\item drivers are allowed to submit buffers that are longer +than what the device expects +(that is, longer than the length of +\field{opcode} through \field{command_specific_data}). +This allows the driver to maintain +a single format structure even if some structure fields are +unused by the device. +\item drivers are allowed to submit buffers that are shorter +than what the device expects +(that is, shorter than the length of \field{status} through +\field{command_specific_result}). This allows the device to maintain +a single format structure even if some structure fields are +unused by the driver. +\end{itemize} + +The device compares the length of each part (device-readable and +device-writeable) of the buffer as submitted by driver to what it +expects and then silently truncates the structures to either the +length submitted by the driver, or the length described in this +specification, whichever is shorter. The device silently ignores +any data falling outside the shorter of the two lengths. Any +missing fields are interpreted as set to zero. + +Similarly, the driver compares the used buffer length +of the buffer to what it expects and then silently +truncates the structure to the used buffer length. +The driver silently ignores any data falling outside +the used buffer length reported by the device. Any missing +fields are interpreted as set to zero. + +This simplifies driver and device implementations since the +driver/device can simply maintain a single large structure (such +as a C structure) for a command and its result. As new versions +of the specification are designed, new fields can be added to the +tail of a structure, with the driver/device using the full +structure without concern for versioning.
content.tex +5 -2
@@ -99,10 +99,10 @@ \section{Feature Bits}\label{sec:Basic Facilities of a Virtio Device / Feature B \begin{description} \item[0 to 23, and 50 to 127] Feature bits for the specific device type -\item[24 to 40] Feature bits reserved for extensions to the queue and +\item[24 to 41] Feature bits reserved for extensions to the queue and feature negotiation mechanisms -\item[41 to 49, and 128 and above] Feature bits reserved for future extensions. +\item[42 to 49, and 128 and above] Feature bits reserved for future extensions. \end{description} \begin{note}
@@ -7682,6 +7682,9 @@ \chapter{Reserved Feature Bits}\label{sec:Reserved Feature Bits} that the driver can reset a queue individually. See \ref{sec:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Reset}. + \item[VIRTIO_F_ADMIN_VQ(41)] This feature indicates that the device exposes one or more + administration virtqueues. + \end{description} \drivernormative{\section}{Reserved Feature Bits}{Reserved Feature Bits}
Signature · 1 line
MST
RE: [PATCH v10 04/10] admin: introduce virtio admin virtqueues
Review
Quoted 5 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, February 9, 2023 7:14 AM(quoted diff) +2
-0+ +If VIRTIO_F_ADMIN_VQ has been negotiated, an owner device exposes one
An owner device supports one or more..
admin.tex \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti · line 163
Quoted 5 lines
admin.tex +5
-0+or more adminstration virtqueues. The number and locations of the +administration virtqueues are exposed by the owner device in a +transport specific manner. + +The driver submits commands by queueing them to an arbitrary
Do you prefer 'driver adds commands' instead of two verbs of 'submitting' and 'queueuing', like we discussed in other thread for enqueuing/post vs add?
I prefer the driver enqueues command and device process them in order.
Review
Quoted 3 lines
(quoted diff) +3
-0+administration virtqueue, and they are processed by the device in the +order in which they are queued. It is the responsibility of the driver +to ensure ordering for commands placed on different administration
ordering of commands reads better than ordering for commands to me.
admin.tex \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti · line 170
Quoted 3 lines
admin.tex +3
-0+virtqueues, because they will be executed with no order constraints. + +Administration virtqueues are used as follows:
Does it have to be plural to describe an operation?
Quoted 33 lines
+\begin{itemize}
+\item The driver submits the command using the \field{struct(quoted diff) +31
-0+virtio_admin_cmd} structure using a buffer consisting of two parts: a +device-readable one followed by a device-writable one. +\item the device-readable part includes fields from \field{opcode} +through \field{command_specific_data}. +\item the device-writeable buffer includes fields from \field{status} +through \field{command_specific_result} inclusive. +\end{itemize} + +For each command, this specification describes a distinct format +structure used for \field{command_specific_data} and +\field{command_specific_result}, the length of these fields depends on +the command. + +However, to ensure forward compatibility \begin{itemize} \item drivers +are allowed to submit buffers that are longer than what the device +expects (that is, longer than the length of \field{opcode} through +\field{command_specific_data}). +This allows the driver to maintain +a single format structure even if some structure fields are unused by +the device. +\item drivers are allowed to submit buffers that are shorter than what +the device expects (that is, shorter than the length of \field{status} +through \field{command_specific_result}). This allows the device to +maintain a single format structure even if some structure fields are +unused by the driver. +\end{itemize} + +The device compares the length of each part (device-readable and +device-writeable) of the buffer as submitted by driver to what it +expects and then silently truncates the structures to either the length +submitted by the driver, or the length described in this specification,
Review
Quoted 10 lines
(quoted diff) +10
-0+whichever is shorter. The device silently ignores any data falling +outside the shorter of the two lengths. Any missing fields are +interpreted as set to zero. + +Similarly, the driver compares the used buffer length of the buffer to +what it expects and then silently truncates the structure to the used +buffer length. +The driver silently ignores any data falling outside the used buffer +length reported by the device. Any missing fields are interpreted as +set to zero.
Above buffer size description is very well written. I don't remember this in earlier version. May be was there. Thanks.
PATCH v10 5/10 pci: add admin vq registers to virtio over pci
In reply to Michael S. TsirkinAdd new registers to the PCI common configuration structure.
These registers will be used for querying the indices of the admin virtqueues of the owner device. To configure, reset or enable the admin virtqueues, the driver should follow existing queue configuration/setup sequence.
--- content.tex | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)
content.tex +34 -0
@@ -946,6 +946,10 @@ \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport le64 queue_device; /* read-write */ le16 queue_notify_data; /* read-only for driver */ le16 queue_reset; /* read-write */ + + /* About the administration virtqueue. */ + le16 admin_queue_index; /* read-only for driver */ + le16 admin_queue_num; /* read-only for driver */ }; \end{lstlisting}
@@ -1031,6 +1035,19 @@ \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport This field exists only if VIRTIO_F_RING_RESET has been negotiated. (see \ref{sec:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Reset}). +\item[\field{admin_queue_index}] + The device uses this to report the index of the first administration virtqueue. + This field is valid only if VIRTIO_F_ADMIN_VQ has been negotiated. +\item[\field{admin_queue_num}] + The device uses this to report the number of the + supported administration virtqueues. Virtqueues with index + between \field{admin_queue_index} and (\field{admin_queue_index} + + \field{admin_queue_num}) inclusive serve as administration + virtqueues. + Thus the number of administration virtqueues equals + (\field{admin_queue_num} + 1). + This field is valid only if VIRTIO_F_ADMIN_VQ has been + negotiated. \end{description} \devicenormative{\paragraph}{Common configuration structure layout}{Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / Common configuration structure layout}
@@ -1117,6 +1134,14 @@ \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport were used before the queue reset. (see \ref{sec:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Reset}). +If VIRTIO_F_ADMIN_VQ has been negotiated, and if the driver +configures any administration virtqueues, the driver MUST +configure the administration virtqueues using the index +in the range \field{admin_queue_index} to +\field{admin_queue_index} + \field{admin_queue_num} inclusive. +The driver MAY configure less administration virtqueues than +supported by the device. + \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / Notification capability} The notification location is found using the VIRTIO_PCI_CAP_NOTIFY_CFG
@@ -7684,6 +7709,15 @@ \chapter{Reserved Feature Bits}\label{sec:Reserved Feature Bits} \item[VIRTIO_F_ADMIN_VQ(41)] This feature indicates that the device exposes one or more administration virtqueues. + At the moment this feature is only supported for devices using + \ref{sec:Virtio Transport Options / Virtio Over PCI + Bus}~\nameref{sec:Virtio Transport Options / Virtio Over PCI Bus} + as the transport and is reserved for future use for + devices using other transports (see + \ref{drivernormative:Basic Facilities of a Virtio Device / Feature Bits} + and + \ref{devicenormative:Basic Facilities of a Virtio Device / Feature Bits} for + handling features reserved for future use. \end{description}
Signature · 1 line
MST
RE: [PATCH v10 05/10] pci: add admin vq registers to virtio over pci
Quoted 29 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, February 9, 2023 7:14 AMcontent.tex +0
-0@@ -946,6 +946,10 @@ \subsubsection{Common configuration structurelayout}\label{sec:Virtio Transport
le64 queue_device; /* read-write */ le16 queue_notify_data; /* read-only for driver */ le16 queue_reset; /* read-write */content.tex +4
-0+ + /* About the administration virtqueue. */ + le16 admin_queue_index; /* read-only for driver */ + le16 admin_queue_num; /* read-only for driver */ }; \end{lstlisting}@@ -1031,6 +1035,19 @@ \subsubsection{Common configuration structurelayout}\label{sec:Virtio Transport
This field exists only ifVIRTIO_F_RING_RESEThas been negotiated. (see \ref{sec:Basic Facilities of a Virtio Device / Virtqueues /
Virtqueue Reset}).+\item[\field{admin_queue_index}]
+ The device uses this to report the index of the first administration
virtqueue.
content.tex \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport
Quoted 4 lines
content.tex +4
-0+ This field is valid only if VIRTIO_F_ADMIN_VQ has been negotiated. +\item[\field{admin_queue_num}] + The device uses this to report the number of the + supported administration virtqueues.
admin_queue_count reads more intuitive to me to indicate how many aqs.
It may be even simpler to have start and end vq numbers rather than complication of index + inclusive sum of number.
Quoted 49 lines
Virtqueues with index
content.tex +7
-0+ between \field{admin_queue_index} and (\field{admin_queue_index} + + \field{admin_queue_num}) inclusive serve as administration + virtqueues. + Thus the number of administration virtqueues equals + (\field{admin_queue_num} + 1). + This field is valid only if VIRTIO_F_ADMIN_VQ has been + negotiated. \end{description} \devicenormative{\paragraph}{Common configuration structure layout}{VirtioTransport Options / Virtio Over PCI Bus / PCI Device Layout / Common configuration structure layout} @@ -1117,6 +1134,14 @@ \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport were used before the queue reset.
(see \ref{sec:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Reset}).content.tex +8
-0+If VIRTIO_F_ADMIN_VQ has been negotiated, and if the driver configures +any administration virtqueues, the driver MUST configure the +administration virtqueues using the index in the range +\field{admin_queue_index} to \field{admin_queue_index} + +\field{admin_queue_num} inclusive. +The driver MAY configure less administration virtqueues than supported +by the device. + \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options/ Virtio Over PCI Bus / PCI Device Layout / Notification capability}
The notification location is found using the
VIRTIO_PCI_CAP_NOTIFY_CFG@@
-7684,6 +7709,15 @@ \chapter{Reserved Feature Bits}\label{sec:Reserved Feature Bits}\item[VIRTIO_F_ADMIN_VQ(41)] This feature indicates that the device
exposes one or more
administration virtqueues.content.tex +8
-0+ At the moment this feature is only supported for devices using + \ref{sec:Virtio Transport Options / Virtio Over PCI + Bus}~\nameref{sec:Virtio Transport Options / Virtio Over PCI Bus} + as the transport and is reserved for future use for + devices using other transports (see + \ref{drivernormative:Basic Facilities of a Virtio Device / Feature Bits} + and + \ref{devicenormative:Basic Facilities of a Virtio Device / Feature Bits}for
content.tex +1
-1+ handling features reserved for future use. \end{description} --
Quoted 1 line
MST
Re: [virtio-comment] [PATCH v10 05/10] pci: add admin vq registers to virtio over pci
In reply to Michael S. TsirkinQuoted 5 lines · Michael S. Tsirkin
content.tex +1
-0@@ -1031,6 +1035,19 @@ \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport This field exists only if VIRTIO_F_RING_RESET has been negotiated. (see \ref{sec:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Reset}). +\item[\field{admin_queue_index}]
content.tex \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport · line 1048
Quoted 10 lines
content.tex +10
-0+ The device uses this to report the index of the first administration virtqueue. + This field is valid only if VIRTIO_F_ADMIN_VQ has been negotiated. +\item[\field{admin_queue_num}] + The device uses this to report the number of the + supported administration virtqueues. Virtqueues with index + between \field{admin_queue_index} and (\field{admin_queue_index} + + \field{admin_queue_num}) inclusive serve as administration + virtqueues. + Thus the number of administration virtqueues equals + (\field{admin_queue_num} + 1).
Really the number of queues is "admin_queue_num + 1"?
That seems ... odd.
Quoted 35 lines
content.tex +19
-0+ This field is valid only if VIRTIO_F_ADMIN_VQ has been + negotiated. \end{description} \devicenormative{\paragraph}{Common configuration structure layout}{Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / Common configuration structure layout}@@ -1117,6 +1134,14 @@ \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport were used before the queue reset. (see \ref{sec:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Reset}). +If VIRTIO_F_ADMIN_VQ has been negotiated, and if the driver +configures any administration virtqueues, the driver MUST +configure the administration virtqueues using the index +in the range \field{admin_queue_index} to +\field{admin_queue_index} + \field{admin_queue_num} inclusive. +The driver MAY configure less administration virtqueues than +supported by the device. + \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / Notification capability} The notification location is found using the VIRTIO_PCI_CAP_NOTIFY_CFG@@ -7684,6 +7709,15 @@ \chapter{Reserved Feature Bits}\label{sec:Reserved Feature Bits} \item[VIRTIO_F_ADMIN_VQ(41)] This feature indicates that the device exposes one or more administration virtqueues. + At the moment this feature is only supported for devices using + \ref{sec:Virtio Transport Options / Virtio Over PCI + Bus}~\nameref{sec:Virtio Transport Options / Virtio Over PCI Bus} + as the transport and is reserved for future use for + devices using other transports (see + \ref{drivernormative:Basic Facilities of a Virtio Device / Feature Bits} + and + \ref{devicenormative:Basic Facilities of a Virtio Device / Feature Bits} for + handling features reserved for future use. \end{description}
Signature · 1 line
She's got no name, but she is family.
Re: [virtio-comment] [PATCH v10 05/10] pci: add admin vq registers to virtio over pci
Quoted 20 lines · David Edmondson
Quoted 5 lines · Michael S. Tsirkin
content.tex +1
-0@@ -1031,6 +1035,19 @@ \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport This field exists only if VIRTIO_F_RING_RESET has been negotiated. (see \ref{sec:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Reset}). +\item[\field{admin_queue_index}]content.tex \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport · line 1048
Quoted 10 lines
content.tex +10
-0+ The device uses this to report the index of the first administration virtqueue. + This field is valid only if VIRTIO_F_ADMIN_VQ has been negotiated. +\item[\field{admin_queue_num}] + The device uses this to report the number of the + supported administration virtqueues. Virtqueues with index + between \field{admin_queue_index} and (\field{admin_queue_index} + + \field{admin_queue_num}) inclusive serve as administration + virtqueues. + Thus the number of administration virtqueues equals + (\field{admin_queue_num} + 1).Really the number of queues is "
admin_queue_num+ 1"?
Quoted 1 line
That seems ... odd.
It's not odd if we'll mention that this is a zero based value. MST, can you add it please for the next version ?
Quoted 36 lines
Quoted 36 lines
content.tex +19
-0+ This field is valid only if VIRTIO_F_ADMIN_VQ has been + negotiated. \end{description} \devicenormative{\paragraph}{Common configuration structure layout}{Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / Common configuration structure layout}@@ -1117,6 +1134,14 @@ \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport were used before the queue reset. (see \ref{sec:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Reset}). +If VIRTIO_F_ADMIN_VQ has been negotiated, and if the driver +configures any administration virtqueues, the driver MUST +configure the administration virtqueues using the index +in the range \field{admin_queue_index} to +\field{admin_queue_index} + \field{admin_queue_num} inclusive. +The driver MAY configure less administration virtqueues than +supported by the device. + \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / Notification capability} The notification location is found using the VIRTIO_PCI_CAP_NOTIFY_CFG@@ -7684,6 +7709,15 @@ \chapter{Reserved Feature Bits}\label{sec:Reserved Feature Bits} \item[VIRTIO_F_ADMIN_VQ(41)] This feature indicates that the device exposes one or more administration virtqueues. + At the moment this feature is only supported for devices using + \ref{sec:Virtio Transport Options / Virtio Over PCI + Bus}~\nameref{sec:Virtio Transport Options / Virtio Over PCI Bus} + as the transport and is reserved for future use for + devices using other transports (see + \ref{drivernormative:Basic Facilities of a Virtio Device / Feature Bits} + and + \ref{devicenormative:Basic Facilities of a Virtio Device / Feature Bits} for + handling features reserved for future use. \end{description}
Re: [virtio-comment] [PATCH v10 05/10] pci: add admin vq registers to virtio over pci
Quoted 22 lines · Max Gurtovoy
Quoted 19 lines · David Edmondson
Quoted 4 lines · Michael S. Tsirkin
content.tex +1
-0@@ -1031,6 +1035,19 @@ \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport This field exists only if VIRTIO_F_RING_RESET has been negotiated. (see \ref{sec:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Reset}). +\item[\field{admin_queue_index}]content.tex \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport · line 1047
Quoted 10 lines
content.tex +10
-0+ The device uses this to report the index of the first administration virtqueue. + This field is valid only if VIRTIO_F_ADMIN_VQ has been negotiated. +\item[\field{admin_queue_num}] + The device uses this to report the number of the + supported administration virtqueues. Virtqueues with index + between \field{admin_queue_index} and (\field{admin_queue_index} + + \field{admin_queue_num}) inclusive serve as administration + virtqueues. + Thus the number of administration virtqueues equals + (\field{admin_queue_num} + 1).Really the number of queues is "
admin_queue_num+ 1"?
Quoted 4 lines
Quoted 1 line
That seems ... odd.
It's not odd if we'll mention that this is a zero based value. MST, can you add it please for the next version ?
OK I can.
Quoted 32 lines
Quoted 32 lines
Quoted 32 lines
content.tex +19
-0+ This field is valid only if VIRTIO_F_ADMIN_VQ has been + negotiated. \end{description} \devicenormative{\paragraph}{Common configuration structure layout}{Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / Common configuration structure layout}@@ -1117,6 +1134,14 @@ \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport were used before the queue reset. (see \ref{sec:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Reset}). +If VIRTIO_F_ADMIN_VQ has been negotiated, and if the driver +configures any administration virtqueues, the driver MUST +configure the administration virtqueues using the index +in the range \field{admin_queue_index} to +\field{admin_queue_index} + \field{admin_queue_num} inclusive. +The driver MAY configure less administration virtqueues than +supported by the device. + \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / Notification capability} The notification location is found using the VIRTIO_PCI_CAP_NOTIFY_CFG@@ -7684,6 +7709,15 @@ \chapter{Reserved Feature Bits}\label{sec:Reserved Feature Bits} \item[VIRTIO_F_ADMIN_VQ(41)] This feature indicates that the device exposes one or more administration virtqueues. + At the moment this feature is only supported for devices using + \ref{sec:Virtio Transport Options / Virtio Over PCI + Bus}~\nameref{sec:Virtio Transport Options / Virtio Over PCI Bus} + as the transport and is reserved for future use for + devices using other transports (see + \ref{drivernormative:Basic Facilities of a Virtio Device / Feature Bits} + and + \ref{devicenormative:Basic Facilities of a Virtio Device / Feature Bits} for + handling features reserved for future use. \end{description}
Re: [virtio-comment] [PATCH v10 05/10] pci: add admin vq registers to virtio over pci
In reply to Max GurtovoyQuoted 19 lines · Max Gurtovoy
Quoted 17 lines · David Edmondson
Quoted 4 lines · Michael S. Tsirkin
content.tex +0
-0@@ -1031,6 +1035,19 @@ \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport This field exists only if VIRTIO_F_RING_RESET has been negotiated. (see \ref{sec:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Reset}). +\item[\field{admin_queue_index}]content.tex \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport · line 1047
Quoted 10 lines
content.tex +10
-0+ The device uses this to report the index of the first administration virtqueue. + This field is valid only if VIRTIO_F_ADMIN_VQ has been negotiated. +\item[\field{admin_queue_num}] + The device uses this to report the number of the + supported administration virtqueues. Virtqueues with index + between \field{admin_queue_index} and (\field{admin_queue_index} + + \field{admin_queue_num}) inclusive serve as administration + virtqueues. + Thus the number of administration virtqueues equals + (\field{admin_queue_num} + 1).Really the number of queues is "
admin_queue_num+ 1"? That seems ... odd.
Quoted 2 lines
It's not odd if we'll mention that this is a zero based value. MST, can you add it please for the next version ?
The field is called ...num, which makes it seem like a count of things, when in reality it's the highest index. Perhaps the name could more accurately reflect the intent?
Quoted 36 lines
Quoted 36 lines
Quoted 36 lines
content.tex +2
-0+ This field is valid only if VIRTIO_F_ADMIN_VQ has been + negotiated. \end{description} \devicenormative{\paragraph}{Common configuration structurelayout}{Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / Common configuration structure layout}
content.tex +7
-0@@ -1117,6 +1134,14 @@ \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport were used before the queue reset. (see \ref{sec:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Reset}). +If VIRTIO_F_ADMIN_VQ has been negotiated, and if the driver +configures any administration virtqueues, the driver MUST +configure the administration virtqueues using the index +in the range \field{admin_queue_index} to +\field{admin_queue_index} + \field{admin_queue_num} inclusive. +The driver MAY configure less administration virtqueues than +supported by the device. + \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / Notification capability} The notification location is found using the
VIRTIO_PCI_CAP_NOTIFY_CFG(quoted diff) +0
-0@@ -7684,6 +7709,15 @@ \chapter{Reserved Feature Bits}\label{sec:Reserved Feature Bits} \item[VIRTIO_F_ADMIN_VQ(41)] This feature indicates that thedevice exposes one or more
administration virtqueues.content.tex +9
-0+ At the moment this feature is only supported for devices using + \ref{sec:Virtio Transport Options / Virtio Over PCI + Bus}~\nameref{sec:Virtio Transport Options / Virtio Over PCI Bus} + as the transport and is reserved for future use for + devices using other transports (see + \ref{drivernormative:Basic Facilities of a Virtio Device / Feature Bits} + and + \ref{devicenormative:Basic Facilities of a Virtio Device / Feature Bits} for + handling features reserved for future use. \end{description}
Signature · 1 line
Stop the music and go home.
PATCH v10 6/10 mmio: document ADMIN_VQ as reserved
In reply to Michael S. TsirkinAdding relevant registers needs more work and it's not clear what the use-case will be as currently only the PCI transport is supported. But let's keep the door open on this.
We already say it's reserved in a central place, but it does not hurt to remind implementers to mask it.
--- content.tex | 12 ++++++++++++ 1 file changed, 12 insertions(+)
content.tex +12 -0
@@ -2362,6 +2362,18 @@ \subsection{Legacy interface}\label{sec:Virtio Transport Options / Virtio Over M Notification mechanisms did not change. +\subsection{Features reserved for future use}\label{sec:Virtio Transport Options / Virtio Over MMIO / Features reserved for future use} + +At this time, devices and drivers utilizing Virtio Over MMIO +do not support the following features: +\begin{itemize} + +\item VIRTIO_F_ADMIN_VQ + +\end{itemize} + +These features are reserved for future use. + \section{Virtio Over Channel I/O}\label{sec:Virtio Transport Options / Virtio Over Channel I/O} S/390 based virtual machines support neither PCI nor MMIO, so a
Signature · 1 line
MST
RE: [PATCH v10 06/10] mmio: document ADMIN_VQ as reserved
Quoted 41 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, February 9, 2023 7:14 AMAdding relevant registers needs more work and it's not clear what the use-case will be as currently only the PCI transport is supported. But let's keep the door open on this.
We already say it's reserved in a central place, but it does not hurt to remind implementers to mask it.Signed-off-by Michael S. Tsirkin <[email protected]>--- content.tex | 12 ++++++++++++ 1 file changed, 12 insertions(+)content.tex +0
-0@@ -2362,6 +2362,18 @@ \subsection{Legacy interface}\label{sec:VirtioTransport Options / Virtio Over M
Notification mechanisms did not change.
+\subsection{Features reserved for future use}\label{sec:Virtio
content.tex +13
-0+Transport Options / Virtio Over MMIO / Features reserved for future +use} + +At this time, devices and drivers utilizing Virtio Over MMIO do not +support the following features: +\begin{itemize} + +\item VIRTIO_F_ADMIN_VQ + +\end{itemize} + +These features are reserved for future use. + \section{Virtio Over Channel I/O}\label{sec:Virtio Transport Options / VirtioOver Channel I/O}
Quoted 3 lines
S/390 based virtual machines support neither PCI nor MMIO, so a
--
MST
Re: [PATCH v10 06/10] mmio: document ADMIN_VQ as reserved
In reply to Michael S. TsirkinQuoted 17 lines · Michael S. Tsirkin
Adding relevant registers needs more work and it's not clear what the use-case will be as currently only the PCI transport is supported. But let's keep the door open on this.
We already say it's reserved in a central place, but it does not hurt to remind implementers to mask it.Signed-off-by Michael S. Tsirkin <[email protected]>--- content.tex | 12 ++++++++++++ 1 file changed, 12 insertions(+)content.tex +0
-0
content.tex \subsection{Legacy interface}\label{sec:Virtio Transport Options / Virtio Over M · line 2371
Quoted 10 lines
content.tex +7
-0@@ -2362,6 +2362,18 @@ \subsection{Legacy interface}\label{sec:Virtio Transport Options / Virtio Over M Notification mechanisms did not change. +\subsection{Features reserved for future use}\label{sec:Virtio Transport Options / Virtio Over MMIO / Features reserved for future use} + +At this time, devices and drivers utilizing Virtio Over MMIO +do not support the following features: +\begin{itemize} + +\item VIRTIO_F_ADMIN_VQ
only ADMIN_VQ is not supported ?
What about SR-IOV :) ?
Quoted 8 lines
content.tex +5
-0+ +\end{itemize} + +These features are reserved for future use. + \section{Virtio Over Channel I/O}\label{sec:Virtio Transport Options / Virtio Over Channel I/O} S/390 based virtual machines support neither PCI nor MMIO, so a
PATCH v10 7/10 ccw: document ADMIN_VQ as reserved
In reply to Michael S. TsirkinAdding relevant registers needs more work and it's not clear what the use-case will be as currently only the PCI transport is supported. But let's keep the door open on this.
We already say it's reserved in a central place, but it does not hurt to remind implementers to mask it.
Note: there are more features to add to this list. Will be done later with a patch on top.
--- content.tex | 12 ++++++++++++ 1 file changed, 12 insertions(+)
content.tex +12 -0
@@ -2976,6 +2976,18 @@ \subsubsection{Resetting Devices}\label{sec:Virtio Transport Options / Virtio ov MAY also choose to verify reset completion by reading \field{device status} via CCW_CMD_READ_STATUS and checking whether it is 0 afterwards. +\subsection{Features reserved for future use}\label{sec:Virtio Transport Options / Virtio over channel I/O / Features reserved for future use} + +At this time, devices and drivers utilizing Virtio over channel I/O +do not support the following features: +\begin{itemize} + +\item VIRTIO_F_ADMIN_VQ + +\end{itemize} + +These features are reserved for future use. + \chapter{Device Types}\label{sec:Device Types} On top of the queues, config space and feature negotiation facilities
Signature · 1 line
MST
[virtio-comment] Re: [PATCH v10 07/10] ccw: document ADMIN_VQ as reserved
Quoted 7 lines · Michael S. Tsirkin
Adding relevant registers needs more work and it's not clear what the use-case will be as currently only the PCI transport is supported. But let's keep the door open on this.
We already say it's reserved in a central place, but it does not hurt to remind implementers to mask it.
Quoted 7 lines
Note: there are more features to add to this list. Will be done later with a patch on top.
Signed-off-by Michael S. Tsirkin <[email protected]>--- content.tex | 12 ++++++++++++ 1 file changed, 12 insertions(+)
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/
Re: [PATCH v10 07/10] ccw: document ADMIN_VQ as reserved
In reply to Michael S. TsirkinQuoted 20 lines · Michael S. Tsirkin
Adding relevant registers needs more work and it's not clear what the use-case will be as currently only the PCI transport is supported. But let's keep the door open on this.
We already say it's reserved in a central place, but it does not hurt to remind implementers to mask it.Note: there are more features to add to this list. Will be done later with a patch on top.
Signed-off-by Michael S. Tsirkin <[email protected]>--- content.tex | 12 ++++++++++++ 1 file changed, 12 insertions(+)content.tex +0
-0
content.tex \subsubsection{Resetting Devices}\label{sec:Virtio Transport Options / Virtio ov · line 2985
Quoted 10 lines
content.tex +7
-0@@ -2976,6 +2976,18 @@ \subsubsection{Resetting Devices}\label{sec:Virtio Transport Options / Virtio ov MAY also choose to verify reset completion by reading \field{device status} via CCW_CMD_READ_STATUS and checking whether it is 0 afterwards. +\subsection{Features reserved for future use}\label{sec:Virtio Transport Options / Virtio over channel I/O / Features reserved for future use} + +At this time, devices and drivers utilizing Virtio over channel I/O +do not support the following features: +\begin{itemize} + +\item VIRTIO_F_ADMIN_VQ
same as in previous patch: what about missing support for SR-IOV feature ?
Quoted 8 lines
content.tex +5
-0+ +\end{itemize} + +These features are reserved for future use. + \chapter{Device Types}\label{sec:Device Types} On top of the queues, config space and feature negotiation facilities
PATCH v10 8/10 admin: command list discovery
In reply to Michael S. TsirkinAdd commands to find out which commands does each group support, as well as enable their use by driver.
This will be especially useful once we have multiple group types.
An alternative is per-type VQs. This is possible but will require more per-transport work. Discovery through the vq helps keep things contained.
--- admin.tex | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 89 insertions(+), 1 deletion(-)
admin.tex +89 -1
@@ -98,7 +98,9 @@ \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti \hline opcode & Name & Command Description \\ \hline \hline -0x0000 - 0x7FFF & - & Group administration commands \\ +0x0000 & VIRTIO_ADMIN_CMD_LIST_QUERY & Provides to driver list of commands supported for this group type \\ +0x0001 & VIRTIO_ADMIN_CMD_LIST_USE & Provides to device list of commands used for this group type \\ +0x0002 - 0x7FFF & - & Group administration commands \\ \hline 0x8000 - 0xFFFF & - & Reserved \\ \hline
@@ -149,6 +151,92 @@ \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti \hline \end{tabular} +Before sending any administration commands to the device, the driver +needs to communicate to the device which commands it is going to +use. Initially (after reset), only two commands are assumed to be used: +VIRTIO_ADMIN_CMD_LIST_QUERY and VIRTIO_ADMIN_CMD_LIST_USE. + +Before sending any other commands for any member of a specific group to +the device, the driver queries the supported commands via +VIRTIO_ADMIN_CMD_LIST_QUERY and sends the commands it will use via +VIRTIO_ADMIN_CMD_LIST_USE. + +Commands VIRTIO_ADMIN_CMD_LIST_QUERY and +VIRTIO_ADMIN_CMD_LIST_USE +both use the following structure describing the +command opcodes: + +\begin{lstlisting} +struct virtio_admin_cmd_list { + /* Indicates which of the below fields were returned + le64 device_admin_cmds[]; +}; +\end{lstlisting} + +This structure is an array of 64 bit values in little-endian byte +order, in which a bit is set if the specific command opcode +is supported. Thus, \field{device_admin_cmds[0]} refers to the first 32-bit value +in this array corresponding to opcodes 0 to 63, +\field{device_admin_cmds[1]} is the second 64-bit value +corresponding to opcodes 64 to 127, etc. +For example, the array of size 2 including +the values 0x3 in \field{device_admin_cmds[0]} +and 0x1 in \field{device_admin_cmds[1]} indicates that only +opcodes 0, 1 and 64 are supported. +The length of the array depends on the supported opcodes - it is +large enough to include bits set for all supported opcodes, +that is the length can be calculated by starting with the largest +supported opcode adding one, dividing by 64 and rounding up. +The array is also allowed to be larger and to additionally +include an arbitrary number of all-zero entries. + +Accordingly, bits 0 and 1 corresponding to opcode 0 +(VIRTIO_ADMIN_CMD_LIST_QUERY) and 1 +(VIRTIO_ADMIN_CMD_LIST_USE) are +always set in \field{device_admin_cmds[0]} returned by VIRTIO_ADMIN_CMD_LIST_QUERY. + +For the command VIRTIO_ADMIN_CMD_LIST_QUERY, \field{opcode} is set to 0x0. +The \field{group_member_id} is unused. It is set to zero by driver. +This command has no command specific data. +The device, upon success, returns a result in +\field{command_specific_result} in the format +\field{struct virtio_admin_cmd_list} describing the +list of administration commands supported for the given group. + + +For the command VIRTIO_ADMIN_CMD_LIST_USE, \field{opcode} +is set to 0x1. +The \field{group_member_id} is unused. It is set to zero by driver. +The \field{command_specific_data} is in the format +\field{struct virtio_admin_cmd_list} describing the +list of administration commands used by the driver. +This command has no command specific result. + +The driver issues the command VIRTIO_ADMIN_CMD_LIST_QUERY to +query the list of commands valid for this group and before sending +any commands for any member of a group. + +The driver then enables use of some of the opcodes by sending to +the device the command VIRTIO_ADMIN_CMD_LIST_USE with a subset +of the list returned by VIRTIO_ADMIN_CMD_LIST_QUERY that is +both understood and used by the driver. + +If the device supports the command list used by the driver, the +device completes the command with status VIRTIO_ADMIN_STATUS_OK. +If the device does not support the command list, the device +completes the command with status +VIRTIO_ADMIN_STATUS_INVALID_FIELD. + +Note: drivers are assumed not to set bits in device_admin_cmds +if they are not familiar with how the command opcode +is used, since devices could have dependencies between +command opcodes. + +It is assumed that all members in a group support and are used +with the same list of commands. However, for owner devices +supporting multiple group types, the list of supported commands +might differ between different group types. + \section{Administration Virtqueues}\label{sec:Basic Facilities of a Virtio Device / Administration Virtqueues} An administration virtqueue of an owner device is used to submit
Signature · 1 line
MST
RE: [PATCH v10 08/10] admin: command list discovery
Quoted 63 lines
-----Original Message-----
From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, February 9, 2023 1:14 PM
To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Jani, Nrupal <[email protected]>; Uminski, Piotr <[email protected]>; Yuan, Hang <[email protected]>
Cc: [email protected]; Zhu, Lingshan <[email protected]>; [email protected]; Shahaf Shuler <[email protected]>; Parav Pandit <[email protected]>; Max Gurtovoy <[email protected]>
Subject: [PATCH v10 08/10] admin: command list discoveryAdd commands to find out which commands does each group support, as well as enable their use by driver.
This will be especially useful once we have multiple group types.An alternative is per-type VQs. This is possible but will require more per- transport work. Discovery through the vq helps keep things contained.
Signed-off-by Max Gurtovoy <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>--- admin.tex | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 89 insertions(+), 1 deletion(-)admin.tex +0
-0@@ -98,7 +98,9 @@ \subsection{Group administrationcommands}\label{sec:Basic Facilities of a Virti \hline opcode & Name & Command Description \\ \hline \hline
-0x0000 -0x7FFF& - & Group administration commands \\
+0x0000 &VIRTIO_ADMIN_CMD_LIST_QUERY& Provides to driver list of
commands supported for this group type \\
+0x0001 &VIRTIO_ADMIN_CMD_LIST_USE& Provides to device list of commands used for this group type \\
+0x0002 -0x7FFF& - & Group administration commands \\
\hline
0x8000-0xFFFF& - & Reserved \\
\hlineadmin.tex +11
-0@@ -149,6 +151,92 @@ \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti \hline \end{tabular} +Before sending any administration commands to the device, the driver +needs to communicate to the device which commands it is going to use. +Initially (after reset), only two commands are assumed to be used: +VIRTIO_ADMIN_CMD_LIST_QUERY and VIRTIO_ADMIN_CMD_LIST_USE. + +Before sending any other commands for any member of a specific group to +the device, the driver queries the supported commands via +VIRTIO_ADMIN_CMD_LIST_QUERY and sends the commands it will use via +VIRTIO_ADMIN_CMD_LIST_USE. + +Commands VIRTIO_ADMIN_CMD_LIST_QUERY and
VIRTIO_ADMIN_CMD_LIST_USEbothadmin.tex +3
-0+use the following structure describing the command opcodes: + +\begin{lstlisting}
admin.tex \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti
Quoted 10 lines
admin.tex +10
-0+struct virtio_admin_cmd_list { + /* Indicates which of the below fields were returned + le64 device_admin_cmds[]; +}; +\end{lstlisting} + +This structure is an array of 64 bit values in little-endian byte +order, in which a bit is set if the specific command opcode is +supported. Thus, \field{device_admin_cmds[0]} refers to the first +32-bit value in this array corresponding to opcodes 0 to 63,
Probably should be "64-bit value"
Quoted 65 lines
+\field{device_admin_cmds[1]} is the second 64-bit value corresponding
admin.tex +15
-0+to opcodes 64 to 127, etc. +For example, the array of size 2 including the values 0x3 in +\field{device_admin_cmds[0]} and 0x1 in \field{device_admin_cmds[1]} +indicates that only opcodes 0, 1 and 64 are supported. +The length of the array depends on the supported opcodes - it is large +enough to include bits set for all supported opcodes, that is the +length can be calculated by starting with the largest supported opcode +adding one, dividing by 64 and rounding up. +The array is also allowed to be larger and to additionally include an +arbitrary number of all-zero entries. + +Accordingly, bits 0 and 1 corresponding to opcode 0 +(VIRTIO_ADMIN_CMD_LIST_QUERY) and 1 +(VIRTIO_ADMIN_CMD_LIST_USE) are +always set in \field{device_admin_cmds[0]} returned by
VIRTIO_ADMIN_CMD_LIST_QUERY.admin.tex +2
-0+ +For the command VIRTIO_ADMIN_CMD_LIST_QUERY, \field{opcode} is setto
0x0.admin.tex +17
-0+The \field{group_member_id} is unused. It is set to zero by driver. +This command has no command specific data. +The device, upon success, returns a result in +\field{command_specific_result} in the format \field{struct +virtio_admin_cmd_list} describing the list of administration commands +supported for the given group. + + +For the command VIRTIO_ADMIN_CMD_LIST_USE, \field{opcode} is set to +0x1. +The \field{group_member_id} is unused. It is set to zero by driver. +The \field{command_specific_data} is in the format \field{struct +virtio_admin_cmd_list} describing the list of administration commands +used by the driver. +This command has no command specific result. + +The driver issues the command VIRTIO_ADMIN_CMD_LIST_QUERY toquery the
admin.tex +5
-0+list of commands valid for this group and before sending any commands +for any member of a group. + +The driver then enables use of some of the opcodes by sending to the +device the command VIRTIO_ADMIN_CMD_LIST_USE with a subset of thelist
+returned byVIRTIO_ADMIN_CMD_LIST_QUERYthat is both understood andadmin.tex +16
-0+used by the driver. + +If the device supports the command list used by the driver, the device +completes the command with status VIRTIO_ADMIN_STATUS_OK. +If the device does not support the command list, the device completes +the command with status VIRTIO_ADMIN_STATUS_INVALID_FIELD. + +Note: drivers are assumed not to set bits in device_admin_cmds if they +are not familiar with how the command opcode is used, since devices +could have dependencies between command opcodes. + +It is assumed that all members in a group support and are used with the +same list of commands. However, for owner devices supporting multiple +group types, the list of supported commands might differ between +different group types. + \section{Administration Virtqueues}\label{sec:Basic Facilities of a VirtioDevice / Administration Virtqueues}
Quoted 3 lines
An administration virtqueue of an owner device is used to submit
--
MST
---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN. Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu ustawy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w transakcjach handlowych.
Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.
RE: [PATCH v10 08/10] admin: command list discovery
In reply to Michael S. TsirkinQuoted 3 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, February 9, 2023 7:14 AM
[..]
Quoted 1 line
+This structure is an array of 64 bit values in little-endian byte
LE is already in the above data type. It can be dropped from the description.
Review
Quoted 3 lines
(quoted diff) +3
-0+order, in which a bit is set if the specific command opcode is +supported. Thus, \field{device_admin_cmds[0]} refers to the first +32-bit value in this array corresponding to opcodes 0 to 63,
s/32-bit/64-bit
Re: [virtio-dev] [PATCH v10 08/10] admin: command list discovery
In reply to Michael S. TsirkinQuoted 48 lines · Michael S. Tsirkin
Add commands to find out which commands does each group support, as well as enable their use by driver.
This will be especially useful once we have multiple group types.An alternative is per-type VQs. This is possible but will require more per-transport work. Discovery through the vq helps keep things contained.
Signed-off-by Max Gurtovoy <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>--- admin.tex | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 89 insertions(+), 1 deletion(-)admin.tex +18
-1@@ -98,7 +98,9 @@ \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti \hline opcode & Name & Command Description \\ \hline \hline -0x0000 - 0x7FFF & - & Group administration commands \\ +0x0000 & VIRTIO_ADMIN_CMD_LIST_QUERY & Provides to driver list of commands supported for this group type \\ +0x0001 & VIRTIO_ADMIN_CMD_LIST_USE & Provides to device list of commands used for this group type \\ +0x0002 - 0x7FFF & - & Group administration commands \\ \hline 0x8000 - 0xFFFF & - & Reserved \\ \hline@@ -149,6 +151,92 @@ \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti \hline \end{tabular} +Before sending any administration commands to the device, the driver +needs to communicate to the device which commands it is going to +use. Initially (after reset), only two commands are assumed to be used: +VIRTIO_ADMIN_CMD_LIST_QUERY and VIRTIO_ADMIN_CMD_LIST_USE. + +Before sending any other commands for any member of a specific group to +the device, the driver queries the supported commands via +VIRTIO_ADMIN_CMD_LIST_QUERY and sends the commands it will use via +VIRTIO_ADMIN_CMD_LIST_USE. + +Commands VIRTIO_ADMIN_CMD_LIST_QUERY and +VIRTIO_ADMIN_CMD_LIST_USE +both use the following structure describing the +command opcodes: +
admin.tex \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti · line 178
Quoted 10 lines
admin.tex +10
-0+\begin{lstlisting} +struct virtio_admin_cmd_list { + /* Indicates which of the below fields were returned + le64 device_admin_cmds[]; +}; +\end{lstlisting} + +This structure is an array of 64 bit values in little-endian byte +order, in which a bit is set if the specific command opcode +is supported. Thus, \field{device_admin_cmds[0]} refers to the first 32-bit value
64-bit? And is an LE64 enough for now and near future? Or the the length needs to be calculated from the descriptor length.
Quoted 64 lines
admin.tex +61
-0+in this array corresponding to opcodes 0 to 63, +\field{device_admin_cmds[1]} is the second 64-bit value +corresponding to opcodes 64 to 127, etc. +For example, the array of size 2 including +the values 0x3 in \field{device_admin_cmds[0]} +and 0x1 in \field{device_admin_cmds[1]} indicates that only +opcodes 0, 1 and 64 are supported. +The length of the array depends on the supported opcodes - it is +large enough to include bits set for all supported opcodes, +that is the length can be calculated by starting with the largest +supported opcode adding one, dividing by 64 and rounding up. +The array is also allowed to be larger and to additionally +include an arbitrary number of all-zero entries. + +Accordingly, bits 0 and 1 corresponding to opcode 0 +(VIRTIO_ADMIN_CMD_LIST_QUERY) and 1 +(VIRTIO_ADMIN_CMD_LIST_USE) are +always set in \field{device_admin_cmds[0]} returned by VIRTIO_ADMIN_CMD_LIST_QUERY. + +For the command VIRTIO_ADMIN_CMD_LIST_QUERY, \field{opcode} is set to 0x0. +The \field{group_member_id} is unused. It is set to zero by driver. +This command has no command specific data. +The device, upon success, returns a result in +\field{command_specific_result} in the format +\field{struct virtio_admin_cmd_list} describing the +list of administration commands supported for the given group. + + +For the command VIRTIO_ADMIN_CMD_LIST_USE, \field{opcode} +is set to 0x1. +The \field{group_member_id} is unused. It is set to zero by driver. +The \field{command_specific_data} is in the format +\field{struct virtio_admin_cmd_list} describing the +list of administration commands used by the driver. +This command has no command specific result. + +The driver issues the command VIRTIO_ADMIN_CMD_LIST_QUERY to +query the list of commands valid for this group and before sending +any commands for any member of a group. + +The driver then enables use of some of the opcodes by sending to +the device the command VIRTIO_ADMIN_CMD_LIST_USE with a subset +of the list returned by VIRTIO_ADMIN_CMD_LIST_QUERY that is +both understood and used by the driver. + +If the device supports the command list used by the driver, the +device completes the command with status VIRTIO_ADMIN_STATUS_OK. +If the device does not support the command list, the device +completes the command with status +VIRTIO_ADMIN_STATUS_INVALID_FIELD. + +Note: drivers are assumed not to set bits in device_admin_cmds +if they are not familiar with how the command opcode +is used, since devices could have dependencies between +command opcodes. + +It is assumed that all members in a group support and are used +with the same list of commands. However, for owner devices +supporting multiple group types, the list of supported commands +might differ between different group types. + \section{Administration Virtqueues}\label{sec:Basic Facilities of a Virtio Device / Administration Virtqueues} An administration virtqueue of an owner device is used to submit
Re: [virtio-comment] [PATCH v10 08/10] admin: command list discovery
In reply to Michael S. TsirkinQuoted 58 lines · Michael S. Tsirkin
Add commands to find out which commands does each group support, as well as enable their use by driver.
This will be especially useful once we have multiple group types.An alternative is per-type VQs. This is possible but will require more per-transport work. Discovery through the vq helps keep things contained.
Signed-off-by Max Gurtovoy <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>--- admin.tex | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 89 insertions(+), 1 deletion(-)admin.tex +28
-1@@ -98,7 +98,9 @@ \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti \hline opcode & Name & Command Description \\ \hline \hline -0x0000 - 0x7FFF & - & Group administration commands \\ +0x0000 & VIRTIO_ADMIN_CMD_LIST_QUERY & Provides to driver list of commands supported for this group type \\ +0x0001 & VIRTIO_ADMIN_CMD_LIST_USE & Provides to device list of commands used for this group type \\ +0x0002 - 0x7FFF & - & Group administration commands \\ \hline 0x8000 - 0xFFFF & - & Reserved \\ \hline@@ -149,6 +151,92 @@ \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti \hline \end{tabular} +Before sending any administration commands to the device, the driver +needs to communicate to the device which commands it is going to +use. Initially (after reset), only two commands are assumed to be used: +VIRTIO_ADMIN_CMD_LIST_QUERY and VIRTIO_ADMIN_CMD_LIST_USE. + +Before sending any other commands for any member of a specific group to +the device, the driver queries the supported commands via +VIRTIO_ADMIN_CMD_LIST_QUERY and sends the commands it will use via +VIRTIO_ADMIN_CMD_LIST_USE. + +Commands VIRTIO_ADMIN_CMD_LIST_QUERY and +VIRTIO_ADMIN_CMD_LIST_USE +both use the following structure describing the +command opcodes: + +\begin{lstlisting} +struct virtio_admin_cmd_list { + /* Indicates which of the below fields were returned + le64 device_admin_cmds[]; +}; +\end{lstlisting} + +This structure is an array of 64 bit values in little-endian byte +order, in which a bit is set if the specific command opcode +is supported. Thus, \field{device_admin_cmds[0]} refers to the first
Quoted 1 line
32-bit value
64-bit value.
Quoted 5 lines
admin.tex +5
-0+in this array corresponding to opcodes 0 to 63, +\field{device_admin_cmds[1]} is the second 64-bit value +corresponding to opcodes 64 to 127, etc. +For example, the array of size 2 including +the values 0x3 in \field{device_admin_cmds[0]}
admin.tex \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti · line 193
Quoted 10 lines
admin.tex +10
-0+and 0x1 in \field{device_admin_cmds[1]} indicates that only +opcodes 0, 1 and 64 are supported. +The length of the array depends on the supported opcodes - it is +large enough to include bits set for all supported opcodes, +that is the length can be calculated by starting with the largest +supported opcode adding one, dividing by 64 and rounding up. +The array is also allowed to be larger and to additionally +include an arbitrary number of all-zero entries. + +Accordingly, bits 0 and 1 corresponding to opcode 0
"opcodes"
Quoted 27 lines
admin.tex +27
-0+(VIRTIO_ADMIN_CMD_LIST_QUERY) and 1 +(VIRTIO_ADMIN_CMD_LIST_USE) are +always set in \field{device_admin_cmds[0]} returned by VIRTIO_ADMIN_CMD_LIST_QUERY. + +For the command VIRTIO_ADMIN_CMD_LIST_QUERY, \field{opcode} is set to 0x0. +The \field{group_member_id} is unused. It is set to zero by driver. +This command has no command specific data. +The device, upon success, returns a result in +\field{command_specific_result} in the format +\field{struct virtio_admin_cmd_list} describing the +list of administration commands supported for the given group. + + +For the command VIRTIO_ADMIN_CMD_LIST_USE, \field{opcode} +is set to 0x1. +The \field{group_member_id} is unused. It is set to zero by driver. +The \field{command_specific_data} is in the format +\field{struct virtio_admin_cmd_list} describing the +list of administration commands used by the driver. +This command has no command specific result. + +The driver issues the command VIRTIO_ADMIN_CMD_LIST_QUERY to +query the list of commands valid for this group and before sending +any commands for any member of a group. + +The driver then enables use of some of the opcodes by sending to +the device the command VIRTIO_ADMIN_CMD_LIST_USE with a subset
admin.tex \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti · line 230
Quoted 10 lines
admin.tex +10
-0+of the list returned by VIRTIO_ADMIN_CMD_LIST_QUERY that is +both understood and used by the driver. + +If the device supports the command list used by the driver, the +device completes the command with status VIRTIO_ADMIN_STATUS_OK. +If the device does not support the command list, the device +completes the command with status +VIRTIO_ADMIN_STATUS_INVALID_FIELD. + +Note: drivers are assumed not to set bits in device_admin_cmds
\field{device_admin_cmds}
Quoted 12 lines
admin.tex +9
-0+if they are not familiar with how the command opcode +is used, since devices could have dependencies between +command opcodes. + +It is assumed that all members in a group support and are used +with the same list of commands. However, for owner devices +supporting multiple group types, the list of supported commands +might differ between different group types. + \section{Administration Virtqueues}\label{sec:Basic Facilities of a Virtio Device / Administration Virtqueues} An administration virtqueue of an owner device is used to submit
Signature · 1 line
They like the smell of it in Hollywood.
PATCH v10 9/10 admin: conformance clauses
In reply to Michael S. TsirkinAdd conformance clauses for admin commands and admin virtqueues.
--- admin.tex | 190 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 190 insertions(+)
admin.tex +190 -0
@@ -237,6 +237,119 @@ \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti supporting multiple group types, the list of supported commands might differ between different group types. +\devicenormative{\paragraph}{Group administration commands}{Basic Facilities of a Virtio Device / Device groups / Group administration commands} + +The device MUST validate \field{opcode}, \field{group_type} and +\field{group_member_id}, and if any of these has an invalid or +unsupported value, set \field{status} to +VIRTIO_ADMIN_STATUS_EINVAL and set \field{status_qualifier} +accordingly: +\begin{itemize} +\item if \field{group_type} is invalid, \field{status_qualifier} + MUST be set to VIRTIO_ADMIN_STATUS_Q_INVALID_GROUP; +\item otherwise, if \field{opcode} is invalid, + \field{status_qualifier} MUST be set to + VIRTIO_ADMIN_STATUS_Q_INVALID_OPCODE; +\item otherwise, if \field{group_member_id} is used by the + specific command and is invalid, \field{status_qualifier} MUST be + set to VIRTIO_ADMIN_STATUS_Q_INVALID_MEM. +\end{itemize} + +If a command completes successfully, the device MUST set +\field{status} to VIRTIO_ADMIN_STATUS_OK. + +If a command fails, the device MUST set +\field{status} to a value different from VIRTIO_ADMIN_STATUS_OK. + +If \field{status} is set to VIRTIO_ADMIN_STATUS_EINVAL, the +device state MUST NOT change, that is the command MUST NOT have +any side effects on the device, in particular the device MUST not +enter an error state as a result of this command. + +If a command fails, the device state generally SHOULD NOT change, +as far as possible. + +The device MAY enforce additional restrictions and dependencies on +opcodes used by the driver and MAY fail the command +VIRTIO_ADMIN_CMD_LIST_USE with \field{status} set to VIRTIO_ADMIN_STATUS_EINVAL +and \field{status_qualifier} set to VIRTIO_ADMIN_STATUS_Q_INVALID_FIELD +if the list of commands used violate internal device dependencies. + +If the device supports multiple group types, commands for each group +type MUST operate independently of each other, in particular, +the device MAY return different results for VIRTIO_ADMIN_CMD_LIST_QUERY +for different group types. + +After reset, if the device supports a given group type +and before receiving VIRTIO_ADMIN_CMD_LIST_USE for this group type +the device MUST assume +that the list of legal commands used by the driver consists of +the two commands VIRTIO_ADMIN_CMD_LIST_QUERY and VIRTIO_ADMIN_CMD_LIST_USE. + +After completing VIRTIO_ADMIN_CMD_LIST_USE successfully, +the device MUST set the list of legal commands used by the driver +to the one supplied in \field{command_specific_data}. + +The device MUST set the list of legal commands used by the driver +to the one supplied in VIRTIO_ADMIN_CMD_LIST_USE. + +The device MUST validate commands against the list used by +the driver and MUST fail any commands not in the list with +\field{status} set to VIRTIO_ADMIN_STATUS_EINVAL +and \field{status_qualifier} set to +VIRTIO_ADMIN_STATUS_Q_INVALID_OPCODE. + +The list of supported commands MUST NOT shrink (but MAY expand): +after reporting a given command as supported through +VIRTIO_ADMIN_CMD_LIST_QUERY the device MUST NOT later report it +as unsupported. Further, after a given set of commands has been +used (via a successful VIRTIO_ADMIN_CMD_LIST_USE), then after a +device or system reset the device SHOULD complete successfully +any following calls to VIRTIO_ADMIN_CMD_LIST_USE with the same +list of commands; if this command VIRTIO_ADMIN_CMD_LIST_USE fails +after a device or system reset, the device MUST not fail it +solely because of the command list used. Failure to do so would +interfere with resuming from suspend and error recovery. + + +\drivernormative{\paragraph}{Group administration commands}{Basic Facilities of a Virtio Device / Device groups / Group administration commands} + +The driver MAY discover whether device supports a specific group type +by issuing VIRTIO_ADMIN_CMD_LIST_QUERY with the matching +\field{group_type}. + +The driver MUST issue VIRTIO_ADMIN_CMD_LIST_USE +and wait for it to be completed with status +VIRTIO_ADMIN_STATUS_OK before issuing any commands +(except for the initial VIRTIO_ADMIN_CMD_LIST_QUERY +and VIRTIO_ADMIN_CMD_LIST_USE). + +The driver SHOULD NOT set bits in device_admin_cmds +if it is not familiar with how the command opcode +is used, as dependencies between command opcodes might exist. + +The driver MUST NOT request (via VIRTIO_ADMIN_CMD_LIST_USE) +the use of any commands not previously reported as +supported for the same group type by VIRTIO_ADMIN_CMD_LIST_QUERY. + +The driver MUST NOT use any commands for a given group type +before sending VIRTIO_ADMIN_CMD_LIST_USE with the correct +list of command opcodes and group type. + +The driver MAY block use of VIRTIO_ADMIN_CMD_LIST_QUERY and +VIRTIO_ADMIN_CMD_LIST_USE by issuing VIRTIO_ADMIN_CMD_LIST_USE +with respective bits cleared in \field{command_specific_data}. + +The driver MUST handle a command error with a reserved \field{status} +value in the same way as \field{status} set to VIRTIO_ADMIN_STATUS_EINVAL +(except possibly for different error reporting/diagnostic messages). + +The driver MUST handle a command error with a reserved +\field{status_qualifier} value in the same way as +\field{status_qualifier} set to +VIRTIO_ADMIN_STATUS_Q_INVALID_COMMAND (except possibly for +different error reporting/diagnostic messages). + \section{Administration Virtqueues}\label{sec:Basic Facilities of a Virtio Device / Administration Virtqueues} An administration virtqueue of an owner device is used to submit
@@ -309,3 +422,80 @@ \section{Administration Virtqueues}\label{sec:Basic Facilities of a Virtio Devic of the specification are designed, new fields can be added to the tail of a structure, with the driver/device using the full structure without concern for versioning. + +\devicenormative{\paragraph}{Group administration commands}{Basic Facilities of a Virtio Device / Administration virtqueues} + +The device MUST support device-readable and device-writeable buffers +shorter than described in this specification, by +\begin{enumerate} +\item acting as if any data that would be read outside the +device-readable buffers is set to zero, and +\item discarding data that would be written outside the +specified device-writeable buffers. +\end{enumerate} + +The device MUST support device-readable and device-writeable buffers +longer than described in this specification, by +\begin{enumerate} +\item ignoring any data in device-readable buffers outside +the expected length, and +\item only writing the expected structure to the device-writeable +buffers, ignoring any extra buffers, and reporting the +actual length of data written, in bytes, +as buffer used length. +\end{enumerate} + +The device SHOULD initialize the device-writeable buffer +up to the length of the structure described by this specification or +the length of the buffer supplied by the driver (even if the buffer is +all set to zero), whichever is shorter. + +The device MUST NOT fail a command solely because the buffers +provided are shorter or longer than described in this +specification. + +The device MUST initialize the device-writeable part of +\field{struct virtio_admin_cmd} that is a multiple of 64 bit in +size. + +The device MUST initialize \field{status} in \field{struct +virtio_admin_cmd}. + +The device MUST process commands on a given administration virtqueue +in the order in which they are queued. + +If multiple administration virtqueues have been configured, +device MAY process commands on distinct virtqueues with +no order constraints. + +\drivernormative{\paragraph}{Group administration commands}{Basic Facilities of a Virtio Device / Administration virtqueues} + +The driver MAY supply device-readable or device-writeable parts +of \field{struct virtio_admin_cmd} that are longer than described in +this specification. + +The driver SHOULD supply device-readable part of +\field{struct virtio_admin_cmd} that is at least as +large as the structure described by this specification +(even if the structure is all set to zero). + +The driver MUST supply both device-readable or device-writeable parts +of \field{struct virtio_admin_cmd} that are a multiple of 64 bit +in length. + +The device MUST supply both device-readable or device-writeable parts +of \field{struct virtio_admin_cmd} that are larger than zero in +length. However, \field{command_specific_data} and +\field{command_specific_result} MAY be zero in length, unless +specified otherwise for the command. + +The driver MUST NOT assume that the device will initialize the whole +device-writeable part of \field{struct virtio_admin_cmd} as described in the specification; instead, +the driver MUST act as if the structure +outside the part of the buffer used by the device +is set to zero. + +If multiple administration virtqueues have been configured, +the driver MUST ensure ordering for commands +placed on different administration virtqueues. +>>>>>>> 29f6525... admin: conformance clauses
Signature · 1 line
MST
RE: [PATCH v10 09/10] admin: conformance clauses
Quoted 4 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, February 9, 2023 7:14 AM
[..]
Quoted 1 line
+>>>>>>> 29f6525... admin: conformance clauses
Merge conflict left over to remove.
[virtio-comment] Re: [virtio-dev] [PATCH v10 09/10] admin: conformance clauses
In reply to Michael S. TsirkinQuoted 139 lines · Michael S. Tsirkin
Add conformance clauses for admin commands and admin virtqueues.
Signed-off-by Michael S. Tsirkin <[email protected]>--- admin.tex | 190 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 190 insertions(+)admin.tex +117
-0@@ -237,6 +237,119 @@ \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti supporting multiple group types, the list of supported commands might differ between different group types. +\devicenormative{\paragraph}{Group administration commands}{Basic Facilities of a Virtio Device / Device groups / Group administration commands} + +The device MUST validate \field{opcode}, \field{group_type} and +\field{group_member_id}, and if any of these has an invalid or +unsupported value, set \field{status} to +VIRTIO_ADMIN_STATUS_EINVAL and set \field{status_qualifier} +accordingly: +\begin{itemize} +\item if \field{group_type} is invalid, \field{status_qualifier} + MUST be set to VIRTIO_ADMIN_STATUS_Q_INVALID_GROUP; +\item otherwise, if \field{opcode} is invalid, + \field{status_qualifier} MUST be set to + VIRTIO_ADMIN_STATUS_Q_INVALID_OPCODE; +\item otherwise, if \field{group_member_id} is used by the + specific command and is invalid, \field{status_qualifier} MUST be + set to VIRTIO_ADMIN_STATUS_Q_INVALID_MEM. +\end{itemize} + +If a command completes successfully, the device MUST set +\field{status} to VIRTIO_ADMIN_STATUS_OK. + +If a command fails, the device MUST set +\field{status} to a value different from VIRTIO_ADMIN_STATUS_OK. + +If \field{status} is set to VIRTIO_ADMIN_STATUS_EINVAL, the +device state MUST NOT change, that is the command MUST NOT have +any side effects on the device, in particular the device MUST not +enter an error state as a result of this command. + +If a command fails, the device state generally SHOULD NOT change, +as far as possible. + +The device MAY enforce additional restrictions and dependencies on +opcodes used by the driver and MAY fail the command +VIRTIO_ADMIN_CMD_LIST_USE with \field{status} set to VIRTIO_ADMIN_STATUS_EINVAL +and \field{status_qualifier} set to VIRTIO_ADMIN_STATUS_Q_INVALID_FIELD +if the list of commands used violate internal device dependencies. + +If the device supports multiple group types, commands for each group +type MUST operate independently of each other, in particular, +the device MAY return different results for VIRTIO_ADMIN_CMD_LIST_QUERY +for different group types. + +After reset, if the device supports a given group type +and before receiving VIRTIO_ADMIN_CMD_LIST_USE for this group type +the device MUST assume +that the list of legal commands used by the driver consists of +the two commands VIRTIO_ADMIN_CMD_LIST_QUERY and VIRTIO_ADMIN_CMD_LIST_USE. + +After completing VIRTIO_ADMIN_CMD_LIST_USE successfully, +the device MUST set the list of legal commands used by the driver +to the one supplied in \field{command_specific_data}. + +The device MUST set the list of legal commands used by the driver +to the one supplied in VIRTIO_ADMIN_CMD_LIST_USE. + +The device MUST validate commands against the list used by +the driver and MUST fail any commands not in the list with +\field{status} set to VIRTIO_ADMIN_STATUS_EINVAL +and \field{status_qualifier} set to +VIRTIO_ADMIN_STATUS_Q_INVALID_OPCODE. + +The list of supported commands MUST NOT shrink (but MAY expand): +after reporting a given command as supported through +VIRTIO_ADMIN_CMD_LIST_QUERY the device MUST NOT later report it +as unsupported. Further, after a given set of commands has been +used (via a successful VIRTIO_ADMIN_CMD_LIST_USE), then after a +device or system reset the device SHOULD complete successfully +any following calls to VIRTIO_ADMIN_CMD_LIST_USE with the same +list of commands; if this command VIRTIO_ADMIN_CMD_LIST_USE fails +after a device or system reset, the device MUST not fail it +solely because of the command list used. Failure to do so would +interfere with resuming from suspend and error recovery. + + +\drivernormative{\paragraph}{Group administration commands}{Basic Facilities of a Virtio Device / Device groups / Group administration commands} + +The driver MAY discover whether device supports a specific group type +by issuing VIRTIO_ADMIN_CMD_LIST_QUERY with the matching +\field{group_type}. + +The driver MUST issue VIRTIO_ADMIN_CMD_LIST_USE +and wait for it to be completed with status +VIRTIO_ADMIN_STATUS_OK before issuing any commands +(except for the initial VIRTIO_ADMIN_CMD_LIST_QUERY +and VIRTIO_ADMIN_CMD_LIST_USE). + +The driver SHOULD NOT set bits in device_admin_cmds +if it is not familiar with how the command opcode +is used, as dependencies between command opcodes might exist. + +The driver MUST NOT request (via VIRTIO_ADMIN_CMD_LIST_USE) +the use of any commands not previously reported as +supported for the same group type by VIRTIO_ADMIN_CMD_LIST_QUERY. + +The driver MUST NOT use any commands for a given group type +before sending VIRTIO_ADMIN_CMD_LIST_USE with the correct +list of command opcodes and group type. + +The driver MAY block use of VIRTIO_ADMIN_CMD_LIST_QUERY and +VIRTIO_ADMIN_CMD_LIST_USE by issuing VIRTIO_ADMIN_CMD_LIST_USE +with respective bits cleared in \field{command_specific_data}. + +The driver MUST handle a command error with a reserved \field{status} +value in the same way as \field{status} set to VIRTIO_ADMIN_STATUS_EINVAL +(except possibly for different error reporting/diagnostic messages). + +The driver MUST handle a command error with a reserved +\field{status_qualifier} value in the same way as +\field{status_qualifier} set to +VIRTIO_ADMIN_STATUS_Q_INVALID_COMMAND (except possibly for +different error reporting/diagnostic messages). + \section{Administration Virtqueues}\label{sec:Basic Facilities of a Virtio Device / Administration Virtqueues} An administration virtqueue of an owner device is used to submit@@ -309,3 +422,80 @@ \section{Administration Virtqueues}\label{sec:Basic Facilities of a Virtio Devic of the specification are designed, new fields can be added to the tail of a structure, with the driver/device using the full structure without concern for versioning. + +\devicenormative{\paragraph}{Group administration commands}{Basic Facilities of a Virtio Device / Administration virtqueues} + +The device MUST support device-readable and device-writeable buffers
admin.tex \section{Administration Virtqueues}\label{sec:Basic Facilities of a Virtio Devic · line 438
Quoted 10 lines
admin.tex +10
-0+shorter than described in this specification, by +\begin{enumerate} +\item acting as if any data that would be read outside the +device-readable buffers is set to zero, and +\item discarding data that would be written outside the +specified device-writeable buffers. +\end{enumerate} + +The device MUST support device-readable and device-writeable buffers +longer than described in this specification, by
maybe I missed it, where defines the length? Does it refer to the descriptor length?
admin.tex \section{Administration Virtqueues}\label{sec:Basic Facilities of a Virtio Devic · line 449
Quoted 11 lines
admin.tex +11
-0+\begin{enumerate} +\item ignoring any data in device-readable buffers outside +the expected length, and +\item only writing the expected structure to the device-writeable +buffers, ignoring any extra buffers, and reporting the +actual length of data written, in bytes, +as buffer used length. +\end{enumerate} + +The device SHOULD initialize the device-writeable buffer +up to the length of the structure described by this specification or
also this length of the structure
Quoted 42 lines
admin.tex +42
-0+the length of the buffer supplied by the driver (even if the buffer is +all set to zero), whichever is shorter. + +The device MUST NOT fail a command solely because the buffers +provided are shorter or longer than described in this +specification. + +The device MUST initialize the device-writeable part of +\field{struct virtio_admin_cmd} that is a multiple of 64 bit in +size. + +The device MUST initialize \field{status} in \field{struct +virtio_admin_cmd}. + +The device MUST process commands on a given administration virtqueue +in the order in which they are queued. + +If multiple administration virtqueues have been configured, +device MAY process commands on distinct virtqueues with +no order constraints. + +\drivernormative{\paragraph}{Group administration commands}{Basic Facilities of a Virtio Device / Administration virtqueues} + +The driver MAY supply device-readable or device-writeable parts +of \field{struct virtio_admin_cmd} that are longer than described in +this specification. + +The driver SHOULD supply device-readable part of +\field{struct virtio_admin_cmd} that is at least as +large as the structure described by this specification +(even if the structure is all set to zero). + +The driver MUST supply both device-readable or device-writeable parts +of \field{struct virtio_admin_cmd} that are a multiple of 64 bit +in length. + +The device MUST supply both device-readable or device-writeable parts +of \field{struct virtio_admin_cmd} that are larger than zero in +length. However, \field{command_specific_data} and +\field{command_specific_result} MAY be zero in length, unless +specified otherwise for the command. +
admin.tex \section{Administration Virtqueues}\label{sec:Basic Facilities of a Virtio Devic · line 501
Quoted 10 lines
admin.tex +10
-0+The driver MUST NOT assume that the device will initialize the whole +device-writeable part of \field{struct virtio_admin_cmd} as described in the specification; instead, +the driver MUST act as if the structure +outside the part of the buffer used by the device +is set to zero. + +If multiple administration virtqueues have been configured, +the driver MUST ensure ordering for commands +placed on different administration virtqueues. +>>>>>>> 29f6525... admin: conformance clauses
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/
Re: [virtio-dev] [PATCH v10 09/10] admin: conformance clauses
Quoted 144 lines · Zhu Lingshan
Quoted 141 lines · Michael S. Tsirkin
Add conformance clauses for admin commands and admin virtqueues.
Signed-off-by Michael S. Tsirkin <[email protected]>--- admin.tex | 190 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 190 insertions(+)admin.tex +121
-0@@ -237,6 +237,119 @@ \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti supporting multiple group types, the list of supported commands might differ between different group types. +\devicenormative{\paragraph}{Group administration commands}{Basic Facilities of a Virtio Device / Device groups / Group administration commands} + +The device MUST validate \field{opcode}, \field{group_type} and +\field{group_member_id}, and if any of these has an invalid or +unsupported value, set \field{status} to +VIRTIO_ADMIN_STATUS_EINVAL and set \field{status_qualifier} +accordingly: +\begin{itemize} +\item if \field{group_type} is invalid, \field{status_qualifier} + MUST be set to VIRTIO_ADMIN_STATUS_Q_INVALID_GROUP; +\item otherwise, if \field{opcode} is invalid, + \field{status_qualifier} MUST be set to + VIRTIO_ADMIN_STATUS_Q_INVALID_OPCODE; +\item otherwise, if \field{group_member_id} is used by the + specific command and is invalid, \field{status_qualifier} MUST be + set to VIRTIO_ADMIN_STATUS_Q_INVALID_MEM. +\end{itemize} + +If a command completes successfully, the device MUST set +\field{status} to VIRTIO_ADMIN_STATUS_OK. + +If a command fails, the device MUST set +\field{status} to a value different from VIRTIO_ADMIN_STATUS_OK. + +If \field{status} is set to VIRTIO_ADMIN_STATUS_EINVAL, the +device state MUST NOT change, that is the command MUST NOT have +any side effects on the device, in particular the device MUST not +enter an error state as a result of this command. + +If a command fails, the device state generally SHOULD NOT change, +as far as possible. + +The device MAY enforce additional restrictions and dependencies on +opcodes used by the driver and MAY fail the command +VIRTIO_ADMIN_CMD_LIST_USE with \field{status} set to VIRTIO_ADMIN_STATUS_EINVAL +and \field{status_qualifier} set to VIRTIO_ADMIN_STATUS_Q_INVALID_FIELD +if the list of commands used violate internal device dependencies. + +If the device supports multiple group types, commands for each group +type MUST operate independently of each other, in particular, +the device MAY return different results for VIRTIO_ADMIN_CMD_LIST_QUERY +for different group types. + +After reset, if the device supports a given group type +and before receiving VIRTIO_ADMIN_CMD_LIST_USE for this group type +the device MUST assume +that the list of legal commands used by the driver consists of +the two commands VIRTIO_ADMIN_CMD_LIST_QUERY and VIRTIO_ADMIN_CMD_LIST_USE. + +After completing VIRTIO_ADMIN_CMD_LIST_USE successfully, +the device MUST set the list of legal commands used by the driver +to the one supplied in \field{command_specific_data}. + +The device MUST set the list of legal commands used by the driver +to the one supplied in VIRTIO_ADMIN_CMD_LIST_USE. + +The device MUST validate commands against the list used by +the driver and MUST fail any commands not in the list with +\field{status} set to VIRTIO_ADMIN_STATUS_EINVAL +and \field{status_qualifier} set to +VIRTIO_ADMIN_STATUS_Q_INVALID_OPCODE. + +The list of supported commands MUST NOT shrink (but MAY expand): +after reporting a given command as supported through +VIRTIO_ADMIN_CMD_LIST_QUERY the device MUST NOT later report it +as unsupported. Further, after a given set of commands has been +used (via a successful VIRTIO_ADMIN_CMD_LIST_USE), then after a +device or system reset the device SHOULD complete successfully +any following calls to VIRTIO_ADMIN_CMD_LIST_USE with the same +list of commands; if this command VIRTIO_ADMIN_CMD_LIST_USE fails +after a device or system reset, the device MUST not fail it +solely because of the command list used. Failure to do so would +interfere with resuming from suspend and error recovery. + + +\drivernormative{\paragraph}{Group administration commands}{Basic Facilities of a Virtio Device / Device groups / Group administration commands} + +The driver MAY discover whether device supports a specific group type +by issuing VIRTIO_ADMIN_CMD_LIST_QUERY with the matching +\field{group_type}. + +The driver MUST issue VIRTIO_ADMIN_CMD_LIST_USE +and wait for it to be completed with status +VIRTIO_ADMIN_STATUS_OK before issuing any commands +(except for the initial VIRTIO_ADMIN_CMD_LIST_QUERY +and VIRTIO_ADMIN_CMD_LIST_USE). + +The driver SHOULD NOT set bits in device_admin_cmds +if it is not familiar with how the command opcode +is used, as dependencies between command opcodes might exist. + +The driver MUST NOT request (via VIRTIO_ADMIN_CMD_LIST_USE) +the use of any commands not previously reported as +supported for the same group type by VIRTIO_ADMIN_CMD_LIST_QUERY. + +The driver MUST NOT use any commands for a given group type +before sending VIRTIO_ADMIN_CMD_LIST_USE with the correct +list of command opcodes and group type. + +The driver MAY block use of VIRTIO_ADMIN_CMD_LIST_QUERY and +VIRTIO_ADMIN_CMD_LIST_USE by issuing VIRTIO_ADMIN_CMD_LIST_USE +with respective bits cleared in \field{command_specific_data}. + +The driver MUST handle a command error with a reserved \field{status} +value in the same way as \field{status} set to VIRTIO_ADMIN_STATUS_EINVAL +(except possibly for different error reporting/diagnostic messages). + +The driver MUST handle a command error with a reserved +\field{status_qualifier} value in the same way as +\field{status_qualifier} set to +VIRTIO_ADMIN_STATUS_Q_INVALID_COMMAND (except possibly for +different error reporting/diagnostic messages). + \section{Administration Virtqueues}\label{sec:Basic Facilities of a Virtio Device / Administration Virtqueues} An administration virtqueue of an owner device is used to submit@@ -309,3 +422,80 @@ \section{Administration Virtqueues}\label{sec:Basic Facilities of a Virtio Devic of the specification are designed, new fields can be added to the tail of a structure, with the driver/device using the full structure without concern for versioning. + +\devicenormative{\paragraph}{Group administration commands}{Basic Facilities of a Virtio Device / Administration virtqueues} + +The device MUST support device-readable and device-writeable buffers +shorter than described in this specification, by +\begin{enumerate} +\item acting as if any data that would be read outside the +device-readable buffers is set to zero, and
Quoted 8 lines
admin.tex \section{Administration Virtqueues}\label{sec:Basic Facilities of a Virtio Devic · line 438
Quoted 6 lines
admin.tex +6
-0+\item discarding data that would be written outside the +specified device-writeable buffers. +\end{enumerate} + +The device MUST support device-readable and device-writeable buffers +longer than described in this specification, bymaybe I missed it, where defines the length? Does it refer to the descriptor length?
Each command uses a different command specific data and command specific result structures and the length depends on this and is described separately or is implicit in the structure description. For example for VIRTIO_ADMIN_CMD_LIST_QUERY and VIRTIO_ADMIN_CMD_LIST_USE it will be DIV_ROUND_UP(max_cmd, 64) * 8 where DIV_ROUND_UP is integer division with round up and max_cmd is the largest available command opcode.
I thought it's clear but apprently not - so I will add this explicitly.
Quoted 4 lines
Quoted 4 lines
admin.tex +4
-0+\begin{enumerate} +\item ignoring any data in device-readable buffers outside +the expected length, and +\item only writing the expected structure to the device-writeable
Quoted 8 lines
admin.tex \section{Administration Virtqueues}\label{sec:Basic Facilities of a Virtio Devic · line 449
Quoted 7 lines
admin.tex +7
-0+buffers, ignoring any extra buffers, and reporting the +actual length of data written, in bytes, +as buffer used length. +\end{enumerate} + +The device SHOULD initialize the device-writeable buffer +up to the length of the structure described by this specification oralso this length of the structure
same.
Quoted 52 lines
Quoted 52 lines
admin.tex +52
-0+the length of the buffer supplied by the driver (even if the buffer is +all set to zero), whichever is shorter. + +The device MUST NOT fail a command solely because the buffers +provided are shorter or longer than described in this +specification. + +The device MUST initialize the device-writeable part of +\field{struct virtio_admin_cmd} that is a multiple of 64 bit in +size. + +The device MUST initialize \field{status} in \field{struct +virtio_admin_cmd}. + +The device MUST process commands on a given administration virtqueue +in the order in which they are queued. + +If multiple administration virtqueues have been configured, +device MAY process commands on distinct virtqueues with +no order constraints. + +\drivernormative{\paragraph}{Group administration commands}{Basic Facilities of a Virtio Device / Administration virtqueues} + +The driver MAY supply device-readable or device-writeable parts +of \field{struct virtio_admin_cmd} that are longer than described in +this specification. + +The driver SHOULD supply device-readable part of +\field{struct virtio_admin_cmd} that is at least as +large as the structure described by this specification +(even if the structure is all set to zero). + +The driver MUST supply both device-readable or device-writeable parts +of \field{struct virtio_admin_cmd} that are a multiple of 64 bit +in length. + +The device MUST supply both device-readable or device-writeable parts +of \field{struct virtio_admin_cmd} that are larger than zero in +length. However, \field{command_specific_data} and +\field{command_specific_result} MAY be zero in length, unless +specified otherwise for the command. + +The driver MUST NOT assume that the device will initialize the whole +device-writeable part of \field{struct virtio_admin_cmd} as described in the specification; instead, +the driver MUST act as if the structure +outside the part of the buffer used by the device +is set to zero. + +If multiple administration virtqueues have been configured, +the driver MUST ensure ordering for commands +placed on different administration virtqueues. +>>>>>>> 29f6525... admin: conformance clauses
Re: [virtio-comment] [PATCH v10 09/10] admin: conformance clauses
In reply to Michael S. TsirkinQuoted 28 lines · Michael S. Tsirkin
Add conformance clauses for admin commands and admin virtqueues.
Signed-off-by Michael S. Tsirkin <[email protected]>--- admin.tex | 190 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 190 insertions(+)admin.tex +13
-0@@ -237,6 +237,119 @@ \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti supporting multiple group types, the list of supported commands might differ between different group types. +\devicenormative{\paragraph}{Group administration commands}{Basic Facilities of a Virtio Device / Device groups / Group administration commands} + +The device MUST validate \field{opcode}, \field{group_type} and +\field{group_member_id}, and if any of these has an invalid or +unsupported value, set \field{status} to +VIRTIO_ADMIN_STATUS_EINVAL and set \field{status_qualifier} +accordingly: +\begin{itemize} +\item if \field{group_type} is invalid, \field{status_qualifier} + MUST be set to VIRTIO_ADMIN_STATUS_Q_INVALID_GROUP; +\item otherwise, if \field{opcode} is invalid, + \field{status_qualifier} MUST be set to + VIRTIO_ADMIN_STATUS_Q_INVALID_OPCODE;
admin.tex \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti · line 262
Quoted 10 lines
admin.tex +10
-0+\item otherwise, if \field{group_member_id} is used by the + specific command and is invalid, \field{status_qualifier} MUST be + set to VIRTIO_ADMIN_STATUS_Q_INVALID_MEM. +\end{itemize} + +If a command completes successfully, the device MUST set +\field{status} to VIRTIO_ADMIN_STATUS_OK. + +If a command fails, the device MUST set +\field{status} to a value different from VIRTIO_ADMIN_STATUS_OK.
s/from/than/
admin.tex \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti · line 266
Quoted 4 lines
admin.tex +4
-0+ +If \field{status} is set to VIRTIO_ADMIN_STATUS_EINVAL, the +device state MUST NOT change, that is the command MUST NOT have +any side effects on the device, in particular the device MUST not
s/not/NOT/
Quoted 5 lines
admin.tex +5
-0+enter an error state as a result of this command. + +If a command fails, the device state generally SHOULD NOT change, +as far as possible. +
admin.tex \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti · line 281
Quoted 10 lines
admin.tex +10
-0+The device MAY enforce additional restrictions and dependencies on +opcodes used by the driver and MAY fail the command +VIRTIO_ADMIN_CMD_LIST_USE with \field{status} set to VIRTIO_ADMIN_STATUS_EINVAL +and \field{status_qualifier} set to VIRTIO_ADMIN_STATUS_Q_INVALID_FIELD +if the list of commands used violate internal device dependencies. + +If the device supports multiple group types, commands for each group +type MUST operate independently of each other, in particular, +the device MAY return different results for VIRTIO_ADMIN_CMD_LIST_QUERY +for different group types.
Is it permitted to have multiple groups of the same type?
If so, can distinct groups of the same type return different results for VIRTIO_ADMIN_CMD_LIST_QUERY?
Quoted 14 lines
admin.tex +14
-0+ +After reset, if the device supports a given group type +and before receiving VIRTIO_ADMIN_CMD_LIST_USE for this group type +the device MUST assume +that the list of legal commands used by the driver consists of +the two commands VIRTIO_ADMIN_CMD_LIST_QUERY and VIRTIO_ADMIN_CMD_LIST_USE. + +After completing VIRTIO_ADMIN_CMD_LIST_USE successfully, +the device MUST set the list of legal commands used by the driver +to the one supplied in \field{command_specific_data}. + +The device MUST set the list of legal commands used by the driver +to the one supplied in VIRTIO_ADMIN_CMD_LIST_USE. +
admin.tex \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti
Quoted 10 lines
admin.tex +10
-0+The device MUST validate commands against the list used by +the driver and MUST fail any commands not in the list with +\field{status} set to VIRTIO_ADMIN_STATUS_EINVAL +and \field{status_qualifier} set to +VIRTIO_ADMIN_STATUS_Q_INVALID_OPCODE. + +The list of supported commands MUST NOT shrink (but MAY expand): +after reporting a given command as supported through +VIRTIO_ADMIN_CMD_LIST_QUERY the device MUST NOT later report it +as unsupported.
Even if it was never used?
Quoted 13 lines
Further, after a given set of commands has been
admin.tex +12
-0+used (via a successful VIRTIO_ADMIN_CMD_LIST_USE), then after a +device or system reset the device SHOULD complete successfully +any following calls to VIRTIO_ADMIN_CMD_LIST_USE with the same +list of commands; if this command VIRTIO_ADMIN_CMD_LIST_USE fails +after a device or system reset, the device MUST not fail it +solely because of the command list used. Failure to do so would +interfere with resuming from suspend and error recovery. + + +\drivernormative{\paragraph}{Group administration commands}{Basic Facilities of a Virtio Device / Device groups / Group administration commands} + +The driver MAY discover whether device supports a specific group type
admin.tex \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti · line 327
Quoted 10 lines
admin.tex +10
-0+by issuing VIRTIO_ADMIN_CMD_LIST_QUERY with the matching +\field{group_type}. + +The driver MUST issue VIRTIO_ADMIN_CMD_LIST_USE +and wait for it to be completed with status +VIRTIO_ADMIN_STATUS_OK before issuing any commands +(except for the initial VIRTIO_ADMIN_CMD_LIST_QUERY +and VIRTIO_ADMIN_CMD_LIST_USE). + +The driver SHOULD NOT set bits in device_admin_cmds
\field{device_admin_cmds}
Quoted 4 lines
admin.tex +4
-0+if it is not familiar with how the command opcode +is used, as dependencies between command opcodes might exist. + +The driver MUST NOT request (via VIRTIO_ADMIN_CMD_LIST_USE)
admin.tex \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti · line 341
Quoted 10 lines
admin.tex +10
-0+the use of any commands not previously reported as +supported for the same group type by VIRTIO_ADMIN_CMD_LIST_QUERY. + +The driver MUST NOT use any commands for a given group type +before sending VIRTIO_ADMIN_CMD_LIST_USE with the correct +list of command opcodes and group type. + +The driver MAY block use of VIRTIO_ADMIN_CMD_LIST_QUERY and +VIRTIO_ADMIN_CMD_LIST_USE by issuing VIRTIO_ADMIN_CMD_LIST_USE +with respective bits cleared in \field{command_specific_data}.
This seems to run contrary to the paragraph relating to resuming from suspend above.
Quoted 42 lines
admin.tex +35
-0+ +The driver MUST handle a command error with a reserved \field{status} +value in the same way as \field{status} set to VIRTIO_ADMIN_STATUS_EINVAL +(except possibly for different error reporting/diagnostic messages). + +The driver MUST handle a command error with a reserved +\field{status_qualifier} value in the same way as +\field{status_qualifier} set to +VIRTIO_ADMIN_STATUS_Q_INVALID_COMMAND (except possibly for +different error reporting/diagnostic messages). + \section{Administration Virtqueues}\label{sec:Basic Facilities of a Virtio Device / Administration Virtqueues} An administration virtqueue of an owner device is used to submit@@ -309,3 +422,80 @@ \section{Administration Virtqueues}\label{sec:Basic Facilities of a Virtio Devic of the specification are designed, new fields can be added to the tail of a structure, with the driver/device using the full structure without concern for versioning. + +\devicenormative{\paragraph}{Group administration commands}{Basic Facilities of a Virtio Device / Administration virtqueues} + +The device MUST support device-readable and device-writeable buffers +shorter than described in this specification, by +\begin{enumerate} +\item acting as if any data that would be read outside the +device-readable buffers is set to zero, and +\item discarding data that would be written outside the +specified device-writeable buffers. +\end{enumerate} + +The device MUST support device-readable and device-writeable buffers +longer than described in this specification, by +\begin{enumerate} +\item ignoring any data in device-readable buffers outside +the expected length, and +\item only writing the expected structure to the device-writeable +buffers, ignoring any extra buffers, and reporting the +actual length of data written, in bytes, +as buffer used length. +\end{enumerate} + +The device SHOULD initialize the device-writeable buffer
admin.tex \section{Administration Virtqueues}\label{sec:Basic Facilities of a Virtio Devic · line 458
Quoted 10 lines
admin.tex +10
-0+up to the length of the structure described by this specification or +the length of the buffer supplied by the driver (even if the buffer is +all set to zero), whichever is shorter. + +The device MUST NOT fail a command solely because the buffers +provided are shorter or longer than described in this +specification. + +The device MUST initialize the device-writeable part of +\field{struct virtio_admin_cmd} that is a multiple of 64 bit in
s/bit/bits/
Quoted 15 lines
admin.tex +15
-0+size. + +The device MUST initialize \field{status} in \field{struct +virtio_admin_cmd}. + +The device MUST process commands on a given administration virtqueue +in the order in which they are queued. + +If multiple administration virtqueues have been configured, +device MAY process commands on distinct virtqueues with +no order constraints. + +\drivernormative{\paragraph}{Group administration commands}{Basic Facilities of a Virtio Device / Administration virtqueues} + +The driver MAY supply device-readable or device-writeable parts
admin.tex \section{Administration Virtqueues}\label{sec:Basic Facilities of a Virtio Devic · line 483
Quoted 10 lines
admin.tex +10
-0+of \field{struct virtio_admin_cmd} that are longer than described in +this specification. + +The driver SHOULD supply device-readable part of +\field{struct virtio_admin_cmd} that is at least as +large as the structure described by this specification +(even if the structure is all set to zero). + +The driver MUST supply both device-readable or device-writeable parts +of \field{struct virtio_admin_cmd} that are a multiple of 64 bit
s/bit/bits/
Quoted 8 lines
admin.tex +8
-0+in length. + +The device MUST supply both device-readable or device-writeable parts +of \field{struct virtio_admin_cmd} that are larger than zero in +length. However, \field{command_specific_data} and +\field{command_specific_result} MAY be zero in length, unless +specified otherwise for the command. +
admin.tex \section{Administration Virtqueues}\label{sec:Basic Facilities of a Virtio Devic · line 501
Quoted 10 lines
admin.tex +10
-0+The driver MUST NOT assume that the device will initialize the whole +device-writeable part of \field{struct virtio_admin_cmd} as described in the specification; instead, +the driver MUST act as if the structure +outside the part of the buffer used by the device +is set to zero. + +If multiple administration virtqueues have been configured, +the driver MUST ensure ordering for commands +placed on different administration virtqueues. +>>>>>>> 29f6525... admin: conformance clauses
Leftover from a merge?
Signature · 1 line
I didn't get a lot in class, but I know it don't come in a shot glass.
PATCH v10 10/10 ccw: document more reserved features
In reply to Michael S. Tsirkinvq reset and shared memory are unsupported, too.
---
This is not strictly part of this patchset, but just to give you the idea of how we can expand this down the road.
content.tex | 2 ++ 1 file changed, 2 insertions(+)
content.tex +2 -0
@@ -2983,6 +2983,8 @@ \subsection{Features reserved for future use}\label{sec:Virtio Transport Options \begin{itemize} \item VIRTIO_F_ADMIN_VQ +\item VIRTIO_F_RING_RESET +\item Shared memory regions including VIRTIO_PMEM_F_SHMEM_REGION \end{itemize}
Signature · 1 line
MST
[virtio] Re: [PATCH v10 10/10] ccw: document more reserved features
Quoted 8 lines · Michael S. Tsirkin
vq reset and shared memory are unsupported, too.
Signed-off-by Michael S. Tsirkin <[email protected]>---
This is not strictly part of this patchset, but just to give you the idea of how we can expand this down the road.
We could split this out to a separate change on top. I think I should just open an issue for that.
Quoted 10 lines
content.tex | 2 ++ 1 file changed, 2 insertions(+)content.tex +0
-0
content.tex \subsection{Features reserved for future use}\label{sec:Virtio Transport Options · line 2989
Quoted 7 lines
content.tex +2
-0@@ -2983,6 +2983,8 @@ \subsection{Features reserved for future use}\label{sec:Virtio Transport Options \begin{itemize} \item VIRTIO_F_ADMIN_VQ +\item VIRTIO_F_RING_RESET +\item Shared memory regions including VIRTIO_PMEM_F_SHMEM_REGION \end{itemize}
---------------------------------------------------------------------
To unsubscribe from this mail list, you must leave the OASIS TC that generates this mail. Follow this link to all your TCs in OASIS at:
https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php
Re: [virtio] Re: [PATCH v10 10/10] ccw: document more reserved features
Quoted 8 lines · Cornelia Huck
Quoted 6 lines · Michael S. Tsirkin
vq reset and shared memory are unsupported, too.
Signed-off-by Michael S. Tsirkin <[email protected]>---
Quoted 5 lines
Quoted 2 lines
This is not strictly part of this patchset, but just to give you the idea of how we can expand this down the road.
We could split this out to a separate change on top. I think I should just open an issue for that.
Opened https://github.com/oasis-tcs/virtio-spec/issues/160.
---------------------------------------------------------------------
To unsubscribe from this mail list, you must leave the OASIS TC that generates this mail. Follow this link to all your TCs in OASIS at:
https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php
Quoted 3 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, February 9, 2023 7:13 AM
[..]
Quoted 3 lines
My intent is to try and support both SR-IOV and SIOV usecases with the same structure and maybe even the same VQ.
Probably it is implicit, but is better for us to mention few examples use cases here something like,
Admin queue is an infrastructure to support use cases like:
a. SIOV devices life cycles management (create, destroy, query, configure) b. SR-IOV VF device/resource management (SR-PCIM)
c. May be transport
Quoted 3 lines
For example, it might make sense to split creating/destroying SIOV devices from the transport passing data from the guest - the driver would then not negotiate
VIRTIO_F_SR_IOV(which then means auto-provisioning).
Above intermixing of SIOV and SR_IOV is very confusing. Can you please drop it and have simpler examples like above?
Quoted 16 lines · Parav Pandit
Quoted 3 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, February 9, 2023 7:13 AM[..]
Quoted 3 lines
My intent is to try and support both SR-IOV and SIOV usecases with the same structure and maybe even the same VQ.
Probably it is implicit, but is better for us to mention few examples use cases here something like,
Admin queue is an infrastructure to support use cases like:
a. SIOV devices life cycles management (create, destroy, query, configure) b. SR-IOV VF device/resource management (SR-PCIM)
c. May be transport
Quoted 6 lines
Quoted 3 lines
For example, it might make sense to split creating/destroying SIOV devices from the transport passing data from the guest - the driver would then not negotiate
VIRTIO_F_SR_IOV(which then means auto-provisioning).Above intermixing of SIOV and
SR_IOVis very confusing. Can you please drop it and have simpler examples like above?
You mean in the cover letter? The more info in the cover letter the better, this stuff does not end up in git. I'll add your examples too though, thanks!
Signature · 1 line
MST
Quoted 25 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Sunday, February 12, 2023 4:42 AMQuoted 9 lines · Parav Pandit
Quoted 3 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, February 9, 2023 7:13 AM[..]
Quoted 3 lines
My intent is to try and support both SR-IOV and SIOV usecases with the same structure and maybe even the same VQ.
Quoted 11 lines
Probably it is implicit, but is better for us to mention few examples use cases here something like,
Admin queue is an infrastructure to support use cases like:
a. SIOV devices life cycles management (create, destroy, query, configure) b. SR-IOV VF device/resource management (SR-PCIM) c. May be transportQuoted 3 lines
For example, it might make sense to split creating/destroying SIOV devices from the transport passing data from the guest - the driver would then not negotiate
VIRTIO_F_SR_IOV(which then means auto-
Quoted 7 lines
provisioning).
Quoted 3 lines
Above intermixing of SIOV and
SR_IOVis very confusing. Can you please drop it and have simpler examples like above?You mean in the cover letter? The more info in the cover letter the better, this stuff does not end up in git.
Yes, in the cover letter. Its ok its not in the git.
Maybe we can start also in the git. Sometimes it's useful for series like this.
it is easy to review and digest the use of new feature introduction when those use cases are described in cover letter.
Quoted 1 line
I'll add your examples too though, thanks!
Ok 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/