From: Stefano Garzarella <[email protected]>
To: Jens Axboe <[email protected]>
Cc: [email protected], [email protected]
Subject: [PATCH liburing v2 1/5] Add CQ ring 'flags' field
Date: Wed, 20 May 2020 19:07:10 +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 4311325..adc8db9 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 a279151..9860a8a 100644
--- a/src/include/liburing/io_uring.h
+++ b/src/include/liburing/io_uring.h
@@ -205,7 +205,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-20 17:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-20 17:07 [PATCH liburing v2 0/5] liburing: add helpers to enable/disable eventfd notifications Stefano Garzarella
2020-05-20 17:07 ` Stefano Garzarella [this message]
2020-05-20 17:07 ` [PATCH liburing v2 2/5] man/io_uring_setup.2: add 'flags' field in the struct io_cqring_offsets Stefano Garzarella
2020-05-20 17:07 ` [PATCH liburing v2 3/5] Add helpers to set and get eventfd notification status Stefano Garzarella
2020-05-20 17:07 ` [PATCH liburing v2 4/5] man/io_uring_register.2: add IORING_CQ_EVENTFD_DISABLED description Stefano Garzarella
2020-05-20 17:07 ` [PATCH liburing v2 5/5] Add test/eventfd-disable.c test case Stefano Garzarella
2020-05-20 17:12 ` [PATCH liburing v2 0/5] liburing: add helpers to enable/disable eventfd notifications 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