[PATCH liburing 1/5] tests: comment on io_uring zc and SO_ZEROCOPY

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <asml.silence@xxxxxxxxx>
---
 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





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux