From: Paolo Abeni <pabeni@redhat.com>
To: Florian Westphal <fw@strlen.de>,
mptcp@lists.linux.dev,
Matthieu Baerts <matthieu.baerts@tessares.net>
Subject: Re: [mptcp-next 2/2] mptcp: re-set push-pending bit on retransmit failure
Date: Mon, 06 Sep 2021 09:43:17 +0200 [thread overview]
Message-ID: <aaefcedbe475b6bf060bbb4d6266233d57d59225.camel@redhat.com> (raw)
In-Reply-To: <20210906060614.25217-3-fw@strlen.de>
On Mon, 2021-09-06 at 08:06 +0200, Florian Westphal wrote:
> The retransmit head will be NULL in case there is no in-flight data
> (meaning all data injected into network has been acked).
>
> In that case the retransmit timer is stopped.
>
> This is only correct if there is no more pending, not-yet-sent data.
>
> If there is, the retransmit timer needs to set the PENDING bit again so
> that mptcp tries to send the remaining (new) data once a subflow can accept
> more data.
>
> Also, mptcp_subflow_get_retrans() has to be called unconditionally.
> This function checks for subflows that have become unresponsive and marks
> them as stale, so in the case where the rtx queue is empty, subflows
> will never be marked stale which prevents available backup subflows from
> becoming eligible for transmit.
>
> Signed-off-by: Florian Westphal <fw@strlen.de>
Looks great, but I'm struggling to follow the code in a couple of
points, see below...
> ---
> net/mptcp/protocol.c | 28 +++++++++++++++++++++++++---
> 1 file changed, 25 insertions(+), 3 deletions(-)
>
> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index c0e0ee4cb24f..b88a9b61025b 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
> @@ -1105,7 +1105,8 @@ static void __mptcp_clean_una(struct sock *sk)
> if (cleaned && tcp_under_memory_pressure(sk))
> __mptcp_mem_reclaim_partial(sk);
>
> - if (snd_una == READ_ONCE(msk->snd_nxt) && !msk->recovery) {
> + if (snd_una == READ_ONCE(msk->snd_nxt) &&
> + snd_una == READ_ONCE(msk->write_seq)) {
> if (mptcp_timer_pending(sk) && !mptcp_data_fin_enabled(msk))
> mptcp_stop_timer(sk);
@Mat: I'm wild guessing the above could possibly address also
issues/230. Could you please give it a spin in the CI? How frequently
do you observe the mentioned issue in the CI?
> } else {
> @@ -1547,6 +1548,13 @@ static void mptcp_update_post_push(struct mptcp_sock *msk,
> msk->snd_nxt = snd_nxt_new;
> }
>
> +static void mptcp_check_and_set_pending(struct sock *sk)
> +{
> + if (mptcp_send_head(sk) &&
> + !test_bit(MPTCP_PUSH_PENDING, &mptcp_sk(sk)->flags))
> + set_bit(MPTCP_PUSH_PENDING, &mptcp_sk(sk)->flags);
> +}
> +
> void __mptcp_push_pending(struct sock *sk, unsigned int flags)
> {
> struct sock *prev_ssk = NULL, *ssk = NULL;
> @@ -1603,6 +1611,13 @@ void __mptcp_push_pending(struct sock *sk, unsigned int flags)
> mptcp_push_release(sk, ssk, &info);
>
> out:
> + /* Set PENDING again in case we found an ssk
> + * that could not accept more data
> + */
> + if (unlikely(copied == 0) &&
> + READ_ONCE(msk->snd_una) == msk->snd_nxt && ssk)
> + mptcp_check_and_set_pending(sk);
@Florian: Why we need to check for ssk != NULL?
Do we need something similar for __mptcp_subflow_push_pending(), too?
I'm wondering if this will cause a sort of 'spinning'/busy loop on
above condition inside mptcp_release_cb(). Could we just ensure that
the rtx timer is harmed instead? We likely have to wait a bit for the
subflow to become ready, I think.
Cheers,
Paolo
next prev parent reply other threads:[~2021-09-06 7:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-06 6:06 [mptcp-next 0/2] Fix mptcp connection hangs after link failover Florian Westphal
2021-09-06 6:06 ` [mptcp-next 1/2] mptcp: remove tx_pending_data Florian Westphal
2021-09-06 7:13 ` Paolo Abeni
2021-09-06 6:06 ` [mptcp-next 2/2] mptcp: re-set push-pending bit on retransmit failure Florian Westphal
2021-09-06 7:43 ` Paolo Abeni [this message]
2021-09-06 7:55 ` Florian Westphal
2021-09-06 8:38 ` Paolo Abeni
2021-09-06 11:35 ` Florian Westphal
2021-09-06 13:14 ` 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=aaefcedbe475b6bf060bbb4d6266233d57d59225.camel@redhat.com \
--to=pabeni@redhat.com \
--cc=fw@strlen.de \
--cc=matthieu.baerts@tessares.net \
--cc=mptcp@lists.linux.dev \
/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