io-uring.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH liburing 1/1] io_uring: update buffer update feature testing
@ 2021-08-26 11:13 Pavel Begunkov
  2021-08-26 14:41 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Begunkov @ 2021-08-26 11:13 UTC (permalink / raw)
  To: Jens Axboe, io-uring

IORING_FEAT_RSRC_TAGS came late, and it's the best way to check if a
ring supports resource (i.e. buffer or file) tagging and dynamic buffer
updates.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 test/rsrc_tags.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/test/rsrc_tags.c b/test/rsrc_tags.c
index 337fbb8..a82ba21 100644
--- a/test/rsrc_tags.c
+++ b/test/rsrc_tags.c
@@ -75,17 +75,17 @@ static int update_rsrc(struct io_uring *ring, int type, int nr, int off,
 static bool has_rsrc_update(void)
 {
 	struct io_uring ring;
-	char buf[1024];
-	struct iovec vec = {.iov_base = buf, .iov_len = sizeof(buf), };
 	int ret;
 
 	ret = io_uring_queue_init(1, &ring, 0);
-	if (ret)
-		return false;
+	if (ret) {
+		fprintf(stderr, "io_uring_queue_init() failed, %d\n", ret);
+		exit(1);
+	}
 
-	ret = register_rsrc(&ring, TEST_IORING_RSRC_BUFFER, 1, &vec, NULL);
+	ret = ring.features & IORING_FEAT_RSRC_TAGS;
 	io_uring_queue_exit(&ring);
-	return ret != -EINVAL;
+	return ret;
 }
 
 static int test_tags_generic(int nr, int type, void *rsrc, int ring_flags)
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-26 14:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-26 11:13 [PATCH liburing 1/1] io_uring: update buffer update feature testing Pavel Begunkov
2021-08-26 14:41 ` Jens Axboe

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).