From: Stefano Garzarella <[email protected]>
To: Jens Axboe <[email protected]>
Cc: [email protected]
Subject: [PATCH liburing 1/5] Add CQ ring 'flags' field
Date: Fri, 15 May 2020 18:43:27 +0200 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
io_uring provides the new CQ ring 'flags' field if 'cq_off.flags'
is not zero. In this case we set the 'cq->kflags' pointer, otherwise
it will be NULL.
Signed-off-by: Stefano Garzarella <[email protected]>
---
src/include/liburing.h | 1 +
src/include/liburing/io_uring.h | 4 +++-
src/setup.c | 2 ++
3 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/include/liburing.h b/src/include/liburing.h
index dd85f7b..ea596f6 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -41,6 +41,7 @@ struct io_uring_cq {
unsigned *ktail;
unsigned *kring_mask;
unsigned *kring_entries;
+ unsigned *kflags;
unsigned *koverflow;
struct io_uring_cqe *cqes;
diff --git a/src/include/liburing/io_uring.h b/src/include/liburing/io_uring.h
index e48d746..602bb0e 100644
--- a/src/include/liburing/io_uring.h
+++ b/src/include/liburing/io_uring.h
@@ -204,7 +204,9 @@ struct io_cqring_offsets {
__u32 ring_entries;
__u32 overflow;
__u32 cqes;
- __u64 resv[2];
+ __u32 flags;
+ __u32 resv1;
+ __u64 resv2;
};
/*
diff --git a/src/setup.c b/src/setup.c
index f783b6a..860c112 100644
--- a/src/setup.c
+++ b/src/setup.c
@@ -76,6 +76,8 @@ err:
cq->kring_entries = cq->ring_ptr + p->cq_off.ring_entries;
cq->koverflow = cq->ring_ptr + p->cq_off.overflow;
cq->cqes = cq->ring_ptr + p->cq_off.cqes;
+ if (p->cq_off.flags)
+ cq->kflags = cq->ring_ptr + p->cq_off.flags;
return 0;
}
--
2.25.4
next prev parent reply other threads:[~2020-05-15 16:43 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-15 16:43 [PATCH liburing 0/5] liburing: add helpers to enable/disable eventfd notifications Stefano Garzarella
2020-05-15 16:43 ` Stefano Garzarella [this message]
2020-05-15 16:43 ` [PATCH liburing 2/5] man/io_uring_setup.2: add 'flags' field in the struct io_cqring_offsets Stefano Garzarella
2020-05-15 16:43 ` [PATCH liburing 3/5] Add helpers to set and get eventfd notification status Stefano Garzarella
2020-05-15 16:53 ` Jens Axboe
2020-05-15 17:11 ` Stefano Garzarella
2020-05-20 13:12 ` Stefano Garzarella
2020-05-20 13:43 ` Jens Axboe
2020-05-20 15:11 ` Stefano Garzarella
2020-05-20 15:19 ` Jens Axboe
2020-05-15 16:43 ` [PATCH liburing 4/5] man/io_uring_register.2: add IORING_CQ_EVENTFD_DISABLED description Stefano Garzarella
2020-05-15 16:43 ` [PATCH liburing 5/5] Add test/eventfd-disable.c test case Stefano Garzarella
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] \
/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