[PATCH mptcp-net 0/6] mptcp: pm: userspace: properly deal with the ID0 case

Matthieu Baerts (NGI0) posted 6 patches 2 weeks, 4 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/20260727-mptcp-pm-userspace-id0-case-v1-0-9877f02a9bae@kernel.org
There is a newer version of this series
net/mptcp/pm.c                                  |  8 ++-
net/mptcp/pm_userspace.c                        | 69 +++++++++----------------
net/mptcp/protocol.h                            |  1 +
tools/testing/selftests/net/mptcp/mptcp_join.sh |  7 +--
4 files changed, 37 insertions(+), 48 deletions(-)
[PATCH mptcp-net 0/6] mptcp: pm: userspace: properly deal with the ID0 case
Posted by Matthieu Baerts (NGI0) 2 weeks, 4 days ago
In MPTCP, the local address and port used by the initial subflow has the
ID "0". It means that when this address and port are used for some
operations -- e.g. creating a new subflow -- they should be linked to
the ID0, and no other addresses and ports can get this special ID while
the initial IP address and port is used.

Instead of dealing with the ID0 case as an exception, add it to the
local addr list, and deal with it like the others, with minor
exceptions. That way, it seems easier to maintain instead of adding new
exceptions at a few places, at the cost of a few more bytes, which seems
OK in this mode.

The first patch modifies add the initial address to the list, and the
others remove exceptions, and validate that in the selftests.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
Matthieu Baerts (NGI0) (6):
      mptcp: pm: userspace: properly handle the ID0 case
      mptcp: pm: userspace: allow announcing ID0 addr
      mptcp: pm: userspace: no ID0 exception for RM_ADDR
      mptcp: pm: userspace: don't dump initial ID0
      selftests: mptcp: join: new ID0 subflow from the right IP
      mptcp: pm: restrict in-kernel worker actions to this PM

 net/mptcp/pm.c                                  |  8 ++-
 net/mptcp/pm_userspace.c                        | 69 +++++++++----------------
 net/mptcp/protocol.h                            |  1 +
 tools/testing/selftests/net/mptcp/mptcp_join.sh |  7 +--
 4 files changed, 37 insertions(+), 48 deletions(-)
---
base-commit: ddf9f880a057486230f16d6a4a8cab7e41c40da1
change-id: 20260724-mptcp-pm-userspace-id0-case-f074f64466c8

Best regards,
--  
Matthieu Baerts (NGI0) <matttbe@kernel.org>
Re: [PATCH mptcp-net 0/6] mptcp: pm: userspace: properly deal with the ID0 case
Posted by Mat Martineau 2 weeks ago
On Mon, 27 Jul 2026, Matthieu Baerts (NGI0) wrote:

> In MPTCP, the local address and port used by the initial subflow has the
> ID "0". It means that when this address and port are used for some
> operations -- e.g. creating a new subflow -- they should be linked to
> the ID0, and no other addresses and ports can get this special ID while
> the initial IP address and port is used.
>
> Instead of dealing with the ID0 case as an exception, add it to the
> local addr list, and deal with it like the others, with minor
> exceptions. That way, it seems easier to maintain instead of adding new
> exceptions at a few places, at the cost of a few more bytes, which seems
> OK in this mode.
>
> The first patch modifies add the initial address to the list, and the
> others remove exceptions, and validate that in the selftests.
>

The approach looks ok to me. Have you tested with mptcpd?

- Mat


> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
> ---
> Matthieu Baerts (NGI0) (6):
>      mptcp: pm: userspace: properly handle the ID0 case
>      mptcp: pm: userspace: allow announcing ID0 addr
>      mptcp: pm: userspace: no ID0 exception for RM_ADDR
>      mptcp: pm: userspace: don't dump initial ID0
>      selftests: mptcp: join: new ID0 subflow from the right IP
>      mptcp: pm: restrict in-kernel worker actions to this PM
>
> net/mptcp/pm.c                                  |  8 ++-
> net/mptcp/pm_userspace.c                        | 69 +++++++++----------------
> net/mptcp/protocol.h                            |  1 +
> tools/testing/selftests/net/mptcp/mptcp_join.sh |  7 +--
> 4 files changed, 37 insertions(+), 48 deletions(-)
> ---
> base-commit: ddf9f880a057486230f16d6a4a8cab7e41c40da1
> change-id: 20260724-mptcp-pm-userspace-id0-case-f074f64466c8
>
> Best regards,
> --
> Matthieu Baerts (NGI0) <matttbe@kernel.org>
>
>
>
Re: [PATCH mptcp-net 0/6] mptcp: pm: userspace: properly deal with the ID0 case
Posted by Matthieu Baerts 1 week, 2 days ago
On 01/08/2026 02:06, Mat Martineau wrote:
> On Mon, 27 Jul 2026, Matthieu Baerts (NGI0) wrote:
> 
>> In MPTCP, the local address and port used by the initial subflow has the
>> ID "0". It means that when this address and port are used for some
>> operations -- e.g. creating a new subflow -- they should be linked to
>> the ID0, and no other addresses and ports can get this special ID while
>> the initial IP address and port is used.
>>
>> Instead of dealing with the ID0 case as an exception, add it to the
>> local addr list, and deal with it like the others, with minor
>> exceptions. That way, it seems easier to maintain instead of adding new
>> exceptions at a few places, at the cost of a few more bytes, which seems
>> OK in this mode.
>>
>> The first patch modifies add the initial address to the list, and the
>> others remove exceptions, and validate that in the selftests.
>>
> 
> The approach looks ok to me. Have you tested with mptcpd?
No, but the "make check" is not validating that. What I'm changing here
is only about the ID0 case, which is quite specific, and cover by the
kernel selftests. I don't think I'm breaking anything here, but only a
full test suite would be able to check that, which we don't have with
mptcpd. I know that Gang is looking at adding some tests, but I guess
the first tests will not validate the IDs being used are the expected ones.

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.
Re: [PATCH mptcp-net 0/6] mptcp: pm: userspace: properly deal with the ID0 case
Posted by MPTCP CI 2 weeks, 4 days ago
Hi Matthieu,

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): Success! ✅
- KVM Validation: btf-normal (only bpftest_all): Success! ✅
- KVM Validation: btf-debug (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/30293699277

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


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)