polyphony 0.94 → 0.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +3 -3
- data/.github/workflows/test_io_uring.yml +4 -4
- data/.gitignore +3 -3
- data/CHANGELOG.md +19 -0
- data/docs/api-reference/fiber.md +2 -2
- data/docs/api-reference/object.md +3 -3
- data/docs/main-concepts/exception-handling.md +2 -2
- data/examples/adapters/redis_blpop.rb +4 -3
- data/examples/adapters/redis_channels.rb +16 -7
- data/examples/core/await.rb +1 -1
- data/examples/io/readline.rb +19 -0
- data/ext/polyphony/backend_common.c +25 -3
- data/ext/polyphony/backend_io_uring.c +18 -16
- data/ext/polyphony/backend_libev.c +2 -2
- data/ext/polyphony/event.c +1 -1
- data/ext/polyphony/extconf.rb +5 -3
- data/ext/polyphony/fiber.c +5 -13
- data/ext/polyphony/io_extensions.c +1 -1
- data/ext/polyphony/pipe.c +1 -1
- data/ext/polyphony/polyphony.c +1 -1
- data/ext/polyphony/polyphony_ext.c +1 -1
- data/ext/polyphony/queue.c +1 -1
- data/ext/polyphony/ring_buffer.c +1 -0
- data/ext/polyphony/socket_extensions.c +1 -1
- data/ext/polyphony/thread.c +1 -1
- data/lib/polyphony/adapters/readline.rb +6 -4
- data/lib/polyphony/adapters/redis.rb +28 -87
- data/lib/polyphony/core/channel.rb +15 -0
- data/lib/polyphony/core/sync.rb +4 -0
- data/lib/polyphony/debugger.rb +2 -2
- data/lib/polyphony/extensions/socket.rb +2 -0
- data/lib/polyphony/version.rb +1 -1
- data/lib/polyphony.rb +4 -0
- data/polyphony.gemspec +10 -10
- data/test/helper.rb +0 -5
- data/test/test_backend.rb +5 -1
- data/test/test_enumerator.rb +46 -0
- data/test/test_ext.rb +63 -0
- data/test/test_io.rb +241 -216
- data/test/test_socket.rb +1 -1
- data/test/test_thread_pool.rb +5 -5
- data/vendor/liburing/.github/workflows/build.yml +51 -5
- data/vendor/liburing/.github/workflows/shellcheck.yml +1 -1
- data/vendor/liburing/.gitignore +6 -123
- data/vendor/liburing/CHANGELOG +35 -0
- data/vendor/liburing/CITATION.cff +11 -0
- data/vendor/liburing/LICENSE +16 -3
- data/vendor/liburing/Makefile +3 -1
- data/vendor/liburing/Makefile.common +1 -0
- data/vendor/liburing/README +14 -2
- data/vendor/liburing/SECURITY.md +6 -0
- data/vendor/liburing/configure +16 -15
- data/vendor/liburing/examples/Makefile +4 -1
- data/vendor/liburing/examples/io_uring-udp.c +395 -0
- data/vendor/liburing/examples/poll-bench.c +101 -0
- data/vendor/liburing/examples/send-zerocopy.c +339 -0
- data/vendor/liburing/liburing.spec +1 -1
- data/vendor/liburing/man/io_uring.7 +38 -11
- data/vendor/liburing/man/io_uring_buf_ring_add.3 +53 -0
- data/vendor/liburing/man/io_uring_buf_ring_advance.3 +31 -0
- data/vendor/liburing/man/io_uring_buf_ring_cq_advance.3 +41 -0
- data/vendor/liburing/man/io_uring_buf_ring_init.3 +30 -0
- data/vendor/liburing/man/io_uring_buf_ring_mask.3 +27 -0
- data/vendor/liburing/man/io_uring_cq_advance.3 +29 -15
- data/vendor/liburing/man/io_uring_cq_has_overflow.3 +25 -0
- data/vendor/liburing/man/io_uring_cq_ready.3 +9 -8
- data/vendor/liburing/man/io_uring_cqe_get_data.3 +32 -13
- data/vendor/liburing/man/io_uring_cqe_get_data64.3 +1 -0
- data/vendor/liburing/man/io_uring_cqe_seen.3 +22 -12
- data/vendor/liburing/man/io_uring_enter.2 +249 -32
- data/vendor/liburing/man/io_uring_enter2.2 +1 -0
- data/vendor/liburing/man/io_uring_free_probe.3 +11 -8
- data/vendor/liburing/man/io_uring_get_events.3 +33 -0
- data/vendor/liburing/man/io_uring_get_probe.3 +9 -8
- data/vendor/liburing/man/io_uring_get_sqe.3 +29 -10
- data/vendor/liburing/man/io_uring_opcode_supported.3 +11 -10
- data/vendor/liburing/man/io_uring_peek_cqe.3 +38 -0
- data/vendor/liburing/man/io_uring_prep_accept.3 +197 -0
- data/vendor/liburing/man/io_uring_prep_accept_direct.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_cancel.3 +118 -0
- data/vendor/liburing/man/io_uring_prep_cancel64.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_close.3 +59 -0
- data/vendor/liburing/man/io_uring_prep_close_direct.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_connect.3 +66 -0
- data/vendor/liburing/man/io_uring_prep_fadvise.3 +59 -0
- data/vendor/liburing/man/io_uring_prep_fallocate.3 +59 -0
- data/vendor/liburing/man/io_uring_prep_files_update.3 +92 -0
- data/vendor/liburing/man/io_uring_prep_fsync.3 +70 -0
- data/vendor/liburing/man/io_uring_prep_link.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_linkat.3 +91 -0
- data/vendor/liburing/man/io_uring_prep_madvise.3 +56 -0
- data/vendor/liburing/man/io_uring_prep_mkdir.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_mkdirat.3 +83 -0
- data/vendor/liburing/man/io_uring_prep_msg_ring.3 +39 -25
- data/vendor/liburing/man/io_uring_prep_multishot_accept.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_multishot_accept_direct.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_nop.3 +28 -0
- data/vendor/liburing/man/io_uring_prep_openat.3 +117 -0
- data/vendor/liburing/man/io_uring_prep_openat2.3 +117 -0
- data/vendor/liburing/man/io_uring_prep_openat2_direct.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_openat_direct.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_poll_add.3 +72 -0
- data/vendor/liburing/man/io_uring_prep_poll_multishot.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_poll_remove.3 +55 -0
- data/vendor/liburing/man/io_uring_prep_poll_update.3 +89 -0
- data/vendor/liburing/man/io_uring_prep_provide_buffers.3 +131 -0
- data/vendor/liburing/man/io_uring_prep_read.3 +33 -14
- data/vendor/liburing/man/io_uring_prep_read_fixed.3 +39 -21
- data/vendor/liburing/man/io_uring_prep_readv.3 +49 -15
- data/vendor/liburing/man/io_uring_prep_readv2.3 +49 -17
- data/vendor/liburing/man/io_uring_prep_recv.3 +105 -0
- data/vendor/liburing/man/io_uring_prep_recv_multishot.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_recvmsg.3 +124 -0
- data/vendor/liburing/man/io_uring_prep_recvmsg_multishot.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_remove_buffers.3 +52 -0
- data/vendor/liburing/man/io_uring_prep_rename.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_renameat.3 +96 -0
- data/vendor/liburing/man/io_uring_prep_send.3 +57 -0
- data/vendor/liburing/man/io_uring_prep_send_zc.3 +64 -0
- data/vendor/liburing/man/io_uring_prep_sendmsg.3 +69 -0
- data/vendor/liburing/man/io_uring_prep_shutdown.3 +53 -0
- data/vendor/liburing/man/io_uring_prep_socket.3 +118 -0
- data/vendor/liburing/man/io_uring_prep_socket_direct.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_socket_direct_alloc.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_splice.3 +80 -0
- data/vendor/liburing/man/io_uring_prep_statx.3 +74 -0
- data/vendor/liburing/man/io_uring_prep_symlink.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_symlinkat.3 +85 -0
- data/vendor/liburing/man/io_uring_prep_sync_file_range.3 +59 -0
- data/vendor/liburing/man/io_uring_prep_tee.3 +74 -0
- data/vendor/liburing/man/io_uring_prep_timeout.3 +95 -0
- data/vendor/liburing/man/io_uring_prep_timeout_remove.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_timeout_update.3 +98 -0
- data/vendor/liburing/man/io_uring_prep_unlink.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_unlinkat.3 +82 -0
- data/vendor/liburing/man/io_uring_prep_write.3 +32 -15
- data/vendor/liburing/man/io_uring_prep_write_fixed.3 +39 -21
- data/vendor/liburing/man/io_uring_prep_writev.3 +50 -16
- data/vendor/liburing/man/io_uring_prep_writev2.3 +50 -17
- data/vendor/liburing/man/io_uring_queue_exit.3 +3 -4
- data/vendor/liburing/man/io_uring_queue_init.3 +58 -13
- data/vendor/liburing/man/io_uring_queue_init_params.3 +1 -0
- data/vendor/liburing/man/io_uring_recvmsg_cmsg_firsthdr.3 +1 -0
- data/vendor/liburing/man/io_uring_recvmsg_cmsg_nexthdr.3 +1 -0
- data/vendor/liburing/man/io_uring_recvmsg_name.3 +1 -0
- data/vendor/liburing/man/io_uring_recvmsg_out.3 +78 -0
- data/vendor/liburing/man/io_uring_recvmsg_payload.3 +1 -0
- data/vendor/liburing/man/io_uring_recvmsg_payload_length.3 +1 -0
- data/vendor/liburing/man/io_uring_recvmsg_validate.3 +1 -0
- data/vendor/liburing/man/io_uring_register.2 +153 -13
- data/vendor/liburing/man/io_uring_register_buf_ring.3 +140 -0
- data/vendor/liburing/man/io_uring_register_buffers.3 +32 -12
- data/vendor/liburing/man/io_uring_register_eventfd.3 +51 -0
- data/vendor/liburing/man/io_uring_register_eventfd_async.3 +1 -0
- data/vendor/liburing/man/io_uring_register_file_alloc_range.3 +52 -0
- data/vendor/liburing/man/io_uring_register_files.3 +33 -11
- data/vendor/liburing/man/io_uring_register_files_sparse.3 +1 -0
- data/vendor/liburing/man/io_uring_register_iowq_aff.3 +61 -0
- data/vendor/liburing/man/io_uring_register_iowq_max_workers.3 +71 -0
- data/vendor/liburing/man/io_uring_register_ring_fd.3 +49 -0
- data/vendor/liburing/man/io_uring_register_sync_cancel.3 +71 -0
- data/vendor/liburing/man/io_uring_setup.2 +119 -13
- data/vendor/liburing/man/io_uring_sq_ready.3 +14 -8
- data/vendor/liburing/man/io_uring_sq_space_left.3 +9 -9
- data/vendor/liburing/man/io_uring_sqe_set_data.3 +29 -11
- data/vendor/liburing/man/io_uring_sqe_set_data64.3 +1 -0
- data/vendor/liburing/man/io_uring_sqe_set_flags.3 +38 -11
- data/vendor/liburing/man/io_uring_sqring_wait.3 +13 -9
- data/vendor/liburing/man/io_uring_submit.3 +29 -12
- data/vendor/liburing/man/io_uring_submit_and_get_events.3 +31 -0
- data/vendor/liburing/man/io_uring_submit_and_wait.3 +16 -12
- data/vendor/liburing/man/io_uring_submit_and_wait_timeout.3 +30 -23
- data/vendor/liburing/man/io_uring_unregister_buf_ring.3 +30 -0
- data/vendor/liburing/man/io_uring_unregister_buffers.3 +11 -10
- data/vendor/liburing/man/io_uring_unregister_eventfd.3 +1 -0
- data/vendor/liburing/man/io_uring_unregister_files.3 +11 -10
- data/vendor/liburing/man/io_uring_unregister_iowq_aff.3 +1 -0
- data/vendor/liburing/man/io_uring_unregister_ring_fd.3 +32 -0
- data/vendor/liburing/man/io_uring_wait_cqe.3 +19 -12
- data/vendor/liburing/man/io_uring_wait_cqe_nr.3 +21 -14
- data/vendor/liburing/man/io_uring_wait_cqe_timeout.3 +27 -13
- data/vendor/liburing/man/io_uring_wait_cqes.3 +24 -14
- data/vendor/liburing/src/Makefile +8 -7
- data/vendor/liburing/src/arch/aarch64/lib.h +48 -0
- data/vendor/liburing/src/arch/aarch64/syscall.h +0 -4
- data/vendor/liburing/src/arch/generic/lib.h +0 -4
- data/vendor/liburing/src/arch/generic/syscall.h +29 -16
- data/vendor/liburing/src/arch/syscall-defs.h +41 -14
- data/vendor/liburing/src/arch/x86/lib.h +0 -21
- data/vendor/liburing/src/arch/x86/syscall.h +146 -10
- data/vendor/liburing/src/include/liburing/io_uring.h +245 -5
- data/vendor/liburing/src/include/liburing.h +468 -35
- data/vendor/liburing/src/int_flags.h +1 -0
- data/vendor/liburing/src/lib.h +20 -16
- data/vendor/liburing/src/liburing.map +16 -0
- data/vendor/liburing/src/nolibc.c +1 -1
- data/vendor/liburing/src/queue.c +87 -55
- data/vendor/liburing/src/register.c +129 -53
- data/vendor/liburing/src/setup.c +65 -28
- data/vendor/liburing/src/syscall.c +14 -32
- data/vendor/liburing/src/syscall.h +12 -64
- data/vendor/liburing/test/{232c93d07b74-test.c → 232c93d07b74.c} +8 -9
- data/vendor/liburing/test/{35fa71a030ca-test.c → 35fa71a030ca.c} +4 -4
- data/vendor/liburing/test/{500f9fbadef8-test.c → 500f9fbadef8.c} +7 -7
- data/vendor/liburing/test/{7ad0e4b2f83c-test.c → 7ad0e4b2f83c.c} +8 -7
- data/vendor/liburing/test/{8a9973408177-test.c → 8a9973408177.c} +4 -3
- data/vendor/liburing/test/{917257daa0fe-test.c → 917257daa0fe.c} +3 -2
- data/vendor/liburing/test/Makefile +60 -62
- data/vendor/liburing/test/{a0908ae19763-test.c → a0908ae19763.c} +3 -2
- data/vendor/liburing/test/{a4c0b3decb33-test.c → a4c0b3decb33.c} +3 -2
- data/vendor/liburing/test/accept-link.c +5 -4
- data/vendor/liburing/test/accept-reuse.c +17 -16
- data/vendor/liburing/test/accept-test.c +14 -10
- data/vendor/liburing/test/accept.c +529 -107
- data/vendor/liburing/test/across-fork.c +7 -6
- data/vendor/liburing/test/{b19062a56726-test.c → b19062a56726.c} +3 -2
- data/vendor/liburing/test/{b5837bd5311d-test.c → b5837bd5311d.c} +10 -9
- data/vendor/liburing/test/buf-ring.c +420 -0
- data/vendor/liburing/test/{ce593a6c480a-test.c → ce593a6c480a.c} +15 -12
- data/vendor/liburing/test/connect.c +8 -7
- data/vendor/liburing/test/cq-full.c +5 -4
- data/vendor/liburing/test/cq-overflow.c +242 -12
- data/vendor/liburing/test/cq-peek-batch.c +5 -4
- data/vendor/liburing/test/cq-ready.c +5 -4
- data/vendor/liburing/test/cq-size.c +5 -4
- data/vendor/liburing/test/{d4ae271dfaae-test.c → d4ae271dfaae.c} +2 -2
- data/vendor/liburing/test/{d77a67ed5f27-test.c → d77a67ed5f27.c} +6 -6
- data/vendor/liburing/test/defer-taskrun.c +336 -0
- data/vendor/liburing/test/defer.c +26 -14
- data/vendor/liburing/test/double-poll-crash.c +15 -5
- data/vendor/liburing/test/drop-submit.c +5 -3
- data/vendor/liburing/test/{eeed8b54e0df-test.c → eeed8b54e0df.c} +7 -6
- data/vendor/liburing/test/empty-eownerdead.c +4 -4
- data/vendor/liburing/test/eventfd-disable.c +48 -20
- data/vendor/liburing/test/eventfd-reg.c +10 -9
- data/vendor/liburing/test/eventfd-ring.c +13 -12
- data/vendor/liburing/test/eventfd.c +13 -12
- data/vendor/liburing/test/exit-no-cleanup.c +1 -1
- data/vendor/liburing/test/fadvise.c +3 -3
- data/vendor/liburing/test/fallocate.c +16 -9
- data/vendor/liburing/test/{fc2a85cb02ef-test.c → fc2a85cb02ef.c} +4 -3
- data/vendor/liburing/test/fd-pass.c +187 -0
- data/vendor/liburing/test/file-register.c +302 -36
- data/vendor/liburing/test/file-update.c +62 -4
- data/vendor/liburing/test/file-verify.c +6 -2
- data/vendor/liburing/test/files-exit-hang-poll.c +11 -25
- data/vendor/liburing/test/files-exit-hang-timeout.c +13 -10
- data/vendor/liburing/test/fixed-buf-iter.c +115 -0
- data/vendor/liburing/test/fixed-link.c +10 -10
- data/vendor/liburing/test/fixed-reuse.c +160 -0
- data/vendor/liburing/test/fpos.c +6 -3
- data/vendor/liburing/test/fsync.c +3 -3
- data/vendor/liburing/test/hardlink.c +10 -6
- data/vendor/liburing/test/helpers.c +137 -4
- data/vendor/liburing/test/helpers.h +27 -0
- data/vendor/liburing/test/io-cancel.c +16 -11
- data/vendor/liburing/test/io_uring_enter.c +46 -81
- data/vendor/liburing/test/io_uring_passthrough.c +451 -0
- data/vendor/liburing/test/io_uring_register.c +59 -229
- data/vendor/liburing/test/io_uring_setup.c +24 -29
- data/vendor/liburing/test/iopoll-leak.c +85 -0
- data/vendor/liburing/test/iopoll.c +16 -9
- data/vendor/liburing/test/lfs-openat-write.c +3 -1
- data/vendor/liburing/test/link-timeout.c +4 -3
- data/vendor/liburing/test/link.c +8 -7
- data/vendor/liburing/test/madvise.c +2 -2
- data/vendor/liburing/test/mkdir.c +9 -5
- data/vendor/liburing/test/msg-ring.c +46 -20
- data/vendor/liburing/test/multicqes_drain.c +51 -12
- data/vendor/liburing/test/nolibc.c +60 -0
- data/vendor/liburing/test/nop.c +78 -16
- data/vendor/liburing/test/nvme.h +168 -0
- data/vendor/liburing/test/open-direct-link.c +188 -0
- data/vendor/liburing/test/open-direct-pick.c +180 -0
- data/vendor/liburing/test/openat2.c +3 -3
- data/vendor/liburing/test/poll-cancel-all.c +472 -0
- data/vendor/liburing/test/poll-link.c +9 -18
- data/vendor/liburing/test/poll-mshot-overflow.c +162 -0
- data/vendor/liburing/test/poll-mshot-update.c +83 -33
- data/vendor/liburing/test/pollfree.c +2 -2
- data/vendor/liburing/test/read-before-exit.c +112 -0
- data/vendor/liburing/test/read-write.c +83 -1
- data/vendor/liburing/test/recv-msgall-stream.c +398 -0
- data/vendor/liburing/test/recv-msgall.c +265 -0
- data/vendor/liburing/test/recv-multishot.c +505 -0
- data/vendor/liburing/test/rename.c +2 -5
- data/vendor/liburing/test/ring-leak.c +97 -0
- data/vendor/liburing/test/ringbuf-read.c +200 -0
- data/vendor/liburing/test/rsrc_tags.c +25 -13
- data/vendor/liburing/test/runtests-quiet.sh +11 -0
- data/vendor/liburing/test/runtests.sh +18 -20
- data/vendor/liburing/test/rw_merge_test.c +3 -2
- data/vendor/liburing/test/send-zerocopy.c +684 -0
- data/vendor/liburing/test/send_recv.c +49 -2
- data/vendor/liburing/test/send_recvmsg.c +165 -55
- data/vendor/liburing/test/shutdown.c +3 -4
- data/vendor/liburing/test/sigfd-deadlock.c +22 -8
- data/vendor/liburing/test/single-issuer.c +171 -0
- data/vendor/liburing/test/socket-rw-eagain.c +2 -12
- data/vendor/liburing/test/socket-rw-offset.c +2 -11
- data/vendor/liburing/test/socket-rw.c +2 -11
- data/vendor/liburing/test/socket.c +409 -0
- data/vendor/liburing/test/sq-poll-dup.c +1 -1
- data/vendor/liburing/test/sq-poll-share.c +1 -1
- data/vendor/liburing/test/statx.c +2 -2
- data/vendor/liburing/test/submit-and-wait.c +108 -0
- data/vendor/liburing/test/submit-link-fail.c +5 -3
- data/vendor/liburing/test/submit-reuse.c +0 -2
- data/vendor/liburing/test/sync-cancel.c +235 -0
- data/vendor/liburing/test/test.h +35 -0
- data/vendor/liburing/test/timeout-overflow.c +11 -11
- data/vendor/liburing/test/timeout.c +7 -7
- data/vendor/liburing/test/tty-write-dpoll.c +60 -0
- data/vendor/liburing/test/unlink.c +1 -1
- data/vendor/liburing/test/xattr.c +425 -0
- metadata +160 -52
- data/Gemfile.lock +0 -78
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
.\" Copyright (C) 2022 Dylan Yudaken <dylany@fb.com>
|
|
2
|
+
.\"
|
|
3
|
+
.\" SPDX-License-Identifier: LGPL-2.0-or-later
|
|
4
|
+
.\"
|
|
5
|
+
.TH io_uring_cq_has_overflow 3 "September 5, 2022" "liburing-2.3" "liburing Manual"
|
|
6
|
+
.SH NAME
|
|
7
|
+
io_uring_cq_has_overflow \- returns if there are overflow entries waiting to move to the CQ ring
|
|
8
|
+
.SH SYNOPSIS
|
|
9
|
+
.nf
|
|
10
|
+
.B #include <liburing.h>
|
|
11
|
+
.PP
|
|
12
|
+
.BI "bool io_uring_cq_has_overflow(const struct io_uring *" ring ");"
|
|
13
|
+
.fi
|
|
14
|
+
.SH DESCRIPTION
|
|
15
|
+
.PP
|
|
16
|
+
The
|
|
17
|
+
.BR io_uring_cq_has_overflow (3)
|
|
18
|
+
function informs the application if CQ entries have overflowed and are waiting to be flushed to
|
|
19
|
+
the CQ ring. For example using
|
|
20
|
+
.BR io_uring_get_events (3)
|
|
21
|
+
.
|
|
22
|
+
.SH RETURN VALUE
|
|
23
|
+
True if there are CQ entries waiting to be flushed to the CQ ring.
|
|
24
|
+
.SH SEE ALSO
|
|
25
|
+
.BR io_uring_get_events (3)
|
|
@@ -2,24 +2,25 @@
|
|
|
2
2
|
.\"
|
|
3
3
|
.\" SPDX-License-Identifier: LGPL-2.0-or-later
|
|
4
4
|
.\"
|
|
5
|
-
.TH io_uring_cq_ready "January 25, 2022" "liburing-2.1" "liburing Manual"
|
|
5
|
+
.TH io_uring_cq_ready 3 "January 25, 2022" "liburing-2.1" "liburing Manual"
|
|
6
6
|
.SH NAME
|
|
7
|
-
io_uring_cq_ready
|
|
7
|
+
io_uring_cq_ready \- returns number of unconsumed ready entries in the CQ ring
|
|
8
8
|
.SH SYNOPSIS
|
|
9
9
|
.nf
|
|
10
|
-
.
|
|
10
|
+
.B #include <liburing.h>
|
|
11
11
|
.PP
|
|
12
|
-
.BI "unsigned io_uring_cq_ready(const struct io_uring *ring)"
|
|
12
|
+
.BI "unsigned io_uring_cq_ready(const struct io_uring *" ring ");"
|
|
13
13
|
.fi
|
|
14
|
-
.PP
|
|
15
14
|
.SH DESCRIPTION
|
|
16
15
|
.PP
|
|
17
|
-
The
|
|
18
|
-
|
|
16
|
+
The
|
|
17
|
+
.BR io_uring_cq_ready (3)
|
|
18
|
+
function returns the number of unconsumed entries that are ready belonging to the
|
|
19
19
|
.I ring
|
|
20
20
|
param.
|
|
21
21
|
|
|
22
22
|
.SH RETURN VALUE
|
|
23
23
|
Returns the number of unconsumed ready entries in the CQ ring.
|
|
24
24
|
.SH SEE ALSO
|
|
25
|
-
.BR io_uring_submit (3),
|
|
25
|
+
.BR io_uring_submit (3),
|
|
26
|
+
.BR io_uring_wait_cqe (3)
|
|
@@ -4,31 +4,50 @@
|
|
|
4
4
|
.\"
|
|
5
5
|
.TH io_uring_cqe_get_data 3 "November 15, 2021" "liburing-2.1" "liburing Manual"
|
|
6
6
|
.SH NAME
|
|
7
|
-
io_uring_cqe_get_data
|
|
7
|
+
io_uring_cqe_get_data \- get user data for completion event
|
|
8
8
|
.SH SYNOPSIS
|
|
9
9
|
.nf
|
|
10
|
-
.
|
|
10
|
+
.B #include <liburing.h>
|
|
11
11
|
.PP
|
|
12
|
-
.BI "void *io_uring_cqe_get_data(struct io_uring_cqe *cqe)"
|
|
12
|
+
.BI "void *io_uring_cqe_get_data(struct io_uring_cqe *" cqe ");"
|
|
13
|
+
.BI "
|
|
14
|
+
.BI "__u64 io_uring_cqe_get_data64(struct io_uring_cqe *" cqe ");"
|
|
13
15
|
.fi
|
|
14
|
-
.PP
|
|
15
16
|
.SH DESCRIPTION
|
|
16
17
|
.PP
|
|
17
|
-
The
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
The
|
|
19
|
+
.BR io_uring_cqe_get_data (3)
|
|
20
|
+
function returns the user_data with the completion queue entry
|
|
21
|
+
.IR cqe
|
|
22
|
+
as a data pointer.
|
|
23
|
+
|
|
24
|
+
The
|
|
25
|
+
.BR io_uring_cqe_get_data64 (3)
|
|
26
|
+
function returns the user_data with the completion queue entry
|
|
27
|
+
.IR cqe
|
|
28
|
+
as a 64-bit data value.
|
|
20
29
|
|
|
21
|
-
After the caller has received a completion queue entry (CQE) with
|
|
22
|
-
|
|
30
|
+
After the caller has received a completion queue entry (CQE) with
|
|
31
|
+
.BR io_uring_wait_cqe (3),
|
|
32
|
+
the application can call
|
|
33
|
+
.BR io_uring_cqe_get_data (3)
|
|
34
|
+
or
|
|
35
|
+
.BR io_uring_cqe_get_data64 (3)
|
|
36
|
+
function to retrieve the
|
|
23
37
|
.I user_data
|
|
24
38
|
value. This requires that
|
|
25
39
|
.I user_data
|
|
26
|
-
has been set earlier with the function
|
|
40
|
+
has been set earlier with the function
|
|
41
|
+
.BR io_uring_sqe_set_data (3)
|
|
42
|
+
or
|
|
43
|
+
.BR io_uring_sqe_set_data64 (3).
|
|
27
44
|
|
|
28
45
|
.SH RETURN VALUE
|
|
29
46
|
If the
|
|
30
47
|
.I user_data
|
|
31
|
-
value has been set before submitting the request, it will be returned.
|
|
32
|
-
the functions returns NULL.
|
|
48
|
+
value has been set before submitting the request, it will be returned.
|
|
49
|
+
Otherwise the functions returns NULL.
|
|
33
50
|
.SH SEE ALSO
|
|
34
|
-
.BR io_uring_get_sqe (3),
|
|
51
|
+
.BR io_uring_get_sqe (3),
|
|
52
|
+
.BR io_uring_sqe_set_data (3),
|
|
53
|
+
.BR io_uring_sqe_submit (3)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
io_uring_cqe_get_data.3
|
|
@@ -4,29 +4,39 @@
|
|
|
4
4
|
.\"
|
|
5
5
|
.TH io_uring_cqe_seen 3 "November 15, 2021" "liburing-2.1" "liburing Manual"
|
|
6
6
|
.SH NAME
|
|
7
|
-
io_uring_cqe_seen
|
|
7
|
+
io_uring_cqe_seen \- mark io_uring completion event as consumed
|
|
8
8
|
.SH SYNOPSIS
|
|
9
9
|
.nf
|
|
10
|
-
.
|
|
10
|
+
.B #include <liburing.h>
|
|
11
11
|
.PP
|
|
12
|
-
.BI "void io_uring_cqe_seen(struct io_uring *ring,"
|
|
13
|
-
.BI " struct io_uring_cqe *cqe)"
|
|
12
|
+
.BI "void io_uring_cqe_seen(struct io_uring *" ring ","
|
|
13
|
+
.BI " struct io_uring_cqe *" cqe ");"
|
|
14
14
|
.fi
|
|
15
|
-
.PP
|
|
16
15
|
.SH DESCRIPTION
|
|
17
16
|
.PP
|
|
18
|
-
The
|
|
17
|
+
The
|
|
18
|
+
.BR io_uring_cqe_seen (3)
|
|
19
|
+
function marks the IO completion
|
|
19
20
|
.I cqe
|
|
20
21
|
belonging to the
|
|
21
22
|
.I ring
|
|
22
|
-
param as
|
|
23
|
+
param as consumed.
|
|
23
24
|
|
|
24
|
-
After the caller has submitted a request with
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
After the caller has submitted a request with
|
|
26
|
+
.BR io_uring_submit (3),
|
|
27
|
+
the application can retrieve the completion with
|
|
28
|
+
.BR io_uring_wait_cqe (3),
|
|
29
|
+
.BR io_uring_peek_cqe (3),
|
|
30
|
+
or any of the other CQE retrieval helpers, and mark it as consumed with
|
|
31
|
+
.BR io_uring_cqe_seen (3).
|
|
27
32
|
|
|
28
|
-
Completions must be marked as completed
|
|
33
|
+
Completions must be marked as completed so their slot can get reused.
|
|
29
34
|
.SH RETURN VALUE
|
|
30
35
|
None
|
|
31
36
|
.SH SEE ALSO
|
|
32
|
-
.BR io_uring_submit (3),
|
|
37
|
+
.BR io_uring_submit (3),
|
|
38
|
+
.BR io_uring_wait_cqe (3),
|
|
39
|
+
.BR io_uring_peek_cqe (3),
|
|
40
|
+
.BR io_uring_wait_cqes (3),
|
|
41
|
+
.BR io_uring_wait_cqe_timeout (3),
|
|
42
|
+
.BR io_uring_cqe_seen (3)
|
|
@@ -3,27 +3,31 @@
|
|
|
3
3
|
.\"
|
|
4
4
|
.\" SPDX-License-Identifier: LGPL-2.0-or-later
|
|
5
5
|
.\"
|
|
6
|
-
.TH
|
|
6
|
+
.TH io_uring_enter 2 2019-01-22 "Linux" "Linux Programmer's Manual"
|
|
7
7
|
.SH NAME
|
|
8
8
|
io_uring_enter \- initiate and/or complete asynchronous I/O
|
|
9
9
|
.SH SYNOPSIS
|
|
10
10
|
.nf
|
|
11
|
-
.BR "#include <
|
|
11
|
+
.BR "#include <liburing.h>"
|
|
12
12
|
.PP
|
|
13
13
|
.BI "int io_uring_enter(unsigned int " fd ", unsigned int " to_submit ,
|
|
14
14
|
.BI " unsigned int " min_complete ", unsigned int " flags ,
|
|
15
15
|
.BI " sigset_t *" sig );
|
|
16
|
+
.PP
|
|
17
|
+
.BI "int io_uring_enter2(unsigned int " fd ", unsigned int " to_submit ,
|
|
18
|
+
.BI " unsigned int " min_complete ", unsigned int " flags ,
|
|
19
|
+
.BI " sigset_t *" sig ", size_t " sz );
|
|
16
20
|
.fi
|
|
17
21
|
.PP
|
|
18
22
|
.SH DESCRIPTION
|
|
19
23
|
.PP
|
|
20
|
-
.BR io_uring_enter ()
|
|
24
|
+
.BR io_uring_enter (2)
|
|
21
25
|
is used to initiate and complete I/O using the shared submission and
|
|
22
26
|
completion queues setup by a call to
|
|
23
27
|
.BR io_uring_setup (2).
|
|
24
28
|
A single call can both submit new I/O and wait for completions of I/O
|
|
25
29
|
initiated by this call or previous calls to
|
|
26
|
-
.BR io_uring_enter ().
|
|
30
|
+
.BR io_uring_enter (2).
|
|
27
31
|
|
|
28
32
|
.I fd
|
|
29
33
|
is the file descriptor returned by
|
|
@@ -34,7 +38,7 @@ specifies the number of I/Os to submit from the submission queue.
|
|
|
34
38
|
is a bitmask of the following values:
|
|
35
39
|
.TP
|
|
36
40
|
.B IORING_ENTER_GETEVENTS
|
|
37
|
-
If this flag is set, then the system call will wait for the
|
|
41
|
+
If this flag is set, then the system call will wait for the specified
|
|
38
42
|
number of events in
|
|
39
43
|
.I min_complete
|
|
40
44
|
before returning. This flag can be set along with
|
|
@@ -61,12 +65,12 @@ Since kernel 5.11, the system calls arguments have been modified to look like
|
|
|
61
65
|
the following:
|
|
62
66
|
|
|
63
67
|
.nf
|
|
64
|
-
.BI "int
|
|
65
|
-
.BI "
|
|
66
|
-
.BI "
|
|
68
|
+
.BI "int io_uring_enter2(unsigned int " fd ", unsigned int " to_submit ,
|
|
69
|
+
.BI " unsigned int " min_complete ", unsigned int " flags ,
|
|
70
|
+
.BI " const void *" arg ", size_t " argsz );
|
|
67
71
|
.fi
|
|
68
72
|
|
|
69
|
-
which
|
|
73
|
+
which behaves just like the original definition by default. However, if
|
|
70
74
|
.B IORING_ENTER_EXT_ARG
|
|
71
75
|
is set, then instead of a
|
|
72
76
|
.I sigset_t
|
|
@@ -93,6 +97,13 @@ is set to a valid pointer, then this time value indicates the timeout for
|
|
|
93
97
|
waiting on events. If an application is waiting on events and wishes to
|
|
94
98
|
stop waiting after a specified amount of time, then this can be accomplished
|
|
95
99
|
directly in version 5.11 and newer by using this feature.
|
|
100
|
+
.TP
|
|
101
|
+
.B IORING_ENTER_REGISTERED_RING
|
|
102
|
+
If the ring file descriptor has been registered through use of
|
|
103
|
+
.B IORING_REGISTER_RING_FDS,
|
|
104
|
+
then setting this flag will tell the kernel that the
|
|
105
|
+
.I ring_fd
|
|
106
|
+
passed in is the registered ring offset rather than a normal file descriptor.
|
|
96
107
|
|
|
97
108
|
.PP
|
|
98
109
|
.PP
|
|
@@ -130,12 +141,12 @@ is a pointer to a signal mask (see
|
|
|
130
141
|
if
|
|
131
142
|
.I sig
|
|
132
143
|
is not NULL,
|
|
133
|
-
.BR io_uring_enter ()
|
|
144
|
+
.BR io_uring_enter (2)
|
|
134
145
|
first replaces the current signal mask by the one pointed to by
|
|
135
146
|
.IR sig ,
|
|
136
147
|
then waits for events to become available in the completion queue, and
|
|
137
148
|
then restores the original signal mask. The following
|
|
138
|
-
.BR io_uring_enter ()
|
|
149
|
+
.BR io_uring_enter (2)
|
|
139
150
|
call:
|
|
140
151
|
.PP
|
|
141
152
|
.in +4n
|
|
@@ -242,7 +253,7 @@ and
|
|
|
242
253
|
.BR pwritev2 (2).
|
|
243
254
|
If the file is not seekable,
|
|
244
255
|
.I off
|
|
245
|
-
must be set to zero.
|
|
256
|
+
must be set to zero or -1.
|
|
246
257
|
|
|
247
258
|
.TP
|
|
248
259
|
.B IORING_OP_READ_FIXED
|
|
@@ -383,12 +394,46 @@ holds the flags associated with the system call. See also
|
|
|
383
394
|
.BR sendmsg (2)
|
|
384
395
|
for the general description of the related system call. Available since 5.3.
|
|
385
396
|
|
|
397
|
+
This command also supports the following modifiers in
|
|
398
|
+
.I ioprio:
|
|
399
|
+
|
|
400
|
+
.PP
|
|
401
|
+
.in +12
|
|
402
|
+
.B IORING_RECVSEND_POLL_FIRST
|
|
403
|
+
If set, io_uring will assume the socket is currently full and attempting to
|
|
404
|
+
send data will be unsuccessful. For this case, io_uring will arm internal
|
|
405
|
+
poll and trigger a send of the data when there is enough space available.
|
|
406
|
+
This initial send attempt can be wasteful for the case where the socket
|
|
407
|
+
is expected to be full, setting this flag will bypass the initial send
|
|
408
|
+
attempt and go straight to arming poll. If poll does indicate that data can
|
|
409
|
+
be sent, the operation will proceed.
|
|
410
|
+
.EE
|
|
411
|
+
.in
|
|
412
|
+
.PP
|
|
413
|
+
|
|
386
414
|
.TP
|
|
387
415
|
.B IORING_OP_RECVMSG
|
|
388
416
|
Works just like IORING_OP_SENDMSG, except for
|
|
389
417
|
.BR recvmsg(2)
|
|
390
418
|
instead. See the description of IORING_OP_SENDMSG. Available since 5.3.
|
|
391
419
|
|
|
420
|
+
This command also supports the following modifiers in
|
|
421
|
+
.I ioprio:
|
|
422
|
+
|
|
423
|
+
.PP
|
|
424
|
+
.in +12
|
|
425
|
+
.B IORING_RECVSEND_POLL_FIRST
|
|
426
|
+
If set, io_uring will assume the socket is currently empty and attempting to
|
|
427
|
+
receive data will be unsuccessful. For this case, io_uring will arm internal
|
|
428
|
+
poll and trigger a receive of the data when the socket has data to be read.
|
|
429
|
+
This initial receive attempt can be wasteful for the case where the socket
|
|
430
|
+
is expected to be empty, setting this flag will bypass the initial receive
|
|
431
|
+
attempt and go straight to arming poll. If poll does indicate that data is
|
|
432
|
+
ready to be received, the operation will proceed.
|
|
433
|
+
.EE
|
|
434
|
+
.in
|
|
435
|
+
.PP
|
|
436
|
+
|
|
392
437
|
.TP
|
|
393
438
|
.B IORING_OP_SEND
|
|
394
439
|
Issue the equivalent of a
|
|
@@ -405,12 +450,46 @@ holds the flags associated with the system call. See also
|
|
|
405
450
|
.BR send(2)
|
|
406
451
|
for the general description of the related system call. Available since 5.6.
|
|
407
452
|
|
|
453
|
+
This command also supports the following modifiers in
|
|
454
|
+
.I ioprio:
|
|
455
|
+
|
|
456
|
+
.PP
|
|
457
|
+
.in +12
|
|
458
|
+
.B IORING_RECVSEND_POLL_FIRST
|
|
459
|
+
If set, io_uring will assume the socket is currently full and attempting to
|
|
460
|
+
send data will be unsuccessful. For this case, io_uring will arm internal
|
|
461
|
+
poll and trigger a send of the data when there is enough space available.
|
|
462
|
+
This initial send attempt can be wasteful for the case where the socket
|
|
463
|
+
is expected to be full, setting this flag will bypass the initial send
|
|
464
|
+
attempt and go straight to arming poll. If poll does indicate that data can
|
|
465
|
+
be sent, the operation will proceed.
|
|
466
|
+
.EE
|
|
467
|
+
.in
|
|
468
|
+
.PP
|
|
469
|
+
|
|
408
470
|
.TP
|
|
409
471
|
.B IORING_OP_RECV
|
|
410
472
|
Works just like IORING_OP_SEND, except for
|
|
411
473
|
.BR recv(2)
|
|
412
474
|
instead. See the description of IORING_OP_SEND. Available since 5.6.
|
|
413
475
|
|
|
476
|
+
This command also supports the following modifiers in
|
|
477
|
+
.I ioprio:
|
|
478
|
+
|
|
479
|
+
.PP
|
|
480
|
+
.in +12
|
|
481
|
+
.B IORING_RECVSEND_POLL_FIRST
|
|
482
|
+
If set, io_uring will assume the socket is currently empty and attempting to
|
|
483
|
+
receive data will be unsuccessful. For this case, io_uring will arm internal
|
|
484
|
+
poll and trigger a receive of the data when the socket has data to be read.
|
|
485
|
+
This initial receive attempt can be wasteful for the case where the socket
|
|
486
|
+
is expected to be empty, setting this flag will bypass the initial receive
|
|
487
|
+
attempt and go straight to arming poll. If poll does indicate that data is
|
|
488
|
+
ready to be received, the operation will proceed.
|
|
489
|
+
.EE
|
|
490
|
+
.in
|
|
491
|
+
.PP
|
|
492
|
+
|
|
414
493
|
.TP
|
|
415
494
|
.B IORING_OP_TIMEOUT
|
|
416
495
|
This command will register a timeout operation. The
|
|
@@ -434,7 +513,7 @@ clock source. The request will complete with
|
|
|
434
513
|
if the timeout got completed through expiration of the timer, or
|
|
435
514
|
.I 0
|
|
436
515
|
if the timeout got completed through requests completing on their own. If
|
|
437
|
-
the timeout was
|
|
516
|
+
the timeout was canceled before it expired, the request will complete with
|
|
438
517
|
.I -ECANCELED.
|
|
439
518
|
Available since 5.4.
|
|
440
519
|
|
|
@@ -453,7 +532,7 @@ suspend while having a timeout request in-flight.
|
|
|
453
532
|
|
|
454
533
|
.B IORING_TIMEOUT_REALTIME
|
|
455
534
|
If set, then the clocksource used is
|
|
456
|
-
.I
|
|
535
|
+
.I CLOCK_REALTIME
|
|
457
536
|
instead of
|
|
458
537
|
.I CLOCK_MONOTONIC.
|
|
459
538
|
.EE
|
|
@@ -469,7 +548,7 @@ operation.
|
|
|
469
548
|
must contain the
|
|
470
549
|
.I user_data
|
|
471
550
|
field of the previously issued timeout operation. If the specified timeout
|
|
472
|
-
request is found and
|
|
551
|
+
request is found and canceled successfully, this request will terminate
|
|
473
552
|
with a result value of
|
|
474
553
|
.I 0
|
|
475
554
|
If the timeout request was found but expiration was already in progress,
|
|
@@ -535,16 +614,16 @@ Attempt to cancel an already issued request.
|
|
|
535
614
|
.I addr
|
|
536
615
|
must contain the
|
|
537
616
|
.I user_data
|
|
538
|
-
field of the request that should be
|
|
617
|
+
field of the request that should be canceled. The cancelation request will
|
|
539
618
|
complete with one of the following results codes. If found, the
|
|
540
619
|
.I res
|
|
541
620
|
field of the cqe will contain 0. If not found,
|
|
542
621
|
.I res
|
|
543
|
-
will contain -ENOENT. If found and attempted
|
|
622
|
+
will contain -ENOENT. If found and attempted canceled, the
|
|
544
623
|
.I res
|
|
545
624
|
field will contain -EALREADY. In this case, the request may or may not
|
|
546
625
|
terminate. In general, requests that are interruptible (like socket IO) will
|
|
547
|
-
get
|
|
626
|
+
get canceled, while disk IO requests cannot be canceled if already started.
|
|
548
627
|
Available since 5.5.
|
|
549
628
|
|
|
550
629
|
.TP
|
|
@@ -562,9 +641,9 @@ If used, the timeout specified in the command will cancel the linked command,
|
|
|
562
641
|
unless the linked command completes before the timeout. The timeout will
|
|
563
642
|
complete with
|
|
564
643
|
.I -ETIME
|
|
565
|
-
if the timer expired and the linked request was attempted
|
|
644
|
+
if the timer expired and the linked request was attempted canceled, or
|
|
566
645
|
.I -ECANCELED
|
|
567
|
-
if the timer got
|
|
646
|
+
if the timer got canceled because of completion of the linked request. Like
|
|
568
647
|
.B IORING_OP_TIMEOUT
|
|
569
648
|
the clock source used is
|
|
570
649
|
.B CLOCK_MONOTONIC
|
|
@@ -778,7 +857,7 @@ contains the read or write offset. If
|
|
|
778
857
|
.I fd
|
|
779
858
|
does not refer to a seekable file,
|
|
780
859
|
.I off
|
|
781
|
-
must be set to zero. If
|
|
860
|
+
must be set to zero or -1. If
|
|
782
861
|
.I offs
|
|
783
862
|
is set to
|
|
784
863
|
.B -1
|
|
@@ -1045,9 +1124,124 @@ set, and a
|
|
|
1045
1124
|
field matching the
|
|
1046
1125
|
.I off
|
|
1047
1126
|
value being passed in. This request type can be used to either just wake or
|
|
1048
|
-
interrupt anyone waiting for completions on the target ring,
|
|
1127
|
+
interrupt anyone waiting for completions on the target ring, or it can be used
|
|
1049
1128
|
to pass messages via the two fields. Available since 5.18.
|
|
1050
1129
|
|
|
1130
|
+
.TP
|
|
1131
|
+
.B IORING_OP_SOCKET
|
|
1132
|
+
Issue the equivalent of a
|
|
1133
|
+
.BR socket(2)
|
|
1134
|
+
system call.
|
|
1135
|
+
.I fd
|
|
1136
|
+
must contain the communication domain,
|
|
1137
|
+
.I off
|
|
1138
|
+
must contain the communication type,
|
|
1139
|
+
.I len
|
|
1140
|
+
must contain the protocol, and
|
|
1141
|
+
.I rw_flags
|
|
1142
|
+
is currently unused and must be set to zero. See also
|
|
1143
|
+
.BR socket(2)
|
|
1144
|
+
for the general description of the related system call. Available since 5.19.
|
|
1145
|
+
|
|
1146
|
+
If the
|
|
1147
|
+
.I file_index
|
|
1148
|
+
field is set to a positive number, the file won't be installed into the
|
|
1149
|
+
normal file table as usual but will be placed into the fixed file table at index
|
|
1150
|
+
.I file_index - 1.
|
|
1151
|
+
In this case, instead of returning a file descriptor, the result will contain
|
|
1152
|
+
either 0 on success or an error. If the index points to a valid empty slot, the
|
|
1153
|
+
installation is guaranteed to not fail. If there is already a file in the slot,
|
|
1154
|
+
it will be replaced, similar to
|
|
1155
|
+
.B IORING_OP_FILES_UPDATE.
|
|
1156
|
+
Please note that only io_uring has access to such files and no other syscall
|
|
1157
|
+
can use them. See
|
|
1158
|
+
.B IOSQE_FIXED_FILE
|
|
1159
|
+
and
|
|
1160
|
+
.B IORING_REGISTER_FILES.
|
|
1161
|
+
|
|
1162
|
+
Available since 5.19.
|
|
1163
|
+
|
|
1164
|
+
.TP
|
|
1165
|
+
.B IORING_OP_SEND_ZC
|
|
1166
|
+
Issue the zerocopy equivalent of a
|
|
1167
|
+
.BR send(2)
|
|
1168
|
+
system call. Similar to IORING_OP_SEND, but tries to avoid making intermediate
|
|
1169
|
+
copies of data. Zerocopy execution is not guaranteed and may fall back to
|
|
1170
|
+
copying. The request may also fail with
|
|
1171
|
+
.B -EOPNOTSUPP ,
|
|
1172
|
+
when a protocol doesn't support zerocopy, in which case users are recommended
|
|
1173
|
+
to use copying sends instead.
|
|
1174
|
+
|
|
1175
|
+
The
|
|
1176
|
+
.I flags
|
|
1177
|
+
field of the first
|
|
1178
|
+
.I "struct io_uring_cqe"
|
|
1179
|
+
may likely contain
|
|
1180
|
+
.B IORING_CQE_F_MORE ,
|
|
1181
|
+
which means that there will be a second completion event / notification for
|
|
1182
|
+
the request, with the
|
|
1183
|
+
.I user_data
|
|
1184
|
+
field set to the same value. The user must not modify the data buffer until the
|
|
1185
|
+
notification is posted. The first cqe follows the usual rules and so its
|
|
1186
|
+
.I res
|
|
1187
|
+
field will contain the number of bytes sent or a negative error code. The
|
|
1188
|
+
notification's
|
|
1189
|
+
.I res
|
|
1190
|
+
field will be set to zero and the
|
|
1191
|
+
.I flags
|
|
1192
|
+
field will contain
|
|
1193
|
+
.B IORING_CQE_F_NOTIF .
|
|
1194
|
+
The two step model is needed because the kernel may hold on to buffers for a
|
|
1195
|
+
long time, e.g. waiting for a TCP ACK, and having a separate cqe for request
|
|
1196
|
+
completions allows userspace to push more data without extra delays. Note,
|
|
1197
|
+
notifications are only responsible for controlling the lifetime of the buffers,
|
|
1198
|
+
and as such don't mean anything about whether the data has atually been sent
|
|
1199
|
+
out or received by the other end. Even errored requests may generate a
|
|
1200
|
+
notification, and the user must check for
|
|
1201
|
+
.B IORING_CQE_F_MORE
|
|
1202
|
+
rather than relying on the result.
|
|
1203
|
+
|
|
1204
|
+
.I fd
|
|
1205
|
+
must be set to the socket file descriptor,
|
|
1206
|
+
.I addr
|
|
1207
|
+
must contain a pointer to the buffer,
|
|
1208
|
+
.I len
|
|
1209
|
+
denotes the length of the buffer to send, and
|
|
1210
|
+
.I msg_flags
|
|
1211
|
+
holds the flags associated with the system call. When
|
|
1212
|
+
.I addr2
|
|
1213
|
+
is non-zero it points to the address of the target with
|
|
1214
|
+
.I addr_len
|
|
1215
|
+
specifying its size, turning the request into a
|
|
1216
|
+
.BR sendto(2)
|
|
1217
|
+
system call equivalent.
|
|
1218
|
+
|
|
1219
|
+
Available since 6.0.
|
|
1220
|
+
|
|
1221
|
+
This command also supports the following modifiers in
|
|
1222
|
+
.I ioprio:
|
|
1223
|
+
|
|
1224
|
+
.PP
|
|
1225
|
+
.in +12
|
|
1226
|
+
.B IORING_RECVSEND_POLL_FIRST
|
|
1227
|
+
If set, io_uring will assume the socket is currently full and attempting to
|
|
1228
|
+
send data will be unsuccessful. For this case, io_uring will arm internal
|
|
1229
|
+
poll and trigger a send of the data when there is enough space available.
|
|
1230
|
+
This initial send attempt can be wasteful for the case where the socket
|
|
1231
|
+
is expected to be full, setting this flag will bypass the initial send
|
|
1232
|
+
attempt and go straight to arming poll. If poll does indicate that data can
|
|
1233
|
+
be sent, the operation will proceed.
|
|
1234
|
+
|
|
1235
|
+
.B IORING_RECVSEND_FIXED_BUF
|
|
1236
|
+
If set, instructs io_uring to use a pre-mapped buffer. The
|
|
1237
|
+
.I buf_index
|
|
1238
|
+
field should contain an index into an array of fixed buffers. See
|
|
1239
|
+
.BR io_uring_register (2)
|
|
1240
|
+
for details on how to setup a context for fixed buffer I/O.
|
|
1241
|
+
.EE
|
|
1242
|
+
.in
|
|
1243
|
+
.PP
|
|
1244
|
+
|
|
1051
1245
|
.PP
|
|
1052
1246
|
The
|
|
1053
1247
|
.I flags
|
|
@@ -1131,12 +1325,12 @@ opcode specific and is the same as with breaking chains of
|
|
|
1131
1325
|
One special case is when the request has a linked timeout, then the CQE
|
|
1132
1326
|
generation for the linked timeout is decided solely by whether it has
|
|
1133
1327
|
.B IOSQE_CQE_SKIP_SUCCESS
|
|
1134
|
-
set, regardless whether it timed out or was
|
|
1328
|
+
set, regardless whether it timed out or was canceled. In other words, if a
|
|
1135
1329
|
linked timeout has the flag set, it's guaranteed to not post a CQE.
|
|
1136
1330
|
|
|
1137
1331
|
The semantics are chosen to accommodate several use cases. First, when all but
|
|
1138
1332
|
the last request of a normal link without linked timeouts are marked with the
|
|
1139
|
-
flag, only one CQE per lin is posted. Additionally, it enables
|
|
1333
|
+
flag, only one CQE per lin is posted. Additionally, it enables suppression of
|
|
1140
1334
|
CQEs in cases where the side effects of a successfully executed operation is
|
|
1141
1335
|
enough for userspace to know the state of the system. One such example would
|
|
1142
1336
|
be writing to a synchronisation file.
|
|
@@ -1247,7 +1441,9 @@ is used for certain commands, like
|
|
|
1247
1441
|
.B IORING_OP_POLL_ADD
|
|
1248
1442
|
or in conjunction with
|
|
1249
1443
|
.B IOSQE_BUFFER_SELECT
|
|
1250
|
-
|
|
1444
|
+
or
|
|
1445
|
+
.B IORING_OP_MSG_RING,
|
|
1446
|
+
, see those entries for details.
|
|
1251
1447
|
.I res
|
|
1252
1448
|
is the operation-specific result, but io_uring-specific errors
|
|
1253
1449
|
(e.g. flags or opcode invalid) are returned through this field.
|
|
@@ -1273,7 +1469,7 @@ in the matching man page for that type, or in the opcodes section above for
|
|
|
1273
1469
|
io_uring-specific opcodes.
|
|
1274
1470
|
.PP
|
|
1275
1471
|
.SH RETURN VALUE
|
|
1276
|
-
.BR io_uring_enter ()
|
|
1472
|
+
.BR io_uring_enter (2)
|
|
1277
1473
|
returns the number of I/Os successfully consumed. This can be zero
|
|
1278
1474
|
if
|
|
1279
1475
|
.I to_submit
|
|
@@ -1290,15 +1486,14 @@ completion queue entry (see section
|
|
|
1290
1486
|
rather than through the system call itself.
|
|
1291
1487
|
|
|
1292
1488
|
Errors that occur not on behalf of a submission queue entry are returned via the
|
|
1293
|
-
system call directly. On such an error,
|
|
1294
|
-
|
|
1295
|
-
is returned and
|
|
1489
|
+
system call directly. On such an error, a negative error code is returned. The
|
|
1490
|
+
caller should not rely on
|
|
1296
1491
|
.I errno
|
|
1297
|
-
|
|
1492
|
+
variable.
|
|
1298
1493
|
.PP
|
|
1299
1494
|
.SH ERRORS
|
|
1300
1495
|
These are the errors returned by
|
|
1301
|
-
.BR io_uring_enter ()
|
|
1496
|
+
.BR io_uring_enter (2)
|
|
1302
1497
|
system call.
|
|
1303
1498
|
.TP
|
|
1304
1499
|
.B EAGAIN
|
|
@@ -1317,8 +1512,30 @@ is a valid file descriptor, but the io_uring ring is not in the right state
|
|
|
1317
1512
|
.BR io_uring_register (2)
|
|
1318
1513
|
for details on how to enable the ring.
|
|
1319
1514
|
.TP
|
|
1515
|
+
.B EBADR
|
|
1516
|
+
At least one CQE was dropped even with the
|
|
1517
|
+
.B IORING_FEAT_NODROP
|
|
1518
|
+
feature, and there are no otherwise available CQEs. This clears the error state
|
|
1519
|
+
and so with no other changes the next call to
|
|
1520
|
+
.BR io_uring_setup (2)
|
|
1521
|
+
will not have this error. This error should be extremely rare and indicates the
|
|
1522
|
+
machine is running critically low on memory and. It may be reasonable for the
|
|
1523
|
+
application to terminate running unless it is able to safely handle any CQE
|
|
1524
|
+
being lost.
|
|
1525
|
+
.TP
|
|
1526
|
+
.B EBUSY
|
|
1527
|
+
If the
|
|
1528
|
+
.B IORING_FEAT_NODROP
|
|
1529
|
+
feature flag is set, then
|
|
1320
1530
|
.B EBUSY
|
|
1321
|
-
|
|
1531
|
+
will be returned if there were overflow entries,
|
|
1532
|
+
.B IORING_ENTER_GETEVENTS
|
|
1533
|
+
flag is set and not all of the overflow entries were able to be flushed to
|
|
1534
|
+
the CQ ring.
|
|
1535
|
+
|
|
1536
|
+
Without
|
|
1537
|
+
.B IORING_FEAT_NODROP
|
|
1538
|
+
the application is attempting to overcommit the number of requests it can have
|
|
1322
1539
|
pending. The application should wait for some completions and try again. May
|
|
1323
1540
|
occur if the application tries to queue more requests than we have room for in
|
|
1324
1541
|
the CQ ring, or if the application attempts to wait for more events without
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
io_uring_enter.2
|
|
@@ -2,23 +2,26 @@
|
|
|
2
2
|
.\"
|
|
3
3
|
.\" SPDX-License-Identifier: LGPL-2.0-or-later
|
|
4
4
|
.\"
|
|
5
|
-
.TH io_uring_free_probe "January 25, 2022" "liburing-2.1" "liburing Manual"
|
|
5
|
+
.TH io_uring_free_probe 3 "January 25, 2022" "liburing-2.1" "liburing Manual"
|
|
6
6
|
.SH NAME
|
|
7
|
-
io_uring_free_probe
|
|
7
|
+
io_uring_free_probe \- free probe instance
|
|
8
8
|
.SH SYNOPSIS
|
|
9
9
|
.nf
|
|
10
|
-
.
|
|
10
|
+
.B #include <liburing.h>
|
|
11
11
|
.PP
|
|
12
|
-
.BI "void io_uring_free_probe(struct io_uring_probe *probe)"
|
|
12
|
+
.BI "void io_uring_free_probe(struct io_uring_probe *" probe ");"
|
|
13
13
|
.fi
|
|
14
|
-
.PP
|
|
15
14
|
.SH DESCRIPTION
|
|
16
15
|
.PP
|
|
17
|
-
The function
|
|
16
|
+
The function
|
|
17
|
+
.BR io_uring_free_probe (3)
|
|
18
|
+
frees the
|
|
18
19
|
.I probe
|
|
19
|
-
instance allocated with the
|
|
20
|
+
instance allocated with the
|
|
21
|
+
.BR io_uring_get_probe (3)
|
|
22
|
+
function.
|
|
20
23
|
|
|
21
24
|
.SH RETURN VALUE
|
|
22
25
|
None
|
|
23
26
|
.SH SEE ALSO
|
|
24
|
-
.BR io_uring_get_probe (3)
|
|
27
|
+
.BR io_uring_get_probe (3)
|