Update to liburing 2.3.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
505577cf3f
commit
e95a3047c2
2
.gitignore
vendored
2
.gitignore
vendored
@ -9,3 +9,5 @@
|
||||
/liburing-2.0.tar.gz.asc
|
||||
/liburing-2.2.tar.gz
|
||||
/liburing-2.2.tar.gz.asc
|
||||
/liburing-2.3.tar.gz
|
||||
/liburing-2.3.tar.gz.asc
|
||||
|
@ -1,205 +0,0 @@
|
||||
From 732bf609b670631731765a585a68d14ed3fdc9b7 Mon Sep 17 00:00:00 2001
|
||||
From: Jens Axboe <axboe@kernel.dk>
|
||||
Date: Sun, 26 Jun 2022 14:37:32 -0600
|
||||
Subject: [PATCH] test/io_uring_register: kill old memfd test
|
||||
|
||||
It's not a useful test case and it's causing issues on weird setups,
|
||||
let's just get rid of it and then we can drop the memfd_create()
|
||||
configure bits as well.
|
||||
|
||||
Link: https://github.com/axboe/liburing/issues/620
|
||||
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
||||
---
|
||||
configure | 20 -------
|
||||
test/io_uring_register.c | 124 ---------------------------------------
|
||||
2 files changed, 144 deletions(-)
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index 2c2441b..43071dd 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -367,23 +367,6 @@ if compile_prog "" "" "has_ucontext"; then
|
||||
fi
|
||||
print_config "has_ucontext" "$has_ucontext"
|
||||
|
||||
-##########################################
|
||||
-# check for memfd_create(2)
|
||||
-has_memfd_create="no"
|
||||
-cat > $TMPC << EOF
|
||||
-#include <sys/mman.h>
|
||||
-int main(int argc, char **argv)
|
||||
-{
|
||||
- int memfd = memfd_create("test", 0);
|
||||
- return 0;
|
||||
-}
|
||||
-EOF
|
||||
-if compile_prog "-Werror=implicit-function-declaration" "" "has_memfd_create"; then
|
||||
- has_memfd_create="yes"
|
||||
-fi
|
||||
-print_config "has_memfd_create" "$has_memfd_create"
|
||||
-
|
||||
-
|
||||
#############################################################################
|
||||
if test "$liburing_nolibc" = "yes"; then
|
||||
output_sym "CONFIG_NOLIBC"
|
||||
@@ -419,9 +402,6 @@ fi
|
||||
if test "$array_bounds" = "yes"; then
|
||||
output_sym "CONFIG_HAVE_ARRAY_BOUNDS"
|
||||
fi
|
||||
-if test "$has_memfd_create" = "yes"; then
|
||||
- output_sym "CONFIG_HAVE_MEMFD_CREATE"
|
||||
-fi
|
||||
|
||||
echo "CC=$cc" >> $config_host_mak
|
||||
print_config "CC" "$cc"
|
||||
diff --git a/test/io_uring_register.c b/test/io_uring_register.c
|
||||
index e639f05..05868e1 100644
|
||||
--- a/test/io_uring_register.c
|
||||
+++ b/test/io_uring_register.c
|
||||
@@ -31,17 +31,6 @@ static int pagesize;
|
||||
static rlim_t mlock_limit;
|
||||
static int devnull;
|
||||
|
||||
-#if !defined(CONFIG_HAVE_MEMFD_CREATE)
|
||||
-#include <sys/syscall.h>
|
||||
-#include <linux/memfd.h>
|
||||
-
|
||||
-static int memfd_create(const char *name, unsigned int flags)
|
||||
-{
|
||||
- return (int)syscall(SYS_memfd_create, name, flags);
|
||||
-}
|
||||
-#endif
|
||||
-
|
||||
-
|
||||
static int expect_fail(int fd, unsigned int opcode, void *arg,
|
||||
unsigned int nr_args, int error)
|
||||
{
|
||||
@@ -462,113 +451,6 @@ static int test_poll_ringfd(void)
|
||||
return status;
|
||||
}
|
||||
|
||||
-static int test_shmem(void)
|
||||
-{
|
||||
- const char pattern = 0xEA;
|
||||
- const int len = 4096;
|
||||
- struct io_uring_sqe *sqe;
|
||||
- struct io_uring_cqe *cqe;
|
||||
- struct io_uring ring;
|
||||
- struct iovec iov;
|
||||
- int memfd, ret, i;
|
||||
- char *mem;
|
||||
- int pipefd[2] = {-1, -1};
|
||||
-
|
||||
- ret = io_uring_queue_init(8, &ring, 0);
|
||||
- if (ret)
|
||||
- return 1;
|
||||
-
|
||||
- if (pipe(pipefd)) {
|
||||
- perror("pipe");
|
||||
- return 1;
|
||||
- }
|
||||
- memfd = memfd_create("uring-shmem-test", 0);
|
||||
- if (memfd < 0) {
|
||||
- fprintf(stderr, "memfd_create() failed %i\n", -errno);
|
||||
- return 1;
|
||||
- }
|
||||
- if (ftruncate(memfd, len)) {
|
||||
- fprintf(stderr, "can't truncate memfd\n");
|
||||
- return 1;
|
||||
- }
|
||||
- mem = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, memfd, 0);
|
||||
- if (!mem) {
|
||||
- fprintf(stderr, "mmap failed\n");
|
||||
- return 1;
|
||||
- }
|
||||
- for (i = 0; i < len; i++)
|
||||
- mem[i] = pattern;
|
||||
-
|
||||
- iov.iov_base = mem;
|
||||
- iov.iov_len = len;
|
||||
- ret = io_uring_register_buffers(&ring, &iov, 1);
|
||||
- if (ret) {
|
||||
- if (ret == -EOPNOTSUPP) {
|
||||
- fprintf(stdout, "memfd registration isn't supported, "
|
||||
- "skip\n");
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
- fprintf(stderr, "buffer reg failed: %d\n", ret);
|
||||
- return 1;
|
||||
- }
|
||||
-
|
||||
- /* check that we can read and write from/to shmem reg buffer */
|
||||
- sqe = io_uring_get_sqe(&ring);
|
||||
- io_uring_prep_write_fixed(sqe, pipefd[1], mem, 512, 0, 0);
|
||||
- sqe->user_data = 1;
|
||||
-
|
||||
- ret = io_uring_submit(&ring);
|
||||
- if (ret != 1) {
|
||||
- fprintf(stderr, "submit write failed\n");
|
||||
- return 1;
|
||||
- }
|
||||
- ret = io_uring_wait_cqe(&ring, &cqe);
|
||||
- if (ret < 0 || cqe->user_data != 1 || cqe->res != 512) {
|
||||
- fprintf(stderr, "reading from shmem failed\n");
|
||||
- return 1;
|
||||
- }
|
||||
- io_uring_cqe_seen(&ring, cqe);
|
||||
-
|
||||
- /* clean it, should be populated with the pattern back from the pipe */
|
||||
- memset(mem, 0, 512);
|
||||
- sqe = io_uring_get_sqe(&ring);
|
||||
- io_uring_prep_read_fixed(sqe, pipefd[0], mem, 512, 0, 0);
|
||||
- sqe->user_data = 2;
|
||||
-
|
||||
- ret = io_uring_submit(&ring);
|
||||
- if (ret != 1) {
|
||||
- fprintf(stderr, "submit write failed\n");
|
||||
- return 1;
|
||||
- }
|
||||
- ret = io_uring_wait_cqe(&ring, &cqe);
|
||||
- if (ret < 0 || cqe->user_data != 2 || cqe->res != 512) {
|
||||
- fprintf(stderr, "reading from shmem failed\n");
|
||||
- return 1;
|
||||
- }
|
||||
- io_uring_cqe_seen(&ring, cqe);
|
||||
-
|
||||
- for (i = 0; i < 512; i++) {
|
||||
- if (mem[i] != pattern) {
|
||||
- fprintf(stderr, "data integrity fail\n");
|
||||
- return 1;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- ret = io_uring_unregister_buffers(&ring);
|
||||
- if (ret) {
|
||||
- fprintf(stderr, "buffer unreg failed: %d\n", ret);
|
||||
- return 1;
|
||||
- }
|
||||
-out:
|
||||
- io_uring_queue_exit(&ring);
|
||||
- close(pipefd[0]);
|
||||
- close(pipefd[1]);
|
||||
- munmap(mem, len);
|
||||
- close(memfd);
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int fd, ret;
|
||||
@@ -621,11 +503,5 @@ int main(int argc, char **argv)
|
||||
if (status)
|
||||
fprintf(stderr, "FAIL\n");
|
||||
|
||||
- ret = test_shmem();
|
||||
- if (ret) {
|
||||
- fprintf(stderr, "test_shmem() failed\n");
|
||||
- status |= 1;
|
||||
- }
|
||||
-
|
||||
return status;
|
||||
}
|
||||
--
|
||||
2.35.1
|
||||
|
@ -1,12 +1,11 @@
|
||||
Name: liburing
|
||||
Version: 2.2
|
||||
Version: 2.3
|
||||
Release: 1%{?dist}
|
||||
Summary: Linux-native io_uring I/O access library
|
||||
License: (GPLv2 with exceptions and LGPLv2+) or MIT
|
||||
Source0: https://brick.kernel.dk/snaps/%{name}-%{version}.tar.gz
|
||||
Source1: https://brick.kernel.dk/snaps/%{name}-%{version}.tar.gz.asc
|
||||
URL: https://git.kernel.dk/cgit/liburing/
|
||||
Patch1: 0001-test-io_uring_register-kill-old-memfd-test.patch
|
||||
BuildRequires: gcc
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: make
|
||||
@ -51,6 +50,9 @@ for the Linux-native io_uring.
|
||||
%{_mandir}/man7/*
|
||||
|
||||
%changelog
|
||||
* Wed Nov 9 2022 Stefan Hajnoczi <stefanha@redhat.com> - 2.3-1
|
||||
- Update to liburing 2.3.
|
||||
|
||||
* Mon Aug 22 2022 Richard W.M. Jones <rjones@redhat.com> - 2.2-1
|
||||
- Update to liburing 2.2.
|
||||
|
||||
|
2
sources
2
sources
@ -1,2 +1,4 @@
|
||||
SHA512 (liburing-2.2.tar.gz) = d33e4a923ee77d72d040321334766a6484d43e6d6281348ec7ad0741518d1282f930795b8e600ef57e85583d0dfe308f8f3536cf226c50cd25786814cfbbbb66
|
||||
SHA512 (liburing-2.2.tar.gz.asc) = 013e91a8c22c577f1c2205f62ea374eabea331601205b20c62972de6f2264eacefab7110e4dc0c1270d7ac83b6792903c49dca45f2b4b9f3a079ae6f2749fbe3
|
||||
SHA512 (liburing-2.3.tar.gz) = 23e353bde22998ce806f359446b6d37dfb4a6a2f670dfe81f681e543ec4edeaca097e29fcf58839df8db121f5fb8d36b39e5e3294bd0630431c3a793366d00dc
|
||||
SHA512 (liburing-2.3.tar.gz.asc) = 485218122fe0cad3782ea800442d795afd50caa493439c7a00b572afc28a18718b129b2a3ba0dede17f30c2e8b096d2dc9ae808cc2257372725be51717333552
|
||||
|
Loading…
Reference in New Issue
Block a user