io-uring.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: Jens Axboe <axboe@kernel.dk>, io-uring@vger.kernel.org
Subject: [PATCH liburing 1/2] tests: don't skip sqpoll needlessly
Date: Wed, 25 Aug 2021 18:53:35 +0100	[thread overview]
Message-ID: <9ace2f7ac85ac105e46bb8d09afee96c5dc842b1.1629913874.git.asml.silence@gmail.com> (raw)
In-Reply-To: <cover.1629913874.git.asml.silence@gmail.com>

Newer kernels support non-privileged SQPOLL, don't skip sqpoll testing
in sq-poll-kthread and others when it would work just fine.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 test/d4ae271dfaae-test.c |  5 -----
 test/sq-poll-kthread.c   | 14 ++++++--------
 2 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/test/d4ae271dfaae-test.c b/test/d4ae271dfaae-test.c
index 80d3f71..10c7e98 100644
--- a/test/d4ae271dfaae-test.c
+++ b/test/d4ae271dfaae-test.c
@@ -27,11 +27,6 @@ int main(int argc, char *argv[])
 	char *fname;
 	void *buf;
 
-	if (geteuid()) {
-		fprintf(stdout, "Test requires root, skipping\n");
-		return 0;
-	}
-
 	memset(&p, 0, sizeof(p));
 	p.flags = IORING_SETUP_SQPOLL;
 	ret = t_create_ring_params(4, &ring, &p);
diff --git a/test/sq-poll-kthread.c b/test/sq-poll-kthread.c
index ed7d0bf..0a0a75a 100644
--- a/test/sq-poll-kthread.c
+++ b/test/sq-poll-kthread.c
@@ -17,6 +17,7 @@
 #include <sys/epoll.h>
 
 #include "liburing.h"
+#include "helpers.h"
 
 #define SQ_THREAD_IDLE  2000
 #define BUF_SIZE        128
@@ -38,23 +39,20 @@ static int do_test_sq_poll_kthread_stopped(bool do_exit)
 	uint8_t buf[BUF_SIZE];
 	struct iovec iov;
 
-	if (geteuid()) {
-		fprintf(stderr, "sqpoll requires root!\n");
-		return TEST_SKIPPED;
-	}
-
 	if (pipe(pipe1) != 0) {
 		perror("pipe");
 		return TEST_FAILED;
 	}
 
 	memset(&param, 0, sizeof(param));
-
 	param.flags |= IORING_SETUP_SQPOLL;
 	param.sq_thread_idle = SQ_THREAD_IDLE;
 
-	ret = io_uring_queue_init_params(16, &ring, &param);
-	if (ret) {
+	ret = t_create_ring_params(16, &ring, &param);
+	if (ret == T_SETUP_SKIP) {
+		ret = TEST_FAILED;
+		goto err_pipe;
+	} else if (ret != T_SETUP_OK) {
 		fprintf(stderr, "ring setup failed\n");
 		ret = TEST_FAILED;
 		goto err_pipe;
-- 
2.32.0


  reply	other threads:[~2021-08-25 17:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-25 17:53 [PATCH liburing 0/2] non-root tests Pavel Begunkov
2021-08-25 17:53 ` Pavel Begunkov [this message]
2021-08-25 17:53 ` [PATCH liburing 2/2] tests: skip when large buf register fails Pavel Begunkov
2021-08-25 17:59 ` [PATCH liburing 0/2] non-root tests Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9ace2f7ac85ac105e46bb8d09afee96c5dc842b1.1629913874.git.asml.silence@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).