public inbox for [email protected]
 help / color / mirror / Atom feed
From: Stefan Metzmacher <[email protected]>
To: Pavel Begunkov <[email protected]>,
	Jens Axboe <[email protected]>,
	[email protected]
Subject: Re: [PATCH 5.11] io_uring: don't take fs for recvmsg/sendmsg
Date: Wed, 18 Nov 2020 17:57:36 +0100	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>


[-- Attachment #1.1: Type: text/plain, Size: 1917 bytes --]

Am 18.11.20 um 17:27 schrieb Stefan Metzmacher:
> Am 07.11.20 um 17:07 schrieb Pavel Begunkov:
>> On 07/11/2020 16:02, Pavel Begunkov wrote:
>>> On 07/11/2020 13:46, Stefan Metzmacher wrote:
>>>> Hi Pavel,
>>>>
>>>>> We don't even allow not plain data msg_control, which is disallowed in __sys_{send,revb}msg_sock().
>>>>
>>>> Can't we better remove these checks and allow msg_control?
>>>> For me it's a limitation that I would like to be removed.
>>>
>>> We can grab fs only in specific situations as you mentioned, by e.g.
>>> adding a switch(opcode) in io_prep_async_work(), but that's the easy
>>> part. All msg_control should be dealt one by one as they do different
>>> things. And it's not the fact that they ever require fs.
>>
>> BTW, Jens mentioned that there is a queued patch that allows plain
>> data msg_control. Are those not enough?
> 
> You mean the PROTO_CMSG_DATA_ONLY check?
> 
> It's not perfect, but better than nothing for a start.

What actually have in mind for my smbdirect socket driver [1]:

- I have a pipe that got filled by IORING_OP_SPLICE
- The data in the pipe need to be "spliced" into a remote RDMA buffers,
  but I can't use IORING_OP_SPLICE again, because the RDMA buffer descriptor [2]
  array needs to be passed too.
- I'd like to use IORING_OP_SENDMSG with MSG_OOB and msg_control.
  msg_control would get the RDMA buffer descriptor array and the pipe fd.

The reverse operation (splicing data from remote RDMA buffers into a pipe)
would be implemented with IORING_OP_RECVMSG with MSG_OOB and msg_control.

I guess my smbdirect socket driver would not qualify to be marked as PROTO_CMSG_DATA_ONLY, correct?

[1] https://git.samba.org/?p=metze/linux/smbdirect.git;a=blob;f=smbdirect_socket.c;h=a738854462b198e#l2076
[2] https://docs.microsoft.com/ru-ru/openspecs/windows_protocols/ms-smbd/bee890cb-48f0-42a3-ba62-f1a3a19b0edc

metze


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2020-11-18 16:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-07 13:20 [PATCH 5.11] io_uring: don't take fs for recvmsg/sendmsg Pavel Begunkov
2020-11-07 13:46 ` Stefan Metzmacher
2020-11-07 16:02   ` Pavel Begunkov
2020-11-07 16:07     ` Pavel Begunkov
2020-11-18 16:27       ` Stefan Metzmacher
2020-11-18 16:57         ` Stefan Metzmacher [this message]
2020-11-18 19:50           ` Pavel Begunkov
2020-11-19  9:17             ` Stefan Metzmacher
2020-11-15 13:07 ` Pavel Begunkov
2020-11-16 16:31 ` 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] \
    /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