From 3c94fb125a35befd546f10fdb57ce5cfbaf96dd1 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 19 Dec 2024 11:31:15 -0700 Subject: [PATCH] test/iopoll: don't fail if HYBRID_IOPOLL isn't available A previous commit added support for testing hybrid iopolling, but it's buggy in the sense that it doesn't properly skip on older kernel versions that have IOPOLL, but not HYBRID_IOPOLL. Fixes: d20600d52bef ("test: add test cases for hybrid iopoll") Signed-off-by: Jens Axboe --- test/iopoll.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/iopoll.c b/test/iopoll.c index 5ff26a4be..96817d390 100644 --- a/test/iopoll.c +++ b/test/iopoll.c @@ -23,6 +23,7 @@ static struct iovec *vecs; static int no_buf_select; static int no_iopoll; +static int no_hybrid; static int provide_buffers(struct io_uring *ring) { @@ -289,7 +290,7 @@ static int test_io_uring_submit_enters(const char *file) unsigned head; struct io_uring_cqe *cqe; - if (no_iopoll) + if (no_iopoll || no_hybrid) return 0; ring_flags = IORING_SETUP_IOPOLL; @@ -367,9 +368,14 @@ static int test_io(const char *file, int write, int sqthread, int fixed, ring_flags |= IORING_SETUP_HYBRID_IOPOLL; ret = t_create_ring(64, &ring, ring_flags); - if (ret == T_SETUP_SKIP) + if (ret == T_SETUP_SKIP) { return 0; + } if (ret != T_SETUP_OK) { + if (ring_flags & IORING_SETUP_HYBRID_IOPOLL) { + no_hybrid = 1; + return 0; + } fprintf(stderr, "ring create failed: %d\n", ret); return 1; }