[v2,5/5] Documentation: Add reconnect process for VDUSE
Commit Message
Add the document to explained how the reconnect process
include how the Userspace App need to do and how it works
with kernel
Signed-off-by: Cindy Lu <lulu@redhat.com>
---
Documentation/userspace-api/vduse.rst | 29 +++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
@@ -231,3 +231,32 @@ able to start the dataplane processing as follows:
after the used ring is filled.
For more details on the uAPI, please see include/uapi/linux/vduse.h.
+
+HOW VDUSE devices reconnectoin works
+----------------
+0. Userspace APP checks if the device /dev/vduse/vduse_name exists, if not create
+ the device. If yes means this is reconnect, goto 3
+
+1. Create a new VDUSE instance with ioctl(VDUSE_CREATE_DEV) on
+ /dev/vduse/control.
+
+2. In ioctl(VDUSE_CREATE_DEV), the kernel alloc the memory to sync the reconnect
+ information.
+
+3. Userspace App will mmap the pages to userspace
+
+ If this first time to connect, userspace App need save the reconnect
+ information (struct vhost_reconnect_data) in mapped pages
+
+ If this is reconnect, userspace App need to check if the saved information
+ OK to reconnect, Also userspace App MUST set the bit reconnected in
+ struct vhost_reconnect_data to 1. (kernel will use this bit to identify if the
+ userAPP is reconnected )
+
+4. Successfully start the userspace App.
+ userspace APP need to call ioctl VDUSE_VQ_GET_INFO to sync the vq information. also
+ APP need to save the reconnect information (struct vhost_reconnect_vring)
+ while running
+
+5. When the Userspace App exit, Userspace App need to unmap all the reconnect
+ pages