From: Florian Westphal <fw at strlen.de>
To: mptcp at lists.01.org
Subject: [MPTCP] Re: [RFC 13/14] sendmsg: don't restart mptcp_sendmsg_frag
Date: Mon, 18 Nov 2019 13:17:33 +0100 [thread overview]
Message-ID: <20191118121733.GB2284@breakpoint.cc> (raw)
In-Reply-To: 2fc61169c91b89ff9e096f18dc27f38ac53cb25b.camel@redhat.com
[-- Attachment #1: Type: text/plain, Size: 1509 bytes --]
Paolo Abeni <pabeni(a)redhat.com> wrote:
> On Thu, 2019-11-14 at 18:32 +0100, Florian Westphal wrote:
> > This function calls do_tcp_sendpages which already has such a loop.
> >
> > When tcp sendbuffer runs out of space and non-blocking io is used,
> > do_tcp_sendpages will return early because it can't sleep.
> > No -EAGAIN is returned, as some data was sent.
> >
> > When mptcp_sendmsg_frag is called again, next call will either return
> > -EAGAIN immediately or it will only send a few more bytes.
>
> If I understand correctly, the goal here is setting the appropriate
> return value when overall sendmsg() spooled a few bytes and than would
> block, right? currently we can return erroneously -EAGAIN instead of
> the number of written bytes on some scenarios.
No, the goal is to remove useless code. The other solution would be
to teach mptcp_send_frag to be able to tell when it did hit EGAIN to
exit the loop earlier, for that it would need to be able to return
both errno and the number of queued bytes. I didn't like adding
another int *err argument.
> I think that there is a side effect with this change: before a
> blocking, successful, write(<large val>) would always return <large
> val>,
Yes.
> After this patch it will return min(<large val>, <max skb size>), as
> mptcp_sendmsg_frag() is limited to a single skb.
>
> Do we want to preserve the old behavior?
TCP doesn't guarantee that it consumes entire buffer either, why would
mptcp try to?
next reply other threads:[~2019-11-18 12:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-18 12:17 Florian Westphal [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-11-18 21:44 [MPTCP] Re: [RFC 13/14] sendmsg: don't restart mptcp_sendmsg_frag Florian Westphal
2019-11-18 21:35 Paolo Abeni
2019-11-18 12:11 Paolo Abeni
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 \
--in-reply-to=20191118121733.GB2284@breakpoint.cc \
--to=unknown@example.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.