History

io_uring: introduce attributes for read/write and PI support

Add the ability to pass additional attributes along with read/write. Application can prepare attibute specific information and pass its address using the SQE field: __u64 attr_ptr; Along with setting a mask indicating attributes being passed: __u64 attr_type_mask; Overall 64 attributes are allowed and currently one attribute 'IORING_RW_ATTR_FLAG_PI' is supported. With PI attribute, userspace can pass following information: - flags: integrity check flags IO_INTEGRITY_CHK_{GUARD/APPTAG/REFTAG} - len: length of PI/metadata buffer - addr: address of metadata buffer - seed: seed value for reftag remapping - app_tag: application defined 16b value Process this information to prepare uio_meta_descriptor and pass it down using kiocb->private. PI attribute is supported only for direct IO.

Anuj Gupta committed 1 year ago

Commit 59a7d121 parent 4de2ce04 files · +112 −3Browse files

Showing the changes to include/uapi (1 of 4 files). Show all

Unified · Split

include/uapi/linux/io_uring.h+16−0
@@ -98,6 +98,10 @@ struct io_uring_sqe { · 97 unmodified lines
9898 __u64 addr3;
9999 __u64 __pad2[1];
100100 };
101+ struct {
102+ __u64 attr_ptr; /* pointer to attribute information */
103+ __u64 attr_type_mask; /* bit mask of attributes */
104+ };
101105 __u64 optval;
102106 /*
103107 * If the ring is initialized with IORING_SETUP_SQE128, then
@@ -107,6 +111,18 @@ struct io_uring_sqe { · 3 unmodified lines
107111 };
108112 };
109113
114+/* sqe->attr_type_mask flags */
115+#define IORING_RW_ATTR_FLAG_PI (1U << 0)
116+/* PI attribute information */
117+struct io_uring_attr_pi {
118+ __u16 flags;
119+ __u16 app_tag;
120+ __u32 len;
121+ __u64 addr;
122+ __u64 seed;
123+ __u64 rsvd;
124+};
125+
110126 /*
111127 * If sqe->file_index is set to this for opcodes that instantiate a new
112128 * direct descriptor (like openat/openat2/accept), then io_uring will allocate