Skip to content

Commit

Permalink
test/reg-fd-only: test SQPOLL as well
Browse files Browse the repository at this point in the history
It's a special case for setting max io-wq workers, exercise it.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
axboe committed Aug 30, 2024
1 parent 0dfe5b7 commit b5b8859
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions test/reg-fd-only.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit b5b8859

Please sign in to comment.