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, tanggeliang@kylinos.cn, kuba@kernel.org
Subject: Re: [PATCH mptcp-next v12 5/7] Documentation: msg_zerocopy: add MPTCP support
Date: Tue, 01 Dec 2026 20:14:10 +0000	[thread overview]
Message-ID: <179615605013.3143.13305468934241297477@kernel.org> (raw)
In-Reply-To: <9211b5530d9dcedf2307274f01d56b21eb98e2fd.1796019473.git.tanggeliang@kylinos.cn>

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

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

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] This patch adds MPTCP to the MSG_ZEROCOPY documentation
  alongside TCP.

--

Documentation: msg_zerocopy: add MPTCP support

This commit updates Documentation/networking/msg_zerocopy.rst to list
MPTCP as a protocol that supports MSG_ZEROCOPY, alongside TCP, UDP and
VSOCK. It also mentions MPTCP in the notification error queue and
Loopback sections.

> diff --git a/Documentation/networking/msg_zerocopy.rst b/Documentation/networking/msg_zerocopy.rst
> index 78fb70e748b77..a06055f1243ad 100644
> --- a/Documentation/networking/msg_zerocopy.rst
> +++ b/Documentation/networking/msg_zerocopy.rst
> @@ -7,8 +7,8 @@ Intro
>  =====
>  
>  The MSG_ZEROCOPY flag enables copy avoidance for socket send calls.
> -The feature is currently implemented for TCP, UDP and VSOCK (with
> -virtio transport) sockets.
> +The feature is currently implemented for TCP, MPTCP, UDP and VSOCK
> +(with virtio transport) sockets.

[Severity: Medium]

With MPTCP listed here, the "Deferred copies" section of this file now
covers MPTCP too:

  reason, the kernel signals if data was completed with a copy, by
  setting flag SO_EE_CODE_ZEROCOPY_COPIED in field ee_code on return.

Does MPTCP report SO_EE_CODE_ZEROCOPY_COPIED when a subflow route lacks
NETIF_F_SG?

In mptcp_sendmsg_frag() in net/mptcp/protocol.c, the ubuf is attached
whether or not the route has SG. The NETIF_F_SG check only decides
whether SKBFL_PURE_ZEROCOPY is set:

	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 |= SKBFL_PURE_ZEROCOPY;
			zc = true;
		}
	}

mptcp_sendmsg() clears uarg_to_msgzc(ubuf)->zerocopy in only three
cases:

  - PAGE_SIZE > U16_MAX + 1
  - MSG_FASTOPEN or DEFER_CONNECT
  - -EFAULT on the first chunk

By contrast, tcp_sendmsg_locked() in net/ipv4/tcp.c handles the non-SG
case directly:

	if (sk->sk_route_caps & NETIF_F_SG)
		zc = MSG_ZEROCOPY;
	else
		uarg_to_msgzc(uarg)->zerocopy = 0;

On a non-SG MPTCP subflow, the user pages are copied later in the
stack. Examples are __skb_linearize() called from validate_xmit_skb(),
or ESP's skb_cow_data().

msg_zerocopy_alloc() always sets SKBFL_DONT_ORPHAN. Because of that,
skb_orphan_frags() returns 0 and skb_copy_ubufs() never runs, so
uarg->zerocopy stays 1. __msg_zerocopy_callback() then sends the
completion without the flag:

	if (!is_zerocopy)
		serr->ee.ee_code |= SO_EE_CODE_ZEROCOPY_COPIED;

Would MPTCP applications then never get the documented signal to stop
using MSG_ZEROCOPY? This could happen with IPsec without hardware
offload, with sk_gso_disabled set, or on a device without SG. It would
also happen when only some subflows of a connection lack SG.

Should the MPTCP code clear ->zerocopy for non-SG subflows, as TCP
does, before this document lists MPTCP alongside TCP?

[ ... ]

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

  reply	other threads:[~2026-12-01 20:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30  6:25 [PATCH mptcp-next v12 0/7] mptcp: add MSG_ZEROCOPY support Geliang Tang
2026-11-30  6:25 ` [PATCH mptcp-next v12 1/7] mptcp: use local variable tp in sendmsg_frag Geliang Tang
2026-11-30  6:29   ` sashiko-bot
2026-12-01 20:14   ` netdev-bot+sashiko
2026-11-30  6:25 ` [PATCH mptcp-next v12 2/7] mptcp: remove redundant orig_offset in carve_data_frag Geliang Tang
2026-11-30  6:25 ` [PATCH mptcp-next v12 3/7] mptcp: add MSG_ZEROCOPY support Geliang Tang
2026-11-30  6:56   ` sashiko-bot
2026-12-01 20:14   ` netdev-bot+sashiko
2026-11-30  6:25 ` [PATCH mptcp-next v12 4/7] mptcp: handle SO_ZEROCOPY in setsockopt Geliang Tang
2026-12-01 20:14   ` netdev-bot+sashiko
2026-11-30  6:25 ` [PATCH mptcp-next v12 5/7] Documentation: msg_zerocopy: add MPTCP support Geliang Tang
2026-12-01 20:14   ` netdev-bot+sashiko [this message]
2026-11-30  6:25 ` [PATCH mptcp-next v12 6/7] selftests: net: " Geliang Tang
2026-12-01 20:14   ` netdev-bot+sashiko
2026-11-30  6:25 ` [PATCH mptcp-next v12 7/7] selftests: mptcp: cover msg_zerocopy test Geliang Tang
2026-11-30  6:40   ` sashiko-bot
2026-12-01 20:14   ` netdev-bot+sashiko
2026-11-30  7:30 ` [PATCH mptcp-next v12 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=179615605013.3143.13305468934241297477@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=geliang@kernel.org \
    --cc=kuba@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=tanggeliang@kylinos.cn \
    /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.