virtio-net: introduce admin control virtqueue
PATCH 1/1 virtio-net: introduce admin control virtqueue
When implementing multiple (sub)functions virtio device like SRIOV or sub-function. We're suffering from several issues:
- There's no management interface for management function (PF) to configure features, attributes for a (sub)function
- Per (sub)function control virtqueue could be too expensive as the number of (sub)functions could be very large
- Virtualize per (sub)function control virtqueue could be very challenge as we need the support of DMA isolation at queue level
So this patch introduces the feature of VIRTIO_NET_CTRL_ADMIN_VQ. This allows the device to implement a single admin control virtqueue to manage per (sub)function features and attributes.
The idea is simple, a new function id is introduced on top of the exist virtio_net_ctrl structure. This id is transport or device specific to uniquely identify a (sub)function.
With this, we get a way of using management function (PF) to configure per (sub)function features and attributes. And since the admin control virtqueue belongs to management function (PF), the DMA is naturally isolated at (sub)function level instead of the queue level for per (sub)function control vq.
--- content.tex | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
content.tex +23 -0
@@ -2940,6 +2940,9 @@ \subsection{Feature bits}\label{sec:Device Types / Network Device / Feature bits \item[VIRTIO_NET_F_CTRL_MAC_ADDR(23)] Set MAC address through control channel. +\item[VIRTIO_NET_F_ADMIN_CTRL_VQ(56)] Admin control channel is + available. + \item[VIRTIO_NET_F_HASH_REPORT(57)] Device can report per-packet hash value and a type of calculated hash.
@@ -3864,6 +3867,26 @@ \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Devi do except issue a diagnostic if \field{ack} is not VIRTIO_NET_OK. +\subsubsection{Admin Control Virtqueue}\label{sec:Device Types / Network Device / Device Operation / Control Virtqueue} + +When VIRTIO_NET_F_ADMIN_CTRL_VQ is negotiated, the driver can use the +control virtqueue to manipulate features of individual function where +the control virtqueues is not easily implemented in each function. + +All commands are of the following form: + +\begin{lstlisting} +struct virtio_net_admin_ctrl { + u32 function_id; + struct virtio_net_ctrl ctrl; +}; + +\end{lstlisting} + +The \field{function_id} is an unique transport or device specific +identifier for a function. E.g for the case of PCI SRIOV, it's the id +of PCI function. + \paragraph{Packet Receive Filtering}\label{sec:Device Types / Network Device / Device Operation / Control Virtqueue / Packet Receive Filtering} \label{sec:Device Types / Network Device / Device Operation / Control Virtqueue / Setting Promiscuous Mode}%old label for latexdiff
Signature · 18 lines
2.25.1 This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC. In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting. Subscribe: [email protected] Unsubscribe: [email protected] List help: [email protected] List archive: https://lists.oasis-open.org/archives/virtio-comment/ Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists Committee: https://www.oasis-open.org/committees/virtio/ Join OASIS: https://www.oasis-open.org/join/
Quoted 18 lines · Jason Wang
When implementing multiple (sub)functions virtio device like SRIOV or sub-function. We're suffering from several issues:
- There's no management interface for management function (PF) to configure features, attributes for a (sub)function
- Per (sub)function control virtqueue could be too expensive as the number of (sub)functions could be very large
- Virtualize per (sub)function control virtqueue could be very challenge as we need the support of DMA isolation at queue levelSo this patch introduces the feature of
VIRTIO_NET_CTRL_ADMIN_VQ. This allows the device to implement a single admin control virtqueue to manage per (sub)function features and attributes.The idea is simple, a new function id is introduced on top of the exist
virtio_net_ctrlstructure. This id is transport or device specific to uniquely identify a (sub)function.
Quoted 7 lines
With this, we get a way of using management function (PF) to configure per (sub)function features and attributes. And since the admin control virtqueue belongs to management function (PF), the DMA is naturally isolated at (sub)function level instead of the queue level for per (sub)function control vq.
Signed-off-by Jason Wang <[email protected]>
Let's specify how this works at least for PCI? What about sub-functions under VF level? How are these specified?
Quoted 19 lines
--- content.tex | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)content.tex +3
-0@@ -2940,6 +2940,9 @@ \subsection{Feature bits}\label{sec:Device Types / Network Device / Feature bits \item[VIRTIO_NET_F_CTRL_MAC_ADDR(23)] Set MAC address through control channel. +\item[VIRTIO_NET_F_ADMIN_CTRL_VQ(56)] Admin control channel is + available. + \item[VIRTIO_NET_F_HASH_REPORT(57)] Device can report per-packet hash value and a type of calculated hash.
content.tex \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Devi · line 3873
Quoted 7 lines
content.tex +4
-0@@ -3864,6 +3867,26 @@ \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Devi do except issue a diagnostic if \field{ack} is not VIRTIO_NET_OK. +\subsubsection{Admin Control Virtqueue}\label{sec:Device Types / Network Device / Device Operation / Control Virtqueue} + +When VIRTIO_NET_F_ADMIN_CTRL_VQ is negotiated, the driver can use the +control virtqueue to manipulate features of individual function where
manipulate features? You don't mean feature bits, do you?
Quoted 21 lines
content.tex +16
-0+the control virtqueues is not easily implemented in each function. + +All commands are of the following form: + +\begin{lstlisting} +struct virtio_net_admin_ctrl { + u32 function_id; + struct virtio_net_ctrl ctrl; +}; + +\end{lstlisting} + +The \field{function_id} is an unique transport or device specific +identifier for a function. E.g for the case of PCI SRIOV, it's the id +of PCI function. + \paragraph{Packet Receive Filtering}\label{sec:Device Types / Network Device / Device Operation / Control Virtqueue / Packet Receive Filtering} \label{sec:Device Types / Network Device / Device Operation / Control Virtqueue / Setting Promiscuous Mode}%old label for latexdiffSignature · 1 line
2.25.1
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
----- Original Message -----
Quoted 25 lines · Jason Wang
Quoted 24 lines
When implementing multiple (sub)functions virtio device like SRIOV or sub-function. We're suffering from several issues:
- There's no management interface for management function (PF) to configure features, attributes for a (sub)function
- Per (sub)function control virtqueue could be too expensive as the number of (sub)functions could be very large
- Virtualize per (sub)function control virtqueue could be very challenge as we need the support of DMA isolation at queue levelSo this patch introduces the feature of
VIRTIO_NET_CTRL_ADMIN_VQ. This allows the device to implement a single admin control virtqueue to manage per (sub)function features and attributes.The idea is simple, a new function id is introduced on top of the exist
virtio_net_ctrlstructure. This id is transport or device specific to uniquely identify a (sub)function.With this, we get a way of using management function (PF) to configure per (sub)function features and attributes. And since the admin control virtqueue belongs to management function (PF), the DMA is naturally isolated at (sub)function level instead of the queue level for per (sub)function control vq.
Quoted 4 lines
Quoted 1 line
Signed-off-by Jason Wang <[email protected]>Let's specify how this works at least for PCI? What about sub-functions under VF level? How are these specified?
Ok, will do.
Quoted 25 lines
Quoted 25 lines
--- content.tex | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)content.tex +0
-0@@ -2940,6 +2940,9 @@ \subsection{Feature bits}\label{sec:Device Types /Network Device / Feature bits
\item[VIRTIO_NET_F_CTRL_MAC_ADDR(23)] Set MAC address through control
channel.+\item[VIRTIO_NET_F_ADMIN_CTRL_VQ(56)] Admin control channel is
content.tex +2
-0+ available. + \item[VIRTIO_NET_F_HASH_REPORT(57)] Device can report per-packet hash value and a type of calculated hash.@@ -3864,6 +3867,26 @@ \subsubsection{Control Virtqueue}\label{sec:DeviceTypes / Network Device / Devi
do except issue a diagnostic if \field{ack} is notVIRTIO_NET_OK.
Quoted 7 lines
content.tex \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Devi · line 3873
Quoted 5 lines
+\subsubsection{Admin Control Virtqueue}\label{sec:Device Types / Network Device / Device Operation / Control Virtqueue}
content.tex +3
-0+ +When VIRTIO_NET_F_ADMIN_CTRL_VQ is negotiated, the driver can use the +control virtqueue to manipulate features of individual function wheremanipulate features? You don't mean feature bits, do you?
I copy from the control virtqueue paragraph above:
"""
The driver uses the control virtqueue (if VIRTIO_NET_F_CTRL_VQ is negotiated) to send commands to manipulate various features of the device which would not easily map into the configuration space.
"""
Do we need to tweak that part as well?
Thanks
Quoted 33 lines
Quoted 23 lines
content.tex +16
-1+the control virtqueues is not easily implemented in each function. + +All commands are of the following form: + +\begin{lstlisting} +struct virtio_net_admin_ctrl { + u32 function_id; + struct virtio_net_ctrl ctrl; +}; + +\end{lstlisting} + +The \field{function_id} is an unique transport or device specific +identifier for a function. E.g for the case of PCI SRIOV, it's the id +of PCI function. + \paragraph{Packet Receive Filtering}\label{sec:Device Types / Network Device / Device Operation / Control Virtqueue / Packet Receive Filtering} \label{sec:Device Types / Network Device / Device Operation / Control Virtqueue / Setting Promiscuous Mode}%old label for latexdiff --Quoted 1 line
2.25.1
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Quoted 10 lines
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
Quoted 77 lines · Jason Wang
----- Original Message -----
Quoted 25 lines · Jason Wang
Quoted 24 lines
When implementing multiple (sub)functions virtio device like SRIOV or sub-function. We're suffering from several issues:
- There's no management interface for management function (PF) to configure features, attributes for a (sub)function
- Per (sub)function control virtqueue could be too expensive as the number of (sub)functions could be very large
- Virtualize per (sub)function control virtqueue could be very challenge as we need the support of DMA isolation at queue levelSo this patch introduces the feature of
VIRTIO_NET_CTRL_ADMIN_VQ. This allows the device to implement a single admin control virtqueue to manage per (sub)function features and attributes.The idea is simple, a new function id is introduced on top of the exist
virtio_net_ctrlstructure. This id is transport or device specific to uniquely identify a (sub)function.With this, we get a way of using management function (PF) to configure per (sub)function features and attributes. And since the admin control virtqueue belongs to management function (PF), the DMA is naturally isolated at (sub)function level instead of the queue level for per (sub)function control vq.
Quoted 4 lines
Quoted 1 line
Signed-off-by Jason Wang <[email protected]>Let's specify how this works at least for PCI? What about sub-functions under VF level? How are these specified?
Ok, will do.
Quoted 25 lines
Quoted 25 lines
--- content.tex | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)content.tex +0
-0@@ -2940,6 +2940,9 @@ \subsection{Feature bits}\label{sec:Device Types /Network Device / Feature bits
\item[VIRTIO_NET_F_CTRL_MAC_ADDR(23)] Set MAC address through control
channel.+\item[VIRTIO_NET_F_ADMIN_CTRL_VQ(56)] Admin control channel is
content.tex +2
-0+ available. + \item[VIRTIO_NET_F_HASH_REPORT(57)] Device can report per-packet hash value and a type of calculated hash.@@ -3864,6 +3867,26 @@ \subsubsection{Control Virtqueue}\label{sec:DeviceTypes / Network Device / Devi
do except issue a diagnostic if \field{ack} is notVIRTIO_NET_OK.Quoted 7 lines
content.tex \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Devi · line 3873
Quoted 5 lines
+\subsubsection{Admin Control Virtqueue}\label{sec:Device Types / Network Device / Device Operation / Control Virtqueue}
content.tex +3
-0+ +When VIRTIO_NET_F_ADMIN_CTRL_VQ is negotiated, the driver can use the +control virtqueue to manipulate features of individual function wheremanipulate features? You don't mean feature bits, do you?
I copy from the control virtqueue paragraph above:
"""
The driver uses the control virtqueue (ifVIRTIO_NET_F_CTRL_VQis negotiated) to send commands to manipulate various features of the device which would not easily map into the configuration space.
"""
Quoted 3 lines
Do we need to tweak that part as well?
Thanks
Maybe, but let's be a bit more specific. For example, is it legal to manipulate the MAC of a VF? When is it legal?
Quoted 33 lines
Quoted 33 lines
Quoted 23 lines
content.tex +16
-1+the control virtqueues is not easily implemented in each function. + +All commands are of the following form: + +\begin{lstlisting} +struct virtio_net_admin_ctrl { + u32 function_id; + struct virtio_net_ctrl ctrl; +}; + +\end{lstlisting} + +The \field{function_id} is an unique transport or device specific +identifier for a function. E.g for the case of PCI SRIOV, it's the id +of PCI function. + \paragraph{Packet Receive Filtering}\label{sec:Device Types / Network Device / Device Operation / Control Virtqueue / Packet Receive Filtering} \label{sec:Device Types / Network Device / Device Operation / Control Virtqueue / Setting Promiscuous Mode}%old label for latexdiff --Quoted 1 line
2.25.1
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Quoted 10 lines
Quoted 10 lines
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
----- Original Message -----
Quoted 81 lines · Jason Wang
Quoted 80 lines
----- Original Message -----
Quoted 25 lines · Jason Wang
Quoted 24 lines
When implementing multiple (sub)functions virtio device like SRIOV or sub-function. We're suffering from several issues:
- There's no management interface for management function (PF) to configure features, attributes for a (sub)function
- Per (sub)function control virtqueue could be too expensive as the number of (sub)functions could be very large
- Virtualize per (sub)function control virtqueue could be very challenge as we need the support of DMA isolation at queue levelSo this patch introduces the feature of
VIRTIO_NET_CTRL_ADMIN_VQ. This allows the device to implement a single admin control virtqueue to manage per (sub)function features and attributes.The idea is simple, a new function id is introduced on top of the exist
virtio_net_ctrlstructure. This id is transport or device specific to uniquely identify a (sub)function.With this, we get a way of using management function (PF) to configure per (sub)function features and attributes. And since the admin control virtqueue belongs to management function (PF), the DMA is naturally isolated at (sub)function level instead of the queue level for per (sub)function control vq.
Quoted 4 lines
Quoted 1 line
Signed-off-by Jason Wang <[email protected]>Let's specify how this works at least for PCI? What about sub-functions under VF level? How are these specified?
Ok, will do.
Quoted 27 lines
Quoted 27 lines
--- content.tex | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)content.tex +0
-0@@ -2940,6 +2940,9 @@ \subsection{Feature bits}\label{sec:Device Types/
Network Device / Feature bits
\item[VIRTIO_NET_F_CTRL_MAC_ADDR(23)] Set MAC address through control
channel.+\item[VIRTIO_NET_F_ADMIN_CTRL_VQ(56)] Admin control channel is
content.tex +2
-0+ available. + \item[VIRTIO_NET_F_HASH_REPORT(57)] Device can report per-packet hash value and a type of calculated hash.@@ -3864,6 +3867,26 @@ \subsubsection{ControlVirtqueue}\label{sec:Device
Types / Network Device / Devi
do except issue a diagnostic if \field{ack} is notVIRTIO_NET_OK.Quoted 8 lines
content.tex \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Devi · line 3873
Quoted 6 lines
+\subsubsection{Admin Control Virtqueue}\label{sec:Device Types / Network
Device / Device Operation / Control Virtqueue}content.tex +3
-0+ +When VIRTIO_NET_F_ADMIN_CTRL_VQ is negotiated, the driver can use the +control virtqueue to manipulate features of individual function wheremanipulate features? You don't mean feature bits, do you?
I copy from the control virtqueue paragraph above:
"""
The driver uses the control virtqueue (ifVIRTIO_NET_F_CTRL_VQis negotiated) to send commands to manipulate various features of the device which would not easily map into the configuration space.
"""
Quoted 6 lines
Quoted 3 lines
Do we need to tweak that part as well?
Thanks
Maybe, but let's be a bit more specific. For example, is it legal to manipulate the MAC of a VF?
Right, so we can clarify that the admin control virtqueue should be only used/advertised for the management function like PF. When neogiated, it's always legal to manipulte the MAC of VF through it.
Quoted 1 line
When is it legal?
Or do you mean some like "trust" command for iproute2 that allows VF to change its own mac?
When PF has admin cvq and VF has normal cvq, management software needs to synrhonize the setting of mac address. E.g management won't set mac address after VM is launched.
Thanks
Quoted 56 lines
Quoted 36 lines
Quoted 36 lines
Quoted 26 lines
content.tex +16
-1+the control virtqueues is not easily implemented in each function. + +All commands are of the following form: + +\begin{lstlisting} +struct virtio_net_admin_ctrl { + u32 function_id; + struct virtio_net_ctrl ctrl; +}; + +\end{lstlisting} + +The \field{function_id} is an unique transport or device specific +identifier for a function. E.g for the case of PCI SRIOV, it's the id +of PCI function. + \paragraph{Packet Receive Filtering}\label{sec:Device Types / Network Device / Device Operation / Control Virtqueue / Packet Receive Filtering} \label{sec:Device Types / Network Device / Device Operation / Control Virtqueue / Setting Promiscuous Mode}%old label for latexdiff --Quoted 1 line
2.25.1
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Quoted 11 lines
Quoted 11 lines
Subscribe: [email protected]
Unsubscribe: [email protected] List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines:
https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Quoted 10 lines
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
Quoted 95 lines · Jason Wang
----- Original Message -----
Quoted 81 lines · Jason Wang
Quoted 80 lines
----- Original Message -----
Quoted 25 lines · Jason Wang
Quoted 24 lines
When implementing multiple (sub)functions virtio device like SRIOV or sub-function. We're suffering from several issues:
- There's no management interface for management function (PF) to configure features, attributes for a (sub)function
- Per (sub)function control virtqueue could be too expensive as the number of (sub)functions could be very large
- Virtualize per (sub)function control virtqueue could be very challenge as we need the support of DMA isolation at queue levelSo this patch introduces the feature of
VIRTIO_NET_CTRL_ADMIN_VQ. This allows the device to implement a single admin control virtqueue to manage per (sub)function features and attributes.The idea is simple, a new function id is introduced on top of the exist
virtio_net_ctrlstructure. This id is transport or device specific to uniquely identify a (sub)function.With this, we get a way of using management function (PF) to configure per (sub)function features and attributes. And since the admin control virtqueue belongs to management function (PF), the DMA is naturally isolated at (sub)function level instead of the queue level for per (sub)function control vq.
Quoted 4 lines
Quoted 1 line
Signed-off-by Jason Wang <[email protected]>Let's specify how this works at least for PCI? What about sub-functions under VF level? How are these specified?
Ok, will do.
Quoted 27 lines
Quoted 27 lines
--- content.tex | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)content.tex +0
-0@@ -2940,6 +2940,9 @@ \subsection{Feature bits}\label{sec:Device Types/
Network Device / Feature bits
\item[VIRTIO_NET_F_CTRL_MAC_ADDR(23)] Set MAC address through control
channel.+\item[VIRTIO_NET_F_ADMIN_CTRL_VQ(56)] Admin control channel is
content.tex +2
-0+ available. + \item[VIRTIO_NET_F_HASH_REPORT(57)] Device can report per-packet hash value and a type of calculated hash.@@ -3864,6 +3867,26 @@ \subsubsection{ControlVirtqueue}\label{sec:Device
Types / Network Device / Devi
do except issue a diagnostic if \field{ack} is notVIRTIO_NET_OK.Quoted 8 lines
content.tex \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Devi · line 3873
Quoted 6 lines
+\subsubsection{Admin Control Virtqueue}\label{sec:Device Types / Network
Device / Device Operation / Control Virtqueue}content.tex +3
-0+ +When VIRTIO_NET_F_ADMIN_CTRL_VQ is negotiated, the driver can use the +control virtqueue to manipulate features of individual function wheremanipulate features? You don't mean feature bits, do you?
I copy from the control virtqueue paragraph above:
"""
The driver uses the control virtqueue (ifVIRTIO_NET_F_CTRL_VQis negotiated) to send commands to manipulate various features of the device which would not easily map into the configuration space.
"""Quoted 6 lines
Quoted 3 lines
Do we need to tweak that part as well?
Thanks
Maybe, but let's be a bit more specific. For example, is it legal to manipulate the MAC of a VF?
Right, so we can clarify that the admin control virtqueue should be only used/advertised for the management function like PF. When neogiated, it's always legal to manipulte the MAC of VF through it.
Quoted 1 line
When is it legal?
Quoted 8 lines
Or do you mean some like "trust" command for iproute2 that allows VF to change its own mac?
When PF has admin cvq and VF has normal cvq, management software needs to synrhonize the setting of mac address. E.g management won't set mac address after VM is launched.
Thanks
Consider.
VF has VIRTIO_NET_F_CTRL_MAC_ADDR. This means guest can set mac address. This is something PF needs ability to control. How is this done?
Also, does PF allow setting guest MAC? when? when PF has VIRTIO_NET_F_CTRL_MAC_ADDR? Do we differentiate between that and ability to set MAC for pf?
Quoted 56 lines
Quoted 56 lines
Quoted 36 lines
Quoted 36 lines
Quoted 26 lines
content.tex +16
-1+the control virtqueues is not easily implemented in each function. + +All commands are of the following form: + +\begin{lstlisting} +struct virtio_net_admin_ctrl { + u32 function_id; + struct virtio_net_ctrl ctrl; +}; + +\end{lstlisting} + +The \field{function_id} is an unique transport or device specific +identifier for a function. E.g for the case of PCI SRIOV, it's the id +of PCI function. + \paragraph{Packet Receive Filtering}\label{sec:Device Types / Network Device / Device Operation / Control Virtqueue / Packet Receive Filtering} \label{sec:Device Types / Network Device / Device Operation / Control Virtqueue / Setting Promiscuous Mode}%old label for latexdiff --Quoted 1 line
2.25.1
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Quoted 11 lines
Quoted 11 lines
Subscribe: [email protected]
Unsubscribe: [email protected] List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines:
https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Quoted 10 lines
Quoted 10 lines
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
Quoted 89 lines · Michael S. Tsirkin
Quoted 88 lines · Jason Wang
----- Original Message -----
Quoted 74 lines · Jason Wang
Quoted 73 lines
----- Original Message -----
Quoted 25 lines · Jason Wang
Quoted 24 lines
When implementing multiple (sub)functions virtio device like SRIOV or sub-function. We're suffering from several issues:
- There's no management interface for management function (PF) to configure features, attributes for a (sub)function
- Per (sub)function control virtqueue could be too expensive as the number of (sub)functions could be very large
- Virtualize per (sub)function control virtqueue could be very challenge as we need the support of DMA isolation at queue levelSo this patch introduces the feature of
VIRTIO_NET_CTRL_ADMIN_VQ. This allows the device to implement a single admin control virtqueue to manage per (sub)function features and attributes.The idea is simple, a new function id is introduced on top of the exist
virtio_net_ctrlstructure. This id is transport or device specific to uniquely identify a (sub)function.With this, we get a way of using management function (PF) to configure per (sub)function features and attributes. And since the admin control virtqueue belongs to management function (PF), the DMA is naturally isolated at (sub)function level instead of the queue level for per (sub)function control vq.
Quoted 3 lines
Quoted 1 line
Signed-off-by Jason Wang<[email protected]>Let's specify how this works at least for PCI? What about sub-functions under VF level? How are these specified?
Ok, will do.
Quoted 26 lines
Quoted 26 lines
--- content.tex | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)content.tex +0
-0@@ -2940,6 +2940,9 @@ \subsection{Feature bits}\label{sec:Device Types/
Network Device / Feature bits
\item[VIRTIO_NET_F_CTRL_MAC_ADDR(23)] Set MAC address through control
channel.+\item[VIRTIO_NET_F_ADMIN_CTRL_VQ(56)] Admin control channel is
content.tex +2
-0+ available. + \item[VIRTIO_NET_F_HASH_REPORT(57)] Device can report per-packet hash value and a type of calculated hash.@@ -3864,6 +3867,26 @@ \subsubsection{ControlVirtqueue}\label{sec:Device
Types / Network Device / Devi
do except issue a diagnostic if \field{ack} is notVIRTIO_NET_OK.Quoted 7 lines
content.tex \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Devi · line 3873
Quoted 6 lines
+\subsubsection{Admin Control Virtqueue}\label{sec:Device Types / Network
Device / Device Operation / Control Virtqueue}content.tex +3
-0+ +When VIRTIO_NET_F_ADMIN_CTRL_VQ is negotiated, the driver can use the +control virtqueue to manipulate features of individual function wheremanipulate features? You don't mean feature bits, do you?
I copy from the control virtqueue paragraph above:
"""
The driver uses the control virtqueue (ifVIRTIO_NET_F_CTRL_VQis negotiated) to send commands to manipulate various features of the device which would not easily map into the configuration space.
"""Quoted 5 lines
Quoted 3 lines
Do we need to tweak that part as well?
Thanks
Maybe, but let's be a bit more specific. For example, is it legal to manipulate the MAC of a VF?
Right, so we can clarify that the admin control virtqueue should be only used/advertised for the management function like PF. When neogiated, it's always legal to manipulte the MAC of VF through it.
Quoted 1 line
When is it legal?
Or do you mean some like "trust" command for iproute2 that allows VF to change its own mac?
Quoted 8 lines
Quoted 5 lines
When PF has admin cvq and VF has normal cvq, management software needs to synrhonize the setting of mac address. E.g management won't set mac address after VM is launched.
Thanks
Consider.
VF hasVIRTIO_NET_F_CTRL_MAC_ADDR. This means guest can set mac address. This is something PF needs ability to control. How is this done?
This requires a new command to allow/deny the mac address setting from the VF.
Quoted 2 lines
Also, does PF allow setting guest MAC?
I think the answer is yes.
Quoted 1 line
when?
It will work as how ip set vf mac work. Usually, it should be done before launching the guest. Management should make sure there's no conflict in mac address updating.
Quoted 2 lines
when PF has
VIRTIO_NET_F_CTRL_MAC_ADDR?
Yes, without this feature. We can't set mac address through admin control virtqueue.
Quoted 2 lines
Do we differentiate between
that and ability to set MAC for pf?
I think not. E.g PF should have a dedicated function_id (or virtual device id) like 0. Then we can set mac address of PF through admin cvq.
Thanks
Quoted 4 lines
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/
Quoted 44 lines · On Fri, 22 Jan 2021 16:23:25 +0800 Jason Wang <[email protected]> wrote:
When implementing multiple (sub)functions virtio device like SRIOV or sub-function. We're suffering from several issues:
- There's no management interface for management function (PF) to configure features, attributes for a (sub)function
- Per (sub)function control virtqueue could be too expensive as the number of (sub)functions could be very large
- Virtualize per (sub)function control virtqueue could be very challenge as we need the support of DMA isolation at queue levelSo this patch introduces the feature of
VIRTIO_NET_CTRL_ADMIN_VQ. This allows the device to implement a single admin control virtqueue to manage per (sub)function features and attributes.The idea is simple, a new function id is introduced on top of the exist
virtio_net_ctrlstructure. This id is transport or device specific to uniquely identify a (sub)function.With this, we get a way of using management function (PF) to configure per (sub)function features and attributes. And since the admin control virtqueue belongs to management function (PF), the DMA is naturally isolated at (sub)function level instead of the queue level for per (sub)function control vq.
Signed-off-by Jason Wang <[email protected]>--- content.tex | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)content.tex +3
-0@@ -2940,6 +2940,9 @@ \subsection{Feature bits}\label{sec:Device Types / Network Device / Feature bits \item[VIRTIO_NET_F_CTRL_MAC_ADDR(23)] Set MAC address through control channel. +\item[VIRTIO_NET_F_ADMIN_CTRL_VQ(56)] Admin control channel is + available. + \item[VIRTIO_NET_F_HASH_REPORT(57)] Device can report per-packet hash value and a type of calculated hash.
content.tex \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Devi · line 3874
Quoted 8 lines
content.tex +5
-0@@ -3864,6 +3867,26 @@ \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Devi do except issue a diagnostic if \field{ack} is not VIRTIO_NET_OK. +\subsubsection{Admin Control Virtqueue}\label{sec:Device Types / Network Device / Device Operation / Control Virtqueue} + +When VIRTIO_NET_F_ADMIN_CTRL_VQ is negotiated, the driver can use the +control virtqueue to manipulate features of individual function where +the control virtqueues is not easily implemented in each function.
What is a 'function' in the context of the virtio-net device? I don't think that this term is universal across transports.
Quoted 8 lines
content.tex +8
-0+ +All commands are of the following form: + +\begin{lstlisting} +struct virtio_net_admin_ctrl { + u32 function_id; + struct virtio_net_ctrl ctrl; +};
content.tex \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Devi · line 3892
Quoted 10 lines
content.tex +7
-0+ +\end{lstlisting} + +The \field{function_id} is an unique transport or device specific +identifier for a function. E.g for the case of PCI SRIOV, it's the id +of PCI function. + \paragraph{Packet Receive Filtering}\label{sec:Device Types / Network Device / Device Operation / Control Virtqueue / Packet Receive Filtering} \label{sec:Device Types / Network Device / Device Operation / Control Virtqueue / Setting Promiscuous Mode}%old label for latexdiff
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/
Quoted 50 lines · Cornelia Huck
Quoted 47 lines · On Fri, 22 Jan 2021 16:23:25 +0800 Jason Wang<[email protected]> wrote:
When implementing multiple (sub)functions virtio device like SRIOV or sub-function. We're suffering from several issues:
- There's no management interface for management function (PF) to configure features, attributes for a (sub)function
- Per (sub)function control virtqueue could be too expensive as the number of (sub)functions could be very large
- Virtualize per (sub)function control virtqueue could be very challenge as we need the support of DMA isolation at queue levelSo this patch introduces the feature of
VIRTIO_NET_CTRL_ADMIN_VQ. This allows the device to implement a single admin control virtqueue to manage per (sub)function features and attributes.The idea is simple, a new function id is introduced on top of the exist
virtio_net_ctrlstructure. This id is transport or device specific to uniquely identify a (sub)function.With this, we get a way of using management function (PF) to configure per (sub)function features and attributes. And since the admin control virtqueue belongs to management function (PF), the DMA is naturally isolated at (sub)function level instead of the queue level for per (sub)function control vq.
Signed-off-by Jason Wang<[email protected]>--- content.tex | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)content.tex +3
-0@@ -2940,6 +2940,9 @@ \subsection{Feature bits}\label{sec:Device Types / Network Device / Feature bits \item[VIRTIO_NET_F_CTRL_MAC_ADDR(23)] Set MAC address through control channel. +\item[VIRTIO_NET_F_ADMIN_CTRL_VQ(56)] Admin control channel is + available. + \item[VIRTIO_NET_F_HASH_REPORT(57)] Device can report per-packet hash value and a type of calculated hash.@@ -3864,6 +3867,26 @@ \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Devi do except issue a diagnostic if \field{ack} is not VIRTIO_NET_OK.
Quoted 7 lines
content.tex \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Devi · line 3874
Quoted 5 lines
content.tex +5
-0+\subsubsection{Admin Control Virtqueue}\label{sec:Device Types / Network Device / Device Operation / Control Virtqueue} + +When VIRTIO_NET_F_ADMIN_CTRL_VQ is negotiated, the driver can use the +control virtqueue to manipulate features of individual function where +the control virtqueues is not easily implemented in each function.What is a 'function' in the context of the virtio-net device? I don't think that this term is universal across transports.
Good point. It might have well definition only in PCI.
I wonder whether we can use "virtual device" here? It avoids transport specific terminology. And we can explain "virtual device" in one or two sentences here.
Thanks
Quoted 1 line
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/
----- Original Message -----
Quoted 64 lines · Cornelia Huck
Quoted 52 lines
Quoted 49 lines · On Fri, 22 Jan 2021 16:23:25 +0800 Jason Wang<[email protected]> wrote:
When implementing multiple (sub)functions virtio device like SRIOV or sub-function. We're suffering from several issues:
- There's no management interface for management function (PF) to configure features, attributes for a (sub)function
- Per (sub)function control virtqueue could be too expensive as the number of (sub)functions could be very large
- Virtualize per (sub)function control virtqueue could be very challenge as we need the support of DMA isolation at queue levelSo this patch introduces the feature of
VIRTIO_NET_CTRL_ADMIN_VQ. This allows the device to implement a single admin control virtqueue to manage per (sub)function features and attributes.The idea is simple, a new function id is introduced on top of the exist
virtio_net_ctrlstructure. This id is transport or device specific to uniquely identify a (sub)function.With this, we get a way of using management function (PF) to configure per (sub)function features and attributes. And since the admin control virtqueue belongs to management function (PF), the DMA is naturally isolated at (sub)function level instead of the queue level for per (sub)function control vq.
Signed-off-by Jason Wang<[email protected]>--- content.tex | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)content.tex +0
-0@@ -2940,6 +2940,9 @@ \subsection{Feature bits}\label{sec:Device Types /Network Device / Feature bits
\item[VIRTIO_NET_F_CTRL_MAC_ADDR(23)] Set MAC address through control
channel.+\item[VIRTIO_NET_F_ADMIN_CTRL_VQ(56)] Admin control channel is
content.tex +2
-0+ available. + \item[VIRTIO_NET_F_HASH_REPORT(57)] Device can report per-packet hash value and a type of calculated hash.@@ -3864,6 +3867,26 @@ \subsubsection{Control Virtqueue}\label{sec:DeviceTypes / Network Device / Devi
do except issue a diagnostic if \field{ack} is notVIRTIO_NET_OK.Quoted 8 lines
content.tex \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Devi · line 3874
Quoted 6 lines
+\subsubsection{Admin Control Virtqueue}\label{sec:Device Types / Network Device / Device Operation / Control Virtqueue}
content.tex +4
-0+ +When VIRTIO_NET_F_ADMIN_CTRL_VQ is negotiated, the driver can use the +control virtqueue to manipulate features of individual function where +the control virtqueues is not easily implemented in each function.What is a 'function' in the context of the virtio-net device? I don't think that this term is universal across transports.
Quoted 7 lines
Good point. It might have well definition only in PCI.
I wonder whether we can use "virtual device" here? It avoids transport specific terminology. And we can explain "virtual device" in one or two sentences here.
Thanks
Something like:
When VIRTIO_NET_F_ADMIN_CTRL_VQ is negotiated, the driver can use the admin control virtqueue of the management device to manipulate features of individual virtual devices where the control virtqueue is not easily implemented. The definition of management device and virtual device is totally transport specific. E.g in the case of PCI transport, the management device is usually the physical function (PF), and the virtual device is the virtual function (VF).
Thanks
Quoted 12 lines
Quoted 3 lines
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Quoted 10 lines
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/