public inbox for [email protected]
 help / color / mirror / Atom feed
From: Jens Axboe <[email protected]>
To: Stefan Metzmacher <[email protected]>,
	David Ahern <[email protected]>,
	[email protected]
Subject: Re: io-uring and tcp sockets
Date: Wed, 4 Nov 2020 07:50:50 -0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On 11/4/20 4:21 AM, Stefan Metzmacher wrote:
> Hi David,
> 
>> New to io_uring but can't find this answer online, so reaching out.
>>
>> I was trying out io_uring with netperf - tcp stream sockets - and
>> noticed a submission is called complete even with a partial send
>> (io_send(), ret < sr->len). Saving the offset of what succeeded (plus
>> some other adjustments) and retrying the sqe again solves the problem.
>> But the issue seems fundamental so wondering if is intentional?
> 
> I guess this is just the way it is currently.
> 
> For Samba I'd also like to be sure to never get short write to a socket.
> 
> There I'd like to keep the pipeline full by submitting as much sqe's as possible
> (without waiting for completions on every single IORING_OP_SENDMSG/IORING_OP_SPLICE)
> using IOSQE_IO_DRAIN or IOSQE_IO_LINK and maybe IOSQE_ASYNC or IORING_SETUP_SQPOLL.
> 
> But for now I just used a single sqe with IOSQE_ASYNC at a time.
> 
> Jens, do you see a way to overcome that limitation?
> 
> As far as I understand the situation is completely fixed now and
> it's no possible to get short reads and writes for file io anymore, is that correct?

Right, the regular file IO will not return short reads or writes, unless a
blocking attempt returns 0 (or short). Which would be expected. The send/recvmsg
side just returns what the socket read/write would return, similarly to if you
did the normal system call variants of those calls.

It would not be impossible to make recvmsg/sendmsg handle this internally as
well, we just need a good way to indicate the intent of "please satisfy the
whole thing before return".

-- 
Jens Axboe


  reply	other threads:[~2020-11-04 14:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-03  1:56 io-uring and tcp sockets David Ahern
2020-11-04 11:21 ` Stefan Metzmacher
2020-11-04 14:50   ` Jens Axboe [this message]
2020-11-04 15:38     ` David Ahern
2020-11-04 17:08       ` Stefan Metzmacher
2020-11-08 23:18         ` David Ahern

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