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 liburing 1/5] tests: comment on io_uring zc and SO_ZEROCOPY
Date: Tue,  5 Dec 2023 15:22:20 +0000	[thread overview]
Message-ID: <84f20fd3b1b0f6bd43b7388f7e442205bf9502f6.1701789563.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>

Application writes can be using send-zerocopy.c as an example of
io_uring zc enablement. However, it's a test, and we're testing all
weird corner cases. One of them is setting SO_ZEROCOPY for io_uring
zc, which is not needed, and applications should not do it. Add a
comment in an attempt to limit misunderstanding.

Signed-off-by: Pavel Begunkov <[email protected]>
---
 test/send-zerocopy.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/test/send-zerocopy.c b/test/send-zerocopy.c
index 9828ac6..1b6dd77 100644
--- a/test/send-zerocopy.c
+++ b/test/send-zerocopy.c
@@ -278,6 +278,10 @@ static int create_socketpair_ip(struct sockaddr_storage *addr,
 #ifdef SO_ZEROCOPY
 		int val = 1;
 
+		/*
+		 * NOTE: apps must not set SO_ZEROCOPY when using io_uring zc.
+		 * It's only here to test interactions with MSG_ZEROCOPY.
+		 */
 		if (setsockopt(*sock_client, SOL_SOCKET, SO_ZEROCOPY, &val, sizeof(val))) {
 			perror("setsockopt zc");
 			return 1;
-- 
2.43.0


  reply	other threads:[~2023-12-05 15:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-05 15:22 [PATCH liburing 0/5] send-zc test/bench improvements Pavel Begunkov
2023-12-05 15:22 ` Pavel Begunkov [this message]
2023-12-05 15:22 ` [PATCH liburing 2/5] examples/sendzc: remove get time overhead Pavel Begunkov
2023-12-05 15:22 ` [PATCH liburing 3/5] examples/sendzc: use stdout for stats Pavel Begunkov
2023-12-05 15:22 ` [PATCH liburing 4/5] examples/sendzc: try to print stats on SIGINT Pavel Begunkov
2023-12-05 15:22 ` [PATCH liburing 5/5] examples/sendzc: improve help message Pavel Begunkov
2023-12-05 16:22 ` [PATCH liburing 0/5] send-zc test/bench improvements 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=84f20fd3b1b0f6bd43b7388f7e442205bf9502f6.1701789563.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