From nobody Wed Sep 17 16:15:15 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 00CD733EB15 for ; Tue, 9 Sep 2025 16:30:39 +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=1757435440; cv=none; b=KRMTFT/Y7pcwZYyf6q1aIpQzsfyRjxImvpB9RzIBpfFqhHvxsC3Z+CMpjQFT/51+ntRRNSi7OBYAe8uoqUW6mOwmV7VOm3KfeLNfFv4hHRz77asTsEekKWysuv70ffsfW8dzOKG4a8GZr8zjJMhiJNJ12PlnxU/cCbp6UvbJgRM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757435440; c=relaxed/simple; bh=BcW/DlHkbdeECwqh/GwccUSfJOwusgerG1DrZQ/WWfE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kC/3dcpzayUnr2M/E8pvB/nrgv2y/plFznZ4zhzWWRJkL7QkN2vIR92DwHfT4GNIuuvgACCDGv5Yn+hWN4jWrBPwY/+EXO+z8ku+kXEx5IOV1RT9Ny5OEfZml8MFLEN+coVkfFf3sD+qcnYzBEY5bmcbm6eNAO3RCR6sGHxaRI0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PNy+e207; 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="PNy+e207" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1EAFEC4CEF8; Tue, 9 Sep 2025 16:30:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757435439; bh=BcW/DlHkbdeECwqh/GwccUSfJOwusgerG1DrZQ/WWfE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=PNy+e207Tdsp+0NNkPGpsV0E206h8+weWhCGAt73c4MCokABag276Wdn8PZZXWUq/ MAbWxzNyv9m6sBxSVCZ+W4VXRNRME+N/4xoZilEDV3Gh2LXNHdrMPzZ8ivRie9iaAk 1muTKAgbeZr/ypYb0Ch9N26zG7TG/66NYOl0bVLLAkwRQG+zSqEJV15UVektQZbZDo uIH5A2+LIuvJ6zOHnpATLaRWidEfaHUmazUcy6adQ8yQzi5ROorV4qaemDNywEikm0 QnlpK47wYK+FeyPdqnBZB9bRffTdQ1EG5uJruHyfotE74ZcNhgvpb84Gu7Au5AEllw phWwZ/mXeAzLg== From: "Matthieu Baerts (NGI0)" Date: Tue, 09 Sep 2025 18:30:13 +0200 Subject: [PATCH mptcp-next 1/4] mptcp: pm: netlink: only add server-side attr when true Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250909-mptcp-pm-user-server-side-flag-v1-1-cb8e2b8d1c0c@kernel.org> References: <20250909-mptcp-pm-user-server-side-flag-v1-0-cb8e2b8d1c0c@kernel.org> In-Reply-To: <20250909-mptcp-pm-user-server-side-flag-v1-0-cb8e2b8d1c0c@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4089; i=matttbe@kernel.org; h=from:subject:message-id; bh=BcW/DlHkbdeECwqh/GwccUSfJOwusgerG1DrZQ/WWfE=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDIOhGkuc9MVtXCfNMUkS+l9JXPvOdOqWeqntD/+8Q5q/ ndc/sm8jlIWBjEuBlkxRRbptsj8mc+reEu8/Cxg5rAygQxh4OIUgIlssWNk+PS+6+jd6d6SHP/u MGu1qqWnLT/H8OLp+TCvL7Gi/3MD6xn+6TgvF3p1/qeFQe1hsxt+ja2y3ju0OFbNWjVr4XKzXRU FfAA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 This attribute is a boolean. No need to add it to set it to 'false'. Indeed, the default value when this attribute is not set is naturally 'false'. A few bytes can then be saved by not adding this attribute if the connection is not on the server side. This prepares the future deprecation of its attribute, in favour of a new flag. Signed-off-by: Matthieu Baerts (NGI0) --- Documentation/netlink/specs/mptcp_pm.yaml | 4 ++-- include/uapi/linux/mptcp_pm.h | 4 ++-- net/mptcp/pm_netlink.c | 4 +++- tools/testing/selftests/net/mptcp/userspace_pm.sh | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Documentation/netlink/specs/mptcp_pm.yaml b/Documentation/netl= ink/specs/mptcp_pm.yaml index d1b4829b580ad09baf4afd73b67abd7b4ef6883a..fc47a2931014c0304efd3215cc2= 4485ea22e1ede 100644 --- a/Documentation/netlink/specs/mptcp_pm.yaml +++ b/Documentation/netlink/specs/mptcp_pm.yaml @@ -28,13 +28,13 @@ definitions: traffic-patterns it can take a long time until the MPTCP_EVENT_ESTABLISHED is sent. Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6, spo= rt, - dport, server-side, [flags]. + dport, [server-side], [flags]. - name: established doc: >- A MPTCP connection is established (can start new subflows). Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6, spo= rt, - dport, server-side, [flags]. + dport, [server-side], [flags]. - name: closed doc: >- diff --git a/include/uapi/linux/mptcp_pm.h b/include/uapi/linux/mptcp_pm.h index 7359d34da446b94be148b363079120db03ba8549..bf44a5cf5b5a1e6d789632682a9= bedbf8090feb9 100644 --- a/include/uapi/linux/mptcp_pm.h +++ b/include/uapi/linux/mptcp_pm.h @@ -16,10 +16,10 @@ * good time to allocate memory and send ADD_ADDR if needed. Depending o= n the * traffic-patterns it can take a long time until the MPTCP_EVENT_ESTABL= ISHED * is sent. Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6, - * sport, dport, server-side, [flags]. + * sport, dport, [server-side], [flags]. * @MPTCP_EVENT_ESTABLISHED: A MPTCP connection is established (can start = new * subflows). Attributes: token, family, saddr4 | saddr6, daddr4 | daddr= 6, - * sport, dport, server-side, [flags]. + * sport, dport, [server-side], [flags]. * @MPTCP_EVENT_CLOSED: A MPTCP connection has stopped. Attribute: token. * @MPTCP_EVENT_ANNOUNCED: A new address has been announced by the peer. * Attributes: token, rem_id, family, daddr4 | daddr6 [, dport]. diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 483ddbb9ec406a3e965376ee5a833ae295896a02..33a6bf536c020b59717472aca2d= 38add26255419 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -413,7 +413,9 @@ static int mptcp_event_created(struct sk_buff *skb, if (err) return err; =20 - if (nla_put_u8(skb, MPTCP_ATTR_SERVER_SIDE, READ_ONCE(msk->pm.server_side= ))) + /* only set when it is the server side */ + if (READ_ONCE(msk->pm.server_side) && + nla_put_u8(skb, MPTCP_ATTR_SERVER_SIDE, 1)) return -EMSGSIZE; =20 if (READ_ONCE(msk->pm.remote_deny_join_id0)) diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/test= ing/selftests/net/mptcp/userspace_pm.sh index 0801d57a9710406a5942af742719f694e3907558..189bfc5bf86611575381542fe59= b86660f335294 100755 --- a/tools/testing/selftests/net/mptcp/userspace_pm.sh +++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh @@ -241,7 +241,7 @@ make_connection() =20 print_test "Established IP${is_v6} MPTCP Connection ns2 =3D> ns1" if [ "${client_token}" !=3D "" ] && [ "${server_token}" !=3D "" ] && - [ "${client_serverside}" =3D 0 ] && [ "${server_serverside}" =3D 1 ] && + [ "${client_serverside:-0}" =3D 0 ] && [ "${server_serverside:-0}" =3D= 1 ] && [ "${client_nojoin:-0}" =3D 1 ] && [ "${server_nojoin:-0}" =3D 0 ] then test_pass --=20 2.51.0 From nobody Wed Sep 17 16:15:15 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 9C8793D984 for ; Tue, 9 Sep 2025 16:30:40 +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=1757435441; cv=none; b=RCXOGWGnGaQvJuM+Xw8R8erzoOYjjUSkUM22KsOd6VVQshviHoAU60SoWBi7LHLnWFew4KtiLwTmSZT9iELopYPY0viFrLcX2k4aftMh/VKI1aJOCx6cbRX2RFRds7ArigPQ444VFJa5rmfdjfz2ZBQjHdWyWjXkbhob7Ic519Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757435441; c=relaxed/simple; bh=cRy72xvnkv5utd+tnwXzYt3aQFsFyahS9CQijmhm/H8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jn7u2Cxjj/aQnWG6++QvcJPgWVafDtZ20B1JSk6/xvGf6f6xpF1HXH1sZx6fSL+tL1kJMm+X79/nfrFzMX3x/srRLDAlcBVBh2fNK/88boEGMsv5Rt31FhJRSal0swTJffnoxXZJcWRNjCDftWX082el3ekwU68MNrXtBAipSNA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BCpHqRJD; 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="BCpHqRJD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F28E4C4CEF9; Tue, 9 Sep 2025 16:30:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757435440; bh=cRy72xvnkv5utd+tnwXzYt3aQFsFyahS9CQijmhm/H8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=BCpHqRJDU77As3oU+gPt1cMLD21S347G0qbNorU4fnTKPyCwXBVNazYQysI0kVAfM U6+A/WFAq3hOUbG+MySYIGM2jPI66PJuKGBVg7+/QpLatH9pyXX5rHhbsicw9BBdeh CRbph8jQv53KGybZ7wHV7ztkH0CTR8DEvNz9kzzwjLcUGFf1SxfZBkcOcjaapalqzZ kbsUbvke25S4avDYKI9hLicqU8gl4uIneC5jFVZC+CtQWCkibC8wBoFrSkmaK4dyYk RmV1pJds9qe9e7quX21K4BbiBeYD62MHmgCjjUbhNaF4n8KpooqzPINR6HuiRSfo6Y OvtqQKw0BkkCQ== From: "Matthieu Baerts (NGI0)" Date: Tue, 09 Sep 2025 18:30:14 +0200 Subject: [PATCH mptcp-next 2/4] mptcp: pm: netlink: announce server-side flag Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250909-mptcp-pm-user-server-side-flag-v1-2-cb8e2b8d1c0c@kernel.org> References: <20250909-mptcp-pm-user-server-side-flag-v1-0-cb8e2b8d1c0c@kernel.org> In-Reply-To: <20250909-mptcp-pm-user-server-side-flag-v1-0-cb8e2b8d1c0c@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1830; i=matttbe@kernel.org; h=from:subject:message-id; bh=cRy72xvnkv5utd+tnwXzYt3aQFsFyahS9CQijmhm/H8=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDIOhGllCCbwq3HrzXhQfETa0yu+1nZ76Ym13gsqO+X35 W8pzs7uKGVhEONikBVTZJFui8yf+byKt8TLzwJmDisTyBAGLk4BmEi3CyPD/63rzXarX+MtO/K2 WWHd3WOHpJmShZd8bJ688sLMCd80Ixn+CnAn5VdZP2B1Kum7cPLPfvfE4P5DB0X0pi+99Nj+4tx rHAA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Now that the 'flags' attribute is used, it seems interesting to add one flag for 'server-side', a boolean value. This is duplicating the info from the dedicated 'server-side' attribute, but it will be deprecated in the next commit, and removed in a few versions. Signed-off-by: Matthieu Baerts (NGI0) --- include/uapi/linux/mptcp.h | 1 + net/mptcp/pm_netlink.c | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/uapi/linux/mptcp.h b/include/uapi/linux/mptcp.h index 5fd5b4cf75ca1e0099e0effa351507d3ab002f1e..95d621f6d59810126cbc37b1d6b= af896a40dd9bc 100644 --- a/include/uapi/linux/mptcp.h +++ b/include/uapi/linux/mptcp.h @@ -32,6 +32,7 @@ #define MPTCP_INFO_FLAG_REMOTE_KEY_RECEIVED _BITUL(1) =20 #define MPTCP_PM_EV_FLAG_DENY_JOIN_ID0 _BITUL(0) +#define MPTCP_PM_EV_FLAG_SERVER_SIDE _BITUL(1) =20 #define MPTCP_PM_ADDR_FLAG_SIGNAL (1 << 0) #define MPTCP_PM_ADDR_FLAG_SUBFLOW (1 << 1) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 33a6bf536c020b59717472aca2d38add26255419..aa0c73faaa6acad3fd66ea09427= 26ecd4d0abcc0 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -413,10 +413,13 @@ static int mptcp_event_created(struct sk_buff *skb, if (err) return err; =20 - /* only set when it is the server side */ - if (READ_ONCE(msk->pm.server_side) && - nla_put_u8(skb, MPTCP_ATTR_SERVER_SIDE, 1)) - return -EMSGSIZE; + if (READ_ONCE(msk->pm.server_side)) { + flags |=3D MPTCP_PM_EV_FLAG_SERVER_SIDE; + + /* only set when it is the server side */ + if (nla_put_u8(skb, MPTCP_ATTR_SERVER_SIDE, 1)) + return -EMSGSIZE; + } =20 if (READ_ONCE(msk->pm.remote_deny_join_id0)) flags |=3D MPTCP_PM_EV_FLAG_DENY_JOIN_ID0; --=20 2.51.0 From nobody Wed Sep 17 16:15:15 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 9C8FA321F29 for ; Tue, 9 Sep 2025 16:30:41 +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=1757435441; cv=none; b=JqtMB97yqCKkShv6sk7KnvA9RhtTBwjuleqRzS8mtAJxAs+hjS5PKOz7C4LkLFvh65RSgv/BJZDBMfKjaG+IDlw6h+FCpw+icFk00uQzu/qEijveZiH6pfTzCRh7TZj8mWSzUUkzMxzdre/6ZrCH0WjSnVGJtAMnVuBA4uEA+o4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757435441; c=relaxed/simple; bh=h5EBAoL8c5IbJUS7ZPFt6K9TMF5J3+GeZFUnOK3HyM8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EKRINRqj9CE2G3K99eGAfjNJWosbI3EjLCwmvi/eJwa4gerkClXK65zipWiqAlyi5wTMcqoz9iJrRIQutbVhO7RVqaEjQ4LO5a3cS5E2j2niTqdPOx2BCfzxj2vESDDFM2XQ1KwIeJWz61bMTKSzt1zxml/xxulP1qSKksTeFM8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=a7tBNKoE; 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="a7tBNKoE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1ED3C4CEF4; Tue, 9 Sep 2025 16:30:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757435441; bh=h5EBAoL8c5IbJUS7ZPFt6K9TMF5J3+GeZFUnOK3HyM8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=a7tBNKoEpJnxdguZpYK00srEFox2H7dhm6IEMaiwB0U8vd49N3RiX+9eRP+VOe46q K3o9kL9+gles6glFvhPXZ2CHW+OtDgzCSaCu4OlrHI/DJPHnhsi7XLQwg+iZcmOmO3 mypoU3f7ujs7Z47CnuoEeOwTIc+Crj87CjscG14V5gRU9fDhoLyx3n49x1Q7o8syBN KLVd+BEQj41B4omCvKiNG+lpnzsJ00kWlk+J01ZmWiL1L/ClUNM0rzW8TIJHjpdfaM 6x5M2cMj/ez6QMu46ti0GhW6cG7N1uy1upaX5pK1Jr831Pl/Fsd3jaIiW7M9ibB9T0 5e15WPkGJE20A== From: "Matthieu Baerts (NGI0)" Date: Tue, 09 Sep 2025 18:30:15 +0200 Subject: [PATCH mptcp-next 3/4] mptcp: pm: netlink: deprecate server-side attribute Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250909-mptcp-pm-user-server-side-flag-v1-3-cb8e2b8d1c0c@kernel.org> References: <20250909-mptcp-pm-user-server-side-flag-v1-0-cb8e2b8d1c0c@kernel.org> In-Reply-To: <20250909-mptcp-pm-user-server-side-flag-v1-0-cb8e2b8d1c0c@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1413; i=matttbe@kernel.org; h=from:subject:message-id; bh=h5EBAoL8c5IbJUS7ZPFt6K9TMF5J3+GeZFUnOK3HyM8=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDIOhOkYXdq9PVdy96nuysnb2j5GZHAuOr0lVufKc24d4 Vh2WZ6zHaUsDGJcDLJiiizSbZH5M59X8ZZ4+VnAzGFlAhnCwMUpABNZ0cPIcIJLdM9CCZsnW7Jf 6nG91LTr2r7n5pe+y3a2kVGTpbqfuTH84Xv/yfO+3JV9KuLH5suJWu6tXZsUXKu8N3SZX8mFKeu vsAEA X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Now that such info is in the 'flags' attribute, it is time to deprecate the dedicated 'server-side' attribute. It will be removed in a few versions. Signed-off-by: Matthieu Baerts (NGI0) --- Documentation/netlink/specs/mptcp_pm.yaml | 1 + net/mptcp/pm_netlink.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/netlink/specs/mptcp_pm.yaml b/Documentation/netl= ink/specs/mptcp_pm.yaml index fc47a2931014c0304efd3215cc24485ea22e1ede..ba30a40b9dbf2d2d4f25cc07b30= 9ea560712f65e 100644 --- a/Documentation/netlink/specs/mptcp_pm.yaml +++ b/Documentation/netlink/specs/mptcp_pm.yaml @@ -266,6 +266,7 @@ attribute-sets: - name: server-side type: u8 + doc: "Deprecated: use 'flags'" =20 operations: list: diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index aa0c73faaa6acad3fd66ea0942726ecd4d0abcc0..d5b383870f79956ce5e10bf3846= 95621604f3ce9 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -416,7 +416,7 @@ static int mptcp_event_created(struct sk_buff *skb, if (READ_ONCE(msk->pm.server_side)) { flags |=3D MPTCP_PM_EV_FLAG_SERVER_SIDE; =20 - /* only set when it is the server side */ + /* Deprecated, and only set when it is the server side */ if (nla_put_u8(skb, MPTCP_ATTR_SERVER_SIDE, 1)) return -EMSGSIZE; } --=20 2.51.0 From nobody Wed Sep 17 16:15:15 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 961003D984 for ; Tue, 9 Sep 2025 16:30:42 +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=1757435442; cv=none; b=kHAZhb8hW7kyPwcurCIFKRTZGm7aRaaW5AUz0LdgsCJhqBusb/JehmkU+9FWctwn8QxET01OYkuJpf65gHdss3J13mNhEWvLyyYqFvhYsZQUUICSQZKTWJPVVhchwqo2aETqvhQxXh651T+MjSWp/0H4yeNJYtYqcp8/jlpost0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757435442; c=relaxed/simple; bh=TMOFE5nuTKyPJ8OJFYpeW0rNQZRbN40e/gGdyr60250=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ErD+dGk3PA9QQoW/rQdJZGRAv5xHjJUQnS344C+BLQPCKXP8BMFROKH8Rl9YU/p2cztmmEy1Pts7JP/Ii1ktIe57skHV32vM5ncPz6vkP92XYzwcV7cw6J5XK4vo9dS03nXZDGLUHm+bQu8NIDoWlMVsALeMjaCD4hG6bmyWOEI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hsQIYUUg; 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="hsQIYUUg" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1ADFC4CEF8; Tue, 9 Sep 2025 16:30:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757435442; bh=TMOFE5nuTKyPJ8OJFYpeW0rNQZRbN40e/gGdyr60250=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=hsQIYUUgJVkbrQFWO7TqzIUg5rXoANY4h+XGlhoOATCRswtmP0sCPcB5n3SYeR/sL XELIieou4gSwnrrJ2O2iz7soiTgzSEq2nzYPLNx48y66JX4Pa909giWKbxIZotrRiv LVl/0nRRfuYAd006JHKatiYNZytiyxRRGYJa6CqAZAfoLzYsdG0QtzM3Hxelxxc50f 5IFrHDPdMRk31hdrRgk7EbQxet+0nV7kF56dohKnDjodukSW6syBqDIoF+OxxVPHUj wsOgvOJWW3SBmSvGVD7HzqFaIRRo2YkNFOIsQXqhJQwWfluHjsPoFDqyqiQuuXLc/m ihFCHclRvxbig== From: "Matthieu Baerts (NGI0)" Date: Tue, 09 Sep 2025 18:30:16 +0200 Subject: [PATCH mptcp-next 4/4] selftests: mptcp: pm: get server-side flag Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250909-mptcp-pm-user-server-side-flag-v1-4-cb8e2b8d1c0c@kernel.org> References: <20250909-mptcp-pm-user-server-side-flag-v1-0-cb8e2b8d1c0c@kernel.org> In-Reply-To: <20250909-mptcp-pm-user-server-side-flag-v1-0-cb8e2b8d1c0c@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2068; i=matttbe@kernel.org; h=from:subject:message-id; bh=TMOFE5nuTKyPJ8OJFYpeW0rNQZRbN40e/gGdyr60250=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDIOhOmetJ0tY7Lb/H5w3MJ/eVs/2lesvnFE2cNV6K5Zy 2Xf+0x1HaUsDGJcDLJiiizSbZH5M59X8ZZ4+VnAzGFlAhnCwMUpABPRSWb4Z7xqYd7JuRbn9jIx p+dI2E1/wRz/dn5v5bLIC7ynN//iNWVkmLQpVn+vWeLVza6525bMal12Pnnz8U7nzb8CtuRr69Q c4wYA X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 server-side info linked to the MPTCP connect/established events can now come from the flags, in addition to the dedicated attribute. The attribute is now deprecated -- in favour of the new flag, and will be removed later on. Print this info only once. Signed-off-by: Matthieu Baerts (NGI0) Reviewed-by: Geliang Tang --- tools/testing/selftests/net/mptcp/pm_nl_ctl.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/mptcp/pm_nl_ctl.c b/tools/testing/= selftests/net/mptcp/pm_nl_ctl.c index 93fea3442216c8fef43731a99c1d5710f234b150..d4981b76693bbddca74169437a5= 40ad6294cf1d5 100644 --- a/tools/testing/selftests/net/mptcp/pm_nl_ctl.c +++ b/tools/testing/selftests/net/mptcp/pm_nl_ctl.c @@ -2,6 +2,7 @@ =20 #include #include +#include #include #include #include @@ -113,6 +114,8 @@ static int capture_events(int fd, int event_group) error(1, errno, "could not join the " MPTCP_PM_EV_GRP_NAME " mcast group= "); =20 do { + bool server_side =3D false; + FD_ZERO(&rfds); FD_SET(fd, &rfds); res_len =3D NLMSG_ALIGN(sizeof(struct nlmsghdr)) + @@ -187,18 +190,22 @@ static int capture_events(int fd, int event_group) else if (attrs->rta_type =3D=3D MPTCP_ATTR_ERROR) fprintf(stderr, ",error:%u", *(__u8 *)RTA_DATA(attrs)); else if (attrs->rta_type =3D=3D MPTCP_ATTR_SERVER_SIDE) - fprintf(stderr, ",server_side:%u", *(__u8 *)RTA_DATA(attrs)); + server_side =3D !!*(__u8 *)RTA_DATA(attrs); else if (attrs->rta_type =3D=3D MPTCP_ATTR_FLAGS) { __u16 flags =3D *(__u16 *)RTA_DATA(attrs); =20 /* only print when present, easier */ if (flags & MPTCP_PM_EV_FLAG_DENY_JOIN_ID0) fprintf(stderr, ",deny_join_id0:1"); + if (flags & MPTCP_PM_EV_FLAG_SERVER_SIDE) + server_side =3D true; } =20 attrs =3D RTA_NEXT(attrs, msg_len); } } + if (server_side) + fprintf(stderr, ",server_side:1"); fprintf(stderr, "\n"); } while (1); =20 --=20 2.51.0