From: Dylan Yudaken <[email protected]>
To: <[email protected]>, <[email protected]>
Cc: <[email protected]>, <[email protected]>,
Dylan Yudaken <[email protected]>
Subject: [PATCH liburing] io_uring-udp: make more obvious what kernel version is required
Date: Wed, 3 Aug 2022 08:57:41 -0700 [thread overview]
Message-ID: <[email protected]> (raw)
This example uses some of the latest kernel features, which can be
confusing. Make this clear in the error messages from these features that
a latest kernel version is required.
Signed-off-by: Dylan Yudaken <[email protected]>
---
examples/io_uring-udp.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/examples/io_uring-udp.c b/examples/io_uring-udp.c
index b4ef0a301963..a07c3e2a6f20 100644
--- a/examples/io_uring-udp.c
+++ b/examples/io_uring-udp.c
@@ -73,7 +73,9 @@ static int setup_buffer_pool(struct ctx *ctx)
ret = io_uring_register_buf_ring(&ctx->ring, ®, 0);
if (ret) {
- fprintf(stderr, "buf_ring init: %s\n", strerror(-ret));
+ fprintf(stderr, "buf_ring init failed: %s\n"
+ "NB This requires a kernel version >= 6.0\n",
+ strerror(-ret));
return ret;
}
@@ -98,7 +100,9 @@ static int setup_context(struct ctx *ctx)
ret = io_uring_queue_init_params(QD, &ctx->ring, ¶ms);
if (ret < 0) {
- fprintf(stderr, "queue_init: %s\n", strerror(-ret));
+ fprintf(stderr, "queue_init failed: %s\n"
+ "NB: This requires a kernel version >= 6.0\n",
+ strerror(-ret));
return ret;
}
@@ -237,7 +241,10 @@ static int process_cqe_recv(struct ctx *ctx, struct io_uring_cqe *cqe,
return 0;
if (!(cqe->flags & IORING_CQE_F_BUFFER) || cqe->res < 0) {
- fprintf(stderr, "bad res %d\n", cqe->res);
+ fprintf(stderr, "recv cqe bad res %d\n", cqe->res);
+ if (cqe->res == -EFAULT || cqe->res == -EINVAL)
+ fprintf(stderr,
+ "NB: This requires a kernel version >= 6.0\n");
return -1;
}
idx = cqe->flags >> 16;
base-commit: 840d0a5d38f3f63ea7b3741c3e201485c6671015
--
2.30.2
next reply other threads:[~2022-08-03 15:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-03 15:57 Dylan Yudaken [this message]
2022-08-05 14:43 ` [PATCH liburing] io_uring-udp: make more obvious what kernel version is required 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 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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