From nobody Fri Nov 22 01:08:20 2024 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 54BD0198E9B; Mon, 26 Aug 2024 17:11:31 +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=1724692292; cv=none; b=oEbFUVyszBHaa2UHHlH4ER/+HLZoVINCCuRpyWLjiBDmK5mRUgx2f+lDC+kf4Y5yXVX8PAuAc5FhdOEuINHAWue2nLrG64BsU3mYB6TN5B80mYv8izazSwF7AbgSXyfkjk075uR7la2d78zr7D75I9lMlTn9wfy0kaJUxJr6HQE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724692292; c=relaxed/simple; bh=uPaLfJPaEp4yYYl1GfXkjcisrWrVxL/OYXKY3CfhqIA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fldmj6rxtSkP7vTXtFN6kU2kjKdIScOMurpbX0nfVgm4c/2I1lKGtw+8Vdo9MzYk4MOnppBrrwFpitDe0dL0Dxn9Fdexco8CSiDSftHrceUNDZRUVLvGViFP+7UZEmPmgHxA8DGkzBnvFZUJD7QJ9maTQmIgcwYSRzKtlR4ReqI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rjKnMw9s; 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="rjKnMw9s" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17A16C58303; Mon, 26 Aug 2024 17:11:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1724692291; bh=uPaLfJPaEp4yYYl1GfXkjcisrWrVxL/OYXKY3CfhqIA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=rjKnMw9sv7+SLLX7ne2jy446QK1GyqaDL4fFoeFb636G8HBve/BQdBzTh1THrpPS3 JttqVqZZmmfsbjfnmQUfyboNi8N61/qNO7JSo/5f5+utpkrPHfagMUuKEvENf8NwYh rAJo1qSjGzeyjJj8ynJQDCTWuRI1d8SFDkgx64ZisQDB9l/1IziWXjo2SELTUfRRjD jkkJgzAAeBSqmtVMSgBgSOyRybl2Fs743bOUtw2xr7ykRpRTv1yZygl3tNRzd0XM9L 1O7SZNAuno8M85Txk2dQuvsSIR67SnmiaD7GA7lRGF0EZOl8kIp0J6GN+t+7nwN+J2 2ZfKT8VFHThzA== From: "Matthieu Baerts (NGI0)" Date: Mon, 26 Aug 2024 19:11:18 +0200 Subject: [PATCH net 1/4] mptcp: close subflow when receiving TCP+FIN Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240826-net-mptcp-close-extra-sf-fin-v1-1-905199fe1172@kernel.org> References: <20240826-net-mptcp-close-extra-sf-fin-v1-0-905199fe1172@kernel.org> In-Reply-To: <20240826-net-mptcp-close-extra-sf-fin-v1-0-905199fe1172@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Florian Westphal , Shuah Khan Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" , stable@vger.kernel.org X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=3238; i=matttbe@kernel.org; h=from:subject:message-id; bh=uPaLfJPaEp4yYYl1GfXkjcisrWrVxL/OYXKY3CfhqIA=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBmzLc9BjejeVADHn/nVZgfUVq+csnwsBdmSgjOf G4lsPZ9s3mJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZsy3PQAKCRD2t4JPQmmg c71oD/41Mkc2JWFNwd5xlqySH9gLJKYonnRBPFmfWxJFbSv1rSYBo4BvIweGJxduW2AOJmBqSMC EraQufQ3w0GZVQgxxUX/UL8akrEfB21alzp46Jv1r47W5CjjoLW3Slp8/RNzZiiFiWIW7D0NsTh HLulQMIObT9IrTV2ZO4nQfCkuag5wkE54o5RW0Sl5dESQqL7kvqpLwMoD8qJjbwtJyuUDlSG86k 3rDoJFiLohDF+CrvDa8nii/ZwvCT6ba4cDm39eUvWUw4lZe9j4iVzORf+gCd+f71DmEE7VEjHqs Vj9x8r4Bqqmf1pHMcNgQoz13zyUWemVjMhRRZ1DqGJjw4aSYsbB4dBwT0T8SClRQc3YHFx3J+hd W69a6bHXlPxyzXm7Us6OnK0dcrKB4s16F6EQQk2h0D/Qykq9Bl4Fh27sVA6p0yf+VdIfriYIBTI NYPpwTG5nt3ND8KIGsvRKpACgysQcOJi/5wxUlfEzYuINMglGrluF8im7jtOGiIaKj5dzfhmRIT mKkdakLkVHywyKxAgB9qOyA1tPT9lJUJ4Y5MUpU4wowrnpfpqm8vDom66P5XeSkpxc56wDPfQ1e n4GEmmQo3++raOPqra4qKfzAcl2tdE71SH5s6ujs5yydXxNXGRTtd6/OY9e/XjDyiB2o9p0FRxZ 7YcqyfSQ/MGFsJw== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 When a peer decides to close one subflow in the middle of a connection having multiple subflows, the receiver of the first FIN should accept that, and close the subflow on its side as well. If not, the subflow will stay half closed, and would even continue to be used until the end of the MPTCP connection or a reset from the network. The issue has not been seen before, probably because the in-kernel path-manager always sends a RM_ADDR before closing the subflow. Upon the reception of this RM_ADDR, the other peer will initiate the closure on its side as well. On the other hand, if the RM_ADDR is lost, or if the path-manager of the other peer only closes the subflow without sending a RM_ADDR, the subflow would switch to TCP_CLOSE_WAIT, but that's it, leaving the subflow half-closed. So now, when the subflow switches to the TCP_CLOSE_WAIT state, and if the MPTCP connection has not been closed before with a DATA_FIN, the kernel owning the subflow schedules its worker to initiate the closure on its side as well. This issue can be easily reproduced with packetdrill, as visible in [1], by creating an additional subflow, injecting a FIN+ACK before sending the DATA_FIN, and expecting a FIN+ACK in return. Fixes: 40947e13997a ("mptcp: schedule worker when subflow is closed") Cc: stable@vger.kernel.org Link: https://github.com/multipath-tcp/packetdrill/pull/154 [1] Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/protocol.c | 5 ++++- net/mptcp/subflow.c | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 0d536b183a6c..151e82e2ff2e 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -2533,8 +2533,11 @@ static void __mptcp_close_subflow(struct sock *sk) =20 mptcp_for_each_subflow_safe(msk, subflow, tmp) { struct sock *ssk =3D mptcp_subflow_tcp_sock(subflow); + int ssk_state =3D inet_sk_state_load(ssk); =20 - if (inet_sk_state_load(ssk) !=3D TCP_CLOSE) + if (ssk_state !=3D TCP_CLOSE && + (ssk_state !=3D TCP_CLOSE_WAIT || + inet_sk_state_load(sk) !=3D TCP_ESTABLISHED)) continue; =20 /* 'subflow_data_ready' will re-sched once rx queue is empty */ diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index a21c712350c3..4834e7fc2fb6 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -1255,12 +1255,16 @@ static void mptcp_subflow_discard_data(struct sock = *ssk, struct sk_buff *skb, /* sched mptcp worker to remove the subflow if no more data is pending */ static void subflow_sched_work_if_closed(struct mptcp_sock *msk, struct so= ck *ssk) { - if (likely(ssk->sk_state !=3D TCP_CLOSE)) + struct sock *sk =3D (struct sock *)msk; + + if (likely(ssk->sk_state !=3D TCP_CLOSE && + (ssk->sk_state !=3D TCP_CLOSE_WAIT || + inet_sk_state_load(sk) !=3D TCP_ESTABLISHED))) return; =20 if (skb_queue_empty(&ssk->sk_receive_queue) && !test_and_set_bit(MPTCP_WORK_CLOSE_SUBFLOW, &msk->flags)) - mptcp_schedule_work((struct sock *)msk); + mptcp_schedule_work(sk); } =20 static bool subflow_can_fallback(struct mptcp_subflow_context *subflow) --=20 2.45.2 From nobody Fri Nov 22 01:08:20 2024 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 7675F1991B9; Mon, 26 Aug 2024 17:11:35 +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=1724692295; cv=none; b=Nm1TjzO4xIzJjk9SGggwGKUafx9v9XDFEN3lhkRdxCRwYVPrx4f1uokR0nFfPWxK05YPL56MAdrkSYQPcM2vpFOnZ9JABm+WfwxCtvIsOjOTcHh7m09edZ5hvYFCKKYpjFMZk5KrDIXANdGmLoJuBrAsP/eqSZNnOT20TUkeEkY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724692295; c=relaxed/simple; bh=jM9ElsHiORy4UPEWXddjuz+CPs1GjQevojAyK+2aOA4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=u/OrnWMFxyFSAS4t2A4dqigfzM5tOo+KgoN1smNQi0EDrSpTc8ao6IuOzceXaqZHmdAnfbPiQIX6FXFRqNyxH8q8um336EwHIGoICscSjU2E6v1VOpCuASx0MhRoqfDro0/orGBv73LxgswqtVQYkG9x8WKAScVU5lHyjl3KYnM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Lv7ZUg7e; 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="Lv7ZUg7e" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 433D0C5E887; Mon, 26 Aug 2024 17:11:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1724692295; bh=jM9ElsHiORy4UPEWXddjuz+CPs1GjQevojAyK+2aOA4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Lv7ZUg7eh+ag07GQBKxnIJWmAYS9UrukdhCx46AV5z+wVC/1YNNy/ne/yXl8+oOB9 DdNoh2jSdUPF0/hrftwsBokHEKefluIcr1NBugV4aWXw+0tf+HkHXxsq3mjILRJWXJ 2R2axHTnuzsx2l7F2PRYQsKlhtIMoYNCvwXI8KLyHgNDwgBm/On8vZbP0z2+9UiClp oIEIrSTpUVg8xePFJoU7ALQJVpLSvzOd49GxgtH0iWeSasEMFCWsCNjIxYJg6zMtHx KC7My+WDKcGGnVUkiZWYypuiWFoX8w1ZmnNjgIPaC/eOXC9Fbztv6urguhTauwKLK4 pHiFGgv/UW08g== From: "Matthieu Baerts (NGI0)" Date: Mon, 26 Aug 2024 19:11:19 +0200 Subject: [PATCH net 2/4] selftests: mptcp: join: cannot rm sf if closed Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240826-net-mptcp-close-extra-sf-fin-v1-2-905199fe1172@kernel.org> References: <20240826-net-mptcp-close-extra-sf-fin-v1-0-905199fe1172@kernel.org> In-Reply-To: <20240826-net-mptcp-close-extra-sf-fin-v1-0-905199fe1172@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Florian Westphal , Shuah Khan Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" , stable@vger.kernel.org X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=3315; i=matttbe@kernel.org; h=from:subject:message-id; bh=jM9ElsHiORy4UPEWXddjuz+CPs1GjQevojAyK+2aOA4=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBmzLc9F7awKeAmslyzxTPhiypDGkK58rFVdMVFT vwwm3doq6WJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZsy3PQAKCRD2t4JPQmmg c0ypD/9XXjlgmIXuw0Ga5bZiH/QSbPv+s67sBTRXfNEFpZn4XuBHVAmNOHMUQlERDmds7766o9O fAdvtbMEvBWVR5TveVGAodEXuvAqAKK8vrsWeC45fA9XcY/Ze7GbZ682EKJd/PfJxcQteUPDJ8A vNZ68hKIO5whpdjiriW62iuWCqFOyIockgpqOmSdHnIm0F0Bfh1KlpZT2hP85mhnoPT5p+/X2h/ wjGCiYkIL++EVqg1ly3/u1VB6pGb7ChejdVIvQy2mANJCicH3faIbCYdPzAMawjKXwS1PktCKlx oEuy5Mvx70244ePN2X1+i7GpdpmYRdR2Bamamj+0zGO23+ZMIRNERU9qOdbextsRmhpBhy/NYA5 yjrMbQrSRLs/JFsgQfQDFz48OkNrgAEXud1mK7pLTGyCuoJGfM2x8Envprqs8BacvgO2o2hmdJ2 J9ItOIYalwE9/Y7DBmSyBkfT6F2MyHHFi7Venw0Y3CtfYV5RgVZ+dKcCGcJcZU/2OAp3UC2x8Lx rmYOx9/YCEl/f6YhjoIEi20TYu5Q8recCpmtJ7GHCchI5KzLPBgyqU3O6Q2KPXzeYYBYZ5COti4 Gu4RaBoXWTlIvevv6WcoDWEyy1krxmZaHjV5mH/R7c4cOc/u1qcWK6lACR+6OlSyhRReX5d0mzr aoDTr6ItvcyYewQ== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Thanks to the previous commit, the MPTCP subflows are now closed on both directions even when only the MPTCP path-manager of one peer asks for their closure. In the two tests modified here -- "userspace pm add & remove address" and "userspace pm create destroy subflow" -- one peer is controlled by the userspace PM, and the other one by the in-kernel PM. When the userspace PM sends a RM_ADDR notification, the in-kernel PM will automatically react by closing all subflows using this address. Now, thanks to the previous commit, the subflows are properly closed on both directions, the userspace PM can then no longer closes the same subflows if they are already closed. Before, it was OK to do that, because the subflows were still half-opened, still OK to send a RM_ADDR. In other words, thanks to the previous commit closing the subflows, an error will be returned to the userspace if it tries to close a subflow that has already been closed. So no need to run this command, which mean that the linked counters will then not be incremented. These tests are then no longer sending both a RM_ADDR, then closing the linked subflow just after. The test with the userspace PM on the server side is now removing one subflow linked to one address, then sending a RM_ADDR for another address. The test with the userspace PM on the client side is now only removing the subflow that was previously created. Fixes: 4369c198e599 ("selftests: mptcp: test userspace pm out of transfer") Cc: stable@vger.kernel.org Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index 89e553e0e0c2..264040a760c6 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3429,14 +3429,12 @@ userspace_tests() "signal" userspace_pm_chk_get_addr "${ns1}" "10" "id 10 flags signal 10.0.2.1" userspace_pm_chk_get_addr "${ns1}" "20" "id 20 flags signal 10.0.3.1" - userspace_pm_rm_addr $ns1 10 userspace_pm_rm_sf $ns1 "::ffff:10.0.2.1" $MPTCP_LIB_EVENT_SUB_ESTABLISH= ED userspace_pm_chk_dump_addr "${ns1}" \ - "id 20 flags signal 10.0.3.1" "after rm_addr 10" + "id 20 flags signal 10.0.3.1" "after rm_sf 10" userspace_pm_rm_addr $ns1 20 - userspace_pm_rm_sf $ns1 10.0.3.1 $MPTCP_LIB_EVENT_SUB_ESTABLISHED userspace_pm_chk_dump_addr "${ns1}" "" "after rm_addr 20" - chk_rm_nr 2 2 invert + chk_rm_nr 1 1 invert chk_mptcp_info subflows 0 subflows 0 chk_subflows_total 1 1 kill_events_pids @@ -3460,12 +3458,11 @@ userspace_tests() "id 20 flags subflow 10.0.3.2" \ "subflow" userspace_pm_chk_get_addr "${ns2}" "20" "id 20 flags subflow 10.0.3.2" - userspace_pm_rm_addr $ns2 20 userspace_pm_rm_sf $ns2 10.0.3.2 $MPTCP_LIB_EVENT_SUB_ESTABLISHED userspace_pm_chk_dump_addr "${ns2}" \ "" \ - "after rm_addr 20" - chk_rm_nr 1 1 + "after rm_sf 20" + chk_rm_nr 0 1 chk_mptcp_info subflows 0 subflows 0 chk_subflows_total 1 1 kill_events_pids --=20 2.45.2 From nobody Fri Nov 22 01:08:20 2024 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 90B9C19922D; Mon, 26 Aug 2024 17:11:38 +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=1724692298; cv=none; b=pU0k6Y3QfteZUDeWbiV0YV/FrUfrPGBgUJ+U7o+nK1sjOEiCARINtbdUK1hlq45I4amNf5hWdLzQdV52qefOXUIxZ6xsnCI50BpQ1Yc3TxhYMMM4JHiw+CnkBVSKcPjYR9ZSSnjS3StM9jmwSqaNZhIuTVewfDbnc0SUHDbUdHA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724692298; c=relaxed/simple; bh=6NiB15fQCRB/0hRYTV+4kq369qwgSUxD5vrznyR2mH0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=M1VmggVpeAPygEylFtHtp7behCD4b6J5tFOfh44nPPPxf/e1J+3viyImNhZ6Uk7rYYKtnrESnmnLnJzsEMCgrqlCgrq4TSmkbezG2RD3zcFY3YQBDusLN3MpYuVKZXFX1+60F7H3Jw7KmfLnNqqGRmUo3IUpCuvdEIWGSAoUWho= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jERFKK3D; 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="jERFKK3D" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75DE6C8402C; Mon, 26 Aug 2024 17:11:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1724692298; bh=6NiB15fQCRB/0hRYTV+4kq369qwgSUxD5vrznyR2mH0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=jERFKK3DC/5Wx1g8Hb9YIWVcJ1GalNCiZ+Ayq4W9qxybtj4Hic58xpJKU3Y+7ywZu QpbsSBDJg5JHJT55qqgNO6Km65AOyqsD1Nc2Ay6j4pVEAjBxgYn4/+vJ+MsT1lt6Fp ZayT/89UEXbj02dPnLB5+IChG7Gl7CXb378bbIv7F6u6xXluirwNqkAscMDEiu6lec HgkgnqpBGuDPzpISLxZkoDlmq6pYDtrRvkeNMJus83R+h/NM7idWkt9hE6Exr3DtVH jq5fKkEpCo34HzzoAQfb0WzWgPCVL1sFehG7lWN40djBLwRpkRPDTgdlpaqpVmIBns L5a57YtG0ng7A== From: "Matthieu Baerts (NGI0)" Date: Mon, 26 Aug 2024 19:11:20 +0200 Subject: [PATCH net 3/4] mptcp: sched: check both backup in retrans Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240826-net-mptcp-close-extra-sf-fin-v1-3-905199fe1172@kernel.org> References: <20240826-net-mptcp-close-extra-sf-fin-v1-0-905199fe1172@kernel.org> In-Reply-To: <20240826-net-mptcp-close-extra-sf-fin-v1-0-905199fe1172@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Florian Westphal , Shuah Khan Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" , stable@vger.kernel.org X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1429; i=matttbe@kernel.org; h=from:subject:message-id; bh=6NiB15fQCRB/0hRYTV+4kq369qwgSUxD5vrznyR2mH0=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBmzLc9Yo4eisWUEwLiIkSMono08U10yqCQph28U pRD0XpCqBaJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZsy3PQAKCRD2t4JPQmmg c/ftD/sE5jmfMkV1GkX+dIVKrDCA8K+8EtEA3yeXzWWyMczPeAaE7Awp+qFEW41Tt3mvY2CJxDB K25s05tG1mo7qBkgQgyTlM9zEYdr5KvEqGB30XK/fHW1jB6qcnMNv60bNZPRjICXkeXYW7gDX3h suq0I665JGolq+jf0GdGSpifeY6nbinEh2iXdSkfG2xPwd0NM+36QghrKsCcKeo3g2/p6HDOLhv 42nZ/ZNUz8UK9Vd2zjONphXFW3fr8+ZUEI/Y5MC7151URzUa0qg5p11+VvU4D69u1nTBP4a0haf j6WWwMfFx59VV/QppnQVnHag0nsr8mGJQPYlaaQFCUpntkdEb0aJKPORRZuWh63E4IEUvp6DwYm /UzdqZv/e1jnEa+AHVhQMZ7kHv+fITaQgUeIpJfsq7EdMm3Fca2Te4IdtAoORuhf5pAGqkY3NKV +nyKSW3Ptu4tNfb7+rJnp60caOTARM/CNpaFM5mXcLnAqOZ7S8Fi7mA6sS8VL9B/rsxknCa/xXx gY4sR+JwSpI0Is4mNpcQWH6deB/t+1fH/EjhZyVmyEfo/58KfBS2WDYBm5dQpJ1PuKVOAZ6ohTj qA2OM6LPeWfjThKn4Pz0J4rmxsZFeg+SAJVgLlDw4ysttffxRTtyQe37eGPPQRZfdtzXVtOEHHo phpbzc9cxJZhQ1Q== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 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 Looking only at the 'backup' flag can make sense in some cases, but it is not the behaviour of the default packet scheduler when selecting paths. As explained in the commit b6a66e521a20 ("mptcp: sched: check both directions for backup"), the packet scheduler should look at both flags, because that was the behaviour from the beginning: the 'backup' flag was set by accident instead of the 'request_bkup' one. Now that the latter has been fixed, get_retrans() needs to be adapted as well. Fixes: b6a66e521a20 ("mptcp: sched: check both directions for backup") Cc: stable@vger.kernel.org Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) --- 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 151e82e2ff2e..34fec753b9c1 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -2326,7 +2326,7 @@ struct sock *mptcp_subflow_get_retrans(struct mptcp_s= ock *msk) continue; } =20 - if (subflow->backup) { + if (subflow->backup || subflow->request_bkup) { if (!backup) backup =3D ssk; continue; --=20 2.45.2 From nobody Fri Nov 22 01:08:20 2024 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 85D1A198A3B; Mon, 26 Aug 2024 17:11: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=1724692302; cv=none; b=A7EqXjl/iQOzzQ/ZOEoXu/OieXW0Lt5OcAfYZiTJWVJOJ5gGP7v0ujdup7EBnHMRh/7beRbB/HM1QfjtIRjVSsjZe28+WWhHKAR5nUEF/XDSJYJoGQ0DpxffUy3HozFiBqxd1IgdhCtJ9a0HdPMOl3C7lKcWm30yNkTTfi9sxtA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724692302; c=relaxed/simple; bh=oh46jpchf4tSn3qQp4q/wPbqD8Sx+1+barkClBvrhgU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gJi9WT/DVunUnHq+CqN88BWKMXLma/LyRa2z9XoKJGonpog6blxGIXc8RR1BdJ0hmxZ+Qw3gLFTZtatjsRMTjNF7hR1FNOGQWkv40p06UDxscNbXQ3G84XwhwUUxR0FboUkll2c5N19Bj9oSarzCk3q+ikubi+2FiqPY/Af3gdc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kAmKethm; 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="kAmKethm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF40AC91B87; Mon, 26 Aug 2024 17:11:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1724692302; bh=oh46jpchf4tSn3qQp4q/wPbqD8Sx+1+barkClBvrhgU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=kAmKethmAxJU+kQ/4vp/cgdqiqiXqP5RXcXgREbkX1pY/L4CaeaU2XKkABG1rzRku XnqTF7lFqmqI4hozfxBbftxnYx2aURiItTuCI2aGwlkQ+xrwVuy4r57fSzbO/jECy/ zR6mPtKooLkA+9gdf1+kNx/LRE2GZthZ0GN/Jg8UlPSYYKrSL4Qzx6gISxdl97VXre v/wY6NT0BJH0YD0KjdKnBIr/TphlSopt/VG/uq3S2fwP0C1aaaa+Zl4+jCQlBXWGMI KutvS1Dgu2DIURwgc1Ro9Gef/Jcx390FKs17Ox9pMpa1Y8iqzM4Be5luxjUh/8OAio C6W6fGsK4+p9A== From: "Matthieu Baerts (NGI0)" Date: Mon, 26 Aug 2024 19:11:21 +0200 Subject: [PATCH net 4/4] mptcp: pr_debug: add missing \n at the end Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240826-net-mptcp-close-extra-sf-fin-v1-4-905199fe1172@kernel.org> References: <20240826-net-mptcp-close-extra-sf-fin-v1-0-905199fe1172@kernel.org> In-Reply-To: <20240826-net-mptcp-close-extra-sf-fin-v1-0-905199fe1172@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Florian Westphal , Shuah Khan Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" , stable@vger.kernel.org X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=41173; i=matttbe@kernel.org; h=from:subject:message-id; bh=oh46jpchf4tSn3qQp4q/wPbqD8Sx+1+barkClBvrhgU=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBmzLc9XHuvObjvAFFuAuS1hLJfV4uJ3UUKgEGCA xDHpPgi2B+JAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZsy3PQAKCRD2t4JPQmmg cyOoEADvjuSEghfDCP8SbmsiGOQO+Uj4yl7G71JjzI94I7nI5czlsAqkP3eYeaXa1EJdFsvwmBS 2lvkmNBhP6ysxLJkJx8E46i4cpvwgxkJIymZUqeudbHd/mXXjuxJr7BoE459846kACZmjCKMaFo vKwZQDICLUFihtCAYj0GvlDcFAhtfYqN84XuNKoW4ZTa3lCW7b1ugRYeD8ulVisEIyNM82XK6b6 4oGqjz+TDNzhpg2aP2Lsu2sQ7fb3kw40lI1zjcNu6z9YbLSqUVB1kW09mpyqxzcFqp29Y8GBQ6z 9ZZdCiQwT5v9Xep9ISHdOeeA5dSDmKaHFpQJOamWx3jzK2NGKSbXA5tUh2k8DrMafHYNpWnFzUm T7bktwj51p59fxFXI5aTuxXDWYhWaZ7EcPJCsJd2tm4Caz2VTj7P2OjdjYjS/OmmjtSS9u2Kwpj /2qTB9QpBBAqkeOlgLa9o0ZU5hPCwQnM+2DyI/BrcuT4nXm/SEgu7EEBmQX9337ubHCpZdKMon0 4QOKNK85n2NYHWRVCAFUDNAgsZkSm/oEoSEbUKqo0tUDnZcivpLpWx5cLRPw5fcKxYFP7YVP3uO ulyU9YN+0D+jDmMSKREXr2pupMek/vvVixsF82YUiL8sY4Y2Fy2MtHHVkql4LOXKglHOIUmvI37 WRvKLdlAfZazofQ== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 pr_debug() have been added in various places in MPTCP code to help developers to debug some situations. With the dynamic debug feature, it is easy to enable all or some of them, and asks users to reproduce issues with extra debug. Many of these pr_debug() don't end with a new line, while no 'pr_cont()' are used in MPTCP code. So the goal was not to display multiple debug messages on one line: they were then not missing the '\n' on purpose. Not having the new line at the end causes these messages to be printed with a delay, when something else needs to be printed. This issue is not visible when many messages need to be printed, but it is annoying and confusing when only specific messages are expected, e.g. # echo "func mptcp_pm_add_addr_echoed +fmp" \ > /sys/kernel/debug/dynamic_debug/control # ./mptcp_join.sh "signal address"; \ echo "$(awk '{print $1}' /proc/uptime) - end"; \ sleep 5s; \ echo "$(awk '{print $1}' /proc/uptime) - restart"; \ ./mptcp_join.sh "signal address" 013 signal address (...) 10.75 - end 15.76 - restart 013 signal address [ 10.367935] mptcp:mptcp_pm_add_addr_echoed: MPTCP: msk=3D(...) (...) =3D> a delay of 5 seconds: printed with a 10.36 ts, but after 'restart' which was printed at the 15.76 ts. The 'Fixes' tag here below points to the first pr_debug() used without '\n' in net/mptcp. This patch could be split in many small ones, with different Fixes tag, but it doesn't seem worth it, because it is easy to re-generate this patch with this simple 'sed' command: git grep -l pr_debug -- net/mptcp | xargs sed -i "s/\(pr_debug(\".*[^n]\)\(\"[,)]\)/\1\\\n\2/g" So in case of conflicts, simply drop the modifications, and launch this command. Fixes: f870fa0b5768 ("mptcp: Add MPTCP socket stubs") Cc: stable@vger.kernel.org Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/fastopen.c | 4 ++-- net/mptcp/options.c | 50 ++++++++++++++++++++++++----------------------= -- net/mptcp/pm.c | 28 +++++++++++++-------------- net/mptcp/pm_netlink.c | 20 +++++++++---------- net/mptcp/protocol.c | 52 +++++++++++++++++++++++++---------------------= ---- net/mptcp/protocol.h | 4 ++-- net/mptcp/sched.c | 4 ++-- net/mptcp/sockopt.c | 4 ++-- net/mptcp/subflow.c | 48 +++++++++++++++++++++++----------------------- 9 files changed, 107 insertions(+), 107 deletions(-) diff --git a/net/mptcp/fastopen.c b/net/mptcp/fastopen.c index ad28da655f8b..a29ff901df75 100644 --- a/net/mptcp/fastopen.c +++ b/net/mptcp/fastopen.c @@ -68,12 +68,12 @@ void __mptcp_fastopen_gen_msk_ackseq(struct mptcp_sock = *msk, struct mptcp_subflo skb =3D skb_peek_tail(&sk->sk_receive_queue); if (skb) { WARN_ON_ONCE(MPTCP_SKB_CB(skb)->end_seq); - pr_debug("msk %p moving seq %llx -> %llx end_seq %llx -> %llx", sk, + pr_debug("msk %p moving seq %llx -> %llx end_seq %llx -> %llx\n", sk, MPTCP_SKB_CB(skb)->map_seq, MPTCP_SKB_CB(skb)->map_seq + msk->ack_seq, MPTCP_SKB_CB(skb)->end_seq, MPTCP_SKB_CB(skb)->end_seq + msk->ack_seq); MPTCP_SKB_CB(skb)->map_seq +=3D msk->ack_seq; MPTCP_SKB_CB(skb)->end_seq +=3D msk->ack_seq; } =20 - pr_debug("msk=3D%p ack_seq=3D%llx", msk, msk->ack_seq); + pr_debug("msk=3D%p ack_seq=3D%llx\n", msk, msk->ack_seq); } diff --git a/net/mptcp/options.c b/net/mptcp/options.c index ac2f1a54cc43..370c3836b771 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -117,7 +117,7 @@ static void mptcp_parse_option(const struct sk_buff *sk= b, mp_opt->suboptions |=3D OPTION_MPTCP_CSUMREQD; ptr +=3D 2; } - pr_debug("MP_CAPABLE version=3D%x, flags=3D%x, optlen=3D%d sndr=3D%llu, = rcvr=3D%llu len=3D%d csum=3D%u", + pr_debug("MP_CAPABLE version=3D%x, flags=3D%x, optlen=3D%d sndr=3D%llu, = rcvr=3D%llu len=3D%d csum=3D%u\n", version, flags, opsize, mp_opt->sndr_key, mp_opt->rcvr_key, mp_opt->data_len, mp_opt->csum); break; @@ -131,7 +131,7 @@ static void mptcp_parse_option(const struct sk_buff *sk= b, ptr +=3D 4; mp_opt->nonce =3D get_unaligned_be32(ptr); ptr +=3D 4; - pr_debug("MP_JOIN bkup=3D%u, id=3D%u, token=3D%u, nonce=3D%u", + pr_debug("MP_JOIN bkup=3D%u, id=3D%u, token=3D%u, nonce=3D%u\n", mp_opt->backup, mp_opt->join_id, mp_opt->token, mp_opt->nonce); } else if (opsize =3D=3D TCPOLEN_MPTCP_MPJ_SYNACK) { @@ -142,19 +142,19 @@ static void mptcp_parse_option(const struct sk_buff *= skb, ptr +=3D 8; mp_opt->nonce =3D get_unaligned_be32(ptr); ptr +=3D 4; - pr_debug("MP_JOIN bkup=3D%u, id=3D%u, thmac=3D%llu, nonce=3D%u", + pr_debug("MP_JOIN bkup=3D%u, id=3D%u, thmac=3D%llu, nonce=3D%u\n", mp_opt->backup, mp_opt->join_id, mp_opt->thmac, mp_opt->nonce); } else if (opsize =3D=3D TCPOLEN_MPTCP_MPJ_ACK) { mp_opt->suboptions |=3D OPTION_MPTCP_MPJ_ACK; ptr +=3D 2; memcpy(mp_opt->hmac, ptr, MPTCPOPT_HMAC_LEN); - pr_debug("MP_JOIN hmac"); + pr_debug("MP_JOIN hmac\n"); } break; =20 case MPTCPOPT_DSS: - pr_debug("DSS"); + pr_debug("DSS\n"); ptr++; =20 /* we must clear 'mpc_map' be able to detect MP_CAPABLE @@ -169,7 +169,7 @@ static void mptcp_parse_option(const struct sk_buff *sk= b, mp_opt->ack64 =3D (flags & MPTCP_DSS_ACK64) !=3D 0; mp_opt->use_ack =3D (flags & MPTCP_DSS_HAS_ACK); =20 - pr_debug("data_fin=3D%d dsn64=3D%d use_map=3D%d ack64=3D%d use_ack=3D%d", + pr_debug("data_fin=3D%d dsn64=3D%d use_map=3D%d ack64=3D%d use_ack=3D%d\= n", mp_opt->data_fin, mp_opt->dsn64, mp_opt->use_map, mp_opt->ack64, mp_opt->use_ack); @@ -207,7 +207,7 @@ static void mptcp_parse_option(const struct sk_buff *sk= b, ptr +=3D 4; } =20 - pr_debug("data_ack=3D%llu", mp_opt->data_ack); + pr_debug("data_ack=3D%llu\n", mp_opt->data_ack); } =20 if (mp_opt->use_map) { @@ -231,7 +231,7 @@ static void mptcp_parse_option(const struct sk_buff *sk= b, ptr +=3D 2; } =20 - pr_debug("data_seq=3D%llu subflow_seq=3D%u data_len=3D%u csum=3D%d:%u", + pr_debug("data_seq=3D%llu subflow_seq=3D%u data_len=3D%u csum=3D%d:%u\n= ", mp_opt->data_seq, mp_opt->subflow_seq, mp_opt->data_len, !!(mp_opt->suboptions & OPTION_MPTCP_CSUMREQD), mp_opt->csum); @@ -293,7 +293,7 @@ static void mptcp_parse_option(const struct sk_buff *sk= b, mp_opt->ahmac =3D get_unaligned_be64(ptr); ptr +=3D 8; } - pr_debug("ADD_ADDR%s: id=3D%d, ahmac=3D%llu, echo=3D%d, port=3D%d", + pr_debug("ADD_ADDR%s: id=3D%d, ahmac=3D%llu, echo=3D%d, port=3D%d\n", (mp_opt->addr.family =3D=3D AF_INET6) ? "6" : "", mp_opt->addr.id, mp_opt->ahmac, mp_opt->echo, ntohs(mp_opt->addr.port)= ); break; @@ -309,7 +309,7 @@ static void mptcp_parse_option(const struct sk_buff *sk= b, mp_opt->rm_list.nr =3D opsize - TCPOLEN_MPTCP_RM_ADDR_BASE; for (i =3D 0; i < mp_opt->rm_list.nr; i++) mp_opt->rm_list.ids[i] =3D *ptr++; - pr_debug("RM_ADDR: rm_list_nr=3D%d", mp_opt->rm_list.nr); + pr_debug("RM_ADDR: rm_list_nr=3D%d\n", mp_opt->rm_list.nr); break; =20 case MPTCPOPT_MP_PRIO: @@ -318,7 +318,7 @@ static void mptcp_parse_option(const struct sk_buff *sk= b, =20 mp_opt->suboptions |=3D OPTION_MPTCP_PRIO; mp_opt->backup =3D *ptr++ & MPTCP_PRIO_BKUP; - pr_debug("MP_PRIO: prio=3D%d", mp_opt->backup); + pr_debug("MP_PRIO: prio=3D%d\n", mp_opt->backup); break; =20 case MPTCPOPT_MP_FASTCLOSE: @@ -329,7 +329,7 @@ static void mptcp_parse_option(const struct sk_buff *sk= b, mp_opt->rcvr_key =3D get_unaligned_be64(ptr); ptr +=3D 8; mp_opt->suboptions |=3D OPTION_MPTCP_FASTCLOSE; - pr_debug("MP_FASTCLOSE: recv_key=3D%llu", mp_opt->rcvr_key); + pr_debug("MP_FASTCLOSE: recv_key=3D%llu\n", mp_opt->rcvr_key); break; =20 case MPTCPOPT_RST: @@ -343,7 +343,7 @@ static void mptcp_parse_option(const struct sk_buff *sk= b, flags =3D *ptr++; mp_opt->reset_transient =3D flags & MPTCP_RST_TRANSIENT; mp_opt->reset_reason =3D *ptr; - pr_debug("MP_RST: transient=3D%u reason=3D%u", + pr_debug("MP_RST: transient=3D%u reason=3D%u\n", mp_opt->reset_transient, mp_opt->reset_reason); break; =20 @@ -354,7 +354,7 @@ static void mptcp_parse_option(const struct sk_buff *sk= b, ptr +=3D 2; mp_opt->suboptions |=3D OPTION_MPTCP_FAIL; mp_opt->fail_seq =3D get_unaligned_be64(ptr); - pr_debug("MP_FAIL: data_seq=3D%llu", mp_opt->fail_seq); + pr_debug("MP_FAIL: data_seq=3D%llu\n", mp_opt->fail_seq); break; =20 default: @@ -417,7 +417,7 @@ bool mptcp_syn_options(struct sock *sk, const struct sk= _buff *skb, *size =3D TCPOLEN_MPTCP_MPC_SYN; return true; } else if (subflow->request_join) { - pr_debug("remote_token=3D%u, nonce=3D%u", subflow->remote_token, + pr_debug("remote_token=3D%u, nonce=3D%u\n", subflow->remote_token, subflow->local_nonce); opts->suboptions =3D OPTION_MPTCP_MPJ_SYN; opts->join_id =3D subflow->local_id; @@ -500,7 +500,7 @@ static bool mptcp_established_options_mp(struct sock *s= k, struct sk_buff *skb, *size =3D TCPOLEN_MPTCP_MPC_ACK; } =20 - pr_debug("subflow=3D%p, local_key=3D%llu, remote_key=3D%llu map_len=3D%d= ", + pr_debug("subflow=3D%p, local_key=3D%llu, remote_key=3D%llu map_len=3D%d= \n", subflow, subflow->local_key, subflow->remote_key, data_len); =20 @@ -509,7 +509,7 @@ static bool mptcp_established_options_mp(struct sock *s= k, struct sk_buff *skb, opts->suboptions =3D OPTION_MPTCP_MPJ_ACK; memcpy(opts->hmac, subflow->hmac, MPTCPOPT_HMAC_LEN); *size =3D TCPOLEN_MPTCP_MPJ_ACK; - pr_debug("subflow=3D%p", subflow); + pr_debug("subflow=3D%p\n", subflow); =20 /* we can use the full delegate action helper only from BH context * If we are in process context - sk is flushing the backlog at @@ -675,7 +675,7 @@ static bool mptcp_established_options_add_addr(struct s= ock *sk, struct sk_buff * =20 *size =3D len; if (drop_other_suboptions) { - pr_debug("drop other suboptions"); + pr_debug("drop other suboptions\n"); opts->suboptions =3D 0; =20 /* note that e.g. DSS could have written into the memory @@ -695,7 +695,7 @@ static bool mptcp_established_options_add_addr(struct s= ock *sk, struct sk_buff * } else { MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_ECHOADDTX); } - pr_debug("addr_id=3D%d, ahmac=3D%llu, echo=3D%d, port=3D%d", + pr_debug("addr_id=3D%d, ahmac=3D%llu, echo=3D%d, port=3D%d\n", opts->addr.id, opts->ahmac, echo, ntohs(opts->addr.port)); =20 return true; @@ -726,7 +726,7 @@ static bool mptcp_established_options_rm_addr(struct so= ck *sk, opts->rm_list =3D rm_list; =20 for (i =3D 0; i < opts->rm_list.nr; i++) - pr_debug("rm_list_ids[%d]=3D%d", i, opts->rm_list.ids[i]); + pr_debug("rm_list_ids[%d]=3D%d\n", i, opts->rm_list.ids[i]); MPTCP_ADD_STATS(sock_net(sk), MPTCP_MIB_RMADDRTX, opts->rm_list.nr); return true; } @@ -752,7 +752,7 @@ static bool mptcp_established_options_mp_prio(struct so= ck *sk, opts->suboptions |=3D OPTION_MPTCP_PRIO; opts->backup =3D subflow->request_bkup; =20 - pr_debug("prio=3D%d", opts->backup); + pr_debug("prio=3D%d\n", opts->backup); =20 return true; } @@ -794,7 +794,7 @@ static bool mptcp_established_options_fastclose(struct = sock *sk, opts->suboptions |=3D OPTION_MPTCP_FASTCLOSE; opts->rcvr_key =3D READ_ONCE(msk->remote_key); =20 - pr_debug("FASTCLOSE key=3D%llu", opts->rcvr_key); + pr_debug("FASTCLOSE key=3D%llu\n", opts->rcvr_key); MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_MPFASTCLOSETX); return true; } @@ -816,7 +816,7 @@ static bool mptcp_established_options_mp_fail(struct so= ck *sk, opts->suboptions |=3D OPTION_MPTCP_FAIL; opts->fail_seq =3D subflow->map_seq; =20 - pr_debug("MP_FAIL fail_seq=3D%llu", opts->fail_seq); + pr_debug("MP_FAIL fail_seq=3D%llu\n", opts->fail_seq); MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_MPFAILTX); =20 return true; @@ -904,7 +904,7 @@ bool mptcp_synack_options(const struct request_sock *re= q, unsigned int *size, opts->csum_reqd =3D subflow_req->csum_reqd; opts->allow_join_id0 =3D subflow_req->allow_join_id0; *size =3D TCPOLEN_MPTCP_MPC_SYNACK; - pr_debug("subflow_req=3D%p, local_key=3D%llu", + pr_debug("subflow_req=3D%p, local_key=3D%llu\n", subflow_req, subflow_req->local_key); return true; } else if (subflow_req->mp_join) { @@ -913,7 +913,7 @@ bool mptcp_synack_options(const struct request_sock *re= q, unsigned int *size, opts->join_id =3D subflow_req->local_id; opts->thmac =3D subflow_req->thmac; opts->nonce =3D subflow_req->local_nonce; - pr_debug("req=3D%p, bkup=3D%u, id=3D%u, thmac=3D%llu, nonce=3D%u", + pr_debug("req=3D%p, bkup=3D%u, id=3D%u, thmac=3D%llu, nonce=3D%u\n", subflow_req, opts->backup, opts->join_id, opts->thmac, opts->nonce); *size =3D TCPOLEN_MPTCP_MPJ_SYNACK; diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c index 3e6e0f5510bb..3f8dbde243f1 100644 --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -19,7 +19,7 @@ int mptcp_pm_announce_addr(struct mptcp_sock *msk, { u8 add_addr =3D READ_ONCE(msk->pm.addr_signal); =20 - pr_debug("msk=3D%p, local_id=3D%d, echo=3D%d", msk, addr->id, echo); + pr_debug("msk=3D%p, local_id=3D%d, echo=3D%d\n", msk, addr->id, echo); =20 lockdep_assert_held(&msk->pm.lock); =20 @@ -45,7 +45,7 @@ int mptcp_pm_remove_addr(struct mptcp_sock *msk, const st= ruct mptcp_rm_list *rm_ { u8 rm_addr =3D READ_ONCE(msk->pm.addr_signal); =20 - pr_debug("msk=3D%p, rm_list_nr=3D%d", msk, rm_list->nr); + pr_debug("msk=3D%p, rm_list_nr=3D%d\n", msk, rm_list->nr); =20 if (rm_addr) { MPTCP_ADD_STATS(sock_net((struct sock *)msk), @@ -66,7 +66,7 @@ void mptcp_pm_new_connection(struct mptcp_sock *msk, cons= t struct sock *ssk, int { struct mptcp_pm_data *pm =3D &msk->pm; =20 - pr_debug("msk=3D%p, token=3D%u side=3D%d", msk, READ_ONCE(msk->token), se= rver_side); + pr_debug("msk=3D%p, token=3D%u side=3D%d\n", msk, READ_ONCE(msk->token), = server_side); =20 WRITE_ONCE(pm->server_side, server_side); mptcp_event(MPTCP_EVENT_CREATED, msk, ssk, GFP_ATOMIC); @@ -90,7 +90,7 @@ bool mptcp_pm_allow_new_subflow(struct mptcp_sock *msk) =20 subflows_max =3D mptcp_pm_get_subflows_max(msk); =20 - pr_debug("msk=3D%p subflows=3D%d max=3D%d allow=3D%d", msk, pm->subflows, + pr_debug("msk=3D%p subflows=3D%d max=3D%d allow=3D%d\n", msk, pm->subflow= s, subflows_max, READ_ONCE(pm->accept_subflow)); =20 /* try to avoid acquiring the lock below */ @@ -114,7 +114,7 @@ bool mptcp_pm_allow_new_subflow(struct mptcp_sock *msk) static bool mptcp_pm_schedule_work(struct mptcp_sock *msk, enum mptcp_pm_status new_status) { - pr_debug("msk=3D%p status=3D%x new=3D%lx", msk, msk->pm.status, + pr_debug("msk=3D%p status=3D%x new=3D%lx\n", msk, msk->pm.status, BIT(new_status)); if (msk->pm.status & BIT(new_status)) return false; @@ -129,7 +129,7 @@ void mptcp_pm_fully_established(struct mptcp_sock *msk,= const struct sock *ssk) struct mptcp_pm_data *pm =3D &msk->pm; bool announce =3D false; =20 - pr_debug("msk=3D%p", msk); + pr_debug("msk=3D%p\n", msk); =20 spin_lock_bh(&pm->lock); =20 @@ -153,14 +153,14 @@ void mptcp_pm_fully_established(struct mptcp_sock *ms= k, const struct sock *ssk) =20 void mptcp_pm_connection_closed(struct mptcp_sock *msk) { - pr_debug("msk=3D%p", msk); + pr_debug("msk=3D%p\n", msk); } =20 void mptcp_pm_subflow_established(struct mptcp_sock *msk) { struct mptcp_pm_data *pm =3D &msk->pm; =20 - pr_debug("msk=3D%p", msk); + pr_debug("msk=3D%p\n", msk); =20 if (!READ_ONCE(pm->work_pending)) return; @@ -212,7 +212,7 @@ void mptcp_pm_add_addr_received(const struct sock *ssk, struct mptcp_sock *msk =3D mptcp_sk(subflow->conn); struct mptcp_pm_data *pm =3D &msk->pm; =20 - pr_debug("msk=3D%p remote_id=3D%d accept=3D%d", msk, addr->id, + pr_debug("msk=3D%p remote_id=3D%d accept=3D%d\n", msk, addr->id, READ_ONCE(pm->accept_addr)); =20 mptcp_event_addr_announced(ssk, addr); @@ -243,7 +243,7 @@ void mptcp_pm_add_addr_echoed(struct mptcp_sock *msk, { struct mptcp_pm_data *pm =3D &msk->pm; =20 - pr_debug("msk=3D%p", msk); + pr_debug("msk=3D%p\n", msk); =20 spin_lock_bh(&pm->lock); =20 @@ -267,7 +267,7 @@ void mptcp_pm_rm_addr_received(struct mptcp_sock *msk, struct mptcp_pm_data *pm =3D &msk->pm; u8 i; =20 - pr_debug("msk=3D%p remote_ids_nr=3D%d", msk, rm_list->nr); + pr_debug("msk=3D%p remote_ids_nr=3D%d\n", msk, rm_list->nr); =20 for (i =3D 0; i < rm_list->nr; i++) mptcp_event_addr_removed(msk, rm_list->ids[i]); @@ -299,19 +299,19 @@ void mptcp_pm_mp_fail_received(struct sock *sk, u64 f= ail_seq) struct mptcp_subflow_context *subflow =3D mptcp_subflow_ctx(sk); struct mptcp_sock *msk =3D mptcp_sk(subflow->conn); =20 - pr_debug("fail_seq=3D%llu", fail_seq); + pr_debug("fail_seq=3D%llu\n", fail_seq); =20 if (!READ_ONCE(msk->allow_infinite_fallback)) return; =20 if (!subflow->fail_tout) { - pr_debug("send MP_FAIL response and infinite map"); + pr_debug("send MP_FAIL response and infinite map\n"); =20 subflow->send_mp_fail =3D 1; subflow->send_infinite_map =3D 1; tcp_send_ack(sk); } else { - pr_debug("MP_FAIL response received"); + pr_debug("MP_FAIL response received\n"); WRITE_ONCE(subflow->fail_tout, 0); } } diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 3e4ad801786f..8d2f97854c64 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -287,7 +287,7 @@ static void mptcp_pm_add_timer(struct timer_list *timer) struct mptcp_sock *msk =3D entry->sock; struct sock *sk =3D (struct sock *)msk; =20 - pr_debug("msk=3D%p", msk); + pr_debug("msk=3D%p\n", msk); =20 if (!msk) return; @@ -306,7 +306,7 @@ static void mptcp_pm_add_timer(struct timer_list *timer) spin_lock_bh(&msk->pm.lock); =20 if (!mptcp_pm_should_add_signal_addr(msk)) { - pr_debug("retransmit ADD_ADDR id=3D%d", entry->addr.id); + pr_debug("retransmit ADD_ADDR id=3D%d\n", entry->addr.id); mptcp_pm_announce_addr(msk, &entry->addr, false); mptcp_pm_add_addr_send_ack(msk); entry->retrans_times++; @@ -387,7 +387,7 @@ void mptcp_pm_free_anno_list(struct mptcp_sock *msk) struct sock *sk =3D (struct sock *)msk; LIST_HEAD(free_list); =20 - pr_debug("msk=3D%p", msk); + pr_debug("msk=3D%p\n", msk); =20 spin_lock_bh(&msk->pm.lock); list_splice_init(&msk->pm.anno_list, &free_list); @@ -473,7 +473,7 @@ static void __mptcp_pm_send_ack(struct mptcp_sock *msk,= struct mptcp_subflow_con struct sock *ssk =3D mptcp_subflow_tcp_sock(subflow); bool slow; =20 - pr_debug("send ack for %s", + pr_debug("send ack for %s\n", prio ? "mp_prio" : (mptcp_pm_should_add_signal(msk) ? "add_addr" : "rm_= addr")); =20 slow =3D lock_sock_fast(ssk); @@ -708,7 +708,7 @@ static void mptcp_pm_nl_add_addr_received(struct mptcp_= sock *msk) add_addr_accept_max =3D mptcp_pm_get_add_addr_accept_max(msk); subflows_max =3D mptcp_pm_get_subflows_max(msk); =20 - pr_debug("accepted %d:%d remote family %d", + pr_debug("accepted %d:%d remote family %d\n", msk->pm.add_addr_accepted, add_addr_accept_max, msk->pm.remote.family); =20 @@ -767,7 +767,7 @@ int mptcp_pm_nl_mp_prio_send_ack(struct mptcp_sock *msk, { struct mptcp_subflow_context *subflow; =20 - pr_debug("bkup=3D%d", bkup); + pr_debug("bkup=3D%d\n", bkup); =20 mptcp_for_each_subflow(msk, subflow) { struct sock *ssk =3D mptcp_subflow_tcp_sock(subflow); @@ -803,7 +803,7 @@ static void mptcp_pm_nl_rm_addr_or_subflow(struct mptcp= _sock *msk, struct sock *sk =3D (struct sock *)msk; u8 i; =20 - pr_debug("%s rm_list_nr %d", + pr_debug("%s rm_list_nr %d\n", rm_type =3D=3D MPTCP_MIB_RMADDR ? "address" : "subflow", rm_list->nr); =20 msk_owned_by_me(msk); @@ -832,7 +832,7 @@ static void mptcp_pm_nl_rm_addr_or_subflow(struct mptcp= _sock *msk, if (rm_type =3D=3D MPTCP_MIB_RMSUBFLOW && !mptcp_local_id_match(msk, id= , rm_id)) continue; =20 - pr_debug(" -> %s rm_list_ids[%d]=3D%u local_id=3D%u remote_id=3D%u mpc_= id=3D%u", + pr_debug(" -> %s rm_list_ids[%d]=3D%u local_id=3D%u remote_id=3D%u mpc_= id=3D%u\n", rm_type =3D=3D MPTCP_MIB_RMADDR ? "address" : "subflow", i, rm_id, id, remote_id, msk->mpc_endpoint_id); spin_unlock_bh(&msk->pm.lock); @@ -889,7 +889,7 @@ void mptcp_pm_nl_work(struct mptcp_sock *msk) =20 spin_lock_bh(&msk->pm.lock); =20 - pr_debug("msk=3D%p status=3D%x", msk, pm->status); + pr_debug("msk=3D%p status=3D%x\n", msk, pm->status); if (pm->status & BIT(MPTCP_PM_ADD_ADDR_RECEIVED)) { pm->status &=3D ~BIT(MPTCP_PM_ADD_ADDR_RECEIVED); mptcp_pm_nl_add_addr_received(msk); @@ -1476,7 +1476,7 @@ static int mptcp_nl_remove_subflow_and_signal_addr(st= ruct net *net, long s_slot =3D 0, s_num =3D 0; struct mptcp_sock *msk; =20 - pr_debug("remove_id=3D%d", addr->id); + pr_debug("remove_id=3D%d\n", addr->id); =20 list.ids[list.nr++] =3D addr->id; =20 diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 34fec753b9c1..b571fba88a2f 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -139,7 +139,7 @@ static bool mptcp_try_coalesce(struct sock *sk, struct = sk_buff *to, !skb_try_coalesce(to, from, &fragstolen, &delta)) return false; =20 - pr_debug("colesced seq %llx into %llx new len %d new end seq %llx", + pr_debug("colesced seq %llx into %llx new len %d new end seq %llx\n", MPTCP_SKB_CB(from)->map_seq, MPTCP_SKB_CB(to)->map_seq, to->len, MPTCP_SKB_CB(from)->end_seq); MPTCP_SKB_CB(to)->end_seq =3D MPTCP_SKB_CB(from)->end_seq; @@ -217,7 +217,7 @@ static void mptcp_data_queue_ofo(struct mptcp_sock *msk= , struct sk_buff *skb) end_seq =3D MPTCP_SKB_CB(skb)->end_seq; max_seq =3D atomic64_read(&msk->rcv_wnd_sent); =20 - pr_debug("msk=3D%p seq=3D%llx limit=3D%llx empty=3D%d", msk, seq, max_seq, + pr_debug("msk=3D%p seq=3D%llx limit=3D%llx empty=3D%d\n", msk, seq, max_s= eq, RB_EMPTY_ROOT(&msk->out_of_order_queue)); if (after64(end_seq, max_seq)) { /* out of window */ @@ -643,7 +643,7 @@ static bool __mptcp_move_skbs_from_subflow(struct mptcp= _sock *msk, } } =20 - pr_debug("msk=3D%p ssk=3D%p", msk, ssk); + pr_debug("msk=3D%p ssk=3D%p\n", msk, ssk); tp =3D tcp_sk(ssk); do { u32 map_remaining, offset; @@ -724,7 +724,7 @@ static bool __mptcp_ofo_queue(struct mptcp_sock *msk) u64 end_seq; =20 p =3D rb_first(&msk->out_of_order_queue); - pr_debug("msk=3D%p empty=3D%d", msk, RB_EMPTY_ROOT(&msk->out_of_order_que= ue)); + pr_debug("msk=3D%p empty=3D%d\n", msk, RB_EMPTY_ROOT(&msk->out_of_order_q= ueue)); while (p) { skb =3D rb_to_skb(p); if (after64(MPTCP_SKB_CB(skb)->map_seq, msk->ack_seq)) @@ -746,7 +746,7 @@ static bool __mptcp_ofo_queue(struct mptcp_sock *msk) int delta =3D msk->ack_seq - MPTCP_SKB_CB(skb)->map_seq; =20 /* skip overlapping data, if any */ - pr_debug("uncoalesced seq=3D%llx ack seq=3D%llx delta=3D%d", + pr_debug("uncoalesced seq=3D%llx ack seq=3D%llx delta=3D%d\n", MPTCP_SKB_CB(skb)->map_seq, msk->ack_seq, delta); MPTCP_SKB_CB(skb)->offset +=3D delta; @@ -1240,7 +1240,7 @@ static int mptcp_sendmsg_frag(struct sock *sk, struct= sock *ssk, size_t copy; int i; =20 - pr_debug("msk=3D%p ssk=3D%p sending dfrag at seq=3D%llu len=3D%u already = sent=3D%u", + pr_debug("msk=3D%p ssk=3D%p sending dfrag at seq=3D%llu len=3D%u already = sent=3D%u\n", msk, ssk, dfrag->data_seq, dfrag->data_len, info->sent); =20 if (WARN_ON_ONCE(info->sent > info->limit || @@ -1341,7 +1341,7 @@ static int mptcp_sendmsg_frag(struct sock *sk, struct= sock *ssk, mpext->use_map =3D 1; mpext->dsn64 =3D 1; =20 - pr_debug("data_seq=3D%llu subflow_seq=3D%u data_len=3D%u dsn64=3D%d", + pr_debug("data_seq=3D%llu subflow_seq=3D%u data_len=3D%u dsn64=3D%d\n", mpext->data_seq, mpext->subflow_seq, mpext->data_len, mpext->dsn64); =20 @@ -1892,7 +1892,7 @@ static int mptcp_sendmsg(struct sock *sk, struct msgh= dr *msg, size_t len) if (!msk->first_pending) WRITE_ONCE(msk->first_pending, dfrag); } - pr_debug("msk=3D%p dfrag at seq=3D%llu len=3D%u sent=3D%u new=3D%d", msk, + pr_debug("msk=3D%p dfrag at seq=3D%llu len=3D%u sent=3D%u new=3D%d\n", m= sk, dfrag->data_seq, dfrag->data_len, dfrag->already_sent, !dfrag_collapsed); =20 @@ -2248,7 +2248,7 @@ static int mptcp_recvmsg(struct sock *sk, struct msgh= dr *msg, size_t len, } } =20 - pr_debug("block timeout %ld", timeo); + pr_debug("block timeout %ld\n", timeo); sk_wait_data(sk, &timeo, NULL); } =20 @@ -2264,7 +2264,7 @@ static int mptcp_recvmsg(struct sock *sk, struct msgh= dr *msg, size_t len, } } =20 - pr_debug("msk=3D%p rx queue empty=3D%d:%d copied=3D%d", + pr_debug("msk=3D%p rx queue empty=3D%d:%d copied=3D%d\n", msk, skb_queue_empty_lockless(&sk->sk_receive_queue), skb_queue_empty(&msk->receive_queue), copied); if (!(flags & MSG_PEEK)) @@ -2717,7 +2717,7 @@ static void mptcp_mp_fail_no_response(struct mptcp_so= ck *msk) if (!ssk) return; =20 - pr_debug("MP_FAIL doesn't respond, reset the subflow"); + pr_debug("MP_FAIL doesn't respond, reset the subflow\n"); =20 slow =3D lock_sock_fast(ssk); mptcp_subflow_reset(ssk); @@ -2891,7 +2891,7 @@ void mptcp_subflow_shutdown(struct sock *sk, struct s= ock *ssk, int how) break; default: if (__mptcp_check_fallback(mptcp_sk(sk))) { - pr_debug("Fallback"); + pr_debug("Fallback\n"); ssk->sk_shutdown |=3D how; tcp_shutdown(ssk, how); =20 @@ -2901,7 +2901,7 @@ void mptcp_subflow_shutdown(struct sock *sk, struct s= ock *ssk, int how) WRITE_ONCE(mptcp_sk(sk)->snd_una, mptcp_sk(sk)->snd_nxt); mptcp_schedule_work(sk); } else { - pr_debug("Sending DATA_FIN on subflow %p", ssk); + pr_debug("Sending DATA_FIN on subflow %p\n", ssk); tcp_send_ack(ssk); if (!mptcp_rtx_timer_pending(sk)) mptcp_reset_rtx_timer(sk); @@ -2967,7 +2967,7 @@ static void mptcp_check_send_data_fin(struct sock *sk) struct mptcp_subflow_context *subflow; struct mptcp_sock *msk =3D mptcp_sk(sk); =20 - pr_debug("msk=3D%p snd_data_fin_enable=3D%d pending=3D%d snd_nxt=3D%llu w= rite_seq=3D%llu", + pr_debug("msk=3D%p snd_data_fin_enable=3D%d pending=3D%d snd_nxt=3D%llu w= rite_seq=3D%llu\n", msk, msk->snd_data_fin_enable, !!mptcp_send_head(sk), msk->snd_nxt, msk->write_seq); =20 @@ -2991,7 +2991,7 @@ static void __mptcp_wr_shutdown(struct sock *sk) { struct mptcp_sock *msk =3D mptcp_sk(sk); =20 - pr_debug("msk=3D%p snd_data_fin_enable=3D%d shutdown=3D%x state=3D%d pend= ing=3D%d", + pr_debug("msk=3D%p snd_data_fin_enable=3D%d shutdown=3D%x state=3D%d pend= ing=3D%d\n", msk, msk->snd_data_fin_enable, sk->sk_shutdown, sk->sk_state, !!mptcp_send_head(sk)); =20 @@ -3006,7 +3006,7 @@ static void __mptcp_destroy_sock(struct sock *sk) { struct mptcp_sock *msk =3D mptcp_sk(sk); =20 - pr_debug("msk=3D%p", msk); + pr_debug("msk=3D%p\n", msk); =20 might_sleep(); =20 @@ -3114,7 +3114,7 @@ bool __mptcp_close(struct sock *sk, long timeout) mptcp_set_state(sk, TCP_CLOSE); =20 sock_hold(sk); - pr_debug("msk=3D%p state=3D%d", sk, sk->sk_state); + pr_debug("msk=3D%p state=3D%d\n", sk, sk->sk_state); if (msk->token) mptcp_event(MPTCP_EVENT_CLOSED, msk, NULL, GFP_KERNEL); =20 @@ -3546,7 +3546,7 @@ static int mptcp_get_port(struct sock *sk, unsigned s= hort snum) { struct mptcp_sock *msk =3D mptcp_sk(sk); =20 - pr_debug("msk=3D%p, ssk=3D%p", msk, msk->first); + pr_debug("msk=3D%p, ssk=3D%p\n", msk, msk->first); if (WARN_ON_ONCE(!msk->first)) return -EINVAL; =20 @@ -3563,7 +3563,7 @@ void mptcp_finish_connect(struct sock *ssk) sk =3D subflow->conn; msk =3D mptcp_sk(sk); =20 - pr_debug("msk=3D%p, token=3D%u", sk, subflow->token); + pr_debug("msk=3D%p, token=3D%u\n", sk, subflow->token); =20 subflow->map_seq =3D subflow->iasn; subflow->map_subflow_seq =3D 1; @@ -3592,7 +3592,7 @@ bool mptcp_finish_join(struct sock *ssk) struct sock *parent =3D (void *)msk; bool ret =3D true; =20 - pr_debug("msk=3D%p, subflow=3D%p", msk, subflow); + pr_debug("msk=3D%p, subflow=3D%p\n", msk, subflow); =20 /* mptcp socket already closing? */ if (!mptcp_is_fully_established(parent)) { @@ -3638,7 +3638,7 @@ bool mptcp_finish_join(struct sock *ssk) =20 static void mptcp_shutdown(struct sock *sk, int how) { - pr_debug("sk=3D%p, how=3D%d", sk, how); + pr_debug("sk=3D%p, how=3D%d\n", sk, how); =20 if ((how & SEND_SHUTDOWN) && mptcp_close_state(sk)) __mptcp_wr_shutdown(sk); @@ -3859,7 +3859,7 @@ static int mptcp_listen(struct socket *sock, int back= log) struct sock *ssk; int err; =20 - pr_debug("msk=3D%p", msk); + pr_debug("msk=3D%p\n", msk); =20 lock_sock(sk); =20 @@ -3898,7 +3898,7 @@ static int mptcp_stream_accept(struct socket *sock, s= truct socket *newsock, struct mptcp_sock *msk =3D mptcp_sk(sock->sk); struct sock *ssk, *newsk; =20 - pr_debug("msk=3D%p", msk); + pr_debug("msk=3D%p\n", msk); =20 /* Buggy applications can call accept on socket states other then LISTEN * but no need to allocate the first subflow just to error out. @@ -3907,12 +3907,12 @@ static int mptcp_stream_accept(struct socket *sock,= struct socket *newsock, if (!ssk) return -EINVAL; =20 - pr_debug("ssk=3D%p, listener=3D%p", ssk, mptcp_subflow_ctx(ssk)); + pr_debug("ssk=3D%p, listener=3D%p\n", ssk, mptcp_subflow_ctx(ssk)); newsk =3D inet_csk_accept(ssk, arg); if (!newsk) return arg->err; =20 - pr_debug("newsk=3D%p, subflow is mptcp=3D%d", newsk, sk_is_mptcp(newsk)); + pr_debug("newsk=3D%p, subflow is mptcp=3D%d\n", newsk, sk_is_mptcp(newsk)= ); if (sk_is_mptcp(newsk)) { struct mptcp_subflow_context *subflow; struct sock *new_mptcp_sock; @@ -4005,7 +4005,7 @@ static __poll_t mptcp_poll(struct file *file, struct = socket *sock, sock_poll_wait(file, sock, wait); =20 state =3D inet_sk_state_load(sk); - pr_debug("msk=3D%p state=3D%d flags=3D%lx", msk, state, msk->flags); + pr_debug("msk=3D%p state=3D%d flags=3D%lx\n", msk, state, msk->flags); if (state =3D=3D TCP_LISTEN) { struct sock *ssk =3D READ_ONCE(msk->first); =20 diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index a1c1b0ff1ce1..240d7c2ea551 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -1177,7 +1177,7 @@ static inline bool mptcp_check_fallback(const struct = sock *sk) static inline void __mptcp_do_fallback(struct mptcp_sock *msk) { if (__mptcp_check_fallback(msk)) { - pr_debug("TCP fallback already done (msk=3D%p)", msk); + pr_debug("TCP fallback already done (msk=3D%p)\n", msk); return; } set_bit(MPTCP_FALLBACK_DONE, &msk->flags); @@ -1213,7 +1213,7 @@ static inline void mptcp_do_fallback(struct sock *ssk) } } =20 -#define pr_fallback(a) pr_debug("%s:fallback to TCP (msk=3D%p)", __func__,= a) +#define pr_fallback(a) pr_debug("%s:fallback to TCP (msk=3D%p)\n", __func_= _, a) =20 static inline bool mptcp_check_infinite_map(struct sk_buff *skb) { diff --git a/net/mptcp/sched.c b/net/mptcp/sched.c index 4a7fd0508ad2..78ed508ebc1b 100644 --- a/net/mptcp/sched.c +++ b/net/mptcp/sched.c @@ -86,7 +86,7 @@ int mptcp_register_scheduler(struct mptcp_sched_ops *sche= d) list_add_tail_rcu(&sched->list, &mptcp_sched_list); spin_unlock(&mptcp_sched_list_lock); =20 - pr_debug("%s registered", sched->name); + pr_debug("%s registered\n", sched->name); return 0; } =20 @@ -118,7 +118,7 @@ int mptcp_init_sched(struct mptcp_sock *msk, if (msk->sched->init) msk->sched->init(msk); =20 - pr_debug("sched=3D%s", msk->sched->name); + pr_debug("sched=3D%s\n", msk->sched->name); =20 return 0; } diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c index 2026a9a36f80..505445a9598f 100644 --- a/net/mptcp/sockopt.c +++ b/net/mptcp/sockopt.c @@ -873,7 +873,7 @@ int mptcp_setsockopt(struct sock *sk, int level, int op= tname, struct mptcp_sock *msk =3D mptcp_sk(sk); struct sock *ssk; =20 - pr_debug("msk=3D%p", msk); + pr_debug("msk=3D%p\n", msk); =20 if (level =3D=3D SOL_SOCKET) return mptcp_setsockopt_sol_socket(msk, optname, optval, optlen); @@ -1453,7 +1453,7 @@ int mptcp_getsockopt(struct sock *sk, int level, int = optname, struct mptcp_sock *msk =3D mptcp_sk(sk); struct sock *ssk; =20 - pr_debug("msk=3D%p", msk); + pr_debug("msk=3D%p\n", msk); =20 /* @@ the meaning of setsockopt() when the socket is connected and * there are multiple subflows is not yet defined. It is up to the diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index 4834e7fc2fb6..064ab3235893 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -39,7 +39,7 @@ static void subflow_req_destructor(struct request_sock *r= eq) { struct mptcp_subflow_request_sock *subflow_req =3D mptcp_subflow_rsk(req); =20 - pr_debug("subflow_req=3D%p", subflow_req); + pr_debug("subflow_req=3D%p\n", subflow_req); =20 if (subflow_req->msk) sock_put((struct sock *)subflow_req->msk); @@ -146,7 +146,7 @@ static int subflow_check_req(struct request_sock *req, struct mptcp_options_received mp_opt; bool opt_mp_capable, opt_mp_join; =20 - pr_debug("subflow_req=3D%p, listener=3D%p", subflow_req, listener); + pr_debug("subflow_req=3D%p, listener=3D%p\n", subflow_req, listener); =20 #ifdef CONFIG_TCP_MD5SIG /* no MPTCP if MD5SIG is enabled on this socket or we may run out of @@ -221,7 +221,7 @@ static int subflow_check_req(struct request_sock *req, } =20 if (subflow_use_different_sport(subflow_req->msk, sk_listener)) { - pr_debug("syn inet_sport=3D%d %d", + pr_debug("syn inet_sport=3D%d %d\n", ntohs(inet_sk(sk_listener)->inet_sport), ntohs(inet_sk((struct sock *)subflow_req->msk)->inet_sport)); if (!mptcp_pm_sport_in_anno_list(subflow_req->msk, sk_listener)) { @@ -243,7 +243,7 @@ static int subflow_check_req(struct request_sock *req, subflow_init_req_cookie_join_save(subflow_req, skb); } =20 - pr_debug("token=3D%u, remote_nonce=3D%u msk=3D%p", subflow_req->token, + pr_debug("token=3D%u, remote_nonce=3D%u msk=3D%p\n", subflow_req->token, subflow_req->remote_nonce, subflow_req->msk); } =20 @@ -527,7 +527,7 @@ static void subflow_finish_connect(struct sock *sk, con= st struct sk_buff *skb) subflow->rel_write_seq =3D 1; subflow->conn_finished =3D 1; subflow->ssn_offset =3D TCP_SKB_CB(skb)->seq; - pr_debug("subflow=3D%p synack seq=3D%x", subflow, subflow->ssn_offset); + pr_debug("subflow=3D%p synack seq=3D%x\n", subflow, subflow->ssn_offset); =20 mptcp_get_options(skb, &mp_opt); if (subflow->request_mptcp) { @@ -559,7 +559,7 @@ static void subflow_finish_connect(struct sock *sk, con= st struct sk_buff *skb) subflow->thmac =3D mp_opt.thmac; subflow->remote_nonce =3D mp_opt.nonce; WRITE_ONCE(subflow->remote_id, mp_opt.join_id); - pr_debug("subflow=3D%p, thmac=3D%llu, remote_nonce=3D%u backup=3D%d", + pr_debug("subflow=3D%p, thmac=3D%llu, remote_nonce=3D%u backup=3D%d\n", subflow, subflow->thmac, subflow->remote_nonce, subflow->backup); =20 @@ -585,7 +585,7 @@ static void subflow_finish_connect(struct sock *sk, con= st struct sk_buff *skb) MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_JOINSYNACKBACKUPRX); =20 if (subflow_use_different_dport(msk, sk)) { - pr_debug("synack inet_dport=3D%d %d", + pr_debug("synack inet_dport=3D%d %d\n", ntohs(inet_sk(sk)->inet_dport), ntohs(inet_sk(parent)->inet_dport)); MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_JOINPORTSYNACKRX); @@ -655,7 +655,7 @@ static int subflow_v4_conn_request(struct sock *sk, str= uct sk_buff *skb) { struct mptcp_subflow_context *subflow =3D mptcp_subflow_ctx(sk); =20 - pr_debug("subflow=3D%p", subflow); + pr_debug("subflow=3D%p\n", subflow); =20 /* Never answer to SYNs sent to broadcast or multicast */ if (skb_rtable(skb)->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST)) @@ -686,7 +686,7 @@ static int subflow_v6_conn_request(struct sock *sk, str= uct sk_buff *skb) { struct mptcp_subflow_context *subflow =3D mptcp_subflow_ctx(sk); =20 - pr_debug("subflow=3D%p", subflow); + pr_debug("subflow=3D%p\n", subflow); =20 if (skb->protocol =3D=3D htons(ETH_P_IP)) return subflow_v4_conn_request(sk, skb); @@ -807,7 +807,7 @@ static struct sock *subflow_syn_recv_sock(const struct = sock *sk, struct mptcp_sock *owner; struct sock *child; =20 - pr_debug("listener=3D%p, req=3D%p, conn=3D%p", listener, req, listener->c= onn); + pr_debug("listener=3D%p, req=3D%p, conn=3D%p\n", listener, req, listener-= >conn); =20 /* After child creation we must look for MPC even when options * are not parsed @@ -898,7 +898,7 @@ static struct sock *subflow_syn_recv_sock(const struct = sock *sk, ctx->conn =3D (struct sock *)owner; =20 if (subflow_use_different_sport(owner, sk)) { - pr_debug("ack inet_sport=3D%d %d", + pr_debug("ack inet_sport=3D%d %d\n", ntohs(inet_sk(sk)->inet_sport), ntohs(inet_sk((struct sock *)owner)->inet_sport)); if (!mptcp_pm_sport_in_anno_list(owner, sk)) { @@ -961,7 +961,7 @@ enum mapping_status { =20 static void dbg_bad_map(struct mptcp_subflow_context *subflow, u32 ssn) { - pr_debug("Bad mapping: ssn=3D%d map_seq=3D%d map_data_len=3D%d", + pr_debug("Bad mapping: ssn=3D%d map_seq=3D%d map_data_len=3D%d\n", ssn, subflow->map_subflow_seq, subflow->map_data_len); } =20 @@ -1121,7 +1121,7 @@ static enum mapping_status get_mapping_status(struct = sock *ssk, =20 data_len =3D mpext->data_len; if (data_len =3D=3D 0) { - pr_debug("infinite mapping received"); + pr_debug("infinite mapping received\n"); MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_INFINITEMAPRX); subflow->map_data_len =3D 0; return MAPPING_INVALID; @@ -1133,7 +1133,7 @@ static enum mapping_status get_mapping_status(struct = sock *ssk, if (data_len =3D=3D 1) { bool updated =3D mptcp_update_rcv_data_fin(msk, mpext->data_seq, mpext->dsn64); - pr_debug("DATA_FIN with no payload seq=3D%llu", mpext->data_seq); + pr_debug("DATA_FIN with no payload seq=3D%llu\n", mpext->data_seq); if (subflow->map_valid) { /* A DATA_FIN might arrive in a DSS * option before the previous mapping @@ -1159,7 +1159,7 @@ static enum mapping_status get_mapping_status(struct = sock *ssk, data_fin_seq &=3D GENMASK_ULL(31, 0); =20 mptcp_update_rcv_data_fin(msk, data_fin_seq, mpext->dsn64); - pr_debug("DATA_FIN with mapping seq=3D%llu dsn64=3D%d", + pr_debug("DATA_FIN with mapping seq=3D%llu dsn64=3D%d\n", data_fin_seq, mpext->dsn64); =20 /* Adjust for DATA_FIN using 1 byte of sequence space */ @@ -1205,7 +1205,7 @@ static enum mapping_status get_mapping_status(struct = sock *ssk, if (unlikely(subflow->map_csum_reqd !=3D csum_reqd)) return MAPPING_INVALID; =20 - pr_debug("new map seq=3D%llu subflow_seq=3D%u data_len=3D%u csum=3D%d:%u", + pr_debug("new map seq=3D%llu subflow_seq=3D%u data_len=3D%u csum=3D%d:%u\= n", subflow->map_seq, subflow->map_subflow_seq, subflow->map_data_len, subflow->map_csum_reqd, subflow->map_data_csum); @@ -1240,7 +1240,7 @@ static void mptcp_subflow_discard_data(struct sock *s= sk, struct sk_buff *skb, avail_len =3D skb->len - offset; incr =3D limit >=3D avail_len ? avail_len + fin : limit; =20 - pr_debug("discarding=3D%d len=3D%d offset=3D%d seq=3D%d", incr, skb->len, + pr_debug("discarding=3D%d len=3D%d offset=3D%d seq=3D%d\n", incr, skb->le= n, offset, subflow->map_subflow_seq); MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_DUPDATA); tcp_sk(ssk)->copied_seq +=3D incr; @@ -1341,7 +1341,7 @@ static bool subflow_check_data_avail(struct sock *ssk) =20 old_ack =3D READ_ONCE(msk->ack_seq); ack_seq =3D mptcp_subflow_get_mapped_dsn(subflow); - pr_debug("msk ack_seq=3D%llx subflow ack_seq=3D%llx", old_ack, + pr_debug("msk ack_seq=3D%llx subflow ack_seq=3D%llx\n", old_ack, ack_seq); if (unlikely(before64(ack_seq, old_ack))) { mptcp_subflow_discard_data(ssk, skb, old_ack - ack_seq); @@ -1413,7 +1413,7 @@ bool mptcp_subflow_data_available(struct sock *sk) subflow->map_valid =3D 0; WRITE_ONCE(subflow->data_avail, false); =20 - pr_debug("Done with mapping: seq=3D%u data_len=3D%u", + pr_debug("Done with mapping: seq=3D%u data_len=3D%u\n", subflow->map_subflow_seq, subflow->map_data_len); } @@ -1523,7 +1523,7 @@ void mptcpv6_handle_mapped(struct sock *sk, bool mapp= ed) =20 target =3D mapped ? &subflow_v6m_specific : subflow_default_af_ops(sk); =20 - pr_debug("subflow=3D%p family=3D%d ops=3D%p target=3D%p mapped=3D%d", + pr_debug("subflow=3D%p family=3D%d ops=3D%p target=3D%p mapped=3D%d\n", subflow, sk->sk_family, icsk->icsk_af_ops, target, mapped); =20 if (likely(icsk->icsk_af_ops =3D=3D target)) @@ -1616,7 +1616,7 @@ int __mptcp_subflow_connect(struct sock *sk, const st= ruct mptcp_addr_info *loc, goto failed; =20 mptcp_crypto_key_sha(subflow->remote_key, &remote_token, NULL); - pr_debug("msk=3D%p remote_token=3D%u local_id=3D%d remote_id=3D%d", msk, + pr_debug("msk=3D%p remote_token=3D%u local_id=3D%d remote_id=3D%d\n", msk, remote_token, local_id, remote_id); subflow->remote_token =3D remote_token; WRITE_ONCE(subflow->remote_id, remote_id); @@ -1751,7 +1751,7 @@ int mptcp_subflow_create_socket(struct sock *sk, unsi= gned short family, SOCK_INODE(sf)->i_gid =3D SOCK_INODE(sk->sk_socket)->i_gid; =20 subflow =3D mptcp_subflow_ctx(sf->sk); - pr_debug("subflow=3D%p", subflow); + pr_debug("subflow=3D%p\n", subflow); =20 *new_sock =3D sf; sock_hold(sk); @@ -1780,7 +1780,7 @@ static struct mptcp_subflow_context *subflow_create_c= tx(struct sock *sk, INIT_LIST_HEAD(&ctx->node); INIT_LIST_HEAD(&ctx->delegated_node); =20 - pr_debug("subflow=3D%p", ctx); + pr_debug("subflow=3D%p\n", ctx); =20 ctx->tcp_sock =3D sk; WRITE_ONCE(ctx->local_id, -1); @@ -1931,7 +1931,7 @@ static int subflow_ulp_init(struct sock *sk) goto out; } =20 - pr_debug("subflow=3D%p, family=3D%d", ctx, sk->sk_family); + pr_debug("subflow=3D%p, family=3D%d\n", ctx, sk->sk_family); =20 tp->is_mptcp =3D 1; ctx->icsk_af_ops =3D icsk->icsk_af_ops; --=20 2.45.2