public inbox for [email protected]
 help / color / mirror / Atom feed
From: Jens Axboe <[email protected]>
To: Kuniyuki Iwashima <[email protected]>, [email protected]
Cc: [email protected], [email protected]
Subject: Re: [PATCH v2 3/4] io_uring: Introduce IORING_OP_BIND
Date: Fri, 14 Jun 2024 18:27:33 -0600	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On 6/14/24 4:46 PM, Kuniyuki Iwashima wrote:
> From: Gabriel Krisman Bertazi <[email protected]>
> Date: Fri, 14 Jun 2024 12:30:46 -0400
>> IORING_OP_BIND provides the semantic of bind(2) via io_uring.  While
>> this is an essentially synchronous system call, the main point is to
>> enable a network path to execute fully with io_uring registered and
>> descriptorless files.
>>
>> Signed-off-by: Gabriel Krisman Bertazi <[email protected]>
>>
>> ---
>> changes since v1:
>> - drop explocit error handling for move_addr_to_kernel (jens)
>> - Remove empty line ahead of return;
>> ---
>>  include/uapi/linux/io_uring.h |  1 +
>>  io_uring/net.c                | 36 +++++++++++++++++++++++++++++++++++
>>  io_uring/net.h                |  3 +++
>>  io_uring/opdef.c              | 13 +++++++++++++
>>  4 files changed, 53 insertions(+)
>>
>> diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h
>> index 994bf7af0efe..4ef153d95c87 100644
>> --- a/include/uapi/linux/io_uring.h
>> +++ b/include/uapi/linux/io_uring.h
>> @@ -257,6 +257,7 @@ enum io_uring_op {
>>  	IORING_OP_FUTEX_WAITV,
>>  	IORING_OP_FIXED_FD_INSTALL,
>>  	IORING_OP_FTRUNCATE,
>> +	IORING_OP_BIND,
>>  
>>  	/* this goes last, obviously */
>>  	IORING_OP_LAST,
>> diff --git a/io_uring/net.c b/io_uring/net.c
>> index 0a48596429d9..8cbc29aff15c 100644
>> --- a/io_uring/net.c
>> +++ b/io_uring/net.c
>> @@ -51,6 +51,11 @@ struct io_connect {
>>  	bool				seen_econnaborted;
>>  };
>>  
>> +struct io_bind {
>> +	struct file			*file;
>> +	int				addr_len;
>> +};
>> +
>>  struct io_sr_msg {
>>  	struct file			*file;
>>  	union {
>> @@ -1715,6 +1720,37 @@ int io_connect(struct io_kiocb *req, unsigned int issue_flags)
>>  	return IOU_OK;
>>  }
>>  
>> +int io_bind_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
>> +{
>> +	struct io_bind *bind = io_kiocb_to_cmd(req, struct io_bind);
>> +	struct sockaddr __user *uaddr;
>> +	struct io_async_msghdr *io;
>> +
>> +	if (sqe->len || sqe->buf_index || sqe->rw_flags || sqe->splice_fd_in)
>> +		return -EINVAL;
>> +
>> +	uaddr = u64_to_user_ptr(READ_ONCE(sqe->addr));
>> +	bind->addr_len =  READ_ONCE(sqe->addr2);
>                         ^^
> nit: double space

Thanks for spotting those, I can just remove those two while applying.
Mostly just a note to Grabriel, no need to re-post for that.

-- 
Jens Axboe


  reply	other threads:[~2024-06-15  0:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-14 16:30 [PATCH v2 1/4] net: Split a __sys_bind helper for io_uring Gabriel Krisman Bertazi
2024-06-14 16:30 ` [PATCH v2 2/4] net: Split a __sys_listen " Gabriel Krisman Bertazi
2024-06-14 22:44   ` Kuniyuki Iwashima
2024-06-19  0:50   ` Jakub Kicinski
2024-06-14 16:30 ` [PATCH v2 3/4] io_uring: Introduce IORING_OP_BIND Gabriel Krisman Bertazi
2024-06-14 22:46   ` Kuniyuki Iwashima
2024-06-15  0:27     ` Jens Axboe [this message]
2024-06-14 16:30 ` [PATCH v2 4/4] io_uring: Introduce IORING_OP_LISTEN Gabriel Krisman Bertazi
2024-06-14 22:42 ` [PATCH v2 1/4] net: Split a __sys_bind helper for io_uring Kuniyuki Iwashima
2024-06-19  0:49 ` Jakub Kicinski
2024-06-19 13:40   ` Jens Axboe
2024-06-19 15:04     ` Jakub Kicinski
2024-06-19 15:06       ` Jens Axboe
2024-07-15 12:49         ` Matus Jokay
2024-07-15 13:59           ` Tetsuo Handa
2024-07-22 12:37             ` Matus Jokay
2024-06-19 14:58 ` 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