MPTCP Linux Development
 help / color / mirror / Atom feed
* [PATCH mptcp-net v7 0/6] mptcp: fixes for SIOCINQ
@ 2026-12-03 16:48 Matthieu Baerts (NGI0)
  2026-12-03 16:48 ` [PATCH mptcp-net v7 1/6] mptcp: fix TFO SIOCINQ overflow in mptcp_inq_hint Matthieu Baerts (NGI0)
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-12-03 16:48 UTC (permalink / raw)
  To: MPTCP Linux; +Cc: Matthieu Baerts (NGI0), Zqiang, Paolo Abeni, Geliang Tang

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_inq_hint() INT_MAX overflow on passive TFO by using
mptcp_data_avail() instead of ack_seq minus map_seq. A fix for v6.2.

The next patches are for mptcp-next, as they are not urgent:

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

- Patch 3 extracts the DATA_FIN check of mptcp_pending_data_fin() into a
  helper, for patch 6.

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

- Patch 5 uses SOCK_DONE in mptcp_inq_hint(), as tcp_inq_hint() does.

- Patch 6 counts the DATA_FIN in mptcp_inq_hint(), as TCP does with the
  FIN in TCP_CM_INQ.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
Changes in v7:
- Patch 1: new, the TFO fix of v6's patch 4 alone, for -net, with the
  Fixes tag of v6.2, where the issue is also visible. The other patches
  are now for mptcp-next. Note: I re-used Geliang's commit message from
  the previous version of patch 6, and kept him as author. I hope that's
  OK. (I removed Paolo's suggested-by because it is no longer something
  he suggested.) After the new fix, patch 6 title had to be modified.
- Patch 3: helper renamed to mptcp_rcv_data_fin_in_seq().
- Patch 4: moved before the mptcp_inq_hint() changes, not to count the
  FIN byte in SIOCINQ again after patch 1.
- Patch 6: the DATA_FIN changes of v6's patch 4.
- Patches 4-6: commit msg: the Packetdrill tests reproducing the issues.
- Link to v6: https://patch.msgid.link/cover.1796101973.git.tanggeliang@kylinos.cn

Changes in v6:
- add patch 2: factor mptcp_data_fin() out of mptcp_pending_data_fin() as
  a standalone preparation.
- patch 4: move the mptcp_data_fin() introduction to patch 2, and drop the
  rcv_data_fin_seq reset in mptcp_disconnect().
- Link to v5: https://patch.msgid.link/cover.1796008859.git.tanggeliang@kylinos.cn

Changes in v5:
- patch 3: check fallback in mptcp_inq_hint
- Link to v4: https://patch.msgid.link/cover.1795863454.git.tanggeliang@kylinos.cn

Changes in 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.
- Link to v3: https://patch.msgid.link/cover.1795396910.git.tanggeliang@kylinos.cn

Changes in 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
- Link to v2: https://patch.msgid.link/cover.1795348666.git.tanggeliang@kylinos.cn

Changes in 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
- Link to v1: https://patch.msgid.link/cover.1795318567.git.tanggeliang@kylinos.cn

---
Geliang Tang (6):
      mptcp: fix TFO SIOCINQ overflow in mptcp_inq_hint
      [mptcp-next] mptcp: add missing memory barriers for rcv_data_fin_seq
      [mptcp-next] mptcp: extract mptcp_rcv_data_fin_in_seq helper
      [mptcp-next] mptcp: add mptcp_inq() for SIOCINQ
      [mptcp-next] mptcp: use SOCK_DONE in mptcp_inq_hint
      [mptcp-next] mptcp: count the DATA_FIN in mptcp_inq_hint

 net/mptcp/options.c  |  1 +
 net/mptcp/protocol.c | 61 ++++++++++++++++++++++++++++++++++------------------
 2 files changed, 41 insertions(+), 21 deletions(-)
---
base-commit: a65588052e99335b9659dff59586854ba0215c81
change-id: 20261203-mptcp-fixes-for-siocinq-d84237074756

Best regards,
--  
Matthieu Baerts (NGI0) <matttbe@kernel.org>


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

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

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 16:48 [PATCH mptcp-net v7 0/6] mptcp: fixes for SIOCINQ Matthieu Baerts (NGI0)
2026-12-03 16:48 ` [PATCH mptcp-net v7 1/6] mptcp: fix TFO SIOCINQ overflow in mptcp_inq_hint Matthieu Baerts (NGI0)
2026-12-03 16:48 ` [PATCH mptcp-next mptcp-net v7 2/6] mptcp: add missing memory barriers for rcv_data_fin_seq Matthieu Baerts (NGI0)
2026-12-03 16:48 ` [PATCH mptcp-next mptcp-net v7 3/6] mptcp: extract mptcp_rcv_data_fin_in_seq helper Matthieu Baerts (NGI0)
2026-12-03 16:48 ` [PATCH mptcp-next mptcp-net v7 4/6] mptcp: add mptcp_inq() for SIOCINQ Matthieu Baerts (NGI0)
2026-12-03 16:48 ` [PATCH mptcp-next mptcp-net v7 5/6] mptcp: use SOCK_DONE in mptcp_inq_hint Matthieu Baerts (NGI0)
2026-12-03 16:48 ` [PATCH mptcp-next mptcp-net v7 6/6] mptcp: count the DATA_FIN " Matthieu Baerts (NGI0)
2026-12-03 18:50   ` sashiko-bot
2026-12-04 10:55     ` Geliang Tang
2026-12-04 12:12       ` Matthieu Baerts
2026-12-04 12:14         ` Matthieu Baerts
2026-12-04 23:06         ` Geliang Tang
2026-12-05 14:28           ` Matthieu Baerts
2026-12-05  6:21   ` netdev-bot+sashiko
2026-12-03 18:33 ` [PATCH mptcp-net v7 0/6] mptcp: fixes for SIOCINQ MPTCP CI

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