MPTCP Linux Development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Geliang Tang" <geliang@kernel.org>, mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next v8 5/7] mptcp: handle SO_ZEROCOPY in setsockopt
Date: Mon, 23 Nov 2026 08:36:49 +0000	[thread overview]
Message-ID: <sashiko-outbox-228906@kernel.org> (raw)
In-Reply-To: <154898fde8a9acdf6562d2adda67ebfe3ddd7246.1795421388.git.tanggeliang@kylinos.cn>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] mptcp: SO_ZEROCOPY lost on passive TCP fallback in
  mptcp_stream_accept()
--

commit 9eb510c1b5396bee88c876458fbf9feb12e69c9b
Author: Geliang Tang <geliang@kernel.org>

mptcp: handle SO_ZEROCOPY in setsockopt

This commit adds SO_ZEROCOPY support to MPTCP setsockopt by setting
SOCK_ZEROCOPY on the MPTCP socket.

> diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c
> index 922f6ae5c80cb..889c17da3f773 100644
> --- a/net/mptcp/sockopt.c
> +++ b/net/mptcp/sockopt.c
> @@ -184,6 +184,19 @@ static int mptcp_setsockopt_sol_socket_tstamp(struct mptcp_sock *msk, int optnam
>  	return 0;
>  }
>  
> +static int mptcp_setsockopt_sol_socket_zerocopy(struct mptcp_sock *msk, int val)
> +{
> +	struct sock *sk = (struct sock *)msk;
> +
> +	if (val != 0 && val != 1)
> +		return -EINVAL;
> +
> +	lock_sock(sk);
> +	sock_valbool_flag(sk, SOCK_ZEROCOPY, val);
> +	release_sock(sk);
> +	return 0;
> +}

[Severity: Medium]
Does setting SOCK_ZEROCOPY only on msk lose the option when a listening
MPTCP socket accepts a non-MP_CAPABLE peer and falls back to plain TCP?

On passive fallback, subflow_syn_recv_sock() clones the child socket from
the listening TCP subflow (msk->first) rather than from msk, and
mptcp_stream_accept() grafts that plain TCP child onto newsock with plain
TCP ops.  Because mptcp_setsockopt_sol_socket_zerocopy() and
sync_socket_options() do not propagate SOCK_ZEROCOPY to subflows, the
accepted fallback socket has SOCK_ZEROCOPY cleared: subsequent
getsockopt(SO_ZEROCOPY) returns 0 and sendmsg(MSG_ZEROCOPY) silently falls
back to copying in tcp_sendmsg_locked() without queuing completion
notifications on MSG_ERRQUEUE.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1795421388.git.tanggeliang@kylinos.cn?part=5

  reply	other threads:[~2026-11-23  8:36 UTC|newest]

Thread overview: 13+ 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-23  8:19 ` [PATCH mptcp-next v8 2/7] mptcp: use local variable tp in sendmsg_frag Geliang Tang
2026-11-23  8:19 ` [PATCH mptcp-next v8 3/7] mptcp: remove redundant orig_offset in carve_data_frag Geliang Tang
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-23  8:19 ` [PATCH mptcp-next v8 5/7] mptcp: handle SO_ZEROCOPY in setsockopt Geliang Tang
2026-11-23  8:36   ` sashiko-bot [this message]
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-23  8:19 ` [PATCH mptcp-next v8 7/7] selftests: mptcp: connect: cover zerocopy mode Geliang Tang
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=sashiko-outbox-228906@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=geliang@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=sashiko-reviews@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox