From nobody Sat Feb 7 02:07:00 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 5681A2E7639 for ; Tue, 12 Aug 2025 08:39:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754987965; cv=none; b=USfHUkV6b5U/rgxnedrNNS2K+AP+nvDujB/ZfFDIhITu9OAABTdCq7z6L9hroDv/d2NgC/WpKW7cGU1URbCXJZHM5ahYxDShJIrFIXZVAk1DajL2Sg+1r10KGgH9rfJ1ExK2Zsvtcin5dBarat/Vfr6pBZ91aJNpDAjf/5DqPuo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754987965; c=relaxed/simple; bh=D2LN6TLti854X5Liyc1EgMclQyJKV3L+RA5FxoC3LdY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PKSjfFaTmpqrUTCIL6yC/TZ7Oub4g1x7YffCXijvFkQB8219gunguDHfHKCJFf05NdEgRJi9hYcfj7YnCXYElVPPP0HMlCBc5DeJzBHm7lFN4lpQc97/q7E8f2tTO4YnK4rjTDxTwxvFEsaZiuSRpBMaRdVNNC9FSauwLWzlv+4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Gw/Xf0I+; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Gw/Xf0I+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B45C7C4CEF4; Tue, 12 Aug 2025 08:39:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1754987965; bh=D2LN6TLti854X5Liyc1EgMclQyJKV3L+RA5FxoC3LdY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gw/Xf0I+h+/HfvQ89UsdbDYG+OuKN4Lm7zobMoOvo6Q/lo869cq8lAGkdD0rPr6aE QyhoLuj7FI/jiXGSuFFCXJI5q4pmQyifrpdQQnHuFWSuBmh2SqqxZDFXSResOkbn6D rQ6ZBeC/evu9rJrroIVNJAuIwmHiyG5WunG9JiUYxFSWa3yczdKORiVGwpREm8keCT 1D7yr+QN6yE4QkAAU3Gd8WuQmn3Xj6tOGvzjzhvlNle/cu3wnHnwKtuvn+ZQsn4/Nq QlByIMt6b9Y/VyL4LkExkUqofUXYVyr1wNK56XO9BNfIU90771itmIhuTf3h5qLvJZ xEbgCbeVtDdAA== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang , Christoph Paasch Subject: [PATCH mptcp-next v4 1/2] mptcp: make ADD_ADDR retransmission timeout adaptive Date: Tue, 12 Aug 2025 16:39:15 +0800 Message-ID: X-Mailer: git-send-email 2.48.1 In-Reply-To: References: 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" From: Geliang Tang Currently the ADD_ADDR option is retransmitted with a fixed timeout. This patch makes the retransmission timeout adaptive by using the maximum RTO among all the subflows, while still capping it at the configured maximum value (add_addr_timeout_max). This improves responsiveness when establishing new subflows. Specifically: 1. Adds mptcp_adjust_add_addr_timeout() helper to compute the adaptive timeout. 2. Uses maximum subflow RTO (icsk_rto) when available. 3. Applies exponential backoff based on retransmission count. 4. Maintains fallback to configured max timeout when no RTO data exists. Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/576 Reviewed-by: Christoph Paasch Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts (NGI0) --- Documentation/networking/mptcp-sysctl.rst | 4 ++-- net/mptcp/pm.c | 28 +++++++++++++++++++---- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/Documentation/networking/mptcp-sysctl.rst b/Documentation/netw= orking/mptcp-sysctl.rst index 1683c139821e..2b8e8fb99ee2 100644 --- a/Documentation/networking/mptcp-sysctl.rst +++ b/Documentation/networking/mptcp-sysctl.rst @@ -8,8 +8,8 @@ MPTCP Sysfs variables =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D =20 add_addr_timeout - INTEGER (seconds) - Set the timeout after which an ADD_ADDR control message will be - resent to an MPTCP peer that has not acknowledged a previous + Set the maximum value of timeout after which an ADD_ADDR control message + will be resent to an MPTCP peer that has not acknowledged a previous ADD_ADDR message. =20 Do not retransmit if set to 0. diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c index e6dcc5b62645..02dfb379417e 100644 --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -268,6 +268,27 @@ int mptcp_pm_mp_prio_send_ack(struct mptcp_sock *msk, return -EINVAL; } =20 +static unsigned int mptcp_adjust_add_addr_timeout(struct mptcp_sock *msk) +{ + const struct net *net =3D sock_net((struct sock *)msk); + unsigned int rto =3D mptcp_get_add_addr_timeout(net); + struct mptcp_subflow_context *subflow; + unsigned int max =3D 0; + + mptcp_for_each_subflow(msk, subflow) { + struct sock *ssk =3D mptcp_subflow_tcp_sock(subflow); + struct inet_connection_sock *icsk =3D inet_csk(ssk); + + if (icsk->icsk_rto > max) + max =3D icsk->icsk_rto; + } + + if (max && max < rto) + rto =3D max; + + return rto; +} + static void mptcp_pm_add_timer(struct timer_list *timer) { struct mptcp_pm_add_entry *entry =3D timer_container_of(entry, timer, @@ -292,7 +313,7 @@ static void mptcp_pm_add_timer(struct timer_list *timer) goto out; } =20 - timeout =3D mptcp_get_add_addr_timeout(sock_net(sk)); + timeout =3D mptcp_adjust_add_addr_timeout(msk); if (!timeout) goto out; =20 @@ -307,7 +328,7 @@ static void mptcp_pm_add_timer(struct timer_list *timer) =20 if (entry->retrans_times < ADD_ADDR_RETRANS_MAX) sk_reset_timer(sk, timer, - jiffies + timeout); + jiffies + (timeout << entry->retrans_times)); =20 spin_unlock_bh(&msk->pm.lock); =20 @@ -348,7 +369,6 @@ bool mptcp_pm_alloc_anno_list(struct mptcp_sock *msk, { struct mptcp_pm_add_entry *add_entry =3D NULL; struct sock *sk =3D (struct sock *)msk; - struct net *net =3D sock_net(sk); unsigned int timeout; =20 lockdep_assert_held(&msk->pm.lock); @@ -374,7 +394,7 @@ bool mptcp_pm_alloc_anno_list(struct mptcp_sock *msk, =20 timer_setup(&add_entry->add_timer, mptcp_pm_add_timer, 0); reset_timer: - timeout =3D mptcp_get_add_addr_timeout(net); + timeout =3D mptcp_adjust_add_addr_timeout(msk); if (timeout) sk_reset_timer(sk, &add_entry->add_timer, jiffies + timeout); =20 --=20 2.48.1 From nobody Sat Feb 7 02:07:00 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 68D4E2E716C for ; Tue, 12 Aug 2025 08:39:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754987967; cv=none; b=hUJvvBeTr4ULH+edFKOvt/+Kuoo3Be4i9ygCYiFedYJJPQH/PNbSYoG/Rb4MPtDiLxeMwtz1eew7o9FG14QYgFnKuETHe9WruuDA0wwCMAPdvaEfsCV/eSBJ7s5X6nEfmM6QK155eB8oT/fOi7H8LL6eFC7jH5uFYxAFB9C8JWQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754987967; c=relaxed/simple; bh=rNeKOBloX0+u0nLEaPssQWu3Y8SM9sXyE1RTeqyV/EI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JpxvAUakZr5mikE9Kts1NGVavnsDylfROHByVDIcPPIGNY0z5YXsr3o62q6Q/nI4SyWa0hhREfX5W7qBOroVznDXzJo62+2sDtfIea0g0XZdB2Ac5HFg+yQleJxolhhPiPJ8cliyqCm+U4fSIoWkRpIHIXztUzuexIp/vK4dPik= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AIFhj/e+; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AIFhj/e+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1705C4CEF0; Tue, 12 Aug 2025 08:39:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1754987967; bh=rNeKOBloX0+u0nLEaPssQWu3Y8SM9sXyE1RTeqyV/EI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AIFhj/e+/Oz+aT4cUBQff3bM7ii7essTIAJA8U81XbC/quByayJDjqaJs2eLDS4bE g4MKJx3uF1X5J28opydYquKYYCc1C/dMn0hr5GXf3nN7UJljNkc+njLuOx9VtHd26I blfP0kocSifvw3J6nYfrX2hxcBwd/TJAiqwug7gULBv0cQoSNUc+l/Lgyj9/woMqmH n+8IB/+P7pjaBkSQfM2iAv77ZTaND6iIAkhIu1z3H9fOqZmlUMVWbh87Pa03TrpEfa UQrIOFqosFB9tdDZWbORfPgP4jV80lt8frdsV/U33EyjLnjcKh+pjsuBdgsqxAx5KM swF8pEDsQQ3/g== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 2/2] selftests: mptcp: remove add_addr_timeout settings Date: Tue, 12 Aug 2025 16:39:16 +0800 Message-ID: <5899c41c862773ed8fef5bbd871a4d6d44322a72.1754987655.git.tanggeliang@kylinos.cn> X-Mailer: git-send-email 2.48.1 In-Reply-To: References: 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" From: Geliang Tang Now that add_addr_timeout can be dynamically adjusted, there is no need to set specific timeout values in the mptcp_join.sh tests. This patch removes the explicit sysctl settings for net.mptcp.add_addr_timeout from the test scripts. The change simplifies the test setup and ensures the tests work with the default or dynamically adjusted timeout values. Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index 82cae37d9c20..e85bb62046e0 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -347,8 +347,6 @@ reset_with_add_addr_timeout() tables=3D"${ip6tables}" fi =20 - ip netns exec $ns1 sysctl -q net.mptcp.add_addr_timeout=3D1 - if ! ip netns exec $ns2 $tables -A OUTPUT -p tcp \ -m tcp --tcp-option 30 \ -m bpf --bytecode \ @@ -2183,7 +2181,6 @@ signal_address_tests() pm_nl_add_endpoint $ns2 10.0.4.2 flags signal =20 # the peer could possibly miss some addr notification, allow retransmiss= ion - ip netns exec $ns1 sysctl -q net.mptcp.add_addr_timeout=3D1 speed=3Dslow \ run_tests $ns1 $ns2 10.0.1.1 =20 --=20 2.48.1