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.
I think that there is a side effect with this change: before a
blocking, successful, write(<large val>) would always return <large
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?