[PATCH mptcp-net v2 00/17] mptcp: fix endpoints with 'signal' and 'subflow' flags

Matthieu Baerts (NGI0) posted 17 patches 3 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/20240715-mptcp-pm-avail-v2-0-fc5153bd1f6e@kernel.org
There is a newer version of this series
net/mptcp/options.c                             |   3 +-
net/mptcp/pm.c                                  |  10 --
net/mptcp/pm_netlink.c                          | 127 ++++++++++++++++-------
net/mptcp/protocol.h                            |   3 -
tools/testing/selftests/net/mptcp/mptcp_join.sh | 130 +++++++++++++++++++-----
5 files changed, 197 insertions(+), 76 deletions(-)
[PATCH mptcp-net v2 00/17] mptcp: fix endpoints with 'signal' and 'subflow' flags
Posted by Matthieu Baerts (NGI0) 3 months, 2 weeks ago
When looking at improving the user experience around the MPTCP endpoints
setup, I noticed that setting an endpoint with both the 'signal' and the
'subflow' flags -- as it has been done in the past by users according to
bug reports we got -- were resulting on only announcing the endpoint,
but not using it to create subflows: the 'subflow' flag was then
ignored.

My initial thought was to modify IPRoute2 to warn the user when the two
flags were set, but it doesn't sound normal to ignore one of them. I
then looked at modifying the kernel not to allow having the two flags
set, but when discussing about that with Mat, we thought it was maybe
not ideal to do that, as there might be use-cases, we might break some
configs, and it was working before apparently. So instead, I fixed the
support on the kernel side (patch 5) using Paolo's suggestion. This also
includes a fix on the options side (patch 1), an explicit deny of some
options combinations (patch 2), and some refactoring (patches 3 and 4).

While at it, I added a new selftest (patch 7) to validate this case --
including a modification of the chk_add_nr helper to inverse the sides
were the counters are checked (patch 6) -- and allowed ADD_ADDR echo
just after the MP_JOIN 3WHS.

While working on that, I also noticed that re-using IDs were not
possible in some cases -- see patches 8, 10 and 12 -- and the accounting
was not correct in some other cases -- see patches 14 to 17.

The selftests modification have the same Fixes tag as the previous
commit, but they should not get the 'Cc: Stable' one later: if the
backport can work, that's not, if not, no need to worry, many CIs will
use the selftests from the last stable version to validate previous
stable releases.

The last patches don't have any modifications of the selftests attached
to them, because the current ones were producing the new WARN() that
have just been added.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
Changes in v2:
- Do not split id_avail_bitmap per target in patch 5 (Paolo)
- Explicit deny (patch 2), reduce indentation (patch 3), stop earlier
  (patch 4) (Paolo)
- New fixes and tests (patches 8-17).
- Link to v1: https://lore.kernel.org/r/20240621-mptcp-pm-avail-v1-0-b692d5eb89b5@kernel.org

---
Matthieu Baerts (NGI0) (17):
      mptcp: fully established after ADD_ADDR echo on MPJ
      mptcp: pm: deny endp with signal + subflow + port
      mptcp: pm: reduce indentation blocks
      mptcp: pm: don't try to create sf if alloc failed
      mptcp: pm: do not ignore 'subflow' if 'signal' flag is also set
      selftests: mptcp: join: ability to invert ADD_ADDR check
      selftests: mptcp: join: test both signal & subflow
      mptcp: pm: re-using ID of unused removed ADD_ADDR
      selftests: mptcp: join: check re-using ID of unused ADD_ADDR
      mptcp: pm: re-using ID of unused removed subflows
      selftests: mptcp: join: check re-using ID of closed subflow
      mptcp: pm: re-using ID of unused flushed subflows
      selftests: mptcp: join: test for flush/re-add endpoints
      mptcp: pm: remove mptcp_pm_remove_subflow()
      mptcp: pm: only mark 'subflow' endp as available
      mptcp: pm: only decrement add_addr_accepted for MPJ req
      mptcp: pm: check add_addr_accept_max before accepting new ADD_ADDR

 net/mptcp/options.c                             |   3 +-
 net/mptcp/pm.c                                  |  10 --
 net/mptcp/pm_netlink.c                          | 127 ++++++++++++++++-------
 net/mptcp/protocol.h                            |   3 -
 tools/testing/selftests/net/mptcp/mptcp_join.sh | 130 +++++++++++++++++++-----
 5 files changed, 197 insertions(+), 76 deletions(-)
---
base-commit: 6cad12b229c1b550b9be002f364632fd0f120b24
change-id: 20240620-mptcp-pm-avail-f5e3957be441

Best regards,
-- 
Matthieu Baerts (NGI0) <matttbe@kernel.org>
Re: [PATCH mptcp-net v2 00/17] mptcp: fix endpoints with 'signal' and 'subflow' flags
Posted by MPTCP CI 3 months, 2 weeks ago
Hi Matthieu,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal: Success! ✅
- KVM Validation: debug: Success! ✅
- KVM Validation: btf (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/9946799319

Initiator: Matthieu Baerts (NGI0)
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/303d54a702ed
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=871305


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)
Re: [PATCH mptcp-net v2 00/17] mptcp: fix endpoints with 'signal' and 'subflow' flags
Posted by MPTCP CI 3 months, 2 weeks ago
Hi Matthieu,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal: Unstable: 5 failed test(s): packetdrill_fastclose packetdrill_mp_join packetdrill_mp_prio packetdrill_mp_reset packetdrill_syscalls 🔴
- KVM Validation: debug: Unstable: 7 failed test(s): packetdrill_fastclose packetdrill_fastopen packetdrill_mp_join packetdrill_mp_prio packetdrill_mp_reset packetdrill_syscalls selftest_mptcp_connect 🔴
- KVM Validation: btf (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/9937776049

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


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)
Re: [PATCH mptcp-net v2 00/17] mptcp: fix endpoints with 'signal' and 'subflow' flags
Posted by Matthieu Baerts 3 months, 2 weeks ago
Hello,

On 15/07/2024 13:06, MPTCP CI wrote:
> Hi Matthieu,
> 
> Thank you for your modifications, that's great!
> 
> Our CI did some validations and here is its report:
> 
> - KVM Validation: normal: Unstable: 5 failed test(s): packetdrill_fastclose packetdrill_mp_join packetdrill_mp_prio packetdrill_mp_reset packetdrill_syscalls 🔴
> - KVM Validation: debug: Unstable: 7 failed test(s): packetdrill_fastclose packetdrill_fastopen packetdrill_mp_join packetdrill_mp_prio packetdrill_mp_reset packetdrill_syscalls selftest_mptcp_connect 🔴

FYI, these failed tests are likely not due to these patches, because
they are also visible when using the last export branch, synced just
before having sent these patches:

 https://github.com/multipath-tcp/mptcp_net-next/actions/runs/9936227696
 https://ci-results.mptcp.dev/flakes.html

It looks like it is due to a patch recently applied in net-next:

 https://lore.kernel.org/netdev/19b76438-2fc8-4f2f-a0ae-c988f5b17e9f@kernel.org/T/#u

I will soon apply a revert of this patch in our tree (or the suggested fix)

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.