diff --git a/0001-Do-not-always-expect-multishot-recv-to-stop-posting-.patch b/0001-Do-not-always-expect-multishot-recv-to-stop-posting-.patch deleted file mode 100644 index d30a4de..0000000 --- a/0001-Do-not-always-expect-multishot-recv-to-stop-posting-.patch +++ /dev/null @@ -1,47 +0,0 @@ -From: Dylan Yudaken -Date: Mon, 7 Nov 2022 05:04:04 -0800 -Subject: Do not always expect multishot recv to stop posting events -Patch-mainline: yes -Git-commit: 0d4fdb416718a70a4a90c5c4722b38cf44849195 -References: kernel 6.2 - -Later kernels can have a fix that does not stop multishot from posting -events, and would just continue in overflow mode. - -Signed-off-by: Dylan Yudaken -Link: https://lore.kernel.org/r/20221107130404.360691-1-dylany@meta.com -Signed-off-by: Jens Axboe -Signed-off-by: Jiri Slaby ---- - test/recv-multishot.c | 12 ++++++++++-- - 1 file changed, 10 insertions(+), 2 deletions(-) - -diff --git a/test/recv-multishot.c b/test/recv-multishot.c -index 2cfe6898..ed26a5f7 100644 ---- a/test/recv-multishot.c -+++ b/test/recv-multishot.c -@@ -264,11 +264,19 @@ static int test(struct args *args) - - bool const is_last = i == recv_cqes - 1; - -+ /* -+ * Older kernels could terminate multishot early due to overflow, -+ * but later ones will not. So discriminate based on the MORE flag. -+ */ -+ bool const early_last = args->early_error == ERROR_EARLY_OVERFLOW && -+ !args->wait_each && -+ i == N_CQE_OVERFLOW && -+ !(cqe->flags & IORING_CQE_F_MORE); -+ - bool const should_be_last = - (cqe->res <= 0) || - (args->stream && is_last) || -- (args->early_error == ERROR_EARLY_OVERFLOW && -- !args->wait_each && i == N_CQE_OVERFLOW); -+ early_last; - int *this_recv; - int orig_payload_size = cqe->res; - --- -2.35.3 - diff --git a/0001-test-file-verify.t-Don-t-run-over-mlock-limit-when-r.patch b/0001-test-file-verify.t-Don-t-run-over-mlock-limit-when-r.patch deleted file mode 100644 index f52114d..0000000 --- a/0001-test-file-verify.t-Don-t-run-over-mlock-limit-when-r.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 87943e896268efbe85e15f7e59f45a042d2ba8f7 Mon Sep 17 00:00:00 2001 -From: Gabriel Krisman Bertazi -Date: Thu, 20 Apr 2023 14:23:55 -0400 -Subject: [PATCH] test/file-verify.t: Don't run over mlock limit when run as - non-root - -test/file-verify tries to get 2MB of pinned memory at once, which is -higher than the default allowed for non-root users in older -kernels (64kb before v5.16, nowadays 8mb). Skip the test for non-root -users if the registration fails instead of failing the test. - -Signed-off-by: Gabriel Krisman Bertazi ---- - test/file-verify.c | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/test/file-verify.c b/test/file-verify.c -index f33b24a..89cbb02 100644 ---- a/test/file-verify.c -+++ b/test/file-verify.c -@@ -381,9 +381,12 @@ static int test(struct io_uring *ring, const char *fname, int buffered, - v[i].iov_base = buf[i]; - v[i].iov_len = CHUNK_SIZE; - } -- ret = io_uring_register_buffers(ring, v, READ_BATCH); -+ ret = t_register_buffers(ring, v, READ_BATCH); - if (ret) { -- fprintf(stderr, "Error buffer reg %d\n", ret); -+ if (ret == T_SETUP_SKIP) { -+ ret = 0; -+ goto free_bufs; -+ } - goto err; - } - } -@@ -477,6 +480,7 @@ static int test(struct io_uring *ring, const char *fname, int buffered, - done: - if (registered) - io_uring_unregister_buffers(ring); -+free_bufs: - if (vectored) { - for (j = 0; j < READ_BATCH; j++) - for (i = 0; i < nr_vecs; i++) --- -2.40.0 - diff --git a/0001-test-helpers-fix-socket-length-type.patch b/0001-test-helpers-fix-socket-length-type.patch deleted file mode 100644 index 84b45d4..0000000 --- a/0001-test-helpers-fix-socket-length-type.patch +++ /dev/null @@ -1,41 +0,0 @@ -From b5caa618565c0c6d0053f7b1bae2423cd317660c Mon Sep 17 00:00:00 2001 -From: Gabriel Krisman Bertazi -Date: Wed, 18 Jan 2023 11:48:06 -0300 -Subject: [PATCH] test/helpers: fix socket length type - -t_create_socket_pair uses size_t for paddrlen, which is uint64 on 64-bit -architecture, while the network syscalls expect uint32. The implicit -cast is always safe for little-endian here due to the structure format, -its small size and the fact it was previously zeroed - so the test -succeeds. - -Still, on BE machines, our CI caught a few tests crashing on -connect(). For instance: - -localhost:~/liburing/test # ./send_recv.t -connect failed -test_invalid failed - -Signed-off-by: Gabriel Krisman Bertazi -Link: https://lore.kernel.org/r/20230118144806.18352-1-krisman@suse.de -Signed-off-by: Jens Axboe ---- - test/helpers.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/test/helpers.c b/test/helpers.c -index 869e903..37ba67c 100644 ---- a/test/helpers.c -+++ b/test/helpers.c -@@ -173,7 +173,7 @@ int t_create_socket_pair(int fd[2], bool stream) - int val; - struct sockaddr_in serv_addr; - struct sockaddr *paddr; -- size_t paddrlen; -+ socklen_t paddrlen; - - type |= SOCK_CLOEXEC; - fd[0] = socket(AF_INET, type, 0); --- -2.39.0 - diff --git a/liburing-2.3.tar.bz2 b/liburing-2.3.tar.bz2 deleted file mode 100644 index 4e69dfe..0000000 --- a/liburing-2.3.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f242bd38777c79ee4e1169f817e08ce111b03e033ef9a1bde274d3196d4de36e -size 197929 diff --git a/liburing-2.4.tar.bz2 b/liburing-2.4.tar.bz2 new file mode 100644 index 0000000..f768f94 --- /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 index 41d4b20..8449e50 100644 --- a/liburing.changes +++ b/liburing.changes @@ -1,3 +1,29 @@ +------------------------------------------------------------------- +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 diff --git a/liburing.spec b/liburing.spec index 7e1e253..bd2e7ba 100644 --- a/liburing.spec +++ b/liburing.spec @@ -18,17 +18,13 @@ %define lname liburing2 Name: liburing -Version: 2.3 +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 -# PATCH-FIX-UPSTREAM: fix tests on big endian -Patch1: 0001-test-helpers-fix-socket-length-type.patch -Patch2: 0001-Do-not-always-expect-multishot-recv-to-stop-posting-.patch -Patch3: 0001-test-file-verify.t-Don-t-run-over-mlock-limit-when-r.patch BuildRequires: gcc-c++ BuildRequires: pkgconfig BuildRequires: procps @@ -47,6 +43,14 @@ Group: Development/Libraries/C and C++ 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++ @@ -81,20 +85,27 @@ sh ./configure --prefix=%{_prefix} \ %install %make_install -rm -v %{buildroot}%{_libdir}/%{name}.a +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/*