Skip to content

mptcp: pm: in-kernel: fullmesh: re-add of the initial subflow endp

Abdul Wasey mptcp stable 8 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest2 patches 3 repliesIn review
  2. v72 patches 1 replySuperseded
  3. v62 patches 1 replySuperseded
Earlier versions · 5
VersionPostedPatchesRepliesStatus
v52 patches1 replySuperseded
v42 patches1 replySuperseded
v32 patches1 replySuperseded
v22 patches1 replySuperseded
v12 patches2 repliesSuperseded

Changes in v5 from the cover letter

- Patch 1: when no subflow is left to take the remote ID 0 address from, use the remote address of the MPTCP socket, as fill_remote_addr() does. Without it, v4 also broke adding another endpoint after the removal of the initial one, when it was the only subflow (Sashiko on netdev).
- Patch 2: add two tests for the initial subflow alone: re-adding its endpoint, and adding another endpoint.
- v4: https://lore.kernel.org/mptcp/[email protected]/

Patches in v8 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2mptcp: pm: in-kernel: fullmesh: skip closed subflowsnet/mptcp/pm_kernel.c+32 -10 replies
2/2selftests: mptcp: join: re-add the initial subflow endp with fullmeshtools/testing/selftests/net/mptcp/mptcp_join.sh+133 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v8 yet.

Read the v8 thread

Cover letter [PATCH mptcp-net v8 0/2] mptcp: pm: in-kernel: fullmesh: re-add of the initial subflow endp

With fullmesh endpoints, removing and re-adding the endpoint used by the initial subflow never creates a new subflow from it: the closed initial subflow stays in the conn_list, and makes the PM think the remote ID 0 is already used, or picks its reset remote address. If the initial subflow was the only one, no address is left for the remote ID 0 at all.

Patch 1 fixes that, patch 2 adds tests for it.

Found with a router flapping one of its links: the link carrying the initial subflow never rejoined the existing connections. Tested on top of export-net: the new tests fail without patch 1, except the one adding another endpoint, which already worked and guards against breaking it. The whole mptcp_join.sh passes with patch 1.

Changes in v8, after the review of v7 by Sashiko on mptcp and on netdev, and the MPTCP CI:
- Patch 2: use nftables in the "after reset" test, as the rest of mptcp_join.sh does now: export-net also got be3b69f3cedf, so ${iptables} was empty there too, and the test failed on v7.
- Patch 2: stop the transfer and the event listeners before marking that test as skipped: when all features are expected, the skip exits.
- v7: https://lore.kernel.org/mptcp/[email protected]/

Changes in v7, after the review of v6 by Sashiko on netdev:
- Patch 2: in the two tests with the initial subflow alone, wait until the PM worker has accounted the initial subflow endpoint before removing it: a join on a third endpoint is created in the same worker run, then that endpoint is removed. v6 only detected the race.
- Patch 2: wait a bit before counting the subflows after the removal, as the other tests do: the closed subflow can still be listed.
- v6: https://lore.kernel.org/mptcp/[email protected]/

Changes in v6, after the review of v5 by Sashiko on netdev:
- Patch 1: in the commit message, the closed initial subflow keeps its remote address: only the destination port is zeroed, not the address.
- Patch 2: skip the "after reset" test if the iptables rule cannot be added, instead of passing, and check that the reset closed the subflow.
- Patch 2: in the two tests with the initial subflow alone, check it is gone after the removal of its endpoint: the ESTABLISHED event comes before the PM worker accounts that endpoint, so a removal right after it can miss the subflow.
- v5: https://lore.kernel.org/mptcp/[email protected]/

Changes in v5:
- Patch 1: when no subflow is left to take the remote ID 0 address from, use the remote address of the MPTCP socket, as fill_remote_addr() does. Without it, v4 also broke adding another endpoint after the removal of the initial one, when it was the only subflow (Sashiko on netdev).
- Patch 2: add two tests for the initial subflow alone: re-adding its endpoint, and adding another endpoint.
- v4: https://lore.kernel.org/mptcp/[email protected]/

Changes in v4:
- Patch 2: only check the joins when the iptables rule has been added (Sashiko).
- v3: https://lore.kernel.org/mptcp/[email protected]/

Changes in v3:
- Patch 2: use iptables instead of init_nftables(), which is only in net-next (Sashiko).
- v2: https://lore.kernel.org/mptcp/[email protected]/

Changes in v2:
- Patch 1: also skip the subflows in TCP_CLOSE: the initial subflow can be disconnected and its context reset, clearing the 'closing' flag and zeroing its remote address (Sashiko).
- Patch 2: validate this case too, by resetting the initial subflow before removing its endpoint.
- v1: https://lore.kernel.org/mptcp/[email protected]/

Abdul Wasey (2):
mptcp: pm: in-kernel: fullmesh: skip closed subflows
selftests: mptcp: join: re-add the initial subflow endp with fullmesh

 net/mptcp/pm_kernel.c                         |  33 ++++-
 .../testing/selftests/net/mptcp/mptcp_join.sh | 133 ++++++++++++++++++
 2 files changed, 165 insertions(+), 1 deletion(-)
Signature · 1 line
2.43.0