public inbox for [email protected]
 help / color / mirror / Atom feed
From: Dylan Yudaken <[email protected]>
To: Jens Axboe <[email protected]>,
	Pavel Begunkov <[email protected]>,
	<[email protected]>
Cc: <[email protected]>, Dylan Yudaken <[email protected]>
Subject: [PATCH liburing] remove recvmsg_multishot
Date: Mon, 4 Jul 2022 07:02:04 -0700	[thread overview]
Message-ID: <[email protected]> (raw)

This was not well thought out enough, and has some API concerns. Such as
how do names and control messages come back in a multishot way.

For now delete the recvmsg API until the kernel API is solid.

Signed-off-by: Dylan Yudaken <[email protected]>
---
 man/io_uring_prep_recvmsg.3           | 20 --------------------
 man/io_uring_prep_recvmsg_multishot.3 |  1 -
 src/include/liburing.h                |  8 --------
 test/recv-multishot.c                 | 19 +++++--------------
 4 files changed, 5 insertions(+), 43 deletions(-)
 delete mode 120000 man/io_uring_prep_recvmsg_multishot.3

diff --git a/man/io_uring_prep_recvmsg.3 b/man/io_uring_prep_recvmsg.3
index 24c68ce..8c49411 100644
--- a/man/io_uring_prep_recvmsg.3
+++ b/man/io_uring_prep_recvmsg.3
@@ -15,11 +15,6 @@ io_uring_prep_recvmsg \- prepare a recvmsg request
 .BI "                           int " fd ","
 .BI "                           struct msghdr *" msg ","
 .BI "                           unsigned " flags ");"
-.PP
-.BI "void io_uring_prep_recvmsg_multishot(struct io_uring_sqe *" sqe ","
-.BI "                                     int " fd ","
-.BI "                                     struct msghdr *" msg ","
-.BI "                                     unsigned " flags ");"
 .fi
 .SH DESCRIPTION
 .PP
@@ -42,21 +37,6 @@ This function prepares an async
 request. See that man page for details on the arguments specified to this
 prep helper.
 
-The multishot version allows the application to issue a single receive request,
-which repeatedly posts a CQE when data is available. It requires length to be 0
-, the
-.B IOSQE_BUFFER_SELECT
-flag to be set and no
-.B MSG_WAITALL
-flag to be set.
-Therefore each CQE will take a buffer out of a provided buffer pool for receiving.
-The application should check the flags of each CQE, regardless of it's result.
-If a posted CQE does not have the
-.B IORING_CQE_F_MORE
-flag set then the multishot receive will be done and the application should issue a
-new request.
-Multishot variants are available since kernel 5.20.
-
 After calling this function, additional io_uring internal modifier flags
 may be set in the SQE
 .I off
diff --git a/man/io_uring_prep_recvmsg_multishot.3 b/man/io_uring_prep_recvmsg_multishot.3
deleted file mode 120000
index cd9566f..0000000
--- a/man/io_uring_prep_recvmsg_multishot.3
+++ /dev/null
@@ -1 +0,0 @@
-io_uring_prep_recvmsg.3
\ No newline at end of file
diff --git a/src/include/liburing.h b/src/include/liburing.h
index 4df3139..d35bfa9 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -419,14 +419,6 @@ static inline void io_uring_prep_recvmsg(struct io_uring_sqe *sqe, int fd,
 	sqe->msg_flags = flags;
 }
 
-static inline void io_uring_prep_recvmsg_multishot(struct io_uring_sqe *sqe,
-						   int fd, struct msghdr *msg,
-						   unsigned flags)
-{
-	io_uring_prep_recvmsg(sqe, fd, msg, flags);
-	sqe->ioprio |= IORING_RECV_MULTISHOT;
-}
-
 static inline void io_uring_prep_sendmsg(struct io_uring_sqe *sqe, int fd,
 					 const struct msghdr *msg,
 					 unsigned flags)
diff --git a/test/recv-multishot.c b/test/recv-multishot.c
index f6d41c8..9df8184 100644
--- a/test/recv-multishot.c
+++ b/test/recv-multishot.c
@@ -25,7 +25,6 @@ enum early_error_t {
 };
 
 struct args {
-	bool recvmsg;
 	bool stream;
 	bool wait_each;
 	enum early_error_t early_error;
@@ -48,7 +47,6 @@ static int test(struct args *args)
 	int recv_cqes = 0;
 	bool early_error = false;
 	bool early_error_started = false;
-	struct msghdr msg = { };
 	struct __kernel_timespec timeout = {
 		.tv_sec = 1,
 	};
@@ -101,13 +99,7 @@ static int test(struct args *args)
 	}
 
 	sqe = io_uring_get_sqe(&ring);
-	if (args->recvmsg) {
-		memset(&msg, 0, sizeof(msg));
-		msg.msg_namelen = sizeof(struct sockaddr_in);
-		io_uring_prep_recvmsg_multishot(sqe, fds[0], &msg, 0);
-	} else {
-		io_uring_prep_recv_multishot(sqe, fds[0], NULL, 0, 0);
-	}
+	io_uring_prep_recv_multishot(sqe, fds[0], NULL, 0, 0);
 	sqe->flags |= IOSQE_BUFFER_SELECT;
 	sqe->buf_group = 7;
 	io_uring_sqe_set_data64(sqe, 1234);
@@ -328,19 +320,18 @@ int main(int argc, char *argv[])
 	if (argc > 1)
 		return T_EXIT_SKIP;
 
-	for (loop = 0; loop < 7; loop++) {
+	for (loop = 0; loop < 4; loop++) {
 		struct args a = {
 			.stream = loop & 0x01,
-			.recvmsg = loop & 0x02,
-			.wait_each = loop & 0x4,
+			.wait_each = loop & 0x2,
 		};
 		for (early_error = 0; early_error < ERROR_EARLY_LAST; early_error++) {
 			a.early_error = (enum early_error_t)early_error;
 			ret = test(&a);
 			if (ret) {
 				fprintf(stderr,
-					"test stream=%d recvmsg=%d wait_each=%d early_error=%d failed\n",
-					a.stream, a.recvmsg, a.wait_each, a.early_error);
+					"test stream=%d wait_each=%d early_error=%d failed\n",
+					a.stream, a.wait_each, a.early_error);
 				return T_EXIT_FAIL;
 			}
 			if (no_recv_mshot)

base-commit: f8eb5f804288e10ae7ef442ef482e4dd8b18fee7
-- 
2.30.2



             reply	other threads:[~2022-07-04 14:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-04 14:02 Dylan Yudaken [this message]
2022-07-05 14:24 ` [PATCH liburing] remove recvmsg_multishot 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 \
    [email protected] \
    [email protected] \
    [email protected] \
    [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