[PATCH v3 2/7] vduse: Add new uAPI for vduse reconnection

From: Cindy Lu
Date: Tue Dec 05 2023 - 03:35:11 EST


To synchronize the information for reconnection, add a new structure
struct vduse_dev_reconnect_data to save the device-related information,
Add the VDUSE_RECONNCT_MMAP_SIZE for the size of mapped memory for each vq
and device status.

Signed-off-by: Cindy Lu <lulu@xxxxxxxxxx>
---
include/uapi/linux/vduse.h | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)

diff --git a/include/uapi/linux/vduse.h b/include/uapi/linux/vduse.h
index 11bd48c72c6c..c22838247814 100644
--- a/include/uapi/linux/vduse.h
+++ b/include/uapi/linux/vduse.h
@@ -350,4 +350,26 @@ struct vduse_dev_response {
};
};

+/**
+ * struct vduse_dev_reconnect_data - saved the reconnect info for device
+ * @version; version for userspace APP
+ * @reconnected: indetify if this is reconnected.userspace APP needs set this
+ * to VDUSE_RECONNECT, while reconnecting.kernel will use this
+ * to indetify if this is reconnect
+ * @features; Device features negotiated in the last connect.
+ * @status; Device status in last reconnect
+ */
+
+struct vduse_dev_reconnect_data {
+ __u32 version;
+#define VDUSE_RECONNECT 1
+#define VDUSE_NOT_RECONNECT 0
+ __u32 reconnected;
+ __u64 features;
+ __u8 status;
+};
+
+/* the reconnection mmap size for each VQ and dev status */
+#define VDUSE_RECONNCT_MMAP_SIZE PAGE_SIZE
+
#endif /* _UAPI_VDUSE_H_ */
--
2.34.3