All of lore.kernel.org
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: geliang@kernel.org
Cc: mptcp@lists.linux.dev, kuba@kernel.org
Subject: Re: [PATCH mptcp-next v8 7/7] selftests: mptcp: connect: cover zerocopy mode
Date: Tue, 24 Nov 2026 23:30:45 +0000	[thread overview]
Message-ID: <179556304544.3133.4992026873532064641@kernel.org> (raw)
In-Reply-To: <0f5e8a01d62f02de8f2b7af3bd49c9e70b960c58.1795421388.git.tanggeliang@kylinos.cn>

Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 1

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] The new wrapper mptcp_connect_zerocopy.sh is added to
  TEST_PROGS in tools/testing/selftests/net/mptcp/Makefile.
- [Low] The commit author is 'Geliang Tang <geliang@kernel.org>', but the
  only Signed-off-by line is 'Geliang Tang <tanggeliang@kylinos.cn>'.

--

selftests: mptcp: connect: cover zerocopy mode

This commit adds a wrapper script, mptcp_connect_zerocopy.sh, which runs
mptcp_connect.sh with -m zerocopy. It also adds the script to TEST_PROGS
so that the MSG_ZEROCOPY mode runs as part of the regular mptcp
selftests.

> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>

[Severity: Low]

This isn't a bug, but the author is Geliang Tang <geliang@kernel.org>,
while the only Signed-off-by line is for tanggeliang@kylinos.cn.
checkpatch reports this as FROM_SIGN_OFF_MISMATCH.

The other patches in the series have the same mismatch. When the series
is resent, could a Signed-off-by be added for the author address, or the
author be changed to match the sign-off?

[ ... ]

> diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect_zerocopy.sh b/tools/testing/selftests/net/mptcp/mptcp_connect_zerocopy.sh
> new file mode 100755
> index 0000000000000..0220d29ad68ee
> --- /dev/null
> +++ b/tools/testing/selftests/net/mptcp/mptcp_connect_zerocopy.sh
> @@ -0,0 +1,5 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +
> +MPTCP_LIB_KSFT_TEST="$(basename "${0}" .sh)" \
> +	"$(dirname "${0}")/mptcp_connect.sh" -m zerocopy "${@}"

[Severity: Medium]

The commit message says this "ensures the MSG_ZEROCOPY path is exercised
in the regular test suite". Can this wrapper fail if the zerocopy send
path regresses?

The zerocopy mode was added to mptcp_connect.c earlier in this series.
In that mode, the only zerocopy-specific checks that can fail seem to be
the setsockopt() and getsockopt() calls for SO_ZEROCOPY. Otherwise the
result only depends on the data arriving intact.

wait_for_completions_zc() returns void and leaves its poll loop on
timeout:

tools/testing/selftests/net/mptcp/mptcp_connect.c:wait_for_completions_zc() {
    ...
		if (elapsed_ms >= timeout_ms)
			break;
    ...
}

So if no SO_EE_ORIGIN_ZEROCOPY completion arrives, neither
do_sendmsg_zc() nor its caller is told.

process_cmsg_zc() returns true on the first zerocopy notification:

tools/testing/selftests/net/mptcp/mptcp_connect.c:process_cmsg_zc() {
    ...
		serr = (struct sock_extended_err *)CMSG_DATA(cm);
		if (serr->ee_origin == SO_EE_ORIGIN_ZEROCOPY)
			return true;
    ...
}

It ignores ee_code, so SO_EE_CODE_ZEROCOPY_COPIED is accepted. It also
does not check that the ee_info..ee_data range covers every sendmsg()
call made in the while (sent < size) loop.

On the kernel side, mptcp_sendmsg() clears the flag without an error and
uses the normal copy path:

net/mptcp/protocol.c:mptcp_sendmsg() {
    ...
	if (msg->msg_flags & MSG_FASTOPEN || !sock_flag(sk, SOCK_ZEROCOPY))
		msg->msg_flags &= ~MSG_ZEROCOPY;
    ...
}

Several regressions would still give byte-identical output, and every
subtest would pass:

  - MSG_ZEROCOPY is masked off.
  - mptcp_sendmsg_zerocopy_iter() is never reached.
  - Completions are never sent, or are lost for later chunks (for
    example, a ubuf refcount leak).
  - Pages are always copied.

The only visible symptom would be up to 5 seconds of extra run time per
sending side.

Should the zerocopy mode in mptcp_connect.c fail when no completion
arrives before the timeout? Should it also fail when the reported
completion range does not cover all the sendmsg() calls?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1795421388.git.tanggeliang%40kylinos.cn

  reply	other threads:[~2026-11-24 23:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23  8:19 [PATCH mptcp-next v8 0/7] mptcp: add MSG_ZEROCOPY support Geliang Tang
2026-11-23  8:19 ` [PATCH mptcp-next v8 1/7] ipv4: fix uninitialized memory in zerocopy cmsg Geliang Tang
2026-11-23  8:37   ` sashiko-bot
2026-11-24 23:30   ` netdev-bot+sashiko
2026-11-23  8:19 ` [PATCH mptcp-next v8 2/7] mptcp: use local variable tp in sendmsg_frag Geliang Tang
2026-11-24 23:30   ` netdev-bot+sashiko
2026-11-23  8:19 ` [PATCH mptcp-next v8 3/7] mptcp: remove redundant orig_offset in carve_data_frag Geliang Tang
2026-11-24 23:30   ` netdev-bot+sashiko
2026-11-23  8:19 ` [PATCH mptcp-next v8 4/7] mptcp: add MSG_ZEROCOPY support Geliang Tang
2026-11-23  8:46   ` sashiko-bot
2026-11-24 23:30   ` netdev-bot+sashiko
2026-11-23  8:19 ` [PATCH mptcp-next v8 5/7] mptcp: handle SO_ZEROCOPY in setsockopt Geliang Tang
2026-11-23  8:36   ` sashiko-bot
2026-11-24 23:30   ` netdev-bot+sashiko
2026-11-23  8:19 ` [PATCH mptcp-next v8 6/7] selftests: mptcp: connect: add zerocopy io mode Geliang Tang
2026-11-23  8:37   ` sashiko-bot
2026-11-24 23:30   ` netdev-bot+sashiko
2026-11-23  8:19 ` [PATCH mptcp-next v8 7/7] selftests: mptcp: connect: cover zerocopy mode Geliang Tang
2026-11-24 23:30   ` netdev-bot+sashiko [this message]
2026-11-23 10:42 ` [PATCH mptcp-next v8 0/7] mptcp: add MSG_ZEROCOPY support MPTCP CI

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179556304544.3133.4992026873532064641@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=geliang@kernel.org \
    --cc=kuba@kernel.org \
    --cc=mptcp@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.