[PATCH mptcp-net v3 0/4] mptcp: fixes for SIOCINQ

Geliang Tang posted 4 patches 18 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/cover.1795396910.git.tanggeliang@kylinos.cn
net/mptcp/options.c  |  1 +
net/mptcp/protocol.c | 63 ++++++++++++++++++++++++++++----------------
2 files changed, 42 insertions(+), 22 deletions(-)
[PATCH mptcp-net v3 0/4] mptcp: fixes for SIOCINQ
Posted by Geliang Tang 18 hours ago
From: Geliang Tang <tanggeliang@kylinos.cn>

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

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

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: handle ack_seq advancing past rcv_data_fin_seq
  mptcp: add missing memory barriers for rcv_data_fin_seq
  mptcp: fix TFO SIOCINQ overflow in mptcp_inq_hint
  mptcp: add mptcp_inq() for SIOCINQ

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

-- 
2.55.0
Re: [PATCH mptcp-net v3 0/4] mptcp: fixes for SIOCINQ
Posted by MPTCP CI 16 hours ago
Hi Geliang,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal (except selftest_mptcp_join): Success! ✅
- KVM Validation: normal (only selftest_mptcp_join): Success! ✅
- KVM Validation: debug (except selftest_mptcp_join): Success! ✅
- KVM Validation: debug (only selftest_mptcp_join): Unstable: 1 failed test(s): selftest_mptcp_join ⚠️ 
- KVM Validation: btf-normal (only bpftest_all): Success! ✅
- KVM Validation: btf-debug (only bpftest_all): Success! ✅
- Perf: Unstable: 2 failed test(s): regression:sched-rmem validation:sched-loss(2) ⚠️  (105 new outliers to review)
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/45096063097

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/fe4d1aa6c043
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=1219076


If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-normal

For more details:

    https://github.com/multipath-tcp/mptcp-upstream-virtme-docker


Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)