commit 4751448abf8ad7f41723aa0278bb90910190e47e Author: Adrian Schröter Date: Fri Oct 6 17:11:07 2023 +0200 Sync from SUSE:ALP:Source:Standard:1.0 liburing revision b1116c3a043c4d3c340a2cbfa160c7c5 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..fecc750 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/liburing-2.4.tar.bz2 b/liburing-2.4.tar.bz2 new file mode 100644 index 0000000..0854355 --- /dev/null +++ b/liburing-2.4.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca260e7a5820c2d0e737ec1e9b999f10776dbe84a169a02a0eff10c8eeaf3394 +size 213774 diff --git a/liburing.changes b/liburing.changes new file mode 100644 index 0000000..07a00f2 --- /dev/null +++ b/liburing.changes @@ -0,0 +1,410 @@ +------------------------------------------------------------------- +Fri Sep 15 05:28:44 UTC 2023 - Jiri Slaby + +- tests-don-t-expect-multishot-recv-overflow-backloggi.patch (bsc#1215332) + +------------------------------------------------------------------- +Thu Sep 14 08:37:29 UTC 2023 - Jiri Slaby + +- build tests in parallel (using %{?_smp_mflags}) + +------------------------------------------------------------------- +Thu Aug 31 06:57:37 UTC 2023 - Jiri Slaby + +- add test-io_uring_register-fix-errno-confusion-and-new-e.patch + to fix test errors on the 6.5 kernel + +------------------------------------------------------------------- +Mon Jun 12 08:44:39 UTC 2023 - David Disseldorp + +- Update to 2.4: + * Add io_uring_{major,minor,check}_version() functions. + * Add IO_URING_{MAJOR,MINOR,CHECK}_VERSION() macros. + * FFI support (for non-C/C++ languages integration). + * Add io_uring_prep_msg_ring_cqe_flags() function. + * Deprecate --nolibc configure option. + * CONFIG_NOLIBC is always enabled on x86-64, x86, and aarch64. + * Add support for IORING_REGISTER_USE_REGISTERED_RING and use if available. + * Add io_uring_close_ring_fd() function. + * Add io_uring_prep_msg_ring_fd_alloc function. + * Add io_uring_free_buf_ring() and io_uring_setup_buf_ring() functions. + * Ensure that io_uring_prep_accept_direct(), io_uring_prep_openat_direct(), + io_uring_prep_openat2_direct(), io_uring_prep_msg_ring_fd(), and + io_uring_prep_socket_direct() factor in being called with + IORING_FILE_INDEX_ALLOC for allocating a direct descriptor. + * Add io_uring_prep_sendto() function. +- Add liburing-ffi2 package for corresponding FFI library, given that + dependents will normally require either that or the base library (not both). +- Drop upstream patches: + * 0001-Do-not-always-expect-multishot-recv-to-stop-posting-.patch + * 0001-test-file-verify.t-Don-t-run-over-mlock-limit-when-r.patch + * 0001-test-helpers-fix-socket-length-type.patch + +------------------------------------------------------------------- +Thu Apr 20 20:26:32 UTC 2023 - Gabriel Krisman Bertazi + +- Add 0001-test-file-verify.t-Don-t-run-over-mlock-limit-when-r.patch + fixes test with kernel <= 5.16 (bsc#1209723) + +------------------------------------------------------------------- +Tue Feb 21 13:10:33 UTC 2023 - Jiri Slaby + +- add 0001-Do-not-always-expect-multishot-recv-to-stop-posting-.patch + fixes tests with kernel 6.2 + +------------------------------------------------------------------- +Sat Jan 21 09:19:57 UTC 2023 - Dirk Müller + +- add 0001-test-helpers-fix-socket-length-type.patch + fixes tests on big endian + +------------------------------------------------------------------- +Fri Nov 18 21:26:17 UTC 2022 - Dirk Müller + +- update to 2.3: + * Support non-libc build for aarch64. + * Add io_uring_{enter,enter2,register,setup} syscall functions. + * Add sync cancel interface, io_uring_register_sync_cancel(). + * Fix return value of io_uring_submit_and_wait_timeout() to match the + man page. + * Improvements to the regression tests + * Add support and test case for passthrough IO + * Add recv and recvmsg multishot helpers and support + * Add documentation and support for IORING_SETUP_DEFER_TASKRUN + * Fix potential missing kernel entry with IORING_SETUP_IOPOLL + * Add support and documentation for zero-copy network transmit + * Various optimizations + * Many cleanups + * Many man page additions and updates +- drop handle-eintr.patch, test-xattr-don-t-rely-on-NUL-termination.patch: upstream + +------------------------------------------------------------------- +Sun Sep 25 14:34:41 UTC 2022 - Dirk Müller + +- skip checks on qemu_linux_user builds + +------------------------------------------------------------------- +Tue Aug 16 10:53:40 UTC 2022 - Jiri Slaby + +- add test-xattr-don-t-rely-on-NUL-termination.patch (bsc#1202413) + +------------------------------------------------------------------- +Fri Jul 8 12:40:13 UTC 2022 - Dirk Müller + +- add handle-eintr.patch, enable tests everywhere + +------------------------------------------------------------------- +Wed Jun 29 11:28:10 UTC 2022 - Dirk Müller + +- enable tests for != ppc64le + +------------------------------------------------------------------- +Tue Jun 28 13:40:10 UTC 2022 - Dirk Müller + +- update to 2.2: + * Support non-libc builds. + * Optimized syscall handling for x86-64/x86/aarch64. + * Enable non-lib function calls for fast path functions. + * Add support for multishot accept. + * io_uring_register_files() will set RLIMIT_NOFILE if necessary. + * Add support for registered ring fds, io_uring_register_ring_fd(), + reducingthe overhead of an io_uring_enter() system call. + * Add support for the message ring opcode. + * Add support for newer request cancelation features. + * Add support for IORING_SETUP_COOP_TASKRUN, which can help reduce the + overhead of io_uring in general. Most applications should set this flag, + see the io_uring_setup.2 man page for details. + * Add support for registering a sparse buffer and file set. + * Add support for a new buffer provide scheme, see + io_uring_register_buf_ring.3 for details. + * Add io_uring_submit_and_wait_timeout() for submitting IO and waiting + for completions with a timeout. + * Add io_uring_prep_{read,write}v2 prep helpers. + * Add io_uring_prep_close_direct() helper. + * Add support for SQE128 and CQE32, which are doubly sized SQE and CQE + rings. This is needed for some cases of the new IORING_OP_URING_CMD, + notably for NVMe passthrough. + * ~5500 lines of man page additions, including adding ~90 new man pages. + * Synced with the 5.19 kernel release, supporting all the features of + 5.19 and earlier. + * 24 new regression test cases, and ~7000 lines of new tests in general. + * General optimizations and fixes. + +------------------------------------------------------------------- +Fri Apr 29 06:53:08 UTC 2022 - Dirk Müller + +- avoid requiring kernel-default (bsc#1193522) + +------------------------------------------------------------------- +Thu Feb 10 13:32:35 UTC 2022 - David Disseldorp + +- add explicit liburing2-devel alias to reflect SLE/LEAP 15.4+ naming + (bsc#1193522) + +------------------------------------------------------------------- +Wed Oct 13 10:31:43 UTC 2021 - David Disseldorp + +- update to 2.1 (bsc#1193522): + * Ignore spurious fadvise/madvise failures + * build: add -D_GNU_SOURCE to all CPPFLAGS/CFLAGS. + * man: clean up spelling + * man/io_uring_enter.2: add notes about direct open/accept + * io_uring.h: sync with 5.15 kernel + * Fix IORING_REGISTER_IOWQ_MAX_WORKERS name + * man: document new register/update API + * liburing: add helpers for direct open/accept + * liburing.h: correct max_worker name + * Change IORING_REGISTER_IOWQ_MAX_UNBOUND_WORKERS + * src/syscall.h: get rid of useless externs + * man/io_uring_enter.2: document IORING_ENTER_EXT_ARG + * Add io_uring_register_iowq_max_unbound() helper + * Get rid of useless 'extern' on function declarations in liburing.h + * Add (UN)REGISTER_IOWQ_AFF helpers + * man/io_uring_register.2: note when MAX_UNBOUND became available + * man/io_uring_register.2: add missing punctuation + * man/io_uring_register.2: document IORING_REGISTER_IOWQ_MAX_UNBOUND + * man/io_uring_enter.2: add IORING_OP_TIMEOUT clock sources + * man/io_uring_enter.2: improve timeout entry + * man/io_uring_enter.2: update SQE + * man/io_uring_enter.2: note that not all requests support fixed files + * man/io_uring_enter.2: add new 5.15 opcodes + * man/io_uring_enter.2: note that cqe->flags is indeed used + * man/io_uring_enter.2: add poll update and multishot mode + * man/io_uring_register.2: add IORING_(UN)REGISTER_IOWQ + * man: update notes on register quiesce + * man: fix io_uring_sqe alignment + * register: add tagging and buf update helpers + * liburing.h: make header clean for implicit sign and size conversions + * configure: document --cc and --cxx options + * io_uring: update buffer update feature testing + * liburing.h: dedup poll mask conversion + * liburing.h: add a multipoll helper + * Update io_uring.h + * examples: disable ucontext-cp for elbrus (e2k) architecture + * Update io_uring_setup.2 + * man/io_uring_setup.2: document the two most recent FEAT flags + * man/io_uring_setup.2: make sure FEAT flags are kernel versioned + * correct syscall NR in mips + * Fix 32-bit compile warnings + * liburing.h: make all file/IO offset __u64 + * src/queue: don't flush SQ ring for new wait interface + * man/io_uring_enter.2: further clarify what cqe->res holds + * Clarify information about error results + * Refer to the accept_flags in io_uring_enter manual + * Fix a bug due to the unreleased lock before function returns + * debian/rules: add missing slash for relativelibdir + * man/io_uring_enter.2: clarify io_uring_enter(2) SQPOLL return value + * liburing.h: add linkat prep helper + * io_uring.h: add linkat opcode + * liburing.h: add symlinkat prep helper + * io_uring.h: add symlinkat opcode + * liburing.h: add mkdirat prep helper + * update rsrc register/update ABI and tests + * queue: clean up SQ flushing + * io_uring_enter(2): Clarify how to read from and write to non-seekable files + * clarify an edge case of IORING_SETUP_SQ_AFF + * io_uring_enter(2): clarify OP_READ and OP_WRITE + * sync io_uring.h API file with Linux 5.13 + * man: Fix typo in man io_uring_queue_exit + * examples/link-cp: fix a couple of strerror negations + * src/setup: don't treat dummy ring init as failure + * src/setup: add some documentation to the memlock helpers + * examples/ucontext-cp.c: cope with variable SIGSTKSZ + * setup: provide helpers to inquire about necessary mlock sizes + * examples/io_uring-cp: wait for pending writes before exit copy loop + * spec: add explicit build dependency on make + * spec: bump version to 2.0 + * man/io_uring_enter.2: note that -EBUSY can also happen for getevents + +------------------------------------------------------------------- +Sat Mar 13 21:33:04 UTC 2021 - Dirk Müller + +- skip building the tests that are neither installed nor run + as they fail to build on 32bit platforms (like e.g. armv7l) (bsc#1181571) + +------------------------------------------------------------------- +Sat Mar 13 20:18:54 UTC 2021 - Dirk Müller + +- update to 2.0: + * Sync io_uring.h API file with Linux 5.12 + * helpers: prefix any helper with t_ instead of io_uring_ + * helpers: add io_uring_create_buffers() helper + * helpers: add io_uring_create_file() helper + * helpers: add io_uring_calloc helper + * helpers: add io_uring_posix_memalign helper + * setup: cleanup probe code + * setup: check whether malloc succ before using it + * io_uring_prep_sync_file_range: cleanups + * .gitignore: add sendmsg_fs_cve + * Added prep function for sync_file_range op + * Install man7 pages + * src/queue: never clear data->wait_nr + * src/queue: control kernel enter with a var + * src/queue: don't re-wait for CQEs + * src/queue: don't loop when don't enter + * src/queue: clean _io_uring_get_cqe() err handling + * src/queue: don't wait for less than expected + * Add inline doc in the comments for io_uring_prep_splice + * Fix sigset_t not found in liburing.h + * src/queue: update comment on io_uring_wait_cqes() with timeouts + * io_uring.h: 5.12 pending kernel sync + * man/io_uring_register.2: fix spelling error + * man/io_uring_register.2: Add documentation on IORING_REGISTER_FILES_SKIP + * Add two ring deadlock case + * Fix IORING_OP_FALLOCATE args in io_uring_enter(2) man page + * src/queue: Fix a typo in `__io_uring_flush_sq()` + * src/queue: fix `sq_ring_needs_enter()` indentation + * src/queue: refactor io_uring_get_sqe() + * man/io_uring_setup.2: correct 5.10 -> 5.11 for non-fixed files and SQPOLL + * man/io_uring_enter.2: document new opcodes + * man/io_uring_enter.2: ensure all IORING_ENTER_* flags are documented + * src/queue: add comment on why reading SQ->head for flush isn't atomic + * liburing.h: fix 32-bit compile warning + * man/io_uring.7: Fix typo + * man/io_uring_enter.2: describe timeout updates + * Don't enter the kernel to wait on cqes if they are already available. + * Add timeout update + * remove zero-size array in io_uring.h + * Rename SIG_IS_DATA -> EXT_ARG + * Update SIG_IS_DATA to modified kernel API + * Use IORING_ENTER_GETEVENTS_TIMEOUT if available + * Add wrapper for __io_uring_get_cqe() + * Add __sys_io_uring_enter2() + * Include 'features' in struct io_uring + * io_uring.h: update with 5.11-pending copy + * Fix compilation with iso C standard (c89, c99 and c11) + * examples: disable ucontext-cp if ucontext.h is not available + * Moves function calls out of assert(). + * liburing.h: add renameat/unlinkat prep helpers + * io_uring.h: add renameat and unlinkat opcodes + * configure: Fix unsafe temporary file creation + * Add const modifier to functions that do not change the state of the ring + * man/io_uring_enter.2: clarify POLL_ADD return value + * Add get_sqe manpage to debian package + * Add man page for io_uring_get_sqe + * man/io_uring_enter.2: add EACCES and EBADFD errors + * man/io_uring_register.2: add description of restrictions + * man/io_uring_setup.2: add IORING_SETUP_R_DISABLED description + * Makefile: add .PHONY dependency + * man/io_uring_enter.2: split ERRORS section in two sections + * liburing.h: add `io_uring_prep_tee` + * Fix build flag settings + * .gitignore: Add sq-poll-dup + * man/io_uring_enter.2: clarify PROVIDE_BUFFERS requirements + * Update packaging/installation for new man pages + * man/io_uring.7: clarify submission/completion ordering + * man/io_uring.7: style and barrier updates + * Add man page for io_uring_queue_exit + * Add man page for io_uring_queue_init + * Adding section 7 man page for io_uring + * probes: provide our own free function + * .gitignore: add pipe-reuse + * Fold versioned symbols into LIBURING_2.0 version node + * Remove versioned symbols not provided by the shared library anymore + * man/io_uring_setup.2: improve SQPOLL wakeup example + * Fix io_uring_sq_ready() to use load acquire to read khead. + * io_uring.h: fix missing tab + * Bump major version to 2 + * Add IORING_OP_SHUTDOWN and prep helper + * Add a few function comments in liburing.h + * Add io_uring_sqring_wait() + * io_uring.h: add new definitions from 5.10 + * man/io_uring_setup.2: document missing IORING_FEAT_* feature flags + * man/io_uring_enter.2: add description of buffer selections + * build: Output CXX on quiet output when using a C++ compiler + * Fix missing 'c' in sigfd-deadlock addition + * Add helper to enable rings + * Add helper to register restrictions + * io_uring.h: add register restrictions and enable ring defines + * io_uring.h: use an enumeration for io_uring_register(2) opcodes + * io_uring_prep_splice(): fix type (again) + * Use the right type for io_uring_prep_splice() + * syscall: make syscall.h independently includeable + * sq_ring_needs_enter: revert change to only enter if submit != 0 + * man/io_uring_setup.2: document IORING_SETUP_ATTACH_WQ + * update debian/changelog + * update debian/liburing1.symbols + * debian/rules: pass down relativelibdir in order to get an absolute path + * man/io_uring_setup.2: document IORING_SETUP_CLAMP + * man/io_uring_enter: fix openat sqe doc + +------------------------------------------------------------------- +Sat Mar 13 20:15:42 UTC 2021 - Dirk Müller + +- update to 0.7: + * io_uring.h: sync with kernel + * io_uring_peek_batch_cqe should also check cq ring overflow + * Check cq ring overflow status + * configure: fix typos in help/error messages + * src/setup: clarify that we always return -errno on error + * man/io_uring_enter.2: updated io_uring_sqe and fixed incorrect flag references. + * Removed misplaced periods from io_uring_enter(2). + * Merge branch 'readme' of https://github.com/jobs-git/liburing + * Make readme sensible + * man/io_uring_enter: update connect to note use of const + * Merge branch 'master' of https://github.com/KayEss/liburing + * Take `sockaddr` immutably in io_uring_prep_connect + * Merge branch 'dev' of https://github.com/CarterLi/liburing + * Merge branch 'fix-splice-docs' of https://github.com/gerow/liburing + * man: fix description of splice offsets + * .travis.yml: Change the language from C to C++ + * configure: Use $CC and $CXX as default compilers if set + * Make the liburing header files again compatible with C++ + * src/include/liburing/barrier.h: Restore clang compatibility + * src/Makefile: Only specify -shared at link time + * Merge branch 'openat_o_path' of https://github.com/MaxKellermann/liburing + * Convert __io_uring_get_sqe() from a macro into an inline function + * src/include/liburing/barrier.h: Use C11 atomics + * Makefiles: Enable -Wextra + * Bump version to 1.0.7 + * change poll_events to 32 bits to cover EPOLLEXCLUSIVE + * examples/ucontext-cp.c: use IORING_OP_TIMEOUT + * man/io_uring_enter: correct the description of + * man/io_uring_register.2: add IORING_CQ_EVENTFD_DISABLED description + * Add helpers to set and get eventfd notification status + * man/io_uring_setup.2: add 'flags' field in the struct io_cqring_offsets + * Add CQ ring 'flags' field + * remove duplicate call to __io_uring_peek_cqe() + * update wait_nr to account for completed event + * preseve wait_nr if SETUP_IOPOLL is set + * man/io_uring_enter.2: add IORING_OP_TEE entry + * update io_uring.h with tee() + * Merge branch 'master' of https://github.com/shuveb/liburing + * Adding section to describe IORING_OP_EPOLL_CTL + * fix missing '#include ' in 'src/include/liburing.h + * fix build on musl libc + * Use uint64_t for splice offsets + * Use __off64_t for offsets + * Merge branch 'master' of https://github.com/shuveb/liburing + * Adding description for the IORING_OP_SPLICE operation + * Merge branch 'master' of https://github.com/shuveb/liburing + * Adding section describing IORING_OP_OPENAT2 + * Fix 32-bit warnings on compile + * __io_uring_get_cqe: silence signed vs unsigned comparison warning + * io_uring_get_sqe: always use khead + +------------------------------------------------------------------- +Fri Oct 30 21:42:16 UTC 2020 - Milan Savić + +!!IMPORTANT!! +Version 0.7 BREAKS ABI COMPATIBILITY WITHOUT CHANGING THE SONAME!!! +https://github.com/axboe/liburing/issues/228 +SONAME is bumped to 2 in commit 25bbcbef3e0a8bfba8044be55d08d5116c51dccd +im master branch. +!!!IMPORTANT!!! + +- Update to version 0.6 + - removed barrier.h-add-generic-smp_mb-implementation.patch since + it was merged in commit ba97eaf8f9ef2030d581be10df9d875dbfadc91d +- License changed to match upstream + +------------------------------------------------------------------- +Thu Dec 12 09:20:32 UTC 2019 - Johannes Thumshirn + +- Fix builds on ppc64le and s390x (bsc#1159055) + + barrier.h-add-generic-smp_mb-implementation.patch + +------------------------------------------------------------------- +Wed Nov 27 08:18:20 UTC 2019 - Johannes Thumshirn + +- Initial packaging for openSUSE (jsc#SLE-7494) diff --git a/liburing.spec b/liburing.spec new file mode 100644 index 0000000..5269e92 --- /dev/null +++ b/liburing.spec @@ -0,0 +1,116 @@ +# +# spec file for package liburing +# +# Copyright (c) 2023 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define lname liburing2 +Name: liburing +Version: 2.4 +Release: 0 +Summary: Linux-native io_uring I/O access library +License: (GPL-2.0-only AND LGPL-2.1-or-later) OR MIT +Group: Development/Libraries/C and C++ +URL: https://git.kernel.dk/cgit/liburing +Source: https://git.kernel.dk/cgit/liburing/snapshot/%{name}-%{version}.tar.bz2 +Patch0: test-io_uring_register-fix-errno-confusion-and-new-e.patch +Patch1: tests-don-t-expect-multishot-recv-overflow-backloggi.patch +BuildRequires: gcc-c++ +BuildRequires: pkgconfig +BuildRequires: procps +# Kernel part has landed in 5.1 +Conflicts: kernel < 5.1 + +%description +Provides native async IO for the Linux kernel, in a fast and efficient +manner, for both buffered and O_DIRECT. + +%package -n %{lname} +Summary: Linux-native io_uring I/O access library +Group: Development/Libraries/C and C++ + +%description -n %{lname} +Provides native async IO for the Linux kernel, in a fast and efficient +manner, for both buffered and O_DIRECT. + +%package -n liburing-ffi2 +Summary: io_uring I/O access library for non-C/C++ languages +Group: Development/Libraries/C and C++ + +%description -n liburing-ffi2 +Foreign function interface for liburing, offering non-C/C++ language +integration. + +%package devel +Summary: Development files for Linux-native io_uring I/O access library +Group: Development/Libraries/C and C++ +# SLE/Leap 15.4+ retain liburing-devel for the inherited 0.6 API. The v2 API is: +Provides: %{lname}-devel = %{version} +Requires: %{lname} = %{version} +Requires: pkgconfig + +%description devel +This package provides header files to include and libraries to link with +for the Linux-native io_uring. + +%prep +%autosetup -p1 + +%build +# not autotools, so configure macro doesn't work +sh ./configure --prefix=%{_prefix} \ + --includedir=%{_includedir} \ + --libdir=/%{_libdir} \ + --libdevdir=/%{_libdir} \ + --mandir=%{_mandir} \ + --datadir=%{_datadir} +%make_build -C src + +%check +# io_uring syscalls not supported as of qemu 7.0.0 and would test the host +# kernel anyway not the target kernel.. +%if !0%{?qemu_user_space_build} +/usr/bin/make %{?_smp_mflags} runtests +%endif + +%install +%make_install +rm -v %{buildroot}%{_libdir}/%{name}*.a + +%post -n %{lname} -p /sbin/ldconfig +%postun -n %{lname} -p /sbin/ldconfig + +%post -n liburing-ffi2 -p /sbin/ldconfig +%postun -n liburing-ffi2 -p /sbin/ldconfig + +%files -n %{lname} +%{_libdir}/liburing.so.* +%license COPYING COPYING.GPL LICENSE + +%files -n liburing-ffi2 +%{_libdir}/liburing-ffi.so.* + +%files devel +%doc README +%{_includedir}/liburing/ +%{_includedir}/liburing.h +%{_libdir}/liburing.so +%{_libdir}/liburing-ffi.so +%{_libdir}/pkgconfig/* +%{_mandir}/man2/* +%{_mandir}/man3/* +%{_mandir}/man7/* + +%changelog diff --git a/test-io_uring_register-fix-errno-confusion-and-new-e.patch b/test-io_uring_register-fix-errno-confusion-and-new-e.patch new file mode 100644 index 0000000..1a2d84a --- /dev/null +++ b/test-io_uring_register-fix-errno-confusion-and-new-e.patch @@ -0,0 +1,171 @@ +From: Jens Axboe +Date: Wed, 28 Jun 2023 19:43:02 -0600 +Subject: test/io_uring_register: fix errno confusion and new error +Git-commit: 2d3368b73b478a737b2247ef5630be56c3b176b5 +Patch-mainline: 2.5 +References: kernel 6.5 + +This test suffers from some serious errno vs liburing function return. +All liburing functions return a negative errno value on failure, there's +no use of errno at all. This means that rather than check for the return +being -1 and then relying on errno being set to EINVAL, liburing +functions return -EINVAL directly instead. + +Outside of that, due to recent kernel changes, we may now get -EFAULT +when trying to register a file backed buffers. Before we always returned +-EOPNOTSUPP. Correct that as well. + +Signed-off-by: Jens Axboe +Signed-off-by: Jiri Slaby (SUSE) +--- + test/io_uring_register.c | 51 +++++++++++++++++++--------------------- + 1 file changed, 24 insertions(+), 27 deletions(-) + +diff --git a/test/io_uring_register.c b/test/io_uring_register.c +index ddd4fe374702..0f44af85eed3 100644 +--- a/test/io_uring_register.c ++++ b/test/io_uring_register.c +@@ -32,7 +32,7 @@ static rlim_t mlock_limit; + static int devnull; + + static int expect_fail(int fd, unsigned int opcode, void *arg, +- unsigned int nr_args, int error) ++ unsigned int nr_args, int error, int error2) + { + int ret; + +@@ -55,8 +55,8 @@ static int expect_fail(int fd, unsigned int opcode, void *arg, + return 1; + } + +- if (ret != error) { +- fprintf(stderr, "expected %d, got %d\n", error, ret); ++ if (ret != error && (error2 && ret != error2)) { ++ fprintf(stderr, "expected %d/%d, got %d\n", error, error2, ret); + return 1; + } + return 0; +@@ -195,8 +195,7 @@ static int test_max_fds(int uring_fd) + status = 0; + ret = io_uring_register(uring_fd, IORING_UNREGISTER_FILES, 0, 0); + if (ret < 0) { +- ret = errno; +- errno = ret; ++ errno = -ret; + perror("io_uring_register UNREGISTER_FILES"); + exit(1); + } +@@ -230,22 +229,20 @@ static int test_memlock_exceeded(int fd) + + while (iov.iov_len) { + ret = io_uring_register(fd, IORING_REGISTER_BUFFERS, &iov, 1); +- if (ret < 0) { +- if (errno == ENOMEM) { +- iov.iov_len /= 2; +- continue; +- } +- if (errno == EFAULT) { +- free(buf); +- return 0; +- } +- fprintf(stderr, "expected success or EFAULT, got %d\n", errno); ++ if (ret == -ENOMEM) { ++ iov.iov_len /= 2; ++ continue; ++ } else if (ret == -EFAULT) { ++ free(buf); ++ return 0; ++ } else if (ret) { ++ fprintf(stderr, "expected success or EFAULT, got %d\n", ret); + free(buf); + return 1; + } + ret = io_uring_register(fd, IORING_UNREGISTER_BUFFERS, NULL, 0); + if (ret != 0) { +- fprintf(stderr, "error: unregister failed with %d\n", errno); ++ fprintf(stderr, "error: unregister failed with %d\n", ret); + free(buf); + return 1; + } +@@ -277,15 +274,15 @@ static int test_iovec_nr(int fd) + iovs[i].iov_len = pagesize; + } + +- status |= expect_fail(fd, IORING_REGISTER_BUFFERS, iovs, nr, -EINVAL); ++ status |= expect_fail(fd, IORING_REGISTER_BUFFERS, iovs, nr, -EINVAL, 0); + + /* reduce to UIO_MAXIOV */ + nr = UIO_MAXIOV; + ret = io_uring_register(fd, IORING_REGISTER_BUFFERS, iovs, nr); +- if (ret && (errno == ENOMEM || errno == EPERM) && geteuid()) { ++ if ((ret == -ENOMEM || ret == -EPERM) && geteuid()) { + fprintf(stderr, "can't register large iovec for regular users, skip\n"); + } else if (ret != 0) { +- fprintf(stderr, "expected success, got %d\n", errno); ++ fprintf(stderr, "expected success, got %d\n", ret); + status = 1; + } else { + io_uring_register(fd, IORING_UNREGISTER_BUFFERS, 0, 0); +@@ -308,12 +305,12 @@ static int test_iovec_size(int fd) + /* NULL pointer for base */ + iov.iov_base = 0; + iov.iov_len = 4096; +- status |= expect_fail(fd, IORING_REGISTER_BUFFERS, &iov, 1, -EFAULT); ++ status |= expect_fail(fd, IORING_REGISTER_BUFFERS, &iov, 1, -EFAULT, 0); + + /* valid base, 0 length */ + iov.iov_base = &buf; + iov.iov_len = 0; +- status |= expect_fail(fd, IORING_REGISTER_BUFFERS, &iov, 1, -EFAULT); ++ status |= expect_fail(fd, IORING_REGISTER_BUFFERS, &iov, 1, -EFAULT, 0); + + /* valid base, length exceeds size */ + /* this requires an unampped page directly after buf */ +@@ -324,7 +321,7 @@ static int test_iovec_size(int fd) + assert(ret == 0); + iov.iov_base = buf; + iov.iov_len = 2 * pagesize; +- status |= expect_fail(fd, IORING_REGISTER_BUFFERS, &iov, 1, -EFAULT); ++ status |= expect_fail(fd, IORING_REGISTER_BUFFERS, &iov, 1, -EFAULT, 0); + munmap(buf, pagesize); + + /* huge page */ +@@ -372,7 +369,7 @@ static int test_iovec_size(int fd) + status = 1; + iov.iov_base = buf; + iov.iov_len = 2*1024*1024; +- status |= expect_fail(fd, IORING_REGISTER_BUFFERS, &iov, 1, -EOPNOTSUPP); ++ status |= expect_fail(fd, IORING_REGISTER_BUFFERS, &iov, 1, -EFAULT, -EOPNOTSUPP); + munmap(buf, 2*1024*1024); + + /* bump up against the soft limit and make sure we get EFAULT +@@ -442,7 +439,7 @@ static int test_poll_ringfd(void) + * fail, because the kernel does not allow registering of the + * ring_fd. + */ +- status |= expect_fail(fd, IORING_REGISTER_FILES, &fd, 1, -EBADF); ++ status |= expect_fail(fd, IORING_REGISTER_FILES, &fd, 1, -EBADF, 0); + + /* tear down queue */ + io_uring_queue_exit(&ring); +@@ -475,14 +472,14 @@ int main(int argc, char **argv) + } + + /* invalid fd */ +- status |= expect_fail(-1, 0, NULL, 0, -EBADF); ++ status |= expect_fail(-1, 0, NULL, 0, -EBADF, 0); + /* valid fd that is not an io_uring fd */ +- status |= expect_fail(devnull, 0, NULL, 0, -EOPNOTSUPP); ++ status |= expect_fail(devnull, 0, NULL, 0, -EOPNOTSUPP, 0); + + /* invalid opcode */ + memset(&p, 0, sizeof(p)); + fd = new_io_uring(1, &p); +- ret = expect_fail(fd, ~0U, NULL, 0, -EINVAL); ++ ret = expect_fail(fd, ~0U, NULL, 0, -EINVAL, 0); + if (ret) { + /* if this succeeds, tear down the io_uring instance + * and start clean for the next test. */ +-- +2.42.0 + diff --git a/tests-don-t-expect-multishot-recv-overflow-backloggi.patch b/tests-don-t-expect-multishot-recv-overflow-backloggi.patch new file mode 100644 index 0000000..05e979f --- /dev/null +++ b/tests-don-t-expect-multishot-recv-overflow-backloggi.patch @@ -0,0 +1,34 @@ +From: Pavel Begunkov +Date: Fri, 11 Aug 2023 13:58:30 +0100 +Subject: tests: don't expect multishot recv overflow backlogging +Patch-mainline: 2.5 +Git-commit: b73e940c9dd4ffa8ac121db046c0788376691b99 +References: kernel 6.5 + +Multishots may and are likely to complete when there is no space in CQ, +don't rely on overflows. + +Signed-off-by: Pavel Begunkov +Link: https://lore.kernel.org/r/d078c0f797322bd01d8c91743d652b734e83e9ba.1691758633.git.asml.silence@gmail.com +Signed-off-by: Jens Axboe +Signed-off-by: Jiri Slaby (SUSE) +--- + test/recv-multishot.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/recv-multishot.c b/test/recv-multishot.c +index e4a07ce976cc..f66f13198dde 100644 +--- a/test/recv-multishot.c ++++ b/test/recv-multishot.c +@@ -271,7 +271,7 @@ static int test(struct args *args) + */ + bool const early_last = args->early_error == ERROR_EARLY_OVERFLOW && + !args->wait_each && +- i == N_CQE_OVERFLOW && ++ i >= N_CQE_OVERFLOW && + !(cqe->flags & IORING_CQE_F_MORE); + + bool const should_be_last = +-- +2.42.0 +