From nobody Sat Aug 15 20:31:14 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 8CDF71EB5E3 for ; Wed, 12 Aug 2026 17:08:37 +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=1786554518; cv=none; b=usyODdUPah/LTwEbwnmS8TjLGXFkhXU6Rumn+BSCqGhupnfaEtkXOuLDzQdGS/kf5fRn1KscjgM8zE7wsysJMUX6acwIg5Zx+6Bi8oPiAzxALWuAzxL5W6/+npntCcCDbz/cJ+YZam9pnJrd6PFEl89CCBUOkDcmIbheBPGnt9c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786554518; c=relaxed/simple; bh=d8cwGVFd84R3sRf3QGbL+ZTKVfllRBG/KvtEndzphiQ=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:content-type; b=eNNBORe0Di6xb95fa9XsO4W8Wvxo9xUZ7iC1sOcD2ICs/fcc1LgIAN8KJARpPGmcaV17XpMMxGD2cv3yT5fEN+kh01rVT3vExohB8JjqOT4s/s+SSnhIpmRELDwsI+AAwaUGNP9ylhzOoaT8GRj3TxciQ4B0acTcJgu+s0KAHqU= 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=LI6WJbh1; 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="LI6WJbh1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1786554516; 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=PeKsFUb8JjkoQLAxa0Oj/id2+piQDNFZVZMf9yiNSII=; b=LI6WJbh1b3yXOKf4LOWVQdNX3ksSTzv1QeBXOAOG+4MUoD6Jh8nTFCs1arlM0MP8S0GWUK W2osjmznAtBRJlishnJQH2NV3PP0rL2nTteNFEs5XIFgodAFndxTStEV8Yc404qTF8nDf3 Lovl26VMPArt53Hf9deg6JG4lOqUkck= Received: from mx-prod-mc-01.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-148--W_Hb74HNLO8Wf9p2M0RTQ-1; Wed, 12 Aug 2026 13:08:25 -0400 X-MC-Unique: -W_Hb74HNLO8Wf9p2M0RTQ-1 X-Mimecast-MFC-AGG-ID: -W_Hb74HNLO8Wf9p2M0RTQ_1786554504 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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 705DA1956095 for ; Wed, 12 Aug 2026 17:08:24 +0000 (UTC) Received: from gerbillo.redhat.com (unknown [10.44.32.162]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A6A8A18005BC for ; Wed, 12 Aug 2026 17:08:23 +0000 (UTC) From: Paolo Abeni To: mptcp@lists.linux.dev Subject: [PATCH mptcp-net 1/4] mptcp: being below memory limit is a likely() condition Date: Wed, 12 Aug 2026 19:08:13 +0200 Message-ID: <93777494d7c03ae68a72357e95b4f54c49addb46.1786553006.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: KXULbzrvIa3HeWPgXhcEWPWk_9M9JDBXToNiRwjBvao_1786554504 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 --- net/mptcp/protocol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 68d766c0206e..f879b1061f2d 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -289,7 +289,7 @@ 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)) || + return likely(sk_rmem_alloc_get(sk) <=3D READ_ONCE(sk->sk_rcvbuf)) || __mptcp_check_fallback(mptcp_sk(sk)); } =20 --=20 2.55.0 From nobody Sat Aug 15 20:31:14 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 4F429470E85 for ; Wed, 12 Aug 2026 17:08:35 +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=1786554516; cv=none; b=C4ElQxtUJuiLFWJl/FP/3CHHq488vXBNMQad5zUhO24YAo9bigNrU7wXo11x5xZa//E/V9E1W42nKt/1WfKavRtESEwbcrQPCJhbLw7UZGTp3RS8shXf+4fh1jvNebzvjqXNcoteOBY5ClMrGwNHyo2p/eT3Q5c6s5Q/yfdm+2U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786554516; c=relaxed/simple; bh=7egbk8BdLZFVc917cZELEcTiUGItdOARMnlbr/mN4Bk=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:content-type; b=UPIxK2vaYIVYVrsHFT23h6B1h3QTlKK9eoUNyy+bAG2cZc5j2OuCa1dUDjjStRk/I7q2De1Fflvg/+3bNwjuQkzNwL0B80ImstET9cuyh5eJXtW6aaEHTHx/sXvyvi2TVpQN/lndLTyKcwzHD4XgquhD2dy0PG6UO/LuKGrFPlw= 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=RiA2+Rh+; 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="RiA2+Rh+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1786554514; 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=RiA2+Rh+6Vdrb8QGl01qgKWTPdMRC1q4whr0Vb+LQV4uCAj2QX9gHqw3XIXG9g8XMyWAsY rR9+5hMCiNs5Q5OCGHF1qM56YoHnSxWaLfkiKMcL1cPNGtS6SjO5O3rbo/KAlSQl+WoV3w hBmUYrrQJhbna3iSJvGQLOT0Cr1wvlo= Received: from mx-prod-mc-05.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-475-icAy_wB-N7-ur-v_4Svg9g-1; Wed, 12 Aug 2026 13:08:26 -0400 X-MC-Unique: icAy_wB-N7-ur-v_4Svg9g-1 X-Mimecast-MFC-AGG-ID: icAy_wB-N7-ur-v_4Svg9g_1786554506 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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C933619560B9 for ; Wed, 12 Aug 2026 17:08:25 +0000 (UTC) Received: from gerbillo.redhat.com (unknown [10.44.32.162]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 157DA180034C for ; Wed, 12 Aug 2026 17:08:24 +0000 (UTC) From: Paolo Abeni To: mptcp@lists.linux.dev Subject: [PATCH mptcp-net 2/4] mptcp: avoid pruning for OoW data Date: Wed, 12 Aug 2026 19:08:14 +0200 Message-ID: <1e1fa2d6fb756ab5a88a17c0d6e834f361cb9bdb.1786553006.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: TMtbP3dPdgtTSoGDA5wOpUIdcmvx5P9_eA4ch1Mmhm8_1786554506 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 --- 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:14 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 2D44E443E3F for ; Wed, 12 Aug 2026 17:08:30 +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=1786554513; cv=none; b=KJSfoAGcH+yr+yQYNbj9ofL/NOk+6XULx0/80TFz2moZeNyEG9a1lKQFFsYMUyraI1zDoKd1vt03dv4qtp90kGMLoE1JcIImh1pDmxBHn+UcOYIK6eXNH8H3jHNsAjcHpBPHDcJTGnwLUggaHHprrAzEn/kc3nMniGuQgaLqVuk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786554513; c=relaxed/simple; bh=QdUJVrae3iLDU2cucvAzDRbw2QHWGweqLEO0IeYwasU=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:content-type; b=nChc7BCOQcg46B2kqbb3Nyl++MmwGS27QAgJoWEc8axSneKXUQw7RXhUsWujFlZ7LKJqSzs5dyq1sz7G+9ttnRfYrQvqERmSAeywTkizw3lrPwGZl/Or8lMCvBoVV2nu5vWNFHwxo3ihw4TXdWKpVX0qhDFbz30JIPVxsFJEBRo= 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=Meq8mbFk; 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="Meq8mbFk" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1786554509; 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=XQWHzwPXlwM9juW6RadGEjhSY79VqqO39f0g+zuQP/o=; b=Meq8mbFk7CH91FHAy9olzULJB3FPODIEH5YJphJOJ/xeo0xEYiWtNrGHs5IwDE9tJg60wb r9dauEfARQ4OD0I9CoicULQ44tuNjcWKYNiWMyebnhsC6ZS8A9cDCxA+CQ55q1tQh7IfLc bI5GLTgOwf+yvlrx94oi2bySwmSaVIM= Received: from mx-prod-mc-01.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-116-XXa9D4F6O6up0E8-L8xMuQ-1; Wed, 12 Aug 2026 13:08:27 -0400 X-MC-Unique: XXa9D4F6O6up0E8-L8xMuQ-1 X-Mimecast-MFC-AGG-ID: XXa9D4F6O6up0E8-L8xMuQ_1786554507 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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 048521954B16 for ; Wed, 12 Aug 2026 17:08:27 +0000 (UTC) Received: from gerbillo.redhat.com (unknown [10.44.32.162]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4500A180034C for ; Wed, 12 Aug 2026 17:08:26 +0000 (UTC) From: Paolo Abeni To: mptcp@lists.linux.dev Subject: [PATCH mptcp-net 3/4] mptcp: remove unneeded READ_ONCE() annotation Date: Wed, 12 Aug 2026 19:08:15 +0200 Message-ID: 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: 29l22gKuxC6fKVVXXnzm8BXx44OYeLhePZdfWc5gH_c_1786554507 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 --- 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 97da22668dbe..11bad5670d06 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:14 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 0686447986C for ; Wed, 12 Aug 2026 17:08:31 +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=1786554514; cv=none; b=XR6Lkk8L0/A0TX1avPy0eEhPOZX/x6GKOctQMQ7nD1OukhmOojMId6fTIY4cF8B+1WhCNeelysHHQBrdLQ+Qly37oObhzlofdB/koOp7e0HIrwJFln27sKDZnAsTKO1Ugt6zXlzw3uO7TaECHKE4tn6LLtJeo4AQfPg2diwh/GI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786554514; c=relaxed/simple; bh=ADsFdpePGYXfBor74YWWVIDAGHMELG8aFyt4q070sz0=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:content-type; b=UhpimQLF1hHqRYtAQeVlDa7UOhsRAnrUKUWNpzHTuj1iRNSK88nl5ndv5M2yj02Cez/wGeFhzkV0YXBlM9eL02BrPnX0NCrh0O//ZBdan+b4wgSb2/Tah7RtiSlVZbuI4Le8YBn+GUEVcWYlrIX03xBOG4i2QPtu3U9Fg2zMHV8= 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=ZRLLWERa; 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="ZRLLWERa" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1786554510; 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=ZRLLWERao12fwUIlsk3xitbRQBtc5agkC4pCBepcxtU7CaTMtVXEyOikvBCwo1fmiG/ZJe WRlSB0IkCLxQQGj3YZzAtDamSY1NR5ceW34lyCTZCVuyN472texx6/Z9ZVQbRkkA2MyTFC liz/csidcAZlM+QB2kT4lZNmdYtMKP8= 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-111-50vVZ_tbNPiHlniLhKDsIg-1; Wed, 12 Aug 2026 13:08:29 -0400 X-MC-Unique: 50vVZ_tbNPiHlniLhKDsIg-1 X-Mimecast-MFC-AGG-ID: 50vVZ_tbNPiHlniLhKDsIg_1786554508 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 3F2D818002E8 for ; Wed, 12 Aug 2026 17:08:28 +0000 (UTC) Received: from gerbillo.redhat.com (unknown [10.44.32.162]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 74385180034F for ; Wed, 12 Aug 2026 17:08:27 +0000 (UTC) From: Paolo Abeni To: mptcp@lists.linux.dev Subject: [PATCH mptcp-net 4/4] mptcp: do not reschedule the RTX timer for fallback sockets Date: Wed, 12 Aug 2026 19:08:16 +0200 Message-ID: <517def06b272a22027775a60334f3f68347510ae.1786553006.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: 241loAVDrbP58Rf8o3PGwdar8JgPyEDAKaaUuHIm3ts_1786554508 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 --- 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