polyphony 0.85 → 0.86
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/ext/polyphony/io_extensions.c +2 -3
- data/lib/polyphony/version.rb +1 -1
- data/polyphony.gemspec +1 -1
- data/test/test_backend.rb +1 -1
- data/test/test_signal.rb +3 -3
- data/vendor/liburing/.github/pull_request_template.md +86 -0
- data/vendor/liburing/.github/workflows/build.yml +85 -0
- data/vendor/liburing/.github/workflows/shellcheck.yml +20 -0
- data/vendor/liburing/.gitignore +149 -0
- data/vendor/liburing/COPYING +502 -0
- data/vendor/liburing/COPYING.GPL +339 -0
- data/vendor/liburing/LICENSE +7 -0
- data/vendor/liburing/Makefile +82 -0
- data/vendor/liburing/Makefile.common +5 -0
- data/vendor/liburing/Makefile.quiet +11 -0
- data/vendor/liburing/README +46 -0
- data/vendor/liburing/configure +486 -0
- data/vendor/liburing/debian/README.Debian +7 -0
- data/vendor/liburing/debian/changelog +27 -0
- data/vendor/liburing/debian/compat +1 -0
- data/vendor/liburing/debian/control +48 -0
- data/vendor/liburing/debian/copyright +49 -0
- data/vendor/liburing/debian/liburing-dev.install +4 -0
- data/vendor/liburing/debian/liburing-dev.manpages +6 -0
- data/vendor/liburing/debian/liburing1-udeb.install +1 -0
- data/vendor/liburing/debian/liburing1.install +1 -0
- data/vendor/liburing/debian/liburing1.symbols +32 -0
- data/vendor/liburing/debian/patches/series +1 -0
- data/vendor/liburing/debian/rules +81 -0
- data/vendor/liburing/debian/source/format +1 -0
- data/vendor/liburing/debian/source/local-options +2 -0
- data/vendor/liburing/debian/source/options +1 -0
- data/vendor/liburing/debian/watch +3 -0
- data/vendor/liburing/examples/Makefile +38 -0
- data/vendor/liburing/examples/io_uring-cp.c +282 -0
- data/vendor/liburing/examples/io_uring-test.c +112 -0
- data/vendor/liburing/examples/link-cp.c +193 -0
- data/vendor/liburing/examples/ucontext-cp.c +273 -0
- data/vendor/liburing/liburing.pc.in +12 -0
- data/vendor/liburing/liburing.spec +66 -0
- data/vendor/liburing/make-debs.sh +53 -0
- data/vendor/liburing/man/io_uring.7 +754 -0
- data/vendor/liburing/man/io_uring_cq_advance.3 +35 -0
- data/vendor/liburing/man/io_uring_cq_ready.3 +25 -0
- data/vendor/liburing/man/io_uring_cqe_get_data.3 +34 -0
- data/vendor/liburing/man/io_uring_cqe_seen.3 +32 -0
- data/vendor/liburing/man/io_uring_enter.2 +1483 -0
- data/vendor/liburing/man/io_uring_free_probe.3 +24 -0
- data/vendor/liburing/man/io_uring_get_probe.3 +29 -0
- data/vendor/liburing/man/io_uring_get_sqe.3 +38 -0
- data/vendor/liburing/man/io_uring_opcode_supported.3 +29 -0
- data/vendor/liburing/man/io_uring_prep_msg_ring.3 +58 -0
- data/vendor/liburing/man/io_uring_prep_read.3 +50 -0
- data/vendor/liburing/man/io_uring_prep_read_fixed.3 +54 -0
- data/vendor/liburing/man/io_uring_prep_readv.3 +51 -0
- data/vendor/liburing/man/io_uring_prep_readv2.3 +79 -0
- data/vendor/liburing/man/io_uring_prep_write.3 +50 -0
- data/vendor/liburing/man/io_uring_prep_write_fixed.3 +54 -0
- data/vendor/liburing/man/io_uring_prep_writev.3 +51 -0
- data/vendor/liburing/man/io_uring_prep_writev2.3 +78 -0
- data/vendor/liburing/man/io_uring_queue_exit.3 +27 -0
- data/vendor/liburing/man/io_uring_queue_init.3 +44 -0
- data/vendor/liburing/man/io_uring_register.2 +688 -0
- data/vendor/liburing/man/io_uring_register_buffers.3 +41 -0
- data/vendor/liburing/man/io_uring_register_files.3 +35 -0
- data/vendor/liburing/man/io_uring_setup.2 +534 -0
- data/vendor/liburing/man/io_uring_sq_ready.3 +25 -0
- data/vendor/liburing/man/io_uring_sq_space_left.3 +25 -0
- data/vendor/liburing/man/io_uring_sqe_set_data.3 +30 -0
- data/vendor/liburing/man/io_uring_sqe_set_flags.3 +60 -0
- data/vendor/liburing/man/io_uring_sqring_wait.3 +30 -0
- data/vendor/liburing/man/io_uring_submit.3 +29 -0
- data/vendor/liburing/man/io_uring_submit_and_wait.3 +34 -0
- data/vendor/liburing/man/io_uring_submit_and_wait_timeout.3 +49 -0
- data/vendor/liburing/man/io_uring_unregister_buffers.3 +26 -0
- data/vendor/liburing/man/io_uring_unregister_files.3 +26 -0
- data/vendor/liburing/man/io_uring_wait_cqe.3 +33 -0
- data/vendor/liburing/man/io_uring_wait_cqe_nr.3 +36 -0
- data/vendor/liburing/man/io_uring_wait_cqe_timeout.3 +39 -0
- data/vendor/liburing/man/io_uring_wait_cqes.3 +46 -0
- data/vendor/liburing/src/Makefile +89 -0
- data/vendor/liburing/src/arch/aarch64/syscall.h +95 -0
- data/vendor/liburing/src/arch/generic/lib.h +21 -0
- data/vendor/liburing/src/arch/generic/syscall.h +87 -0
- data/vendor/liburing/src/arch/syscall-defs.h +67 -0
- data/vendor/liburing/src/arch/x86/lib.h +32 -0
- data/vendor/liburing/src/arch/x86/syscall.h +160 -0
- data/vendor/liburing/src/include/liburing/barrier.h +81 -0
- data/vendor/liburing/src/include/liburing/io_uring.h +442 -0
- data/vendor/liburing/src/include/liburing.h +921 -0
- data/vendor/liburing/src/int_flags.h +8 -0
- data/vendor/liburing/src/lib.h +57 -0
- data/vendor/liburing/src/liburing.map +53 -0
- data/vendor/liburing/src/nolibc.c +48 -0
- data/vendor/liburing/src/queue.c +403 -0
- data/vendor/liburing/src/register.c +293 -0
- data/vendor/liburing/src/setup.c +332 -0
- data/vendor/liburing/src/syscall.c +47 -0
- data/vendor/liburing/src/syscall.h +103 -0
- data/vendor/liburing/test/232c93d07b74-test.c +306 -0
- data/vendor/liburing/test/35fa71a030ca-test.c +329 -0
- data/vendor/liburing/test/500f9fbadef8-test.c +89 -0
- data/vendor/liburing/test/7ad0e4b2f83c-test.c +93 -0
- data/vendor/liburing/test/8a9973408177-test.c +106 -0
- data/vendor/liburing/test/917257daa0fe-test.c +53 -0
- data/vendor/liburing/test/Makefile +244 -0
- data/vendor/liburing/test/a0908ae19763-test.c +58 -0
- data/vendor/liburing/test/a4c0b3decb33-test.c +180 -0
- data/vendor/liburing/test/accept-link.c +254 -0
- data/vendor/liburing/test/accept-reuse.c +164 -0
- data/vendor/liburing/test/accept-test.c +79 -0
- data/vendor/liburing/test/accept.c +477 -0
- data/vendor/liburing/test/across-fork.c +283 -0
- data/vendor/liburing/test/b19062a56726-test.c +53 -0
- data/vendor/liburing/test/b5837bd5311d-test.c +77 -0
- data/vendor/liburing/test/ce593a6c480a-test.c +136 -0
- data/vendor/liburing/test/close-opath.c +122 -0
- data/vendor/liburing/test/config +10 -0
- data/vendor/liburing/test/connect.c +398 -0
- data/vendor/liburing/test/cq-full.c +96 -0
- data/vendor/liburing/test/cq-overflow.c +294 -0
- data/vendor/liburing/test/cq-peek-batch.c +102 -0
- data/vendor/liburing/test/cq-ready.c +94 -0
- data/vendor/liburing/test/cq-size.c +64 -0
- data/vendor/liburing/test/d4ae271dfaae-test.c +96 -0
- data/vendor/liburing/test/d77a67ed5f27-test.c +65 -0
- data/vendor/liburing/test/defer.c +307 -0
- data/vendor/liburing/test/double-poll-crash.c +185 -0
- data/vendor/liburing/test/drop-submit.c +92 -0
- data/vendor/liburing/test/eeed8b54e0df-test.c +114 -0
- data/vendor/liburing/test/empty-eownerdead.c +45 -0
- data/vendor/liburing/test/eventfd-disable.c +151 -0
- data/vendor/liburing/test/eventfd-reg.c +76 -0
- data/vendor/liburing/test/eventfd-ring.c +97 -0
- data/vendor/liburing/test/eventfd.c +112 -0
- data/vendor/liburing/test/exec-target.c +6 -0
- data/vendor/liburing/test/exit-no-cleanup.c +117 -0
- data/vendor/liburing/test/fadvise.c +202 -0
- data/vendor/liburing/test/fallocate.c +249 -0
- data/vendor/liburing/test/fc2a85cb02ef-test.c +131 -0
- data/vendor/liburing/test/file-register.c +858 -0
- data/vendor/liburing/test/file-update.c +173 -0
- data/vendor/liburing/test/file-verify.c +629 -0
- data/vendor/liburing/test/files-exit-hang-poll.c +128 -0
- data/vendor/liburing/test/files-exit-hang-timeout.c +134 -0
- data/vendor/liburing/test/fixed-link.c +90 -0
- data/vendor/liburing/test/fpos.c +252 -0
- data/vendor/liburing/test/fsync.c +224 -0
- data/vendor/liburing/test/hardlink.c +136 -0
- data/vendor/liburing/test/helpers.c +135 -0
- data/vendor/liburing/test/helpers.h +67 -0
- data/vendor/liburing/test/io-cancel.c +550 -0
- data/vendor/liburing/test/io_uring_enter.c +296 -0
- data/vendor/liburing/test/io_uring_register.c +676 -0
- data/vendor/liburing/test/io_uring_setup.c +192 -0
- data/vendor/liburing/test/iopoll.c +372 -0
- data/vendor/liburing/test/lfs-openat-write.c +119 -0
- data/vendor/liburing/test/lfs-openat.c +275 -0
- data/vendor/liburing/test/link-timeout.c +1107 -0
- data/vendor/liburing/test/link.c +496 -0
- data/vendor/liburing/test/link_drain.c +229 -0
- data/vendor/liburing/test/madvise.c +195 -0
- data/vendor/liburing/test/mkdir.c +108 -0
- data/vendor/liburing/test/msg-ring.c +234 -0
- data/vendor/liburing/test/multicqes_drain.c +387 -0
- data/vendor/liburing/test/nop-all-sizes.c +99 -0
- data/vendor/liburing/test/nop.c +115 -0
- data/vendor/liburing/test/open-close.c +261 -0
- data/vendor/liburing/test/openat2.c +308 -0
- data/vendor/liburing/test/personality.c +204 -0
- data/vendor/liburing/test/pipe-eof.c +83 -0
- data/vendor/liburing/test/pipe-reuse.c +105 -0
- data/vendor/liburing/test/poll-cancel-ton.c +135 -0
- data/vendor/liburing/test/poll-cancel.c +228 -0
- data/vendor/liburing/test/poll-link.c +230 -0
- data/vendor/liburing/test/poll-many.c +208 -0
- data/vendor/liburing/test/poll-mshot-update.c +273 -0
- data/vendor/liburing/test/poll-ring.c +48 -0
- data/vendor/liburing/test/poll-v-poll.c +353 -0
- data/vendor/liburing/test/poll.c +109 -0
- data/vendor/liburing/test/pollfree.c +426 -0
- data/vendor/liburing/test/probe.c +135 -0
- data/vendor/liburing/test/read-write.c +876 -0
- data/vendor/liburing/test/register-restrictions.c +633 -0
- data/vendor/liburing/test/rename.c +135 -0
- data/vendor/liburing/test/ring-leak.c +173 -0
- data/vendor/liburing/test/ring-leak2.c +249 -0
- data/vendor/liburing/test/rsrc_tags.c +449 -0
- data/vendor/liburing/test/runtests-loop.sh +16 -0
- data/vendor/liburing/test/runtests.sh +170 -0
- data/vendor/liburing/test/rw_merge_test.c +97 -0
- data/vendor/liburing/test/self.c +91 -0
- data/vendor/liburing/test/send_recv.c +286 -0
- data/vendor/liburing/test/send_recvmsg.c +345 -0
- data/vendor/liburing/test/sendmsg_fs_cve.c +200 -0
- data/vendor/liburing/test/shared-wq.c +84 -0
- data/vendor/liburing/test/short-read.c +75 -0
- data/vendor/liburing/test/shutdown.c +165 -0
- data/vendor/liburing/test/sigfd-deadlock.c +74 -0
- data/vendor/liburing/test/skip-cqe.c +429 -0
- data/vendor/liburing/test/socket-rw-eagain.c +158 -0
- data/vendor/liburing/test/socket-rw-offset.c +157 -0
- data/vendor/liburing/test/socket-rw.c +145 -0
- data/vendor/liburing/test/splice.c +512 -0
- data/vendor/liburing/test/sq-full-cpp.cc +45 -0
- data/vendor/liburing/test/sq-full.c +45 -0
- data/vendor/liburing/test/sq-poll-dup.c +204 -0
- data/vendor/liburing/test/sq-poll-kthread.c +169 -0
- data/vendor/liburing/test/sq-poll-share.c +137 -0
- data/vendor/liburing/test/sq-space_left.c +159 -0
- data/vendor/liburing/test/sqpoll-cancel-hang.c +157 -0
- data/vendor/liburing/test/sqpoll-disable-exit.c +196 -0
- data/vendor/liburing/test/sqpoll-exit-hang.c +78 -0
- data/vendor/liburing/test/sqpoll-sleep.c +69 -0
- data/vendor/liburing/test/statx.c +172 -0
- data/vendor/liburing/test/stdout.c +232 -0
- data/vendor/liburing/test/submit-link-fail.c +154 -0
- data/vendor/liburing/test/submit-reuse.c +239 -0
- data/vendor/liburing/test/symlink.c +116 -0
- data/vendor/liburing/test/teardowns.c +58 -0
- data/vendor/liburing/test/thread-exit.c +143 -0
- data/vendor/liburing/test/timeout-new.c +252 -0
- data/vendor/liburing/test/timeout-overflow.c +204 -0
- data/vendor/liburing/test/timeout.c +1523 -0
- data/vendor/liburing/test/unlink.c +112 -0
- data/vendor/liburing/test/wakeup-hang.c +162 -0
- metadata +223 -2
@@ -0,0 +1,442 @@
|
|
1
|
+
/* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR MIT */
|
2
|
+
/*
|
3
|
+
* Header file for the io_uring interface.
|
4
|
+
*
|
5
|
+
* Copyright (C) 2019 Jens Axboe
|
6
|
+
* Copyright (C) 2019 Christoph Hellwig
|
7
|
+
*/
|
8
|
+
#ifndef LINUX_IO_URING_H
|
9
|
+
#define LINUX_IO_URING_H
|
10
|
+
|
11
|
+
#include <linux/fs.h>
|
12
|
+
#include <linux/types.h>
|
13
|
+
|
14
|
+
#ifdef __cplusplus
|
15
|
+
extern "C" {
|
16
|
+
#endif
|
17
|
+
|
18
|
+
/*
|
19
|
+
* IO submission data structure (Submission Queue Entry)
|
20
|
+
*/
|
21
|
+
struct io_uring_sqe {
|
22
|
+
__u8 opcode; /* type of operation for this sqe */
|
23
|
+
__u8 flags; /* IOSQE_ flags */
|
24
|
+
__u16 ioprio; /* ioprio for the request */
|
25
|
+
__s32 fd; /* file descriptor to do IO on */
|
26
|
+
union {
|
27
|
+
__u64 off; /* offset into file */
|
28
|
+
__u64 addr2;
|
29
|
+
};
|
30
|
+
union {
|
31
|
+
__u64 addr; /* pointer to buffer or iovecs */
|
32
|
+
__u64 splice_off_in;
|
33
|
+
};
|
34
|
+
__u32 len; /* buffer size or number of iovecs */
|
35
|
+
union {
|
36
|
+
__kernel_rwf_t rw_flags;
|
37
|
+
__u32 fsync_flags;
|
38
|
+
__u16 poll_events; /* compatibility */
|
39
|
+
__u32 poll32_events; /* word-reversed for BE */
|
40
|
+
__u32 sync_range_flags;
|
41
|
+
__u32 msg_flags;
|
42
|
+
__u32 timeout_flags;
|
43
|
+
__u32 accept_flags;
|
44
|
+
__u32 cancel_flags;
|
45
|
+
__u32 open_flags;
|
46
|
+
__u32 statx_flags;
|
47
|
+
__u32 fadvise_advice;
|
48
|
+
__u32 splice_flags;
|
49
|
+
__u32 rename_flags;
|
50
|
+
__u32 unlink_flags;
|
51
|
+
__u32 hardlink_flags;
|
52
|
+
};
|
53
|
+
__u64 user_data; /* data to be passed back at completion time */
|
54
|
+
/* pack this to avoid bogus arm OABI complaints */
|
55
|
+
union {
|
56
|
+
/* index into fixed buffers, if used */
|
57
|
+
__u16 buf_index;
|
58
|
+
/* for grouped buffer selection */
|
59
|
+
__u16 buf_group;
|
60
|
+
} __attribute__((packed));
|
61
|
+
/* personality to use, if used */
|
62
|
+
__u16 personality;
|
63
|
+
union {
|
64
|
+
__s32 splice_fd_in;
|
65
|
+
__u32 file_index;
|
66
|
+
};
|
67
|
+
__u64 __pad2[2];
|
68
|
+
};
|
69
|
+
|
70
|
+
enum {
|
71
|
+
IOSQE_FIXED_FILE_BIT,
|
72
|
+
IOSQE_IO_DRAIN_BIT,
|
73
|
+
IOSQE_IO_LINK_BIT,
|
74
|
+
IOSQE_IO_HARDLINK_BIT,
|
75
|
+
IOSQE_ASYNC_BIT,
|
76
|
+
IOSQE_BUFFER_SELECT_BIT,
|
77
|
+
IOSQE_CQE_SKIP_SUCCESS_BIT,
|
78
|
+
};
|
79
|
+
|
80
|
+
/*
|
81
|
+
* sqe->flags
|
82
|
+
*/
|
83
|
+
/* use fixed fileset */
|
84
|
+
#define IOSQE_FIXED_FILE (1U << IOSQE_FIXED_FILE_BIT)
|
85
|
+
/* issue after inflight IO */
|
86
|
+
#define IOSQE_IO_DRAIN (1U << IOSQE_IO_DRAIN_BIT)
|
87
|
+
/* links next sqe */
|
88
|
+
#define IOSQE_IO_LINK (1U << IOSQE_IO_LINK_BIT)
|
89
|
+
/* like LINK, but stronger */
|
90
|
+
#define IOSQE_IO_HARDLINK (1U << IOSQE_IO_HARDLINK_BIT)
|
91
|
+
/* always go async */
|
92
|
+
#define IOSQE_ASYNC (1U << IOSQE_ASYNC_BIT)
|
93
|
+
/* select buffer from sqe->buf_group */
|
94
|
+
#define IOSQE_BUFFER_SELECT (1U << IOSQE_BUFFER_SELECT_BIT)
|
95
|
+
/* don't post CQE if request succeeded */
|
96
|
+
#define IOSQE_CQE_SKIP_SUCCESS (1U << IOSQE_CQE_SKIP_SUCCESS_BIT)
|
97
|
+
|
98
|
+
/*
|
99
|
+
* io_uring_setup() flags
|
100
|
+
*/
|
101
|
+
#define IORING_SETUP_IOPOLL (1U << 0) /* io_context is polled */
|
102
|
+
#define IORING_SETUP_SQPOLL (1U << 1) /* SQ poll thread */
|
103
|
+
#define IORING_SETUP_SQ_AFF (1U << 2) /* sq_thread_cpu is valid */
|
104
|
+
#define IORING_SETUP_CQSIZE (1U << 3) /* app defines CQ size */
|
105
|
+
#define IORING_SETUP_CLAMP (1U << 4) /* clamp SQ/CQ ring sizes */
|
106
|
+
#define IORING_SETUP_ATTACH_WQ (1U << 5) /* attach to existing wq */
|
107
|
+
#define IORING_SETUP_R_DISABLED (1U << 6) /* start with ring disabled */
|
108
|
+
#define IORING_SETUP_SUBMIT_ALL (1U << 7) /* continue submit on error */
|
109
|
+
|
110
|
+
enum {
|
111
|
+
IORING_OP_NOP,
|
112
|
+
IORING_OP_READV,
|
113
|
+
IORING_OP_WRITEV,
|
114
|
+
IORING_OP_FSYNC,
|
115
|
+
IORING_OP_READ_FIXED,
|
116
|
+
IORING_OP_WRITE_FIXED,
|
117
|
+
IORING_OP_POLL_ADD,
|
118
|
+
IORING_OP_POLL_REMOVE,
|
119
|
+
IORING_OP_SYNC_FILE_RANGE,
|
120
|
+
IORING_OP_SENDMSG,
|
121
|
+
IORING_OP_RECVMSG,
|
122
|
+
IORING_OP_TIMEOUT,
|
123
|
+
IORING_OP_TIMEOUT_REMOVE,
|
124
|
+
IORING_OP_ACCEPT,
|
125
|
+
IORING_OP_ASYNC_CANCEL,
|
126
|
+
IORING_OP_LINK_TIMEOUT,
|
127
|
+
IORING_OP_CONNECT,
|
128
|
+
IORING_OP_FALLOCATE,
|
129
|
+
IORING_OP_OPENAT,
|
130
|
+
IORING_OP_CLOSE,
|
131
|
+
IORING_OP_FILES_UPDATE,
|
132
|
+
IORING_OP_STATX,
|
133
|
+
IORING_OP_READ,
|
134
|
+
IORING_OP_WRITE,
|
135
|
+
IORING_OP_FADVISE,
|
136
|
+
IORING_OP_MADVISE,
|
137
|
+
IORING_OP_SEND,
|
138
|
+
IORING_OP_RECV,
|
139
|
+
IORING_OP_OPENAT2,
|
140
|
+
IORING_OP_EPOLL_CTL,
|
141
|
+
IORING_OP_SPLICE,
|
142
|
+
IORING_OP_PROVIDE_BUFFERS,
|
143
|
+
IORING_OP_REMOVE_BUFFERS,
|
144
|
+
IORING_OP_TEE,
|
145
|
+
IORING_OP_SHUTDOWN,
|
146
|
+
IORING_OP_RENAMEAT,
|
147
|
+
IORING_OP_UNLINKAT,
|
148
|
+
IORING_OP_MKDIRAT,
|
149
|
+
IORING_OP_SYMLINKAT,
|
150
|
+
IORING_OP_LINKAT,
|
151
|
+
IORING_OP_MSG_RING,
|
152
|
+
|
153
|
+
/* this goes last, obviously */
|
154
|
+
IORING_OP_LAST,
|
155
|
+
};
|
156
|
+
|
157
|
+
/*
|
158
|
+
* sqe->fsync_flags
|
159
|
+
*/
|
160
|
+
#define IORING_FSYNC_DATASYNC (1U << 0)
|
161
|
+
|
162
|
+
/*
|
163
|
+
* sqe->timeout_flags
|
164
|
+
*/
|
165
|
+
#define IORING_TIMEOUT_ABS (1U << 0)
|
166
|
+
#define IORING_TIMEOUT_UPDATE (1U << 1)
|
167
|
+
#define IORING_TIMEOUT_BOOTTIME (1U << 2)
|
168
|
+
#define IORING_TIMEOUT_REALTIME (1U << 3)
|
169
|
+
#define IORING_LINK_TIMEOUT_UPDATE (1U << 4)
|
170
|
+
#define IORING_TIMEOUT_ETIME_SUCCESS (1U << 5)
|
171
|
+
#define IORING_TIMEOUT_CLOCK_MASK (IORING_TIMEOUT_BOOTTIME | IORING_TIMEOUT_REALTIME)
|
172
|
+
#define IORING_TIMEOUT_UPDATE_MASK (IORING_TIMEOUT_UPDATE | IORING_LINK_TIMEOUT_UPDATE)
|
173
|
+
/*
|
174
|
+
* sqe->splice_flags
|
175
|
+
* extends splice(2) flags
|
176
|
+
*/
|
177
|
+
#define SPLICE_F_FD_IN_FIXED (1U << 31) /* the last bit of __u32 */
|
178
|
+
|
179
|
+
/*
|
180
|
+
* POLL_ADD flags. Note that since sqe->poll_events is the flag space, the
|
181
|
+
* command flags for POLL_ADD are stored in sqe->len.
|
182
|
+
*
|
183
|
+
* IORING_POLL_ADD_MULTI Multishot poll. Sets IORING_CQE_F_MORE if
|
184
|
+
* the poll handler will continue to report
|
185
|
+
* CQEs on behalf of the same SQE.
|
186
|
+
*
|
187
|
+
* IORING_POLL_UPDATE Update existing poll request, matching
|
188
|
+
* sqe->addr as the old user_data field.
|
189
|
+
*/
|
190
|
+
#define IORING_POLL_ADD_MULTI (1U << 0)
|
191
|
+
#define IORING_POLL_UPDATE_EVENTS (1U << 1)
|
192
|
+
#define IORING_POLL_UPDATE_USER_DATA (1U << 2)
|
193
|
+
|
194
|
+
/*
|
195
|
+
* IO completion data structure (Completion Queue Entry)
|
196
|
+
*/
|
197
|
+
struct io_uring_cqe {
|
198
|
+
__u64 user_data; /* sqe->data submission passed back */
|
199
|
+
__s32 res; /* result code for this event */
|
200
|
+
__u32 flags;
|
201
|
+
};
|
202
|
+
|
203
|
+
/*
|
204
|
+
* cqe->flags
|
205
|
+
*
|
206
|
+
* IORING_CQE_F_BUFFER If set, the upper 16 bits are the buffer ID
|
207
|
+
* IORING_CQE_F_MORE If set, parent SQE will generate more CQE entries
|
208
|
+
* IORING_CQE_F_MSG If set, CQE was generated with IORING_OP_MSG_RING
|
209
|
+
*/
|
210
|
+
#define IORING_CQE_F_BUFFER (1U << 0)
|
211
|
+
#define IORING_CQE_F_MORE (1U << 1)
|
212
|
+
#define IORING_CQE_F_MSG (1U << 2)
|
213
|
+
|
214
|
+
enum {
|
215
|
+
IORING_CQE_BUFFER_SHIFT = 16,
|
216
|
+
};
|
217
|
+
|
218
|
+
/*
|
219
|
+
* Magic offsets for the application to mmap the data it needs
|
220
|
+
*/
|
221
|
+
#define IORING_OFF_SQ_RING 0ULL
|
222
|
+
#define IORING_OFF_CQ_RING 0x8000000ULL
|
223
|
+
#define IORING_OFF_SQES 0x10000000ULL
|
224
|
+
|
225
|
+
/*
|
226
|
+
* Filled with the offset for mmap(2)
|
227
|
+
*/
|
228
|
+
struct io_sqring_offsets {
|
229
|
+
__u32 head;
|
230
|
+
__u32 tail;
|
231
|
+
__u32 ring_mask;
|
232
|
+
__u32 ring_entries;
|
233
|
+
__u32 flags;
|
234
|
+
__u32 dropped;
|
235
|
+
__u32 array;
|
236
|
+
__u32 resv1;
|
237
|
+
__u64 resv2;
|
238
|
+
};
|
239
|
+
|
240
|
+
/*
|
241
|
+
* sq_ring->flags
|
242
|
+
*/
|
243
|
+
#define IORING_SQ_NEED_WAKEUP (1U << 0) /* needs io_uring_enter wakeup */
|
244
|
+
#define IORING_SQ_CQ_OVERFLOW (1U << 1) /* CQ ring is overflown */
|
245
|
+
|
246
|
+
struct io_cqring_offsets {
|
247
|
+
__u32 head;
|
248
|
+
__u32 tail;
|
249
|
+
__u32 ring_mask;
|
250
|
+
__u32 ring_entries;
|
251
|
+
__u32 overflow;
|
252
|
+
__u32 cqes;
|
253
|
+
__u32 flags;
|
254
|
+
__u32 resv1;
|
255
|
+
__u64 resv2;
|
256
|
+
};
|
257
|
+
|
258
|
+
/*
|
259
|
+
* cq_ring->flags
|
260
|
+
*/
|
261
|
+
|
262
|
+
/* disable eventfd notifications */
|
263
|
+
#define IORING_CQ_EVENTFD_DISABLED (1U << 0)
|
264
|
+
|
265
|
+
/*
|
266
|
+
* io_uring_enter(2) flags
|
267
|
+
*/
|
268
|
+
#define IORING_ENTER_GETEVENTS (1U << 0)
|
269
|
+
#define IORING_ENTER_SQ_WAKEUP (1U << 1)
|
270
|
+
#define IORING_ENTER_SQ_WAIT (1U << 2)
|
271
|
+
#define IORING_ENTER_EXT_ARG (1U << 3)
|
272
|
+
#define IORING_ENTER_REGISTERED_RING (1U << 4)
|
273
|
+
|
274
|
+
/*
|
275
|
+
* Passed in for io_uring_setup(2). Copied back with updated info on success
|
276
|
+
*/
|
277
|
+
struct io_uring_params {
|
278
|
+
__u32 sq_entries;
|
279
|
+
__u32 cq_entries;
|
280
|
+
__u32 flags;
|
281
|
+
__u32 sq_thread_cpu;
|
282
|
+
__u32 sq_thread_idle;
|
283
|
+
__u32 features;
|
284
|
+
__u32 wq_fd;
|
285
|
+
__u32 resv[3];
|
286
|
+
struct io_sqring_offsets sq_off;
|
287
|
+
struct io_cqring_offsets cq_off;
|
288
|
+
};
|
289
|
+
|
290
|
+
/*
|
291
|
+
* io_uring_params->features flags
|
292
|
+
*/
|
293
|
+
#define IORING_FEAT_SINGLE_MMAP (1U << 0)
|
294
|
+
#define IORING_FEAT_NODROP (1U << 1)
|
295
|
+
#define IORING_FEAT_SUBMIT_STABLE (1U << 2)
|
296
|
+
#define IORING_FEAT_RW_CUR_POS (1U << 3)
|
297
|
+
#define IORING_FEAT_CUR_PERSONALITY (1U << 4)
|
298
|
+
#define IORING_FEAT_FAST_POLL (1U << 5)
|
299
|
+
#define IORING_FEAT_POLL_32BITS (1U << 6)
|
300
|
+
#define IORING_FEAT_SQPOLL_NONFIXED (1U << 7)
|
301
|
+
#define IORING_FEAT_EXT_ARG (1U << 8)
|
302
|
+
#define IORING_FEAT_NATIVE_WORKERS (1U << 9)
|
303
|
+
#define IORING_FEAT_RSRC_TAGS (1U << 10)
|
304
|
+
#define IORING_FEAT_CQE_SKIP (1U << 11)
|
305
|
+
|
306
|
+
/*
|
307
|
+
* io_uring_register(2) opcodes and arguments
|
308
|
+
*/
|
309
|
+
enum {
|
310
|
+
IORING_REGISTER_BUFFERS = 0,
|
311
|
+
IORING_UNREGISTER_BUFFERS = 1,
|
312
|
+
IORING_REGISTER_FILES = 2,
|
313
|
+
IORING_UNREGISTER_FILES = 3,
|
314
|
+
IORING_REGISTER_EVENTFD = 4,
|
315
|
+
IORING_UNREGISTER_EVENTFD = 5,
|
316
|
+
IORING_REGISTER_FILES_UPDATE = 6,
|
317
|
+
IORING_REGISTER_EVENTFD_ASYNC = 7,
|
318
|
+
IORING_REGISTER_PROBE = 8,
|
319
|
+
IORING_REGISTER_PERSONALITY = 9,
|
320
|
+
IORING_UNREGISTER_PERSONALITY = 10,
|
321
|
+
IORING_REGISTER_RESTRICTIONS = 11,
|
322
|
+
IORING_REGISTER_ENABLE_RINGS = 12,
|
323
|
+
|
324
|
+
/* extended with tagging */
|
325
|
+
IORING_REGISTER_FILES2 = 13,
|
326
|
+
IORING_REGISTER_FILES_UPDATE2 = 14,
|
327
|
+
IORING_REGISTER_BUFFERS2 = 15,
|
328
|
+
IORING_REGISTER_BUFFERS_UPDATE = 16,
|
329
|
+
|
330
|
+
/* set/clear io-wq thread affinities */
|
331
|
+
IORING_REGISTER_IOWQ_AFF = 17,
|
332
|
+
IORING_UNREGISTER_IOWQ_AFF = 18,
|
333
|
+
|
334
|
+
/* set/get max number of io-wq workers */
|
335
|
+
IORING_REGISTER_IOWQ_MAX_WORKERS = 19,
|
336
|
+
|
337
|
+
/* register/unregister io_uring fd with the ring */
|
338
|
+
IORING_REGISTER_RING_FDS = 20,
|
339
|
+
IORING_UNREGISTER_RING_FDS = 21,
|
340
|
+
|
341
|
+
/* this goes last */
|
342
|
+
IORING_REGISTER_LAST
|
343
|
+
};
|
344
|
+
|
345
|
+
/* io-wq worker categories */
|
346
|
+
enum {
|
347
|
+
IO_WQ_BOUND,
|
348
|
+
IO_WQ_UNBOUND,
|
349
|
+
};
|
350
|
+
|
351
|
+
/* deprecated, see struct io_uring_rsrc_update */
|
352
|
+
struct io_uring_files_update {
|
353
|
+
__u32 offset;
|
354
|
+
__u32 resv;
|
355
|
+
__aligned_u64 /* __s32 * */ fds;
|
356
|
+
};
|
357
|
+
|
358
|
+
struct io_uring_rsrc_register {
|
359
|
+
__u32 nr;
|
360
|
+
__u32 resv;
|
361
|
+
__u64 resv2;
|
362
|
+
__aligned_u64 data;
|
363
|
+
__aligned_u64 tags;
|
364
|
+
};
|
365
|
+
|
366
|
+
struct io_uring_rsrc_update {
|
367
|
+
__u32 offset;
|
368
|
+
__u32 resv;
|
369
|
+
__aligned_u64 data;
|
370
|
+
};
|
371
|
+
|
372
|
+
struct io_uring_rsrc_update2 {
|
373
|
+
__u32 offset;
|
374
|
+
__u32 resv;
|
375
|
+
__aligned_u64 data;
|
376
|
+
__aligned_u64 tags;
|
377
|
+
__u32 nr;
|
378
|
+
__u32 resv2;
|
379
|
+
};
|
380
|
+
|
381
|
+
/* Skip updating fd indexes set to this value in the fd table */
|
382
|
+
#define IORING_REGISTER_FILES_SKIP (-2)
|
383
|
+
|
384
|
+
#define IO_URING_OP_SUPPORTED (1U << 0)
|
385
|
+
|
386
|
+
struct io_uring_probe_op {
|
387
|
+
__u8 op;
|
388
|
+
__u8 resv;
|
389
|
+
__u16 flags; /* IO_URING_OP_* flags */
|
390
|
+
__u32 resv2;
|
391
|
+
};
|
392
|
+
|
393
|
+
struct io_uring_probe {
|
394
|
+
__u8 last_op; /* last opcode supported */
|
395
|
+
__u8 ops_len; /* length of ops[] array below */
|
396
|
+
__u16 resv;
|
397
|
+
__u32 resv2[3];
|
398
|
+
struct io_uring_probe_op ops[];
|
399
|
+
};
|
400
|
+
|
401
|
+
struct io_uring_restriction {
|
402
|
+
__u16 opcode;
|
403
|
+
union {
|
404
|
+
__u8 register_op; /* IORING_RESTRICTION_REGISTER_OP */
|
405
|
+
__u8 sqe_op; /* IORING_RESTRICTION_SQE_OP */
|
406
|
+
__u8 sqe_flags; /* IORING_RESTRICTION_SQE_FLAGS_* */
|
407
|
+
};
|
408
|
+
__u8 resv;
|
409
|
+
__u32 resv2[3];
|
410
|
+
};
|
411
|
+
|
412
|
+
/*
|
413
|
+
* io_uring_restriction->opcode values
|
414
|
+
*/
|
415
|
+
enum {
|
416
|
+
/* Allow an io_uring_register(2) opcode */
|
417
|
+
IORING_RESTRICTION_REGISTER_OP = 0,
|
418
|
+
|
419
|
+
/* Allow an sqe opcode */
|
420
|
+
IORING_RESTRICTION_SQE_OP = 1,
|
421
|
+
|
422
|
+
/* Allow sqe flags */
|
423
|
+
IORING_RESTRICTION_SQE_FLAGS_ALLOWED = 2,
|
424
|
+
|
425
|
+
/* Require sqe flags (these flags must be set on each submission) */
|
426
|
+
IORING_RESTRICTION_SQE_FLAGS_REQUIRED = 3,
|
427
|
+
|
428
|
+
IORING_RESTRICTION_LAST
|
429
|
+
};
|
430
|
+
|
431
|
+
struct io_uring_getevents_arg {
|
432
|
+
__u64 sigmask;
|
433
|
+
__u32 sigmask_sz;
|
434
|
+
__u32 pad;
|
435
|
+
__u64 ts;
|
436
|
+
};
|
437
|
+
|
438
|
+
#ifdef __cplusplus
|
439
|
+
}
|
440
|
+
#endif
|
441
|
+
|
442
|
+
#endif
|