From: David Wei <[email protected]>
To: [email protected]
Cc: Jens Axboe <[email protected]>, Pavel Begunkov <[email protected]>
Subject: [PATCH liburing v2 3/4] zcrx: add basic support
Date: Tue, 18 Feb 2025 14:01:35 -0800 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
Add basic support for zcrx with a thin wrapper around
IORING_REGISTER_ZCRX_IFQ and a struct for the refill queue.
Signed-off-by: David Wei <[email protected]>
---
src/include/liburing.h | 12 ++++++++++++
src/liburing-ffi.map | 2 ++
src/liburing.map | 2 ++
src/register.c | 6 ++++++
4 files changed, 22 insertions(+)
diff --git a/src/include/liburing.h b/src/include/liburing.h
index 49b4edf437b2..6393599cb3bf 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -132,6 +132,16 @@ struct io_uring {
unsigned pad2;
};
+struct io_uring_zcrx_rq {
+ __u32 *khead;
+ __u32 *ktail;
+ __u32 rq_tail;
+ unsigned ring_entries;
+
+ struct io_uring_zcrx_rqe *rqes;
+ void *ring_ptr;
+};
+
/*
* Library interface
*/
@@ -265,6 +275,8 @@ int io_uring_register_file_alloc_range(struct io_uring *ring,
int io_uring_register_napi(struct io_uring *ring, struct io_uring_napi *napi);
int io_uring_unregister_napi(struct io_uring *ring, struct io_uring_napi *napi);
+int io_uring_register_ifq(struct io_uring *ring,
+ struct io_uring_zcrx_ifq_reg *reg);
int io_uring_register_clock(struct io_uring *ring,
struct io_uring_clock_register *arg);
diff --git a/src/liburing-ffi.map b/src/liburing-ffi.map
index 968ccbc67366..fe14adb6d83f 100644
--- a/src/liburing-ffi.map
+++ b/src/liburing-ffi.map
@@ -227,4 +227,6 @@ LIBURING_2.9 {
} LIBURING_2.8;
LIBURING_2.10 {
+ global:
+ io_uring_register_ifq;
} LIBURING_2.9;
diff --git a/src/liburing.map b/src/liburing.map
index 264a94946e90..d1661d9d61f9 100644
--- a/src/liburing.map
+++ b/src/liburing.map
@@ -113,4 +113,6 @@ LIBURING_2.9 {
} LIBURING_2.8;
LIBURING_2.10 {
+ global:
+ io_uring_register_ifq;
} LIBURING_2.9;
diff --git a/src/register.c b/src/register.c
index 0fff208cd5f5..99337d13135d 100644
--- a/src/register.c
+++ b/src/register.c
@@ -422,6 +422,12 @@ int io_uring_clone_buffers(struct io_uring *dst, struct io_uring *src)
return io_uring_clone_buffers_offset(dst, src, 0, 0, 0, 0);
}
+int io_uring_register_ifq(struct io_uring *ring,
+ struct io_uring_zcrx_ifq_reg *reg)
+{
+ return do_register(ring, IORING_REGISTER_ZCRX_IFQ, reg, 1);
+}
+
int io_uring_resize_rings(struct io_uring *ring, struct io_uring_params *p)
{
unsigned sq_head, sq_tail;
--
2.43.5
next prev parent reply other threads:[~2025-02-18 22:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-18 22:01 [PATCH liburing v2 0/4] add basic zero copy receive support David Wei
2025-02-18 22:01 ` [PATCH liburing v2 1/4] liburing: sync io_uring headers David Wei
2025-02-18 22:01 ` [PATCH liburing v2 2/4] zcrx: " David Wei
2025-02-18 22:01 ` David Wei [this message]
2025-02-18 22:01 ` [PATCH liburing v2 4/4] zcrx: add unit test David Wei
2025-02-18 23:31 ` [PATCH liburing v2 0/4] add basic zero copy receive support 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] \
/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