From 934ef38e5bdebf9e625cd308457449360c6c95f7b7ae519d0cd19e6215d1672a Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Tue, 21 Feb 2023 13:29:30 +0000 Subject: [PATCH] Accepting request 1067008 from home:jirislaby:branches:devel:libraries:c_c++ - add 0001-Do-not-always-expect-multishot-recv-to-stop-posting-.patch fixes tests with kernel 6.2 OBS-URL: https://build.opensuse.org/request/show/1067008 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/liburing?expand=0&rev=27 --- ...pect-multishot-recv-to-stop-posting-.patch | 47 +++++++++++++++++++ liburing.changes | 6 +++ liburing.spec | 1 + 3 files changed, 54 insertions(+) create mode 100644 0001-Do-not-always-expect-multishot-recv-to-stop-posting-.patch 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 new file mode 100644 index 0000000..d30a4de --- /dev/null +++ b/0001-Do-not-always-expect-multishot-recv-to-stop-posting-.patch @@ -0,0 +1,47 @@ +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/liburing.changes b/liburing.changes index 0cef41b..a35f563 100644 --- a/liburing.changes +++ b/liburing.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +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 diff --git a/liburing.spec b/liburing.spec index 29b5d1e..acf301f 100644 --- a/liburing.spec +++ b/liburing.spec @@ -27,6 +27,7 @@ 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 BuildRequires: gcc-c++ BuildRequires: pkgconfig BuildRequires: procps