From nobody Sat May 10 07:53:56 2025
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 A20A61369AE;
	Mon, 12 Aug 2024 12:38:55 +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=1723466335; cv=none;
 b=VTXx0IvmOfvXY2h+fYsC8peEC3mEG7A2NLT0cnIai5CVVsGCc8PcmywjwwpAeu8cxjXE5aEWtlnNXUQ8fmavdc70s38skfggLdOHBb7CkJQIaiAbljTHF26eM8WvNEba8LBgVmioxEYlCHeW83IKmpkUjPSpYC5rlCX5vWcUNoY=
ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1723466335; c=relaxed/simple;
	bh=N10imcpJltWY6M0l9tiDIDXF3aiJlPYIbpj9ckAbJ7c=;
	h=Subject:To:Cc:From:Date:In-Reply-To:Message-ID:MIME-Version:
	 Content-Type;
 b=KqEPNHfrV2KXIymYYCfRG4SGaBW/xMS02WCmxJbb++7r2Rx3AYrZxroOeDOox4ywjpOkCLOrNnNg+0A6QWsNPZIXJ1t2h2TG/z6/51lcyzH93Rss/BFjoecJp3zhbTncabK3dEHBBfLiGrxPMclpGNW0jye1PdlmSPguUZeYIHU=
ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
 dkim=pass (1024-bit key) header.d=linuxfoundation.org
 header.i=@linuxfoundation.org header.b=NSA/uum0;
 arc=none smtp.client-ip=10.30.226.201
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=linuxfoundation.org
 header.i=@linuxfoundation.org header.b="NSA/uum0"
Received: by smtp.kernel.org (Postfix) with ESMTPSA id AEF59C32782;
	Mon, 12 Aug 2024 12:38:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org;
	s=korg; t=1723466335;
	bh=N10imcpJltWY6M0l9tiDIDXF3aiJlPYIbpj9ckAbJ7c=;
	h=Subject:To:Cc:From:Date:In-Reply-To:From;
	b=NSA/uum0T1+xbr6gA70wEfgI44cw4va1Axi0LbeNXCecoH1tG0mmdRiZJ3bGIkhWR
	 i/tA/lQa7dhXKl+sivQHtUwP6Fs2QKi1sQuxs4kJQqmOEyY1QRJsJ/XaOEL3VvwT3S
	 e7/b/chxqDKl5JxUzSh2K15j/60o+o9OSYGfGY5Y=
Subject: Patch "mptcp: sched: check both directions for backup" has been added
 to the 5.15-stable tree
To: 
 gregkh@linuxfoundation.org,martineau@kernel.org,matttbe@kernel.org,mptcp@lists.linux.dev,pabeni@redhat.com
Cc: <stable-commits@vger.kernel.org>
From: <gregkh@linuxfoundation.org>
Date: Mon, 12 Aug 2024 14:38:29 +0200
In-Reply-To: <20240809090530.2696742-2-matttbe@kernel.org>
Message-ID: <2024081229-snorkel-frisk-f2e7@gregkh>
Precedence: bulk
X-Mailing-List: mptcp@lists.linux.dev
List-Id: <mptcp.lists.linux.dev>
List-Subscribe: <mailto:mptcp+subscribe@lists.linux.dev>
List-Unsubscribe: <mailto:mptcp+unsubscribe@lists.linux.dev>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
X-stable: commit
X-Patchwork-Hint: ignore 
Content-Type: text/plain; charset="utf-8"


This is a note to let you know that I've just added the patch titled

    mptcp: sched: check both directions for backup

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=3Dlinux/kernel/git/stable/stable-queue.git=
;a=3Dsummary

The filename of the patch is:
     mptcp-sched-check-both-directions-for-backup.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


From matttbe@kernel.org Fri Aug  9 11:05:44 2024
From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
Date: Fri,  9 Aug 2024 11:05:31 +0200
Subject: mptcp: sched: check both directions for backup
To: stable@vger.kernel.org, gregkh@linuxfoundation.org
Cc: MPTCP Upstream <mptcp@lists.linux.dev>, "Matthieu Baerts (NGI0)" <mattt=
be@kernel.org>, Mat Martineau <martineau@kernel.org>, Paolo Abeni <pabeni@r=
edhat.com>
Message-ID: <20240809090530.2696742-2-matttbe@kernel.org>

