MPTCP Linux Development
 help / color / mirror / Atom feed
* [PATCH mptcp-net v4 0/4] mptcp: fixes for SIOCINQ
@ 2026-11-28 11:08 Geliang Tang
  2026-11-28 11:08 ` [PATCH mptcp-net v4 1/4] mptcp: add missing memory barriers for rcv_data_fin_seq Geliang Tang
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Geliang Tang @ 2026-11-28 11:08 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

From: Geliang Tang <tanggeliang@kylinos.cn>

v4:
 - drop patch 1 "handle ack_seq advancing past rcv_data_fin_seq": revert
   '!before64()' back to '==' in mptcp_pending_data_fin(), the OFO queue
   edge case is not a real issue
 - add patch 2 "use SOCK_DONE in mptcp_inq_hint": replace the
   TCP_CLOSE/RCV_SHUTDOWN check with sock_flag(sk, SOCK_DONE), aligning
   with tcp_inq_hint()
 - patch 3: use sock_flag(sk, SOCK_DONE) to add FIN byte instead of
   checking TCP_CLOSE/RCV_SHUTDOWN and rcv_fastclose, simplifying the
   condition.

v3:
 - patch 3: fix Sashiko AI review comment
   avoid comparing ack_seq with unset rcv_data_fin_seq (0)
   check TCP_CLOSE/RCV_SHUTDOWN directly, only call mptcp_data_fin() when
   rcv_data_fin is true, exclude MP_FASTCLOSE from +1
 - https://patchwork.kernel.org/project/mptcp/cover/cover.1795396910.git.tanggeliang@kylinos.cn/

v2:
 - patch 3: drop mptcp_data_fin_seq(), reuse mptcp_data_fin()
   - u64 return couldn't distinguish "no DATA_FIN" from "DATA_FIN at seq 0"
   - mptcp_inq_hint() checks rcv_data_fin/TCP_CLOSE/RCV_SHUTDOWN first
 - https://patchwork.kernel.org/project/mptcp/cover/cover.1795348666.git.tanggeliang@kylinos.cn/

v1:
 - https://patchwork.kernel.org/project/mptcp/cover/cover.1795318567.git.tanggeliang@kylinos.cn/

The goal of this series is to make MPTCP's SIOCINQ fully consistent with
TCP's: both report the number of readable data bytes, excluding the FIN
byte.

Patch 1 fixes mptcp_pending_data_fin() to use >= instead of == so that
DATA_FIN is processed when ack_seq advances past rcv_data_fin_seq due to
OFO queue processing.

Patch 2 adds missing smp_wmb/smp_rmb barriers for rcv_data_fin_seq on
weakly-ordered architectures.

Patch 3 fixes mptcp_inq_hint() INT_MAX overflow on passive TFO by using
mptcp_data_avail() instead of ack_seq minus map_seq, and reuses
mptcp_data_fin() to guard the FIN byte (+1).

Patch 4 adds mptcp_inq() that excludes the FIN byte, matching TCP's
tcp_inq() behavior, and switches SIOCINQ to it.

Geliang Tang (4):
  mptcp: add missing memory barriers for rcv_data_fin_seq
  mptcp: use SOCK_DONE in mptcp_inq_hint
  mptcp: fix TFO SIOCINQ overflow in mptcp_inq_hint
  mptcp: add mptcp_inq() for SIOCINQ

 net/mptcp/options.c  |  1 +
 net/mptcp/protocol.c | 62 ++++++++++++++++++++++++++++----------------
 2 files changed, 41 insertions(+), 22 deletions(-)

-- 
2.55.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-11-28 12:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-28 11:08 [PATCH mptcp-net v4 0/4] mptcp: fixes for SIOCINQ Geliang Tang
2026-11-28 11:08 ` [PATCH mptcp-net v4 1/4] mptcp: add missing memory barriers for rcv_data_fin_seq Geliang Tang
2026-11-28 11:08 ` [PATCH mptcp-net v4 2/4] mptcp: use SOCK_DONE in mptcp_inq_hint Geliang Tang
2026-11-28 11:20   ` sashiko-bot
2026-11-28 11:08 ` [PATCH mptcp-net v4 3/4] mptcp: fix TFO SIOCINQ overflow " Geliang Tang
2026-11-28 11:25   ` sashiko-bot
2026-11-28 11:08 ` [PATCH mptcp-net v4 4/4] mptcp: add mptcp_inq() for SIOCINQ Geliang Tang
2026-11-28 12:13 ` [PATCH mptcp-net v4 0/4] mptcp: fixes " MPTCP CI

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox