Hello,

On 29/01/2026 20:23, Matthieu Baerts (NGI0) wrote:
> From: Geliang Tang <[email protected]>
> 
> This patch implements .splice_read interface of mptcp struct proto_ops
> as mptcp_splice_read() with reference to tcp_splice_read().
> 
> Corresponding to __tcp_splice_read(), __mptcp_splice_read() is defined,
> invoking mptcp_read_sock() instead of tcp_read_sock().
> 
> mptcp_splice_read() is almost the same as tcp_splice_read(), except for
> sock_rps_record_flow().
> 
> Signed-off-by: Geliang Tang <[email protected]>
> Reviewed-by: Mat Martineau <[email protected]>
> Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
> ---
>  net/mptcp/protocol.c | 114 
> +++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 114 insertions(+)
> 
> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index c58e306ec3ef..3aee29f70954 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
> @@ -4396,6 +4396,118 @@ static int mptcp_read_sock(struct sock *sk, 
> read_descriptor_t *desc,
>       return __mptcp_read_sock(sk, desc, recv_actor, false);
>  }
>  
> +static int __mptcp_splice_read(struct sock *sk, struct tcp_splice_state *tss)
> +{
> +     /* Store TCP splice context information in read_descriptor_t. */
> +     read_descriptor_t rd_desc = {
> +             .arg.data = tss,
> +             .count    = tss->len,
> +     };
> +
> +     return mptcp_read_sock(sk, &rd_desc, tcp_splice_data_recv);
> +}
> +
> +/**
> + *  mptcp_splice_read - splice data from MPTCP socket to a pipe
> + * @sock:    socket to splice from
> + * @ppos:    position (not valid)
> + * @pipe:    pipe to splice to
> + * @len:     number of bytes to splice
> + * @flags:   splice modifier flags
> + *
> + * Description:
> + *    Will read pages from given socket and fill them into a pipe.

This comment is a copy of tcp_splice_read() where only the first line
has been adapted, but this seems to cause a new kdoc warning:

  net/mptcp/protocol.c:4424 No description found for return value of
'mptcp_splice_read'


I guess something like that should be added in a v2:

  Return:
     Amount of bytes that have been spliced.

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


Reply via email to