From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796020807; b=3k+XuGc8MFlYuihMerJa6u10olRVJxHUCtAOkYQWD9eYGRHxq6f+9x9274CqZPd+IfUo sEuPj4WUnH068Y9IiDzg7K77fW1zSFNXIIPu2iyEnF47VMDakotO6S8tDyuU5vBn/xCyR mVMJCcbw22v4wey9XakBE9s2gYJbS1xijwC4T33U+v546hFw+a6vNbqFij65hxhoLd5jl ULBkRrnD9TB9sSGGC1T0JT/xGroLqde8Yaw7oI1Du1cMLTvyRYu6ceC7aSTXFFxiTmkmx VjgQhfHTj+aP0YXlcNwgK5M+9sNbP8p/l0zJUEQVU0QBPM+TfFNZu5gHJFJwCPXRXmw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796020807; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=NI37NytBim9h2zTrmPt2Xf6VEWkX41s8l6HOwgUG3Ms=; b=FY9ZRlsnK/maPSs3c5nyZuB6sDr04yc26OKFojdOY60TaShX1Yb6oMsYh0n36EGbFLjB wgZa4NtuY7L3bWB5DBOwlvRPF6Q8wHZ4Gc22jA53YvCYJjQ3tfPmTNNpJEUhMTk6AiwNP qBm4VHbnXRqZbEsb7+43vB3eE92zco7+CiCm+xfu8X9dxUhgER/1/Mc4aETDh28TJ859q DgmoYUG3tmKwFb6iYQnPKQ1pQlnrL0NKH5iY5GMuO+PDY5yHICoFe7bTlfdkf0LBYUj9a YsT/1OLTrcehsTD29DgHcaFXeIofn6XJ0TMjMqeXut8+oFox3bAUfpz6g3sdZ6X2XLg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=VCLHDykh; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 84B4D606A31C for ; Mon, 30 Nov 2026 06:40:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=VCLHDykh Received: by smtp.kernel.org (Postfix) with ESMTPSA id 186891F000C1; Mon, 30 Nov 2026 06:40:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796020807; bh=NI37NytBim9h2zTrmPt2Xf6VEWkX41s8l6HOwgUG3Ms=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=VCLHDykhD7vhr+QjBDhMQBlS1eL6yclC61wQ5dW/RAD1zAGsA0SDeoLC4nMkZT+nc GNjmRY3HK5Qytaco9b+MpFBIn2xvIdcbtPZ8i+OmeaJRIasV6820vXDZGqK+7H0ily nY4DABY5+r0DkyD7oO3eDfoNY+cSmMqofb1ZLSMfejPqwrNj6MfhEcTQptDJhJh1fI i/IH5BVLJwVaNt/m2uBXePTlTc8qk04cot5AMis/i+reETWwx1F4fhd5cW57l9loe3 1sb8X/tPZh89LHEKzg8HgXArgxdoXJO2QSQzUYygthARq5HuLsx/eBT1O4O8CMzMFZ eu2OMgN+xarZw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH mptcp-next v12 7/7] selftests: mptcp: cover msg_zerocopy test Reply-To: sashiko-reviews@lists.linux.dev To: "Geliang Tang" , mptcp@lists.linux.dev In-Reply-To: <7e7e09aa0c307412e516ac35cadbe403c99d7a95.1796019473.git.tanggeliang@kylinos.cn> References: <7e7e09aa0c307412e516ac35cadbe403c99d7a95.1796019473.git.tanggeliang@kylinos.cn> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 30 Nov 2026 06:40:06 +0000 X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 3 potential issues to consider: - [Medium] selftests: mptcp: missing zerocopy check in msg_zerocopy.sh wrapper - [Medium] mptcp: unscheduled sk_mem_charge() without SG in mptcp_sendmsg_frag() - [Medium] mptcp: zc cleared before mptcp_sendmsg_fastopen() in mptcp_sendmsg() -- commit 1852c1fd7d811fa5bc6531df5e7b0dad74715d8f Author: Geliang Tang selftests: mptcp: cover msg_zerocopy test This commit adds a wrapper script and build rules to run the msg_zerocopy test as part of the MPTCP selftest suite. > diff --git a/tools/testing/selftests/net/mptcp/msg_zerocopy.sh b/tools/te= sting/selftests/net/mptcp/msg_zerocopy.sh > new file mode 100755 > index 0000000000000..118fff27dc5cd > --- /dev/null > +++ b/tools/testing/selftests/net/mptcp/msg_zerocopy.sh > @@ -0,0 +1,8 @@ > +#!/bin/bash > +# SPDX-License-Identifier: GPL-2.0 > + > +. "$(dirname "${0}")/mptcp_lib.sh" > + > +mptcp_lib_check_mptcp > + > +exec "$(dirname "${0}")/../msg_zerocopy.sh" "$@" [Severity: Medium] Does this wrapper actually check for MPTCP zerocopy support before running ../msg_zerocopy.sh? mptcp_lib_check_mptcp() only checks that /proc/sys/net/mptcp/enabled exists. On a kernel with MPTCP enabled but without MPTCP zerocopy support, running this script executes the TCP and UDP zerocopy tests in ../msg_zerocopy.sh, prints skip messages for the MPTCP subtests, and exits 0 (KSFT_PASS) instead of KSFT_SKIP, while also bypassing SELFTESTS_MPTCP_LIB_EXPECT_ALL_FEATURES= =3D1. Checking for the feature symbol via mptcp_lib_kallsyms_has() (for example "mptcp_sendmsg_zerocopy_iter$") before execing ../msg_zerocopy.sh would avo= id this. [Severity: Medium] In commit "mptcp: add MSG_ZEROCOPY support", can mptcp_sendmsg_frag() call sk_mem_charge() without prior memory scheduling when the subflow route lacks NETIF_F_SG? net/mptcp/protocol.c:mptcp_sendmsg_frag() { ... if (skb_zcopy_pure(skb) !=3D !!dfrag->ubuf || (dfrag->ubuf && skb_zcopy(skb) && skb_zcopy(skb) !=3D dfrag->ubuf)) { tcp_mark_push(tp, skb); goto alloc_skb; } ... if (!dfrag->ubuf) { /* like TCP, allow some progress up to tcp_wmem[0] */ avail =3D tcp_wmem_schedule(ssk, copy); ... if (dfrag->ubuf && !skb_zcopy(skb)) { skb_zcopy_set(skb, dfrag->ubuf, NULL); if (ssk->sk_route_caps & NETIF_F_SG) { skb_shinfo(skb)->flags |=3D SKBFL_PURE_ZEROCOPY; zc =3D true; } } } if (!zc) zc =3D skb_zcopy_pure(skb); ... if (!zc) sk_mem_charge(ssk, copy); } tcp_wmem_schedule() is skipped whenever dfrag->ubuf is set, but SKBFL_PURE_ZEROCOPY and zc =3D true are only set when NETIF_F_SG is present= on the subflow route. Without NETIF_F_SG, zc stays false, so sk_mem_charge() charges unscheduled bytes against ssk->sk_forward_alloc (driving it negativ= e), and the next mptcp_sendmsg_frag() call fails skb_zcopy_pure(skb) !=3D !!dfrag->ubuf and allocates a new skb for every fragment. [Severity: Medium] In commit "mptcp: add MSG_ZEROCOPY support", does mptcp_sendmsg() always pa= ss NULL instead of ubuf to mptcp_sendmsg_fastopen()? net/mptcp/protocol.c:mptcp_sendmsg() { ... if (unlikely(inet_test_bit(DEFER_CONNECT, sk) || msg->msg_flags & MSG_FASTOPEN)) { int copied_syn =3D 0; if (zc && (msg->msg_flags & MSG_FASTOPEN || inet_test_bit(DEFER_CONNECT, sk))) { uarg_to_msgzc(ubuf)->zerocopy =3D 0; zc =3D false; } ret =3D mptcp_sendmsg_fastopen(sk, msg, len, &copied_syn, zc ? ubuf : NULL); } Because zc is cleared to false right before the call, zc ? ubuf : NULL alwa= ys evaluates to NULL. tcp_send_syn_data() never attaches ubuf to the SYN+DATA skb via skb_zcopy_set(), and when mptcp_sendmsg_fastopen() returns -EINPROGRESS with copied_syn > 0, mptcp_sendmsg() jumps to out and calls net_zcopy_put(ubuf), completing the zerocopy notification before the SYN da= ta is sent or acknowledged. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/cover.1796019473.gi= t.tanggeliang@kylinos.cn?part=3D7