From nobody Fri Mar 29 14:13:07 2024 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a02:1d48:0:0:0:0:0 with SMTP id 69csp2415314jaj; Mon, 6 Sep 2021 06:11:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAmrNDDyasofbPL2AlsR2JNeXqQ+gIkHViWpabUQ5hW0mD2WAYkeCuVhd80gjH3oAiRfbn X-Received: by 2002:aa7:9787:0:b0:409:7f3e:82b5 with SMTP id o7-20020aa79787000000b004097f3e82b5mr11735451pfp.51.1630933867416; Mon, 06 Sep 2021 06:11:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630933867; cv=none; d=google.com; s=arc-20160816; b=M2R65zVT4Czlq+o6NDATSIrdjQz3DrXo+nCRIY2A/emJel7k+eftlrKE1qFHWUVkyG Haqbb1h6NcccP4zKPKH5el3RIgw9w1T8fEELCiLosl2gYg+FNpWV9t0/qcNg+22DHYCS SmnxwtpQWAB7GPezlgOF0vbb3wNq5GSjHY5Xs1lsQzs8u24h5zDqbN52K/0L0aGFI/zq 7GXgFfWm/P8HBcPDi7YyKUappcb4RH8Kt9HcD7OOEEQQswMMuzJGlbwEt+D5AODXi4fU g+lqjGsax9faZ1jDq624c6t1uSBU89niWxsHa+r/Y249nF1hCf+D+9t8bCze1SGKFz0U 142A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=o3+EWwAAszunHDjnaSOYkAwxC+NG/EjzXjLaWK8Wf14=; b=ZwsTXroHMhEr30xnl5y2T3+7jlinYKrxdBEMpdi4N1jCFpd1Kc8ZGabclal/8kBi6L PwYJ7eJ1ZeKtzdlRO9dLsefJVtqCtOJXI7mN+oVF+jMvIS8mOy1sXe+6HKbnewWIVdVg T6L+LcoUe7Kj2ChD0i0ojinOBJ4Nc8dLnNBUJPP3kFCCnuWCT39o9ykuwQdaPxVm1JXx ZWqcB8VggqUzWx93TU4dLFMPzub7NU5LoQK0aKX/GJGdI3E4jRVokLoGLeOnN/FFdu6T 7SUkgfrivvWkYVU11LzMwpG8NI5mvtahLaVAzhhvoH5BgJU2OWb+EsQhQQeNQ4cOopDl bWSA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of mptcp+bounces-1867-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1:3600::1 as permitted sender) smtp.mailfrom="mptcp+bounces-1867-wpasupplicant.patchew=gmail.com@lists.linux.dev" Return-Path: Received: from ewr.edge.kernel.org (ewr.edge.kernel.org. [2604:1380:1:3600::1]) by mx.google.com with ESMTPS id o4si11264268pll.276.2021.09.06.06.11.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Sep 2021 06:11:07 -0700 (PDT) Received-SPF: pass (google.com: domain of mptcp+bounces-1867-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1:3600::1 as permitted sender) client-ip=2604:1380:1:3600::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of mptcp+bounces-1867-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1:3600::1 as permitted sender) smtp.mailfrom="mptcp+bounces-1867-wpasupplicant.patchew=gmail.com@lists.linux.dev" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ewr.edge.kernel.org (Postfix) with ESMTPS id AE44D1C0F4C for ; Mon, 6 Sep 2021 13:11:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 383A83FCC; Mon, 6 Sep 2021 13:11:01 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [193.142.43.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 047753FC1 for ; Mon, 6 Sep 2021 13:11:00 +0000 (UTC) Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1mNEOo-0001oQ-8i; Mon, 06 Sep 2021 15:10:58 +0200 From: Florian Westphal To: Cc: Florian Westphal Subject: [PATCH mptcp-next v2 2/2] mptcp: re-arm retransmit timer if data is pending Date: Mon, 6 Sep 2021 15:10:45 +0200 Message-Id: <20210906131045.18513-3-fw@strlen.de> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210906131045.18513-1-fw@strlen.de> References: <20210906131045.18513-1-fw@strlen.de> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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. Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/226 Signed-off-by: Florian Westphal Acked-by: Paolo Abeni --- Changes in v2: - drop reset-pending conditional in __mptcp_push_pending, retrans timer already takes care of this (Paolo) - rename patch subject - add a 'closes' tag to commit message net/mptcp/protocol.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index c0e0ee4cb24f..73cb5d053785 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); =20 - if (snd_una =3D=3D READ_ONCE(msk->snd_nxt) && !msk->recovery) { + if (snd_una =3D=3D READ_ONCE(msk->snd_nxt) && + snd_una =3D=3D READ_ONCE(msk->write_seq)) { if (mptcp_timer_pending(sk) && !mptcp_data_fin_enabled(msk)) mptcp_stop_timer(sk); } else { @@ -1547,6 +1548,13 @@ static void mptcp_update_post_push(struct mptcp_sock= *msk, msk->snd_nxt =3D snd_nxt_new; } =20 +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 =3D NULL, *ssk =3D NULL; @@ -2414,6 +2422,9 @@ static void __mptcp_retrans(struct sock *sk) int ret; =20 mptcp_clean_una_wakeup(sk); + + /* first check ssk: need to kick "stale" logic */ + ssk =3D mptcp_subflow_get_retrans(msk); dfrag =3D mptcp_rtx_head(sk); if (!dfrag) { if (mptcp_data_fin_enabled(msk)) { @@ -2426,10 +2437,12 @@ static void __mptcp_retrans(struct sock *sk) goto reset_timer; } =20 - return; + if (!mptcp_send_head(sk)) + return; + + goto reset_timer; } =20 - ssk =3D mptcp_subflow_get_retrans(msk); if (!ssk) goto reset_timer; =20 @@ -2456,6 +2469,8 @@ static void __mptcp_retrans(struct sock *sk) release_sock(ssk); =20 reset_timer: + mptcp_check_and_set_pending(sk); + if (!mptcp_timer_pending(sk)) mptcp_reset_timer(sk); } --=20 2.32.0