diff mbox series

[liburing] remove recvmsg_multishot

Message ID 20220704140204.204505-1-dylany@fb.com (mailing list archive)
State New
Headers show
Series [liburing] remove recvmsg_multishot | expand

Commit Message

Dylan Yudaken July 4, 2022, 2:02 p.m. UTC
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 <dylany@fb.com>
---
 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


base-commit: f8eb5f804288e10ae7ef442ef482e4dd8b18fee7

Comments

Jens Axboe July 5, 2022, 2:24 p.m. UTC | #1
On Mon, 4 Jul 2022 07:02:04 -0700, Dylan Yudaken wrote:
> 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.
> 
> 

Applied, thanks!

[1/1] remove recvmsg_multishot
      commit: 47ccd7c2c74c2c68d1a2821391ecf71be5566918

Best regards,
diff mbox series

Patch

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)