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 3/7] mptcp: implement peek_len for proto_ops
Date: Wed, 18 Nov 2026 01:05:45 +0000	[thread overview]
Message-ID: <179496394553.3133.12238622788939082283@kernel.org> (raw)
In-Reply-To: <0ecc320bbed2cf5713fd0e23c71bbb7127370a70.1794826541.git.geliang@kernel.org>

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The new mptcp_peek_len() (net/mptcp/protocol.c), wired into
  mptcp_stream_ops and mptcp_v6_stream_ops, has no caller that can reach…

--

mptcp: implement peek_len for proto_ops

This adds mptcp_inq(), which uses mptcp_data_avail() to report how many
bytes can be read at the MPTCP level. It also wires mptcp_inq() into a new
mptcp_peek_len() callback. That callback is set as .peek_len in both
mptcp_stream_ops and mptcp_v6_stream_ops, to prepare for kTLS and sockmap
support.

> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index 574eba9989a8d..a0ad28f5a3851 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
> @@ -4789,6 +4789,26 @@ static ssize_t mptcp_splice_read(struct socket *sock, loff_t *ppos,
>  	return ret;
>  }
>  
> +static int mptcp_inq(struct sock *sk)
> +{

[ ... ]

> +}
> +
> +static int mptcp_peek_len(struct socket *sock)
> +{
> +	return mptcp_inq(sock->sk);
> +}

[Severity: Low]
Can anything call mptcp_peek_len() on an MPTCP socket, either at this
commit or later in the series?

I can only find two users of ->peek_len. One is strp_peek_len() in
net/strparser/strparser.c, called from strp_recv() and strp_data_ready().
The other is drivers/vhost/net.c, and vhost-net only accepts AF_PACKET or
tap sockets through get_raw_socket() and get_tap_socket().

The strparser users don't seem to accept MPTCP sockets. sock_map_link()
only sets up the strparser for TCP:

net/core/sock_map.c:sock_map_link() {
    ...
	if (stream_parser && stream_verdict && !psock->saved_data_ready) {
		if (sk_is_tcp(sk))
			ret = sk_psock_init_strp(sk, psock);
		else
			ret = -EOPNOTSUPP;
    ...
}

sk_is_tcp() requires sk_protocol == IPPROTO_TCP. kcm_attach() also
rejects any csk->sk_protocol other than IPPROTO_TCP.

The commit message says:

    This prepares for upcoming kTLS and sockmap support.

Is the kTLS part accurate? kTLS receive doesn't use net/strparser. It has
its own parser in net/tls/tls_strp.c, which calls tcp_inq(), tcp_sk() and
tcp_read_sock() directly on strp->sk and never calls sock->ops->peek_len:

net/tls/tls_strp.c:tls_strp_read_sock() {
    ...
	inq = tcp_inq(strp->sk);
	if (inq < 1)
		return 0;
    ...
}

The commit message also uses a consumer that isn't in this series to
justify some specific choices: no EOF hint, no backlog drain, and
returning 0 in TCP_SYN_SENT/TCP_SYN_RECV.

None of the later patches in the series seem to add a caller either. That
covers "mptcp: add sendmsg_locked to proto_ops", "mptcp: track app-limited
state in mptcp_sendmsg", "mptcp: update mptcp_check_readable" and the
selftests.

Could this patch be merged together with its first user? Those choices
could then be checked against how the callback is actually used.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1794826541.git.geliang%40kernel.org

  reply	other threads:[~2026-11-18  1:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 10:57 [PATCH mptcp-next v8 0/7] prepare interfaces for kTLS and sockmap support Geliang Tang
2026-11-16 10:57 ` [PATCH mptcp-net v8 1/7] mptcp: fix TFO SIOCINQ overflow in mptcp_inq_hint Geliang Tang
2026-11-18  1:05   ` netdev-bot+sashiko
2026-11-16 10:57 ` [PATCH mptcp-next v8 2/7] selftests: mptcp: connect: check TFO SIOCINQ overflow Geliang Tang
2026-11-18  1:05   ` netdev-bot+sashiko
2026-11-16 10:57 ` [PATCH mptcp-next v8 3/7] mptcp: implement peek_len for proto_ops Geliang Tang
2026-11-18  1:05   ` netdev-bot+sashiko [this message]
2026-11-16 10:57 ` [PATCH mptcp-next v8 4/7] mptcp: add sendmsg_locked to proto_ops Geliang Tang
2026-11-18  1:05   ` netdev-bot+sashiko
2026-11-16 10:57 ` [PATCH mptcp-next v8 5/7] mptcp: track app-limited state in mptcp_sendmsg Geliang Tang
2026-11-18  1:05   ` netdev-bot+sashiko
2026-11-16 10:57 ` [PATCH mptcp-next v8 6/7] selftests: mptcp: sockopt: check app_limited Geliang Tang
2026-11-18  1:05   ` netdev-bot+sashiko
2026-11-16 10:57 ` [PATCH mptcp-next v8 7/7] mptcp: update mptcp_check_readable Geliang Tang
2026-11-16 13:38 ` [PATCH mptcp-next v8 0/7] prepare interfaces for kTLS and sockmap 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=179496394553.3133.12238622788939082283@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.