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-net v2 4/4] mptcp: add mptcp_inq() for SIOCINQ
Date: Tue, 24 Nov 2026 01:05:29 +0000	[thread overview]
Message-ID: <179548232967.3133.6523672027761488381@kernel.org> (raw)
In-Reply-To: <66c8d6fa77da5d076888ad6199f1699bf513fa28.1795348666.git.tanggeliang@kylinos.cn>

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 From:/Signed-off-by email addresses do not match.
- [Low] No in-tree selftest covers the behaviour this patch changes.

--

mptcp: add mptcp_inq() for SIOCINQ

This commit adds mptcp_inq(). It reports the readable bytes at the MPTCP
level as bytes_received - bytes_consumed and does not count the DATA_FIN
byte. SIOCINQ now uses mptcp_inq() instead of mptcp_inq_hint(), so
FIONREAD matches tcp_ioctl() when DATA_FIN is pending.

>     Co-developed-by: Zqiang <qiang.zhang@linux.dev>
>     Signed-off-by: Zqiang <qiang.zhang@linux.dev>
>     Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>

[Severity: Low]
This isn't a bug, but the author address and the author's Signed-off-by
address are different:

Author: Geliang Tang <geliang@kernel.org>
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>

checkpatch doesn't read .mailmap, so this patch triggers its
FROM_SIGN_OFF_MISMATCH warning.

Could the author and the sign-off use the same address?

> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index 7ef37f978f5b1..d9144fffe0163 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c

[ ... ]

> @@ -4153,7 +4168,7 @@ static int mptcp_ioctl(struct sock *sk, int cmd, int *karg)
>  		lock_sock(sk);
>  		if (mptcp_move_skbs(sk))
>  			mptcp_cleanup_rbuf(msk, 0);
> -		*karg = mptcp_inq_hint(sk);
> +		*karg = mptcp_inq(sk);

[Severity: Low]
This isn't a bug, but does any selftest cover the FIONREAD change made
here?

The MPTCP selftests call FIONREAD in only one place. It is in
process_one_client() in tools/testing/selftests/net/mptcp/mptcp_inq.c,
inside the polling loop that runs before the peer shuts down:

		ret = ioctl(fd, FIONREAD, &queued);
		...
		if (queued > expect_len)

No DATA_FIN has arrived at that point, so mptcp_inq_hint() and
mptcp_inq() return the same value.

After the "shut"/"closed" exchange, one data byte and the DATA_FIN are
pending. That is the only state where this patch changes the result. The
test only checks the TCP_CM_INQ cmsg there:

	iov.iov_len = 1;
	ret = recvmsg(fd, &msg, 0);
	...
	/* tcp_inq should be 1 due to received fin. */
	assert(tcp_inq == 1);

The cmsg value still comes from mptcp_inq_hint() in mptcp_recvmsg(),
which this patch doesn't change. So the selftest passes with both the old
N+1 result and the new N result.

Would it make sense to add a FIONREAD check that expects 1 just before
that recvmsg() call in process_one_client()? The old code would return 2
there.

>  		release_sock(sk);
>  		break;
>  	case SIOCOUTQ:

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

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

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-22 12:07 [PATCH mptcp-net v2 0/4] mptcp: fixes for SIOCINQ Geliang Tang
2026-11-22 12:07 ` [PATCH mptcp-net v2 1/4] mptcp: handle ack_seq advancing past rcv_data_fin_seq Geliang Tang
2026-11-24  1:05   ` netdev-bot+sashiko
2026-11-22 12:07 ` [PATCH mptcp-net v2 2/4] mptcp: add missing memory barriers for rcv_data_fin_seq Geliang Tang
2026-11-24  1:05   ` netdev-bot+sashiko
2026-11-22 12:07 ` [PATCH mptcp-net v2 3/4] mptcp: fix TFO SIOCINQ overflow in mptcp_inq_hint Geliang Tang
2026-11-22 12:21   ` sashiko-bot
2026-11-24  1:05   ` netdev-bot+sashiko
2026-11-22 12:07 ` [PATCH mptcp-net v2 4/4] mptcp: add mptcp_inq() for SIOCINQ Geliang Tang
2026-11-24  1:05   ` netdev-bot+sashiko [this message]
2026-11-22 14:26 ` [PATCH mptcp-net v2 0/4] mptcp: fixes " 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=179548232967.3133.6523672027761488381@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.