All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw at strlen.de>
To: mptcp at lists.01.org
Subject: [MPTCP] Re: [PATCH mptcp-next 3/7] mptcp: avoid blocking in tcp_sendpages due to skb alloc
Date: Thu, 07 May 2020 16:33:48 +0200	[thread overview]
Message-ID: <20200507143348.GO32392@breakpoint.cc> (raw)
In-Reply-To: ded361991210fd296fdd471d2a5dafa2da785163.camel@redhat.com

[-- Attachment #1: Type: text/plain, Size: 1323 bytes --]

Paolo Abeni <pabeni(a)redhat.com> wrote:
> Ok, I missed/forgot that the retransmission must be non blocking.
> 
> I now see that retransmissions are fine as is!
> 
> Still on this, don't we need to check mptcp_sendmsg_alloc_skb() inside
> the sendmsg() loop, too? Elsewhere we could fail on large send if we
> complete the first skb, keep looping in sendmsg() and the next
> iteration would block. Am I missing something?

You mean:

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 780d873b6c19..66a67b11d01b 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -814,6 +814,7 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
                if (!tx_ok)
                        break;
                if (!sk_stream_memory_free(ssk) ||
+                   !mptcp_sendmsg_alloc_skb(ssk) ||
                    !mptcp_page_frag_refill(ssk, pfrag) ||
                    !mptcp_ext_cache_refill(msk)) {
                        tcp_push(ssk, msg->msg_flags, mss_now,

?

Yes, that could be added.  Its not a huge deal since mptcp_sendmsg_frag() would
yield -EAGAIN if do_tcp_sendpages would block, and that will then re-start for
the 'blocking io' case (i.e., ssk is released and 'goto restart' fetches next
ssk with posssible wait_for_memory).

             reply	other threads:[~2020-05-07 14:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-07 14:33 Florian Westphal [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-05-07 14:38 [MPTCP] Re: [PATCH mptcp-next 3/7] mptcp: avoid blocking in tcp_sendpages due to skb alloc Paolo Abeni
2020-05-07 14:13 Paolo Abeni
2020-05-07 11:44 Florian Westphal
2020-05-07 11:27 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=20200507143348.GO32392@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.