virtio-fs: add notification queue
v3 cover virtio-fs: add notification queue
v3:
* Clarify that empty notification vq semantics are documented for all supported notification message types. [Vivek]
* Clarify that the device has internal resources for lock requests and when they are exhausted ENOLCK is returned. [Vivek]
v2:
* Document empty virtqueue behavior for FUSE_NOTIFY_LOCK messages
This patch series adds the notification queue to the VIRTIO specification. This new virtqueue carries device->driver FUSE notify messages. They are currently unused but will be necessary for file locking, which can block for an unbounded amount of time and therefore needs a asynchronous completion event instead of a request/response buffer that consumes space in the request virtqueue until the operation completes.
Patch 1 corrects an oversight I noticed: the file system device was not added to the Conformance chapter.
Stefan Hajnoczi (2):
virtio-fs: add file system device to Conformance chapter
virtio-fs: add notification queue
conformance.tex | 23 ++++++++++++++++ virtio-fs.tex | 71 ++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 84 insertions(+), 10 deletions(-)
Signature · 1 line
2.31.1
PATCH v3 1/2 virtio-fs: add file system device to Conformance chapter
The file system device is not listed in the Conformance chapter. Fix this.
--- conformance.tex | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
conformance.tex +22 -0
@@ -25,6 +25,7 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets} \ref{sec:Conformance / Driver Conformance / Input Driver Conformance}, \ref{sec:Conformance / Driver Conformance / Crypto Driver Conformance}, \ref{sec:Conformance / Driver Conformance / Socket Driver Conformance}, +\ref{sec:Conformance / Driver Conformance / File System Driver Conformance}, \ref{sec:Conformance / Driver Conformance / RPMB Driver Conformance}, \ref{sec:Conformance / Driver Conformance / IOMMU Driver Conformance}, \ref{sec:Conformance / Driver Conformance / Sound Driver Conformance},
@@ -48,6 +49,7 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets} \ref{sec:Conformance / Device Conformance / Input Device Conformance}, \ref{sec:Conformance / Device Conformance / Crypto Device Conformance}, \ref{sec:Conformance / Device Conformance / Socket Device Conformance}, +\ref{sec:Conformance / Device Conformance / File System Device Conformance}, \ref{sec:Conformance / Device Conformance / RPMB Device Conformance}, \ref{sec:Conformance / Device Conformance / IOMMU Device Conformance}, \ref{sec:Conformance / Device Conformance / Sound Device Conformance},
@@ -220,6 +222,16 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets} \item \ref{drivernormative:Device Types / Socket Device / Device Operation / Device Events} \end{itemize} +\conformance{\subsection}{File System Driver Conformance}\label{sec:Conformance / Driver Conformance / File System Driver Conformance} + +A file system driver MUST conform to the following normative statements: + +\begin{itemize} +\item \ref{drivernormative:Device Types / File System Device / Device configuration layout} +\item \ref{drivernormative:Device Types / File System Device / Device Operation / Device Operation: High Priority Queue} +\item \ref{drivernormative:Device Types / File System Device / Device Operation / Device Operation: DAX Window} +\end{itemize} + \conformance{\subsection}{RPMB Driver Conformance}\label{sec:Conformance / Driver Conformance / RPMB Driver Conformance} A RPMB driver MUST conform to the following normative statements:
@@ -448,6 +460,16 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets} \item \ref{devicenormative:Device Types / Socket Device / Device Operation / Receive and Transmit} \end{itemize} +\conformance{\subsection}{File System Device Conformance}\label{sec:Conformance / Device Conformance / File System Device Conformance} + +A file system device MUST conform to the following normative statements: + +\begin{itemize} +\item \ref{devicenormative:Device Types / File System Device / Device configuration layout} +\item \ref{devicenormative:Device Types / File System Device / Device Operation / Device Operation: High Priority Queue} +\item \ref{devicenormative:Device Types / File System Device / Device Operation / Device Operation: DAX Window} +\end{itemize} + \conformance{\subsection}{RPMB Device Conformance}\label{sec:Conformance / Device Conformance / RPMB Device Conformance} An RPMB device MUST conform to the following normative statements:
Signature · 1 line
2.31.1
PATCH v3 2/2 virtio-fs: add notification queue
In reply to Stefan HajnocziThe FUSE protocol allows the file server (device) to initiate communication with the client (driver) using FUSE notify messages. Normally only the client can initiate communication. This feature is used to report asynchronous events that are not related to an in-flight request.
This patch adds a notification queue that works like an rx queue in other VIRTIO device types. The device can emit FUSE notify messages by using a buffer from this queue.
This mechanism was designed by Vivek Goyal <[email protected]>.
--- conformance.tex | 1 + virtio-fs.tex | 71 ++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 62 insertions(+), 10 deletions(-)
conformance.tex +1 -0
@@ -229,6 +229,7 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets} \begin{itemize} \item \ref{drivernormative:Device Types / File System Device / Device configuration layout} \item \ref{drivernormative:Device Types / File System Device / Device Operation / Device Operation: High Priority Queue} +\item \ref{drivernormative:Device Types / File System Device / Device Operation / Device Operation: Notification Queue} \item \ref{drivernormative:Device Types / File System Device / Device Operation / Device Operation: DAX Window} \end{itemize}
virtio-fs.tex +61 -10
117 lines not on this page · raw message
Signature · 1 line
2.31.1
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 20 lines · Vivek Goyal
On Wed, Jun 09, 2021 at 04:37:40PM +0100, Stefan Hajnoczi wrote:
[..]
virtio-fs.tex \subsection{Virtqueues}\label{sec:Device Types / File System Device / Virtqueues · line 47
Quoted 9 lines
\subsection{Device configuration layout}\label{sec:Device Types / File System Device / Device configuration layout}
virtio-fs.tex +1
-2-All fields of this configuration are always available. - \begin{lstlisting} struct virtio_fs_config { char tag[36]; le32 num_request_queues; + le32 notify_buf_size;Hi Stefan,
I am wondering if there should be a negotiation for number of descriptors in the notification queue between device and driver. How does it work for regular queus. I remeber there is a qemu has "queue-size" parameter which controls this.
Quoted 4 lines
But given this is notification queue and number of descriptors will be allocated by driver. For now I have hardcoded it to 16 in driver. But may be device should be able to specify how many descriptors to allocate for notification queue, possibly using configuration space? WDYT.
VIRTIO devices report the maximum supported queue size via transport-specific means (e.g. virtio-pci's struct virtio_pci_common_cfg->queue_size field). QEMU's -device virtio-*,queue-size= sets this field.
The driver can reduce the queue size from that maximum, if desired.
Since this mechanism is already present I don't think anything additional is needed in the virtiofs device specification.
Stefan
Quoted 18 lines · Stefan Hajnoczi
v3:
* Clarify that empty notification vq semantics are documented for all supported notification message types. [Vivek]
* Clarify that the device has internal resources for lock requests and when they are exhausted ENOLCK is returned. [Vivek]
v2:
* Document empty virtqueue behavior forFUSE_NOTIFY_LOCKmessagesThis patch series adds the notification queue to the VIRTIO specification. This new virtqueue carries
device->driverFUSE notify messages. They are currently unused but will be necessary for file locking, which can block for an unbounded amount of time and therefore needs a asynchronous completion event instead of a request/response buffer that consumes space in the request virtqueue until the operation completes.Patch 1 corrects an oversight I noticed: the file system device was not added to the Conformance chapter.
Quoted 7 lines
Stefan Hajnoczi (2):
virtio-fs: add file system device to Conformance chapter
virtio-fs: add notification queueconformance.tex | 23 ++++++++++++++++ virtio-fs.tex | 71 ++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 84 insertions(+), 10 deletions(-)
I am requesting a vote. Thank you!
Stefan