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
98 __u64 addr3;98 __u64 addr3;
99 __u64 __pad2[1];99 __u64 __pad2[1];
100 };100 };
101 struct {
102 __u64 attr_ptr; /* pointer to attribute information */
103 __u64 attr_type_mask; /* bit mask of attributes */
104 };
101 __u64 optval;105 __u64 optval;
102 /*106 /*
103 * If the ring is initialized with IORING_SETUP_SQE128, then107 * If the ring is initialized with IORING_SETUP_SQE128, then
@@ -107,6 +111,18 @@ struct io_uring_sqe { · 3 unmodified lines
107 };111 };
108};112};
109 113
114/* sqe->attr_type_mask flags */
115#define IORING_RW_ATTR_FLAG_PI (1U << 0)
116/* PI attribute information */
117struct 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
110/*126/*
111 * If sqe->file_index is set to this for opcodes that instantiate a new127 * If sqe->file_index is set to this for opcodes that instantiate a new
112 * direct descriptor (like openat/openat2/accept), then io_uring will allocate128 * direct descriptor (like openat/openat2/accept), then io_uring will allocate