public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: [email protected]
Cc: Jens Axboe <[email protected]>, [email protected]
Subject: [PATCH 5/8] io_uring/net: io_async_msghdr caches for sendzc
Date: Thu,  8 Sep 2022 13:20:31 +0100	[thread overview]
Message-ID: <42fa615b6e0be25f47a685c35d7b5e4f1b03d348.1662639236.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>

We already keep io_async_msghdr caches for normal send/recv requests,
use them also for zerocopy send.

Signed-off-by: Pavel Begunkov <[email protected]>
---
 io_uring/net.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/io_uring/net.c b/io_uring/net.c
index fa54a35191d7..ff1fed00876f 100644
--- a/io_uring/net.c
+++ b/io_uring/net.c
@@ -196,10 +196,9 @@ int io_sendzc_prep_async(struct io_kiocb *req)
 
 	if (!zc->addr || req_has_async_data(req))
 		return 0;
-	if (io_alloc_async_data(req))
+	io = io_msg_alloc_async_prep(req);
+	if (!io)
 		return -ENOMEM;
-
-	io = req->async_data;
 	ret = move_addr_to_kernel(zc->addr, zc->addr_len, &io->addr);
 	return ret;
 }
@@ -212,9 +211,9 @@ static int io_setup_async_addr(struct io_kiocb *req,
 
 	if (!addr || req_has_async_data(req))
 		return -EAGAIN;
-	if (io_alloc_async_data(req))
+	io = io_msg_alloc_async(req, issue_flags);
+	if (!io)
 		return -ENOMEM;
-	io = req->async_data;
 	memcpy(&io->addr, addr, sizeof(io->addr));
 	return -EAGAIN;
 }
-- 
2.37.2


  parent reply	other threads:[~2022-09-08 12:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-08 12:20 [PATCH for-next 0/8] random io_uring 6.1 changes Pavel Begunkov
2022-09-08 12:20 ` [PATCH 1/8] io_uring: kill an outdated comment Pavel Begunkov
2022-09-08 12:20 ` [PATCH 2/8] io_uring: use io_cq_lock consistently Pavel Begunkov
2022-09-08 12:20 ` [PATCH 3/8] io_uring/net: reshuffle error handling Pavel Begunkov
2022-09-08 12:20 ` [PATCH 4/8] io_uring/net: use async caches for async prep Pavel Begunkov
2022-09-08 12:20 ` Pavel Begunkov [this message]
2022-09-08 12:20 ` [PATCH 6/8] io_uring/net: add non-bvec sg chunking callback Pavel Begunkov
2022-09-08 12:20 ` [PATCH 7/8] io_uring/net: refactor io_sr_msg types Pavel Begunkov
2022-09-08 12:20 ` [PATCH 8/8] io_uring/net: use io_sr_msg for sendzc Pavel Begunkov
2022-09-08 14:59 ` [PATCH for-next 0/8] random io_uring 6.1 changes 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=42fa615b6e0be25f47a685c35d7b5e4f1b03d348.1662639236.git.asml.silence@gmail.com \
    [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