summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-05-23 22:51:04 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2022-05-23 22:51:04 +0300
commite1a8fde7203fa8a3e3f35d4f9df47477d23529c1 (patch)
treeb56c41f8e0e340679c40c09b3dab0544de8b54c5 /include
parent368da430d04dbe31aded44e5f5c255ff0899ad1d (diff)
parentf548a12efd5ab97e6b1fb332e5634ce44b3d9328 (diff)
downloadlinux-e1a8fde7203fa8a3e3f35d4f9df47477d23529c1.tar.xz
Merge tag 'for-5.19/io_uring-net-2022-05-22' of git://git.kernel.dk/linux-block
Pull io_uring 'more data in socket' support from Jens Axboe: "To be able to fully utilize the 'poll first' support in the core io_uring branch, it's advantageous knowing if the socket was empty after a receive. This adds support for that" * tag 'for-5.19/io_uring-net-2022-05-22' of git://git.kernel.dk/linux-block: io_uring: return hint on whether more data is available after receive tcp: pass back data left in socket after receive
Diffstat (limited to 'include')
-rw-r--r--include/linux/socket.h6
-rw-r--r--include/uapi/linux/io_uring.h2
2 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/socket.h b/include/linux/socket.h
index a1882e1e71d2..17311ad9f9af 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -50,6 +50,9 @@ struct linger {
struct msghdr {
void *msg_name; /* ptr to socket address structure */
int msg_namelen; /* size of socket address structure */
+
+ int msg_inq; /* output, data left in socket */
+
struct iov_iter msg_iter; /* data */
/*
@@ -62,8 +65,9 @@ struct msghdr {
void __user *msg_control_user;
};
bool msg_control_is_user : 1;
- __kernel_size_t msg_controllen; /* ancillary data buffer length */
+ bool msg_get_inq : 1;/* return INQ after receive */
unsigned int msg_flags; /* flags on received message */
+ __kernel_size_t msg_controllen; /* ancillary data buffer length */
struct kiocb *msg_iocb; /* ptr to iocb for async requests */
};
diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h
index 804916814e51..cc9544629eee 100644
--- a/include/uapi/linux/io_uring.h
+++ b/include/uapi/linux/io_uring.h
@@ -258,9 +258,11 @@ struct io_uring_cqe {
*
* IORING_CQE_F_BUFFER If set, the upper 16 bits are the buffer ID
* IORING_CQE_F_MORE If set, parent SQE will generate more CQE entries
+ * IORING_CQE_F_SOCK_NONEMPTY If set, more data to read after socket recv
*/
#define IORING_CQE_F_BUFFER (1U << 0)
#define IORING_CQE_F_MORE (1U << 1)
+#define IORING_CQE_F_SOCK_NONEMPTY (1U << 2)
enum {
IORING_CQE_BUFFER_SHIFT = 16,