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 7/8] io_uring/net: refactor io_sr_msg types
Date: Thu,  8 Sep 2022 13:20:33 +0100	[thread overview]
Message-ID: <42c2639d6385b8b2181342d2af3a42d3b1c5bcd2.1662639236.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>

In preparation for using struct io_sr_msg for zerocopy sends, clean up
types. First, flags can be u16 as it's provided by the userspace in u16
ioprio, as well as addr_len. This saves us 4 bytes. Also use unsigned
for size and done_io, both are as well limited to u32.

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

diff --git a/io_uring/net.c b/io_uring/net.c
index 4dbdb59968c3..97778cd1306c 100644
--- a/io_uring/net.c
+++ b/io_uring/net.c
@@ -55,21 +55,21 @@ struct io_sr_msg {
 		struct user_msghdr __user	*umsg;
 		void __user			*buf;
 	};
+	unsigned			len;
+	unsigned			done_io;
 	unsigned			msg_flags;
-	unsigned			flags;
-	size_t				len;
-	size_t				done_io;
+	u16				flags;
 };
 
 struct io_sendzc {
 	struct file			*file;
 	void __user			*buf;
-	size_t				len;
+	unsigned			len;
+	unsigned			done_io;
 	unsigned			msg_flags;
-	unsigned			flags;
-	unsigned			addr_len;
+	u16				flags;
+	u16				addr_len;
 	void __user			*addr;
-	size_t				done_io;
 	struct io_kiocb 		*notif;
 };
 
-- 
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 ` [PATCH 5/8] io_uring/net: io_async_msghdr caches for sendzc Pavel Begunkov
2022-09-08 12:20 ` [PATCH 6/8] io_uring/net: add non-bvec sg chunking callback Pavel Begunkov
2022-09-08 12:20 ` Pavel Begunkov [this message]
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=42c2639d6385b8b2181342d2af3a42d3b1c5bcd2.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