From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>

commit b6a66e521a2032f7fcba2af5a9bcbaeaa19b7ca3 upstream.

The 'mptcp_subflow_context' structure has two items related to the
backup flags:

 - 'backup': the subflow has been marked as backup by the other peer

 - 'request_bkup': the backup flag has been set by the host

Before this patch, the scheduler was only looking at the 'backup' flag.
That can make sense in some cases, but it looks like that's not what we
wanted for the general use, because either the path-manager was setting
both of them when sending an MP_PRIO, or the receiver was duplicating
the 'backup' flag in the subflow request.

Note that the use of these two flags in the path-manager are going to be
fixed in the next commits, but this change here is needed not to modify
the behaviour.

Fixes: f296234c98a8 ("mptcp: Add handling of incoming MP_JOIN requests")
Cc: stable@vger.kernel.org
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
[ Conflicts in protocol.c, because the context has changed in commit
  3ce0852c86b9 ("mptcp: enforce HoL-blocking estimation"), which is not
  in this version. This commit is unrelated to this modification. ]
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 include/trace/events/mptcp.h |    2 +-
 net/mptcp/protocol.c         |   10 ++++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

--- a/include/trace/events/mptcp.h
+++ b/include/trace/events/mptcp.h
@@ -34,7 +34,7 @@ TRACE_EVENT(mptcp_subflow_get_send,
 		struct sock *ssk;
=20
 		__entry->active =3D mptcp_subflow_active(subflow);
-		__entry->backup =3D subflow->backup;
+		__entry->backup =3D subflow->backup || subflow->request_bkup;
=20
 		if (subflow->tcp_sock && sk_fullsock(subflow->tcp_sock))
 			__entry->free =3D sk_stream_memory_free(subflow->tcp_sock);
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -1514,13 +1514,15 @@ static struct sock *mptcp_subflow_get_se
 		send_info[i].ratio =3D -1;
 	}
 	mptcp_for_each_subflow(msk, subflow) {
+		bool backup =3D subflow->backup || subflow->request_bkup;
+
 		trace_mptcp_subflow_get_send(subflow);
 		ssk =3D  mptcp_subflow_tcp_sock(subflow);
 		if (!mptcp_subflow_active(subflow))
 			continue;
=20
 		tout =3D max(tout, mptcp_timeout_from_subflow(subflow));
-		nr_active +=3D !subflow->backup;
+		nr_active +=3D !backup;
 		if (!sk_stream_memory_free(subflow->tcp_sock) || !tcp_sk(ssk)->snd_wnd)
 			continue;
=20
@@ -1530,9 +1532,9 @@ static struct sock *mptcp_subflow_get_se
=20
 		ratio =3D div_u64((u64)READ_ONCE(ssk->sk_wmem_queued) << 32,
 				pace);
-		if (ratio < send_info[subflow->backup].ratio) {
-			send_info[subflow->backup].ssk =3D ssk;
-			send_info[subflow->backup].ratio =3D ratio;
+		if (ratio < send_info[backup].ratio) {
+			send_info[backup].ssk =3D ssk;
+			send_info[backup].ratio =3D ratio;
 		}
 	}
 	__mptcp_set_timeout(sk, tout);


Patches currently in stable-queue which might be from matttbe@kernel.org are

queue-5.15/mptcp-fix-nl-pm-announced-address-accounting.patch
queue-5.15/mptcp-distinguish-rcv-vs-sent-backup-flag-in-requests.patch
queue-5.15/mptcp-pm-fix-backup-support-in-signal-endpoints.patch
queue-5.15/mptcp-mib-count-mpj-with-backup-flag.patch
queue-5.15/selftests-mptcp-join-check-backup-support-in-signal-endp.patch
queue-5.15/selftests-mptcp-join-validate-backup-in-mpj.patch
queue-5.15/mptcp-sched-check-both-directions-for-backup.patch
queue-5.15/mptcp-export-local_address.patch
queue-5.15/mptcp-pm-only-set-request_bkup-flag-when-sending-mp_prio.patch
queue-5.15/mptcp-fix-bad-rcvpruned-mib-accounting.patch
queue-5.15/mptcp-fix-duplicate-data-handling.patch