From b5b8859ac3b5a6ff17fb7ab350ecc14938e45b48 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 30 Aug 2024 13:38:20 -0600 Subject: [PATCH] test/reg-fd-only: test SQPOLL as well It's a special case for setting max io-wq workers, exercise it. Signed-off-by: Jens Axboe --- test/reg-fd-only.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/test/reg-fd-only.c b/test/reg-fd-only.c index cfc5771e0..65b7b322a 100644 --- a/test/reg-fd-only.c +++ b/test/reg-fd-only.c @@ -49,14 +49,15 @@ static int test_nops(struct io_uring *ring, int sq_size, int nr_nops) return T_EXIT_PASS; } -static int test(int nentries) +static int test(int nentries, int ring_flags) { struct io_uring ring; unsigned values[2]; int ret; ret = io_uring_queue_init(nentries, &ring, - IORING_SETUP_REGISTERED_FD_ONLY | IORING_SETUP_NO_MMAP); + IORING_SETUP_REGISTERED_FD_ONLY | IORING_SETUP_NO_MMAP | + ring_flags); if (ret == -EINVAL) { no_mmap = 1; return T_EXIT_SKIP; @@ -110,7 +111,16 @@ int main(int argc, char *argv[]) return T_EXIT_SKIP; /* test single normal page */ - ret = test(NORMAL_PAGE_ENTRIES); + ret = test(NORMAL_PAGE_ENTRIES, 0); + if (ret == T_EXIT_SKIP || no_mmap) { + return T_EXIT_SKIP; + } else if (ret != T_EXIT_PASS) { + fprintf(stderr, "test 8 failed\n"); + return T_EXIT_FAIL; + } + + /* test single normal page */ + ret = test(NORMAL_PAGE_ENTRIES, IORING_SETUP_SQPOLL); if (ret == T_EXIT_SKIP || no_mmap) { return T_EXIT_SKIP; } else if (ret != T_EXIT_PASS) { @@ -119,7 +129,7 @@ int main(int argc, char *argv[]) } /* test with entries requiring a huge page */ - ret = test(HUGE_PAGE_ENTRIES); + ret = test(HUGE_PAGE_ENTRIES, 0); if (ret == T_EXIT_SKIP) { return T_EXIT_SKIP; } else if (ret != T_EXIT_PASS) {