Skip to content

Commit

Permalink
test/iopoll: don't fail if HYBRID_IOPOLL isn't available
Browse files Browse the repository at this point in the history
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: d20600d ("test: add test cases for hybrid iopoll")
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
axboe committed Dec 19, 2024
1 parent 69e0bc2 commit 3c94fb1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/iopoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 3c94fb1

Please sign in to comment.