content: add virtio file system device
RFC 1/1 content: add virtio file system device
The work-in-progress virtio file system device transports Linux FUSE requests between a FUSE daemon running on the host and the FUSE driver inside the guest.
This is an early version of the spec that maps FUSE requests to virtqueues. No changes are needed to the FUSE request format.
Multiqueue is supported for normal requests. FUSE_INTERRUPT and FUSE_FORGET requests are only sent on the dedicated hiprio queue. Notifications are sent on the notifications queue.
The FUSE driver currently works in a "pull" model where userspace reads requests from /dev/fuse one at a time. Virtqueues are a "push" model where the FUSE driver will need to enqueue requests onto a specific virtqueue and wait for the guest to process them.
The request queue buffers are completed by the device when the request has been processed and struct fuse_out_header has been filled out. The FUSE driver then picks up the completed request and processes it as if the FUSE daemon had written to /dev/fuse.
Notifications involve device-to-driver communication. Since virtqueues live in guest RAM, the device cannot initiate communication. Instead the notifications queue is populated with empty buffers by the FUSE driver (similar to a NIC rx queue). The device then "completes" a buffer when it wishes to notify the driver. Replies to the notification are place in a normal request queue, they do not go via the notifications queue.
Note that this design assumes that the driver knows the required buffer size for each request. My understanding is that this is true in FUSE. The only exception is FUSE_NOTIFY_STORE, and even there the FUSE implementation has a limit of 32 pages, which makes for a natural buffer size limit for the notifications queue.
---
The HTML version of this draft spec is available at
https://stefanha.github.io/virtio/virtio-fs.html#x1-38800010.
This is mostly for reference and serious review isn't necessary yet.
For more information on virtio-fs, see https://virtio-fs.gitlab.io/.
Once the implementation matures we will send a real VIRTIO spec patch.
content.tex | 3 + introduction.tex | 3 + virtio-fs.tex | 208 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 214 insertions(+) create mode 100644 virtio-fs.tex
content.tex +3 -0
@@ -2528,6 +2528,8 @@ Device ID & Virtio Device \\ \hline 24 & Memory device \\ \hline +26 & file system device \\ +\hline \end{tabular} Some of the devices above are unspecified by this document,
@@ -5432,6 +5434,7 @@ descriptor for the \field{sense_len}, \field{residual}, \input{virtio-gpu.tex} \input{virtio-input.tex} \input{virtio-crypto.tex} +\input{virtio-fs.tex} \chapter{Reserved Feature Bits}\label{sec:Reserved Feature Bits}
introduction.tex +3 -0
@@ -60,6 +60,9 @@ Levels'', BCP 14, RFC 2119, March 1997. \newline\url{http://www.ietf.org/rfc/rfc \phantomsection\label{intro:SCSI MMC}\textbf{[SCSI MMC]} & SCSI Multimedia Commands, \newline\url{http://www.t10.org/cgi-bin/ac.pl?t=f&f=mmc6r00.pdf}\\ + \phantomsection\label{intro:FUSE}\textbf{[FUSE]} & + Linux FUSE interface, + \newline\url{https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/fuse.h}\\ \end{longtable}
virtio-fs.tex new file +208 -0
208 lines not on this page · raw message
Signature · 6 lines
2.19.2 --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Quoted 57 lines · On Tue, 11 Dec 2018 12:51:56 +0000 Stefan Hajnoczi <[email protected]> wrote:
The work-in-progress virtio file system device transports Linux FUSE requests between a FUSE daemon running on the host and the FUSE driver inside the guest.
This is an early version of the spec that maps FUSE requests to virtqueues. No changes are needed to the FUSE request format.
Multiqueue is supported for normal requests.
FUSE_INTERRUPTandFUSE_FORGETrequests are only sent on the dedicated hiprio queue. Notifications are sent on the notifications queue.The FUSE driver currently works in a "pull" model where userspace reads requests from
/dev/fuseone at a time. Virtqueues are a "push" model where the FUSE driver will need to enqueue requests onto a specific virtqueue and wait for the guest to process them.The request queue buffers are completed by the device when the request has been processed and struct
fuse_out_headerhas been filled out. The FUSE driver then picks up the completed request and processes it as if the FUSE daemon had written to/dev/fuse.Notifications involve device-to-driver communication. Since virtqueues live in guest RAM, the device cannot initiate communication. Instead the notifications queue is populated with empty buffers by the FUSE driver (similar to a NIC rx queue). The device then "completes" a buffer when it wishes to notify the driver. Replies to the notification are place in a normal request queue, they do not go via the notifications queue.
Note that this design assumes that the driver knows the required buffer size for each request. My understanding is that this is true in FUSE. The only exception is
FUSE_NOTIFY_STORE, and even there the FUSE implementation has a limit of 32 pages, which makes for a natural buffer size limit for the notifications queue.Signed-off-by Stefan Hajnoczi <[email protected]>---
The HTML version of this draft spec is available at
https://stefanha.github.io/virtio/virtio-fs.html#x1-38800010.This is mostly for reference and serious review isn't necessary yet.
For more information on virtio-fs, see https://virtio-fs.gitlab.io/.
Once the implementation matures we will send a real VIRTIO spec patch.
content.tex | 3 + introduction.tex | 3 + virtio-fs.tex | 208 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 214 insertions(+) create mode 100644 virtio-fs.texcontent.tex +0
-0
content.tex Device ID & Virtio Device \\ · line 2531
Quoted 4 lines
content.tex +1
-0@@ -2528,6 +2528,8 @@ Device ID & Virtio Device \\ \hline 24 & Memory device \\ \hline +26 & file system device \\
Would it make sense to go ahead and reserve this id now?
content.tex Device ID & Virtio Device \\ · line 2535
Quoted 4 lines
content.tex +1
-0+\hline \end{tabular} Some of the devices above are unspecified by this document,
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Quoted 55 lines · Cornelia Huck
Quoted 52 lines · On Tue, 11 Dec 2018 12:51:56 +0000 Stefan Hajnoczi <[email protected]> wrote:
The work-in-progress virtio file system device transports Linux FUSE requests between a FUSE daemon running on the host and the FUSE driver inside the guest.
This is an early version of the spec that maps FUSE requests to virtqueues. No changes are needed to the FUSE request format.
Multiqueue is supported for normal requests.
FUSE_INTERRUPTandFUSE_FORGETrequests are only sent on the dedicated hiprio queue. Notifications are sent on the notifications queue.The FUSE driver currently works in a "pull" model where userspace reads requests from
/dev/fuseone at a time. Virtqueues are a "push" model where the FUSE driver will need to enqueue requests onto a specific virtqueue and wait for the guest to process them.The request queue buffers are completed by the device when the request has been processed and struct
fuse_out_headerhas been filled out. The FUSE driver then picks up the completed request and processes it as if the FUSE daemon had written to/dev/fuse.Notifications involve device-to-driver communication. Since virtqueues live in guest RAM, the device cannot initiate communication. Instead the notifications queue is populated with empty buffers by the FUSE driver (similar to a NIC rx queue). The device then "completes" a buffer when it wishes to notify the driver. Replies to the notification are place in a normal request queue, they do not go via the notifications queue.
Note that this design assumes that the driver knows the required buffer size for each request. My understanding is that this is true in FUSE. The only exception is
FUSE_NOTIFY_STORE, and even there the FUSE implementation has a limit of 32 pages, which makes for a natural buffer size limit for the notifications queue.Signed-off-by Stefan Hajnoczi <[email protected]>---
The HTML version of this draft spec is available at
https://stefanha.github.io/virtio/virtio-fs.html#x1-38800010.This is mostly for reference and serious review isn't necessary yet.
For more information on virtio-fs, see https://virtio-fs.gitlab.io/.
Once the implementation matures we will send a real VIRTIO spec patch.
content.tex | 3 + introduction.tex | 3 + virtio-fs.tex | 208 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 214 insertions(+) create mode 100644 virtio-fs.tex
Quoted 11 lines
content.tex Device ID & Virtio Device \\ · line 2531
Quoted 9 lines
content.tex +1
-0@@ -2528,6 +2528,8 @@ Device ID & Virtio Device \\ \hline 24 & Memory device \\ \hline +26 & file system device \\Would it make sense to go ahead and reserve this id now?
Yes.
Stefan