setup. Copied back with updated info on success.
The flags, sq_thread_cpu, and sq_thread_idle fields are used to configure the io_uring instance. If no flags
are specified, the io_uring instance is setup for interrupt driven I/O. I/O may be submitted using enter and can be reaped by polling the
completion queue.
The rest of the fields are filled in by the kernel, and provide the information necessary to memory map the submission queue, completion queue, and the array of submission queue entries.
sq_off describes the offsets of various ring buffer fields. Taken together, sq_entries and sq_off provide all of the
information necessary for accessing the submission queue ring buffer and the submission queue entry array. The submission queue can be mapped with a
call like:
ptr = mmap(0, sq_off.array + sq_entries * sizeof(__u32),
PROT_READ|PROT_WRITE, MAP_SHARED|MAP_POPULATE,
ring_fd, IORING_OFF_SQ_RING);
where sq_off is the io_sqring_offsets structure, and ring_fd is the file descriptor returned from setup. The addition of
sq_off.array to the length of the region accounts for the fact that the ring located at the end of the data structure. As an example, the ring
buffer head pointer can be accessed by adding sq_off.head to the address returned from mmap(2):
head = ptr + sq_off.head;
The array of submission queue entries is mapped with:
sqentries = mmap(0, sq_entries * sizeof(struct io_uring_sqe),
PROT_READ|PROT_WRITE, MAP_SHARED|MAP_POPULATE,
ring_fd, IORING_OFF_SQES);
The completion queue is described by cq_entries and cq_off. The completion queue is simpler, since the entries are not separated from
the queue itself, and can be mapped with:
ptr = mmap(0, cq_off.cqes + cq_entries * sizeof(struct io_uring_cqe),
PROT_READ|PROT_WRITE, MAP_SHARED|MAP_POPULATE, ring_fd,
IORING_OFF_CQ_RING);
struct io_uring_params {
__u32 sq_entries;
__u32 cq_entries;
__u32 flags;
__u32 sq_thread_cpu;
__u32 sq_thread_idle;
__u32 features;
__u32 wq_fd;
__u32 resv[3];
struct io_sqring_offsets sq_off;
struct io_cqring_offsets cq_off;
}
| Modifier and Type | Class and Description |
|---|---|
| public static class | IOURingParams.
An array of |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | ALIGNOF
The struct alignment in bytes. |
| public static final int | CQ_ENTRIES
The struct member offsets. |
| public static final int | CQ_OFF
The struct member offsets. |
| public static final int | FEATURES
The struct member offsets. |
| public static final int | FLAGS
The struct member offsets. |
| public static final int | RESV
The struct member offsets. |
| public static final int | SIZEOF
The struct size in bytes. |
| public static final int | SQ_ENTRIES
The struct member offsets. |
| public static final int | SQ_OFF
The struct member offsets. |
| public static final int | SQ_THREAD_CPU
The struct member offsets. |
| public static final int | SQ_THREAD_IDLE
The struct member offsets. |
| public static final int | WQ_FD
The struct member offsets. |
| Access | Constructor and Description |
|---|---|
| protected | |
| public | IOURingParams(ByteBuffer container)
Creates a |
| Modifier and Type | Method and Description |
|---|---|
| public static IOURingParams | |
| public static IOURingParams. | calloc(int
the buffer capacity capacity)Returns a new |
| public static IOURingParams | calloc(MemoryStack
the stack from which to allocate stack)Returns a new |
| public static IOURingParams. | calloc(int
the buffer capacity capacity, MemoryStack the stack from which to allocate stack)Returns a new |
| public int | |
| public IOURingParams | |
| public IOCQRingOffsets | |
| public IOURingParams | |
| public IOURingParams | |
| protected IOURingParams | create(long
the struct memory address address, ByteBuffer an optional container buffer, to be referenced strongly by the struct instance. container)Implements abstract org. the constructor, but returns the exact type of the Struct subclass.
|
| public static IOURingParams | |
| public static IOURingParams | |
| public static IOURingParams. | create(int
the buffer capacity capacity)Returns a new |
| public static IOURingParams. | create(long
the memory address address, int the buffer capacity capacity)Create a |
| public static IOURingParams | |
| public static IOURingParams. | |
| public int | features()
filled in by the kernel, which specifies various features supported by current kernel version. |
| public IOURingParams | |
| public int | |
| public IOURingParams | |
| public static IOURingParams | |
| public static IOURingParams. | malloc(int
the buffer capacity capacity)Returns a new |
| public static IOURingParams | malloc(MemoryStack
the stack from which to allocate stack)Returns a new |
| public static IOURingParams. | malloc(int
the buffer capacity capacity, MemoryStack the stack from which to allocate stack)Returns a new |
| public static int | |
| public static void | |
| public static IOCQRingOffsets | |
| public static void | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public static IntBuffer | |
| public static int | |
| public static void | |
| public static void | |
| public static int | |
| public static void | |
| public static IOSQRingOffsets | |
| public static void | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public IntBuffer | |
| public int | |
| public IOURingParams | |
| public IOURingParams | |
| public IOURingParams | set(int sq_entries, int cq_entries, int flags, int sq_thread_cpu, int sq_thread_idle, int features, int wq_fd, IntBuffer resv, IOSQRingOffsets sq_off, IOCQRingOffsets cq_off)
Initializes this struct with the specified values. |
| public IOURingParams | Returns: this structthe source struct src)Copies the specified struct data to this struct. |
| public int | |
| public int | |
| public IOURingParams | |
| public IOSQRingOffsets | |
| public IOURingParams | |
| public IOURingParams | |
| public int | |
| public IOURingParams | |
| public int | |
| public IOURingParams | |
| public int | |
| public IOURingParams |