Commit 9ab614bc authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge branch 'mptcp-handle-late-add_addr-selftests-skip'

Matthieu Baerts says:

====================
mptcp: handle late ADD_ADDR + selftests skip

Here are a few independent fixes related to MPTCP and its selftests:

- Patch 1: correctly handle ADD_ADDR being received after the switch to
  'fully-established'. A fix for another recent fix backported up to
  v5.14.

- Patches 2-5: properly mark some MPTCP Join subtests as 'skipped' if
  the tested kernel doesn't support the feature being validated. Some
  fixes for up to v5.13, v5.18, v6.11 and v6.18-rc1 respectively.
====================

Link: https://patch.msgid.link/20251020-net-mptcp-c-flag-late-add-addr-v1-0-8207030cb0e8@kernel.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 49d34f3d a9649dfb
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -370,6 +370,10 @@ static void mptcp_pm_create_subflow_or_signal_addr(struct mptcp_sock *msk)
	}

subflow:
	/* No need to try establishing subflows to remote id0 if not allowed */
	if (mptcp_pm_add_addr_c_flag_case(msk))
		goto exit;

	/* check if should create a new subflow */
	while (msk->pm.local_addr_used < endp_subflow_max &&
	       msk->pm.extra_subflows < limit_extra_subflows) {
@@ -401,6 +405,8 @@ static void mptcp_pm_create_subflow_or_signal_addr(struct mptcp_sock *msk)
			__mptcp_subflow_connect(sk, &local, &addrs[i]);
		spin_lock_bh(&msk->pm.lock);
	}

exit:
	mptcp_pm_nl_check_work_pending(msk);
}

+9 −9
Original line number Diff line number Diff line
@@ -2324,7 +2324,7 @@ laminar_endp_tests()
{
	# no laminar endpoints: routing rules are used
	if reset_with_tcp_filter "without a laminar endpoint" ns1 10.0.2.2 REJECT &&
	   mptcp_lib_kallsyms_has "mptcp_pm_get_endp_laminar_max$"; then
	   continue_if mptcp_lib_kallsyms_has "mptcp_pm_get_endp_laminar_max$"; then
		pm_nl_set_limits $ns1 0 2
		pm_nl_set_limits $ns2 2 2
		pm_nl_add_endpoint $ns1 10.0.2.1 flags signal
@@ -2336,7 +2336,7 @@ laminar_endp_tests()

	# laminar endpoints: this endpoint is used
	if reset_with_tcp_filter "with a laminar endpoint" ns1 10.0.2.2 REJECT &&
	   mptcp_lib_kallsyms_has "mptcp_pm_get_endp_laminar_max$"; then
	   continue_if mptcp_lib_kallsyms_has "mptcp_pm_get_endp_laminar_max$"; then
		pm_nl_set_limits $ns1 0 2
		pm_nl_set_limits $ns2 2 2
		pm_nl_add_endpoint $ns1 10.0.2.1 flags signal
@@ -2348,7 +2348,7 @@ laminar_endp_tests()

	# laminar endpoints: these endpoints are used
	if reset_with_tcp_filter "with multiple laminar endpoints" ns1 10.0.2.2 REJECT &&
	   mptcp_lib_kallsyms_has "mptcp_pm_get_endp_laminar_max$"; then
	   continue_if mptcp_lib_kallsyms_has "mptcp_pm_get_endp_laminar_max$"; then
		pm_nl_set_limits $ns1 0 2
		pm_nl_set_limits $ns2 2 2
		pm_nl_add_endpoint $ns1 10.0.2.1 flags signal
@@ -2363,7 +2363,7 @@ laminar_endp_tests()

	# laminar endpoints: only one endpoint is used
	if reset_with_tcp_filter "single laminar endpoint" ns1 10.0.2.2 REJECT &&
	   mptcp_lib_kallsyms_has "mptcp_pm_get_endp_laminar_max$"; then
	   continue_if mptcp_lib_kallsyms_has "mptcp_pm_get_endp_laminar_max$"; then
		pm_nl_set_limits $ns1 0 2
		pm_nl_set_limits $ns2 2 2
		pm_nl_add_endpoint $ns1 10.0.2.1 flags signal
@@ -2376,7 +2376,7 @@ laminar_endp_tests()

	# laminar endpoints: subflow and laminar flags
	if reset_with_tcp_filter "sublow + laminar endpoints" ns1 10.0.2.2 REJECT &&
	   mptcp_lib_kallsyms_has "mptcp_pm_get_endp_laminar_max$"; then
	   continue_if mptcp_lib_kallsyms_has "mptcp_pm_get_endp_laminar_max$"; then
		pm_nl_set_limits $ns1 0 4
		pm_nl_set_limits $ns2 2 4
		pm_nl_add_endpoint $ns1 10.0.2.1 flags signal
@@ -3939,7 +3939,7 @@ endpoint_tests()
	# subflow_rebuild_header is needed to support the implicit flag
	# userspace pm type prevents add_addr
	if reset "implicit EP" &&
	   mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
	   continue_if mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
		pm_nl_set_limits $ns1 2 2
		pm_nl_set_limits $ns2 2 2
		pm_nl_add_endpoint $ns1 10.0.2.1 flags signal
@@ -3964,7 +3964,7 @@ endpoint_tests()
	fi

	if reset_with_tcp_filter "delete and re-add" ns2 10.0.3.2 REJECT OUTPUT &&
	   mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
	   continue_if mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
		start_events
		pm_nl_set_limits $ns1 0 3
		pm_nl_set_limits $ns2 0 3
@@ -4040,7 +4040,7 @@ endpoint_tests()

	# remove and re-add
	if reset_with_events "delete re-add signal" &&
	   mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
	   continue_if mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
		ip netns exec $ns1 sysctl -q net.mptcp.add_addr_timeout=0
		pm_nl_set_limits $ns1 0 3
		pm_nl_set_limits $ns2 3 3
@@ -4115,7 +4115,7 @@ endpoint_tests()

	# flush and re-add
	if reset_with_tcp_filter "flush re-add" ns2 10.0.3.2 REJECT OUTPUT &&
	   mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
	   continue_if mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
		pm_nl_set_limits $ns1 0 2
		pm_nl_set_limits $ns2 1 2
		# broadcast IP: no packet for this address will be received on ns1