public inbox for [email protected]
 help / color / mirror / Atom feed
From: Stefan Roesch <[email protected]>
To: <[email protected]>, <[email protected]>
Cc: <[email protected]>, <[email protected]>
Subject: [PATCH v4 3/6] liburing: return correct ring size for large CQE's
Date: Mon, 25 Apr 2022 11:51:25 -0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

Return the correct ring_size when large CQE's are used.

Signed-off-by: Stefan Roesch <[email protected]>
---
 src/setup.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/setup.c b/src/setup.c
index dd6a712..d2adc7f 100644
--- a/src/setup.c
+++ b/src/setup.c
@@ -257,8 +257,11 @@ static size_t rings_size(struct io_uring_params *p, unsigned entries,
 {
 	size_t pages, sq_size, cq_size;
 
-	cq_size = KRING_SIZE;
-	cq_size += cq_entries * sizeof(struct io_uring_cqe);
+	cq_size = sizeof(struct io_uring_cqe);
+	if (p->flags & IORING_SETUP_CQE32)
+		cq_size += sizeof(struct io_uring_cqe);
+	cq_size *= cq_entries;
+	cq_size += KRING_SIZE;
 	cq_size = (cq_size + 63) & ~63UL;
 	pages = (size_t) 1 << npages(cq_size, page_size);
 
-- 
2.30.2


  parent reply	other threads:[~2022-04-25 18:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-25 18:51 [PATCH v4 0/6]liburing: add support for large CQE sizes Stefan Roesch
2022-04-25 18:51 ` [PATCH v4 1/6] liburing: Update io_uring.h with large CQE kernel changes Stefan Roesch
2022-04-25 18:51 ` [PATCH v4 2/6] liburing: increase mmap size for large CQE's Stefan Roesch
2022-04-25 18:51 ` Stefan Roesch [this message]
2022-04-25 18:51 ` [PATCH v4 4/6] liburing: index large CQE's correctly Stefan Roesch
2022-04-25 18:51 ` [PATCH v4 5/6] liburing: add large CQE tests to nop test Stefan Roesch
2022-04-25 18:51 ` [PATCH v4 6/6] liburing: Test all configurations with NOP test Stefan Roesch

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