All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Roesch <shr@fb.com>
To: <io-uring@vger.kernel.org>, <kernel-team@fb.com>
Cc: <shr@fb.com>
Subject: [PATCH v2 2/6] liburing: increase mmap size for large CQE's
Date: Wed, 20 Apr 2022 12:15:20 -0700	[thread overview]
Message-ID: <20220420191524.2906409-3-shr@fb.com> (raw)
In-Reply-To: <20220420191524.2906409-1-shr@fb.com>

This doubles the mmap size for large CQE's.

Signed-off-by: Stefan Roesch <shr@fb.com>
---
 src/setup.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/setup.c b/src/setup.c
index aec8b33..dd6a712 100644
--- a/src/setup.c
+++ b/src/setup.c
@@ -21,8 +21,12 @@ static int io_uring_mmap(int fd, struct io_uring_params *p,
 	size_t size;
 	int ret;
 
+	size = sizeof(struct io_uring_cqe);
+	if (p->flags & IORING_SETUP_CQE32)
+		size += sizeof(struct io_uring_cqe);
+
 	sq->ring_sz = p->sq_off.array + p->sq_entries * sizeof(unsigned);
-	cq->ring_sz = p->cq_off.cqes + p->cq_entries * sizeof(struct io_uring_cqe);
+	cq->ring_sz = p->cq_off.cqes + p->cq_entries * size;
 
 	if (p->features & IORING_FEAT_SINGLE_MMAP) {
 		if (cq->ring_sz > sq->ring_sz)
-- 
2.30.2


  parent reply	other threads:[~2022-04-20 19:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20 19:15 [PATCH v2 0/6] liburing: add support for large CQE sizes Stefan Roesch
2022-04-20 19:15 ` [PATCH v2 1/6] liburing: Update io_uring.h with large CQE kernel changes Stefan Roesch
2022-04-20 19:15 ` Stefan Roesch [this message]
2022-04-20 19:15 ` [PATCH v2 3/6] liburing: return correct ring size for large CQE's Stefan Roesch
2022-04-20 19:15 ` [PATCH v2 4/6] liburing: index large CQE's correctly Stefan Roesch
2022-04-20 19:15 ` [PATCH v2 5/6] liburing: add large CQE tests to nop test Stefan Roesch
2022-04-20 19:15 ` [PATCH v2 6/6] liburing: Test all configurations with NOP test Stefan Roesch
2022-04-20 22:45 ` [PATCH v2 0/6] liburing: add support for large CQE sizes 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 \
    --in-reply-to=20220420191524.2906409-3-shr@fb.com \
    --to=shr@fb.com \
    --cc=io-uring@vger.kernel.org \
    --cc=kernel-team@fb.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.