public inbox for mptcp@lists.linux.dev
 help / color / mirror / Atom feed
From: Matthieu Baerts <matttbe@kernel.org>
To: Geliang Tang <geliang@kernel.org>, mptcp@lists.linux.dev
Cc: Geliang Tang <tanggeliang@kylinos.cn>
Subject: Re: [PATCH mptcp-next 2/3] mptcp: implement .splice_eof
Date: Mon, 2 Feb 2026 11:07:06 +0100	[thread overview]
Message-ID: <5866364b-87b9-4abd-9eed-5437e6c56ffb@kernel.org> (raw)
In-Reply-To: <9e3dddfc65f24c1a11e5f0353b497f1d4f1c6f82.1770023932.git.tanggeliang@kylinos.cn>

Hi Geliang,

Thank you for looking at that!

On 02/02/2026 10:21, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
> 
> This patch implements the .splice_eof interface for MPTCP, namely
> mptcp_splice_eof(), which sequentially calls do_tcp_splice_eof() for
> each subflow.

Can you please explain what this hook is supposed to do / used for please?
And also why the solution is to call do_tcp_splice_eof() on each subflow?

Also, I'm a bit confused: why is this needed? Does it fix something or
is it a new feature or an optimisation?

> Suggested-by: Matthieu Baerts <matttbe@kernel.org>
> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
> ---
>  net/mptcp/protocol.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index c88882062c40..5635d196cb9f 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
> @@ -4018,6 +4018,20 @@ static int mptcp_connect(struct sock *sk, struct sockaddr_unsized *uaddr,
>  	return 0;
>  }
>  
> +static void mptcp_splice_eof(struct socket *sock)
> +{
> +	struct mptcp_subflow_context *subflow;
> +	struct sock *sk = sock->sk, *ssk;
> +
> +	lock_sock(sk);
> +	mptcp_for_each_subflow(mptcp_sk(sk), subflow) {
> +		ssk = mptcp_subflow_tcp_sock(subflow);
> +
> +		do_tcp_splice_eof(ssk);

Is it fine to call this on closed subflows? e.g. if the initial subflow
has been closed. (I didn't check, maybe that's OK)

> +	}
> +	release_sock(sk);
> +}
> +
>  static struct proto mptcp_prot = {
>  	.name		= "MPTCP",
>  	.owner		= THIS_MODULE,
> @@ -4049,6 +4063,7 @@ static struct proto mptcp_prot = {
>  	.obj_size	= sizeof(struct mptcp_sock),
>  	.slab_flags	= SLAB_TYPESAFE_BY_RCU,
>  	.no_autobind	= true,
> +	.splice_eof	= mptcp_splice_eof,
>  };
>  
>  static int mptcp_bind(struct socket *sock, struct sockaddr_unsized *uaddr, int addr_len)
> @@ -4540,6 +4555,7 @@ static const struct proto_ops mptcp_stream_ops = {
>  	.set_rcvlowat	   = mptcp_set_rcvlowat,
>  	.read_sock	   = mptcp_read_sock,
>  	.splice_read	   = mptcp_splice_read,
> +	.splice_eof	   = inet_splice_eof,

Is this line required? Will it not call inet_splice_eof() by default? (I
didn't check)

>  };
>  
>  static struct inet_protosw mptcp_protosw = {

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


  reply	other threads:[~2026-02-02 10:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-02  9:21 [PATCH mptcp-next 0/3] implement .splice_eof Geliang Tang
2026-02-02  9:21 ` [PATCH mptcp-next 1/3] tcp: export do_tcp_splice_eof Geliang Tang
2026-02-02  9:21 ` [PATCH mptcp-next 2/3] mptcp: implement .splice_eof Geliang Tang
2026-02-02 10:07   ` Matthieu Baerts [this message]
2026-02-03  6:36     ` Geliang Tang
2026-02-03  9:07       ` Matthieu Baerts
2026-02-02  9:21 ` [PATCH mptcp-next 3/3] selftests: mptcp: connect: trigger splice_eof Geliang Tang
2026-02-02 10:09   ` Matthieu Baerts
2026-02-03  6:26     ` Geliang Tang
2026-02-02 10:41 ` [PATCH mptcp-next 0/3] implement .splice_eof 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=5866364b-87b9-4abd-9eed-5437e6c56ffb@kernel.org \
    --to=matttbe@kernel.org \
    --cc=geliang@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox