From nobody Sat Aug 15 20:31:11 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 3FEA141A797 for ; Fri, 14 Aug 2026 13:38:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786714717; cv=none; b=KgyvMH9A4dBsrsLRQcq76117oy39XUm6VF4RDP7chGnbHWl9zIm8cUyEPadUvLZGpiT78VMkAAoxFTKF2KOvqHSXPkkVR75dpt8JQx4PVuxsFhPMnjv/oWVXXtTJYYv0ZX0pqchb7obxsVNO1Mprp0obCGgEPORngBjojRD97Uo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786714717; c=relaxed/simple; bh=3avHYOb3K81rljOb79YclD3VMNfOHkxhcrSMbwd84Do=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:content-type; b=YHPr3lFJqSojTeK0kyfoptALzy5hwiVQchkDsdTYYiQAW1ilCDrnM7nbGzjbdVy51XwOETmyhzaulxnj46CRZ2w3LxnPCTeK0TtxlS2LLI5GNhfter69/xnQ6cw4TpL2fn59gbxqr95Ld/TYgvbG4KfwqeYs25XmLsD0w6Y+JqQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=h9QdWt+0; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="h9QdWt+0" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1786714715; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=22PLh90W/4k4cuL+dO0q/fKrCO9E0D7hcwTIv7AqMXg=; b=h9QdWt+0AAnYwVexElaHCRFxL6hJnQiTGj5hgJGz7FCNS4pxvFcH1wMOXmL8YVO9e5murP anbeCKbzZS5kfkoTnAQttT06qpC+iYWw2Z/Zup5uWm9p5Az8RyIh8maJRLUXRSUJHPg4DC 8ZcsKX/fy9o+iAQxapDs4iEjOfl7qV8= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-175-E8_g6GWIMqirUUz3FNcnoA-1; Fri, 14 Aug 2026 09:38:33 -0400 X-MC-Unique: E8_g6GWIMqirUUz3FNcnoA-1 X-Mimecast-MFC-AGG-ID: E8_g6GWIMqirUUz3FNcnoA_1786714713 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A778E1800C3A for ; Fri, 14 Aug 2026 13:38:32 +0000 (UTC) Received: from gerbillo.redhat.com (unknown [10.44.48.145]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DEDF8180034C for ; Fri, 14 Aug 2026 13:38:31 +0000 (UTC) From: Paolo Abeni To: mptcp@lists.linux.dev Subject: [PATCH resend mptcp-net 1/4] mptcp: being below memory limit is a likely() condition Date: Fri, 14 Aug 2026 15:38:20 +0200 Message-ID: <8719c7e65a70255ca607bc874c46b4c2388871cd.1786713351.git.pabeni@redhat.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: EMf6BkzE3jd6tK7WEnONXsASlBgneCaR5FRJWqjnjiw_1786714713 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8"; x-default="true" The current compiler hint annotation is wrong, due to inverted logic in the previous revision of the relevant code. Fixes: e468d371180d ("mptcp: implemented OoO queue pruning") Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts (NGI0) --- net/mptcp/protocol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index c2762d74f29d..f879b1061f2d 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -289,8 +289,8 @@ static void mptcp_prune_ofo_queue(struct sock *sk, */ static bool mptcp_can_ingest(const struct sock *sk) { - return unlikely(sk_rmem_alloc_get(sk) <=3D READ_ONCE(sk->sk_rcvbuf)) || - __mptcp_check_fallback(mptcp_sk(sk)); + return likely(sk_rmem_alloc_get(sk) <=3D READ_ONCE(sk->sk_rcvbuf)) || + __mptcp_check_fallback(mptcp_sk(sk)); } =20 static bool mptcp_try_rmem_schedule(struct sock *sk, const struct sk_buff = *skb) --=20 2.55.0 From nobody Sat Aug 15 20:31:11 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 535C1432E6C for ; Fri, 14 Aug 2026 13:38:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786714732; cv=none; b=mC+/K+FJnk++YnEk8KOpDkyUAvzKaGdmLnQoSW6rggSo8s48klEHeDxjG8IU4zMVYRztkAQWrio2wlrHfJYzQeZDlyw8Rmk8sCh1yt14L9P099YLfzQsuHyYeAhU7D3TIFyK33m7apB6lFetH1Tegki9OgfSotNg3dKBmDtxwZg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786714732; c=relaxed/simple; bh=7egbk8BdLZFVc917cZELEcTiUGItdOARMnlbr/mN4Bk=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:content-type; b=bM1KSAEHdWlzhZc4FjedEUe79JnBbWuvYcU5ziejY9BkIUXT/axTELrNEEu8nb+fgHQjUbstHRrnbz+xSPxjMGCr+BNyJRhkDICi7+Z9SCWLGXmUpF2l2BmNTOlxjuHBWDPvg6Z5i8lOJsBLloHcIXyTRY+vJLZdoLrsF5xwTzk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Y3Q3rUZk; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Y3Q3rUZk" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1786714728; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K++/2TEDmYGi8tBJJj6M5b9OOqEs4w/1oBMQvj+0SyE=; b=Y3Q3rUZkrFvAjreYoewxlIJaTRzLUzlso1MMRTc+o6cMC+OO4sYA+DG6CvUSPaZb+1yPXm v8h/FkpFlJrSJyb4C8tcs+iXucU7QUsxcw8+7/Mr37fbJIiPL1KWLnNsSA3IvmsvgPE+w8 Y2nqlG9xL7DR+gahRCWWFVwt3tWLowg= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-658-HwzWae3xPyW_ufxZeBr78g-1; Fri, 14 Aug 2026 09:38:34 -0400 X-MC-Unique: HwzWae3xPyW_ufxZeBr78g-1 X-Mimecast-MFC-AGG-ID: HwzWae3xPyW_ufxZeBr78g_1786714714 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EEF0F1955F3C for ; Fri, 14 Aug 2026 13:38:33 +0000 (UTC) Received: from gerbillo.redhat.com (unknown [10.44.48.145]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3B86518005BD for ; Fri, 14 Aug 2026 13:38:32 +0000 (UTC) From: Paolo Abeni To: mptcp@lists.linux.dev Subject: [PATCH resend mptcp-net 2/4] mptcp: avoid pruning for OoW data Date: Fri, 14 Aug 2026 15:38:21 +0200 Message-ID: <9035d664610bd149b23f0380395419d0f2bbb4e0.1786713351.git.pabeni@redhat.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: SofnjoJqAjuS5iVt6z_W7VkcFT_vOHvhnQtjOJ5thkE_1786714714 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8"; x-default="true" Pruning is expansive and destructive, do it only when we expect to accept the skb triggering the cleanup. Fixes: e468d371180d ("mptcp: implemented OoO queue pruning") Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts (NGI0) --- net/mptcp/protocol.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index f879b1061f2d..2ee23e9411be 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -313,12 +313,6 @@ static void mptcp_data_queue_ofo(struct mptcp_sock *ms= k, struct sk_buff *skb) u64 seq, end_seq, max_seq; struct sk_buff *skb1; =20 - if (!mptcp_try_rmem_schedule(sk, skb)) { - MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_RCVPRUNED); - mptcp_drop(sk, skb); - return; - } - seq =3D MPTCP_SKB_CB(skb)->map_seq; end_seq =3D MPTCP_SKB_CB(skb)->end_seq; max_seq =3D atomic64_read(&msk->rcv_wnd_sent); @@ -335,6 +329,12 @@ static void mptcp_data_queue_ofo(struct mptcp_sock *ms= k, struct sk_buff *skb) return; } =20 + if (!mptcp_try_rmem_schedule(sk, skb)) { + MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_RCVPRUNED); + mptcp_drop(sk, skb); + return; + } + p =3D &msk->out_of_order_queue.rb_node; MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_OFOQUEUE); if (RB_EMPTY_ROOT(&msk->out_of_order_queue)) { --=20 2.55.0 From nobody Sat Aug 15 20:31:11 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 A514843D501 for ; Fri, 14 Aug 2026 13:38:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786714723; cv=none; b=f1leEG4oklm0RRey6nDsHG8Crbrc5mKyQ2LnCZXkwseS/QstapwGgtmjG7oqMp8ZQWHgPcnOap2l+K4BRRRq6ElzgJrNkrDbQSovRYI3zUWx6bfUFc8VI4idCtIykx503k1pRXd5bbILl5YGSu6TWgk95fK/Of/wgN+xidatPuo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786714723; c=relaxed/simple; bh=S4Jy9kXq4zyZDYgEG1MWwO2idTZz8zIunAPh6OESQYo=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:content-type; b=K1txcoxrBdso5/J3bme4PEPhQJyPVVnRyNiAg+ONoOTyzx71QwVN46Jw4/hjN39xJY2VzuTo42PHZIQ4bLSZVbLaLime5FJa+OvowQSU8RzajHeZar6vPN4zsGDe6G6c3qpkpBSG0RiXuxw0A5397hQ0eju1KA8dhK/nw86Kbew= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=IDLc048L; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="IDLc048L" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1786714720; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=o2MdFdNU7PStgkd8Yi7t4hlCuD6mRkrOcjrmSc7BMUY=; b=IDLc048LdT/NvLvgfoRZlkn9YUSmDiY6SV5tHUJtPiTm4AmZk1sac80d3c7YtXhs30/Zum UBCP5zYHMUsqUfZBAJMs3+XiiOfrBfE60QawnBLznGQxztC24XvX5qKFBq9qflNRa6RiRd y3e+yk/k5oDJveun0N7he7tMZWTys8k= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-607-HkA38gC3PLWZgpiMm168Ww-1; Fri, 14 Aug 2026 09:38:36 -0400 X-MC-Unique: HkA38gC3PLWZgpiMm168Ww-1 X-Mimecast-MFC-AGG-ID: HkA38gC3PLWZgpiMm168Ww_1786714715 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 308B818001E2 for ; Fri, 14 Aug 2026 13:38:35 +0000 (UTC) Received: from gerbillo.redhat.com (unknown [10.44.48.145]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 720CF180034F for ; Fri, 14 Aug 2026 13:38:34 +0000 (UTC) From: Paolo Abeni To: mptcp@lists.linux.dev Subject: [PATCH resend mptcp-net 3/4] mptcp: remove unneeded READ_ONCE() annotation Date: Fri, 14 Aug 2026 15:38:22 +0200 Message-ID: <904e519f63b9ddbebb474dfea2672ac18c6d6f4f.1786713351.git.pabeni@redhat.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: txUP9cZhPzvRIw2cG1tZQP5xEnqRPZahxCYagYZPQAc_1786714715 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8"; x-default="true" The subflow->fully_established flag is always written under the subflow socket lock. Reading such value under the same lock does not require any ONCE annotation. Fixes: 581c8cbfa934 ("mptcp: annotate data-races around subflow->fully_esta= blished") Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts (NGI0) --- net/mptcp/options.c | 4 ++-- net/mptcp/protocol.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/net/mptcp/options.c b/net/mptcp/options.c index 1bb486daf56a..8a299a8ef5e0 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -529,7 +529,7 @@ static bool mptcp_established_options_mp(struct sock *s= k, struct sk_buff *skb, return false; =20 /* MPC/MPJ needed only on 3rd ack packet, DATA_FIN and TCP shutdown take = precedence */ - if (READ_ONCE(subflow->fully_established) || snd_data_fin_enable || + if (subflow->fully_established || snd_data_fin_enable || subflow->snd_isn !=3D TCP_SKB_CB(skb)->seq || sk->sk_state !=3D TCP_ESTABLISHED) return false; @@ -980,7 +980,7 @@ static bool check_fully_established(struct mptcp_sock *= msk, struct sock *ssk, /* here we can process OoO, in-window pkts, only in-sequence 4th ack * will make the subflow fully established */ - if (likely(READ_ONCE(subflow->fully_established))) { + if (likely(subflow->fully_established)) { /* on passive sockets, check for 3rd ack retransmission * note that msk is always set by subflow_syn_recv_sock() * for mp_join subflows diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 2ee23e9411be..b311fe30c785 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -3912,7 +3912,7 @@ static void schedule_3rdack_retransmission(struct soc= k *ssk) struct tcp_sock *tp =3D tcp_sk(ssk); unsigned long timeout; =20 - if (READ_ONCE(mptcp_subflow_ctx(ssk)->fully_established)) + if (mptcp_subflow_ctx(ssk)->fully_established) return; =20 /* reschedule with a timeout above RTT, as we must look only for drop */ --=20 2.55.0 From nobody Sat Aug 15 20:31:11 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 A51D5459AF4 for ; Fri, 14 Aug 2026 13:38:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786714723; cv=none; b=RHaz8OLIzdQS04V5UEbhdkB+fHCQEjG0HLaOSEmiPLXDQ8EvieDDqZ+ZkX7W3fDHjasNXOM0k7BRaW0IrFfWGskq79uFZYz/W3jy8wWnYwPIs5iZS6Hq0nYRb6YiZv0pVtcwu4miHf5fwYiSNEFGV84jbdrfW8MvpYTuaLOkTTM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786714723; c=relaxed/simple; bh=ADsFdpePGYXfBor74YWWVIDAGHMELG8aFyt4q070sz0=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:content-type; b=nJYKgLQoPOm4o/th8qy2c45uzf/xy4YZs0zdp3ufQlENx6vJaGorIvl7tPP/uRzQvjiloZ2m3iwt9YcINz1WPwFS5tJk29LlWC4J2LYqTMwWAlt3LLZodIQrYCwdIdJW7T82hfzQWCHXwKpw4TxvWNqqGOvBlCcWmVw6K7iq8FQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Q7M0RIEs; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Q7M0RIEs" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1786714720; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cs25WEdfvYuA2Y8Klql5aaljxZ6QkCST6kYh+ssuAik=; b=Q7M0RIEsawFTQ9nlhoBIQnw4j1lqM3U7BOX7nq5g0DDc3unEiy0jHJqVEz33O8Y6kWfBT8 Vrb+CsjWFjeNErOhdas5q85gjwheDWdDT4CPxBaAzgF+8ZggqiCHJhJd8LM8A1uTcZP6Et tYymenkBug7TwJF4YDCNJPF6ax5U5l8= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-391-LZWt30gdNrK5yUzl368vEQ-1; Fri, 14 Aug 2026 09:38:37 -0400 X-MC-Unique: LZWt30gdNrK5yUzl368vEQ-1 X-Mimecast-MFC-AGG-ID: LZWt30gdNrK5yUzl368vEQ_1786714716 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 602F11800848 for ; Fri, 14 Aug 2026 13:38:36 +0000 (UTC) Received: from gerbillo.redhat.com (unknown [10.44.48.145]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A1F0E18005BB for ; Fri, 14 Aug 2026 13:38:35 +0000 (UTC) From: Paolo Abeni To: mptcp@lists.linux.dev Subject: [PATCH resend mptcp-net 4/4] mptcp: do not reschedule the RTX timer for fallback sockets Date: Fri, 14 Aug 2026 15:38:23 +0200 Message-ID: <59c6c4dd41bb72b7aef984b14a0c6ad0881f6a4c.1786713351.git.pabeni@redhat.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 5BNFAYNJLLE7ZnpYH4dyIEFDQaF4dzpq4koNWXTEL4o_1786714716 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8"; x-default="true" On fallback socket the retrans timer is a quite convoluted no-op, but currently nothing prevents the MPTCP core to keep rescheduling it. Additionally gate RTX timer reset to the msk not being fallen back to TCP yet. To avoid adding multiple tests in fast-path, use a new flags bit for such condition. Fixes: b51f9b80c032 ("mptcp: introduce MPTCP retransmission timer") Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts (NGI0) --- In fact so convoluted that sashiko thinks otherwise. Sashiko: in case of fallback there could be a single active subflow; it can't become stale --- net/mptcp/protocol.c | 11 ++++++++--- net/mptcp/protocol.h | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index b311fe30c785..f22d64ab1c53 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -96,6 +96,7 @@ bool __mptcp_try_fallback(struct mptcp_sock *msk, int fb_= mib) =20 msk->allow_subflows =3D false; set_bit(MPTCP_FALLBACK_DONE, &msk->flags); + set_bit(MPTCP_RTX_DISABLED, &msk->flags); __MPTCP_INC_STATS(net, fb_mib); spin_unlock_bh(&msk->fallback_lock); return true; @@ -1121,13 +1122,14 @@ static bool mptcp_rtx_timer_pending(struct sock *sk) =20 static void mptcp_reset_rtx_timer(struct sock *sk) { + struct mptcp_sock *msk =3D mptcp_sk(sk); unsigned long tout; =20 - /* prevent rescheduling on close */ - if (unlikely(inet_sk_state_load(sk) =3D=3D TCP_CLOSE)) + /* Prevent rescheduling on close and in case of fallback. */ + if (test_bit(MPTCP_RTX_DISABLED, &msk->flags)) return; =20 - tout =3D mptcp_sk(sk)->timer_ival; + tout =3D msk->timer_ival; sk_reset_timer(sk, &sk->mptcp_retransmit_timer, jiffies + tout); } =20 @@ -3360,6 +3362,9 @@ void mptcp_set_state(struct sock *sk, int state) * transition from TCP_SYN_RECV to TCP_CLOSE_WAIT. */ break; + case TCP_CLOSE: + set_bit(MPTCP_RTX_DISABLED, &mptcp_sk(sk)->flags); + fallthrough; default: if (oldstate =3D=3D TCP_ESTABLISHED || oldstate =3D=3D TCP_CLOSE_WAIT) MPTCP_DEC_STATS(sock_net(sk), MPTCP_MIB_CURRESTAB); diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index 7e168e450fb0..f9300d644ff3 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -116,6 +116,7 @@ #define MPTCP_WORK_RTX 1 #define MPTCP_FALLBACK_DONE 2 #define MPTCP_WORK_CLOSE_SUBFLOW 3 +#define MPTCP_RTX_DISABLED 4 =20 /* MPTCP socket release cb flags */ #define MPTCP_PUSH_PENDING 1 --=20 2.55.0