Skip to contentSkip to conversation

fullmesh path manager support

PATCH Superseded Geliang Tang 4 participants 11 messages Jul 27, 2021 – Jul 29, 2021

Subsystems (3)

v6 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v6 cover fullmesh path manager support

From: Geliang Tang <[email protected]>

v6:
- drop lookup_subflow_by_addrs()
- pass three arrays instead of 'entries' in fill_local_adresses_vec()
- drop the 'remote' argument of fill_local_addresses_vec
- drop the 'local' argument of fill_remote_addresses_vec
- fix the pm.subflows.
- add limit testcase.

v5:
- patch 1, add a new helper lookup_address_in_vec.
- patch 2, update pm.subflows in the non-fullmesh case.
- patch 4, add more tests.
- tag: export/20210727T054640

v4:
- add new helpers, fill_local/remote_addresses_vec
- add max_subflows checks
- add 'local' into the local addresses array only when no fullmesh entry found.
- add signal,fullmesh check

v3:
- the in-kernel fullmesh path manager has been dropped from this patchset, only keep the fullmesh flag support code.

v2:
- Implement the fullmesh mode as an extension to the netlink PM, not a standalone PM as Paolo suggested.
- drop duplicate code.
- add a new per endpoint flag MPTCP_PM_ADDR_FLAG_FULLMESH.

Geliang Tang (5):
mptcp: remote addresses fullmesh
mptcp: local addresses fullmesh
selftests: mptcp: set and print the fullmesh flag
selftests: mptcp: add fullmesh testcases
selftests: mptcp: delete uncontinuous removing ids

 include/uapi/linux/mptcp.h                    |   1 +
 net/mptcp/pm_netlink.c                        | 145 ++++++++++++++++--
 .../testing/selftests/net/mptcp/mptcp_join.sh |  67 +++++++-
 tools/testing/selftests/net/mptcp/pm_nl_ctl.c |  16 +-
 4 files changed, 206 insertions(+), 23 deletions(-)
Signature · 1 line
2.31.1
#1 lore raw

PATCH v6 1/5 mptcp: remote addresses fullmesh

From: Geliang Tang <[email protected]>

This patch added and managed a new per endpoint flag, named MPTCP_PM_ADDR_FLAG_FULLMESH.

In mptcp_pm_create_subflow_or_signal_addr(), if such flag is set, instead of:

        remote_address((struct sock_common *)sk, &remote);

fill a temporary allocated array of all known remote address. After releaseing the pm lock loop on such array and create a subflow for each remote address from the given local.

Note that the we could still use an array even for non 'fullmesh'
endpoint: with a single entry corresponding to the primary MPC subflow remote address.

---
 include/uapi/linux/mptcp.h |  1 +
 net/mptcp/pm_netlink.c     | 64 +++++++++++++++++++++++++++++++++++---
 2 files changed, 60 insertions(+), 5 deletions(-)
include/uapi/linux/mptcp.h +1 -0
index 7b05f7102321..f66038b9551f 100644
@@ -73,6 +73,7 @@ enum {
 #define MPTCP_PM_ADDR_FLAG_SIGNAL			(1 << 0)
 #define MPTCP_PM_ADDR_FLAG_SUBFLOW			(1 << 1)
 #define MPTCP_PM_ADDR_FLAG_BACKUP			(1 << 2)
+#define MPTCP_PM_ADDR_FLAG_FULLMESH			(1 << 3)
 
 enum {
 	MPTCP_PM_CMD_UNSPEC,
net/mptcp/pm_netlink.c +59 -5

80 lines not on this page · raw message

Signature · 1 line
2.31.1
#2 lore raw

PATCH v6 2/5 mptcp: local addresses fullmesh

From: Geliang Tang <[email protected]>

In mptcp_pm_nl_add_addr_received(), fill a temporary allocate array of all local address corresponding to the fullmesh endpoint. If such array is empty, keep the current behavior.

Elsewhere loop on such array and create a subflow for each local address towards the given remote address

---
 net/mptcp/pm_netlink.c | 81 ++++++++++++++++++++++++++++++++++++------
 1 file changed, 71 insertions(+), 10 deletions(-)
net/mptcp/pm_netlink.c +71 -10
index ecf43d45711a..b2d2256f2abd 100644
@@ -538,13 +538,76 @@ static void mptcp_pm_nl_subflow_established(struct mptcp_sock *msk)
 	mptcp_pm_create_subflow_or_signal_addr(msk);
 }
 
+/*
+ * Fill all the local addresses into the three arrays,
+ * addr[], flags[] and ifindex[],
+ * and return the arrays size.
+ */
+static unsigned int fill_local_addresses_vec(struct mptcp_sock *msk,
+					     struct mptcp_addr_info *addr,
+					     u8 *flags, int *ifindex)
+{
+	struct sock *sk = (struct sock *)msk;
+	struct mptcp_pm_addr_entry *entry;
+	struct mptcp_addr_info local;
+	struct pm_nl_pernet *pernet;
+	unsigned int subflows_max;
+	int i = 0;
+
+	pernet = net_generic(sock_net(sk), pm_nl_pernet_id);
+	subflows_max = mptcp_pm_get_subflows_max(msk);
+
+	rcu_read_lock();
+	__mptcp_flush_join_list(msk);
+	list_for_each_entry_rcu(entry, &pernet->local_addr_list, list) {
+		if (!(entry->flags & MPTCP_PM_ADDR_FLAG_FULLMESH))
+			continue;
+
+		if (entry->addr.family != sk->sk_family) {
+#if IS_ENABLED(CONFIG_MPTCP_IPV6)
+			if ((entry->addr.family == AF_INET &&
+			     !ipv6_addr_v4mapped(&sk->sk_v6_daddr)) ||
+			    (sk->sk_family == AF_INET &&
+			     !ipv6_addr_v4mapped(&entry->addr.addr6)))
+#endif
+				continue;
+		}
+
+		if (msk->pm.subflows < subflows_max) {
+			msk->pm.subflows++;
+			addr[i] = entry->addr;
+			flags[i] = entry->flags;
+			ifindex[i] = entry->ifindex;
+			i++;
+		}
+	}
+	rcu_read_unlock();
+
+	/* if the array is empty, fill in the local address */
+	if (!i) {
+		memset(&local, 0, sizeof(local));
+		local.family = msk->pm.remote.family;
+
+		msk->pm.subflows++;
+		addr[i] = local;
+		flags[i] = 0;
+		ifindex[i] = 0;
+		i++;
+	}
+
+	return i;
+}
+
 static void mptcp_pm_nl_add_addr_received(struct mptcp_sock *msk)
 {
+	struct mptcp_addr_info addr[MPTCP_PM_ADDR_MAX];
 	struct sock *sk = (struct sock *)msk;
 	unsigned int add_addr_accept_max;
+	int ifindex[MPTCP_PM_ADDR_MAX];
 	struct mptcp_addr_info remote;
-	struct mptcp_addr_info local;
+	u8 flags[MPTCP_PM_ADDR_MAX];
 	unsigned int subflows_max;
+	int i, nr;
 
 	add_addr_accept_max = mptcp_pm_get_add_addr_accept_max(msk);
 	subflows_max = mptcp_pm_get_subflows_max(msk);
@@ -556,23 +619,21 @@ static void mptcp_pm_nl_add_addr_received(struct mptcp_sock *msk)
 	if (lookup_subflow_by_daddr(&msk->conn_list, &msk->pm.remote))
 		goto add_addr_echo;
 
-	msk->pm.add_addr_accepted++;
-	msk->pm.subflows++;
-	if (msk->pm.add_addr_accepted >= add_addr_accept_max ||
-	    msk->pm.subflows >= subflows_max)
-		WRITE_ONCE(msk->pm.accept_addr, false);
-
 	/* connect to the specified remote address, using whatever
 	 * local address the routing configuration will pick.
 	 */
 	remote = msk->pm.remote;
 	if (!remote.port)
 		remote.port = sk->sk_dport;
-	memset(&local, 0, sizeof(local));
-	local.family = remote.family;
+	nr = fill_local_addresses_vec(msk, addr, flags, ifindex);
 
+	msk->pm.add_addr_accepted++;
+	if (msk->pm.add_addr_accepted >= add_addr_accept_max ||
+	    msk->pm.subflows >= subflows_max)
+		WRITE_ONCE(msk->pm.accept_addr, false);
 	spin_unlock_bh(&msk->pm.lock);
-	__mptcp_subflow_connect(sk, &local, &remote, 0, 0);
+	for (i = 0; i < nr; i++)
+		__mptcp_subflow_connect(sk, &addr[i], &remote, flags[i], ifindex[i]);
 	spin_lock_bh(&msk->pm.lock);
 
 add_addr_echo:
Signature · 1 line
2.31.1
#3 lore raw

PATCH v6 3/5 selftests: mptcp: set and print the fullmesh flag

From: Geliang Tang <[email protected]>

This patch dealt with the MPTCP_PM_ADDR_FLAG_FULLMESH flag in add_addr() and print_addr(), to set and print out the fullmesh flag.

---
 tools/testing/selftests/net/mptcp/pm_nl_ctl.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
tools/testing/selftests/net/mptcp/pm_nl_ctl.c +15 -1
index 115decfdc1ef..354784512748 100644
@@ -25,7 +25,7 @@
 static void syntax(char *argv[])
 {
 	fprintf(stderr, "%s add|get|set|del|flush|dump|accept [<args>]\n", argv[0]);
-	fprintf(stderr, "\tadd [flags signal|subflow|backup] [id <nr>] [dev <name>] <ip>\n");
+	fprintf(stderr, "\tadd [flags signal|subflow|backup|fullmesh] [id <nr>] [dev <name>] <ip>\n");
 	fprintf(stderr, "\tdel <id> [<ip>]\n");
 	fprintf(stderr, "\tget <id>\n");
 	fprintf(stderr, "\tset <ip> [flags backup|nobackup]\n");
@@ -236,11 +236,18 @@ int add_addr(int fd, int pm_family, int argc, char *argv[])
 					flags |= MPTCP_PM_ADDR_FLAG_SIGNAL;
 				else if (!strcmp(tok, "backup"))
 					flags |= MPTCP_PM_ADDR_FLAG_BACKUP;
+				else if (!strcmp(tok, "fullmesh"))
+					flags |= MPTCP_PM_ADDR_FLAG_FULLMESH;
 				else
 					error(1, errno,
 					      "unknown flag %s", argv[arg]);
 			}
 
+			if (flags & MPTCP_PM_ADDR_FLAG_SIGNAL &&
+			    flags & MPTCP_PM_ADDR_FLAG_FULLMESH) {
+				error(1, errno, "error flag fullmesh");
+			}
+
 			rta = (void *)(data + off);
 			rta->rta_type = MPTCP_PM_ADDR_ATTR_FLAGS;
 			rta->rta_len = RTA_LENGTH(4);
@@ -422,6 +429,13 @@ static void print_addr(struct rtattr *attrs, int len)
 					printf(",");
 			}
 
+			if (flags & MPTCP_PM_ADDR_FLAG_FULLMESH) {
+				printf("fullmesh");
+				flags &= ~MPTCP_PM_ADDR_FLAG_FULLMESH;
+				if (flags)
+					printf(",");
+			}
+
 			/* bump unknown flags, if any */
 			if (flags)
 				printf("0x%x", flags);
Signature · 1 line
2.31.1
#4 lore raw

PATCH v6 4/5 selftests: mptcp: add fullmesh testcases

From: Geliang Tang <[email protected]>

This patch added the testcases for the fullmesh address flag of the path manager.

Reuse the above 10 address numbers for the fullmesh test.

---
 .../testing/selftests/net/mptcp/mptcp_join.sh | 57 ++++++++++++++++++-
 1 file changed, 54 insertions(+), 3 deletions(-)
tools/testing/selftests/net/mptcp/mptcp_join.sh +54 -3
index 937e861e9490..2a27d6240f5b 100755
@@ -367,7 +367,13 @@ do_transfer()
 	fi
 
 	if [ $addr_nr_ns2 -gt 0 ]; then
-		let add_nr_ns2=addr_nr_ns2
+		if [ $addr_nr_ns2 -gt 10 ]; then
+			let add_nr_ns2=addr_nr_ns2-10
+			flags=subflow,fullmesh
+		else
+			let add_nr_ns2=addr_nr_ns2
+			flags=subflow
+		fi
 		counter=3
 		sleep 1
 		while [ $add_nr_ns2 -gt 0 ]; do
@@ -377,7 +383,7 @@ do_transfer()
 			else
 				addr="10.0.$counter.2"
 			fi
-			ip netns exec $ns2 ./pm_nl_ctl add $addr flags subflow
+			ip netns exec $ns2 ./pm_nl_ctl add $addr flags $flags
 			let counter+=1
 			let add_nr_ns2-=1
 		done
@@ -1697,6 +1703,46 @@ deny_join_id0_tests()
 	chk_join_nr "subflow and address allow join id0 2" 1 1 1
 }
 
+fullmesh_tests()
+{
+	# fullmesh 1
+	reset
+	ip netns exec $ns1 ./pm_nl_ctl limits 0 4
+	ip netns exec $ns2 ./pm_nl_ctl limits 1 4
+	ip netns exec $ns2 ./pm_nl_ctl add 10.0.2.2 flags subflow,fullmesh
+	ip netns exec $ns2 ./pm_nl_ctl add 10.0.3.2 flags subflow,fullmesh
+	run_tests $ns1 $ns2 10.0.1.1 0 1 0 slow
+	chk_join_nr "fullmesh test 1" 4 4 4
+	chk_add_nr 1 1
+
+	# fullmesh 2
+	reset
+	ip netns exec $ns1 ./pm_nl_ctl limits 1 3
+	ip netns exec $ns2 ./pm_nl_ctl limits 1 3
+	ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal
+	run_tests $ns1 $ns2 10.0.1.1 0 0 11 slow
+	chk_join_nr "fullmesh test 2" 3 3 3
+	chk_add_nr 1 1
+
+	# fullmesh 3
+	reset
+	ip netns exec $ns1 ./pm_nl_ctl limits 2 5
+	ip netns exec $ns2 ./pm_nl_ctl limits 1 5
+	ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal
+	run_tests $ns1 $ns2 10.0.1.1 0 0 12 slow
+	chk_join_nr "fullmesh test 3" 5 5 5
+	chk_add_nr 1 1
+
+	# fullmesh 4
+	reset
+	ip netns exec $ns1 ./pm_nl_ctl limits 2 4
+	ip netns exec $ns2 ./pm_nl_ctl limits 1 4
+	ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal
+	run_tests $ns1 $ns2 10.0.1.1 0 0 12 slow
+	chk_join_nr "fullmesh test 4" 4 4 4
+	chk_add_nr 1 1
+}
+
 all_tests()
 {
 	subflows_tests
@@ -1712,6 +1758,7 @@ all_tests()
 	syncookies_tests
 	checksum_tests
 	deny_join_id0_tests
+	fullmesh_tests
 }
 
 usage()
@@ -1730,6 +1777,7 @@ usage()
 	echo "  -k syncookies_tests"
 	echo "  -S checksum_tests"
 	echo "  -d deny_join_id0_tests"
+	echo "  -m fullmesh_tests"
 	echo "  -c capture pcap files"
 	echo "  -C enable data checksum"
 	echo "  -h help"
@@ -1765,7 +1813,7 @@ if [ $do_all_tests -eq 1 ]; then
 	exit $ret
 fi
 
-while getopts 'fsltra64bpkdchCS' opt; do
+while getopts 'fsltra64bpkdmchCS' opt; do
 	case $opt in
 		f)
 			subflows_tests
@@ -1806,6 +1854,9 @@ while getopts 'fsltra64bpkdchCS' opt; do
 		d)
 			deny_join_id0_tests
 			;;
+		m)
+			fullmesh_tests
+			;;
 		c)
 			;;
 		C)
Signature · 1 line
2.31.1
#5 lore raw

PATCH v6 5/5 selftests: mptcp: delete uncontinuous removing ids

From: Geliang Tang <[email protected]>

The removing addresses testcases can only deal with the continuous ids. This patch added the uncontinuous removing ids support.

Fixes f87744ad42446 ("selftests: mptcp: set addr id for removing testcases")
---
 tools/testing/selftests/net/mptcp/mptcp_join.sh | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
tools/testing/selftests/net/mptcp/mptcp_join.sh +6 -4
index 2a27d6240f5b..a5141f933f3c 100755
@@ -344,17 +344,18 @@ do_transfer()
 		let rm_nr_ns1=-addr_nr_ns1
 		if [ $rm_nr_ns1 -lt 8 ]; then
 			counter=1
+			pos=1
 			dump=(`ip netns exec ${listener_ns} ./pm_nl_ctl dump`)
 			if [ ${#dump[@]} -gt 0 ]; then
-				id=${dump[1]}
 				sleep 1
 
 				while [ $counter -le $rm_nr_ns1 ]
 				do
+					id=${dump[$pos]}
 					ip netns exec ${listener_ns} ./pm_nl_ctl del $id
 					sleep 1
 					let counter+=1
-					let id+=1
+					let pos+=5
 				done
 			fi
 		elif [ $rm_nr_ns1 -eq 8 ]; then
@@ -392,17 +393,18 @@ do_transfer()
 		let rm_nr_ns2=-addr_nr_ns2
 		if [ $rm_nr_ns2 -lt 8 ]; then
 			counter=1
+			pos=1
 			dump=(`ip netns exec ${connector_ns} ./pm_nl_ctl dump`)
 			if [ ${#dump[@]} -gt 0 ]; then
-				id=${dump[1]}
 				sleep 1
 
 				while [ $counter -le $rm_nr_ns2 ]
 				do
+					id=${dump[$pos]}
 					ip netns exec ${connector_ns} ./pm_nl_ctl del $id
 					sleep 1
 					let counter+=1
-					let id+=1
+					let pos+=5
 				done
 			fi
 		elif [ $rm_nr_ns2 -eq 8 ]; then
Signature · 1 line
2.31.1
maintainer
#6 lore raw

Re: [MPTCP][PATCH v6 mptcp-next 4/5] selftests: mptcp: add fullmesh testcases

In reply to Geliang Tang
Quoted 52 lines · Geliang Tang

From: Geliang Tang <[email protected]>

This patch added the testcases for the fullmesh address flag of the path manager.

Reuse the above 10 address numbers for the fullmesh test.

---
 .../testing/selftests/net/mptcp/mptcp_join.sh | 57 ++++++++++++++++++-
 1 file changed, 54 insertions(+), 3 deletions(-)
tools/testing/selftests/net/mptcp/mptcp_join.sh +16 -2
index 937e861e9490..2a27d6240f5b 100755
@@ -367,7 +367,13 @@ do_transfer()
 	fi
 
 	if [ $addr_nr_ns2 -gt 0 ]; then
-		let add_nr_ns2=addr_nr_ns2
+		if [ $addr_nr_ns2 -gt 10 ]; then
+			let add_nr_ns2=addr_nr_ns2-10
+			flags=subflow,fullmesh
+		else
+			let add_nr_ns2=addr_nr_ns2
+			flags=subflow
+		fi
 		counter=3
 		sleep 1
 		while [ $add_nr_ns2 -gt 0 ]; do
@@ -377,7 +383,7 @@ do_transfer()
 			else
 				addr="10.0.$counter.2"
 			fi
-			ip netns exec $ns2 ./pm_nl_ctl add $addr flags subflow
+			ip netns exec $ns2 ./pm_nl_ctl add $addr flags $flags
 			let counter+=1
 			let add_nr_ns2-=1
 		done
@@ -1697,6 +1703,46 @@ deny_join_id0_tests()
 	chk_join_nr "subflow and address allow join id0 2" 1 1 1
 }
 
+fullmesh_tests()
+{
+	# fullmesh 1
+	reset
+	ip netns exec $ns1 ./pm_nl_ctl limits 0 4
+	ip netns exec $ns2 ./pm_nl_ctl limits 1 4
+	ip netns exec $ns2 ./pm_nl_ctl add 10.0.2.2 flags subflow,fullmesh
+	ip netns exec $ns2 ./pm_nl_ctl add 10.0.3.2 flags subflow,fullmesh

tools/testing/selftests/net/mptcp/mptcp_join.sh deny_join_id0_tests() · line 1723

Quoted 10 lines
tools/testing/selftests/net/mptcp/mptcp_join.sh +10 -0
+	run_tests $ns1 $ns2 10.0.1.1 0 1 0 slow
+	chk_join_nr "fullmesh test 1" 4 4 4
+	chk_add_nr 1 1
+
+	# fullmesh 2
+	reset
+	ip netns exec $ns1 ./pm_nl_ctl limits 1 3
+	ip netns exec $ns2 ./pm_nl_ctl limits 1 3
+	ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal
+	run_tests $ns1 $ns2 10.0.1.1 0 0 11 slow

It still took me a bit follow topology creation here. I think a comment is deserved, the first time this kind of argument is used.

Additionally, I suggest to use the "12" as an argument even in the previous test, dropping the explicit endpoint creation, for consistency.

All the above could use a squash-to patch, as this is the only minor thing I have to comment for the whole series.

Thanks!

Paolo

#7 lore raw

Re: [MPTCP][PATCH v6 mptcp-next 4/5] selftests: mptcp: add fullmesh testcases

Hi Geliang, Paolo,

Thank you for the new version.

Quoted 20 lines · Paolo Abeni
Quoted 19 lines · Geliang Tang

From: Geliang Tang <[email protected]>

This patch added the testcases for the fullmesh address flag of the path manager.

Reuse the above 10 address numbers for the fullmesh test.

---
 .../testing/selftests/net/mptcp/mptcp_join.sh | 57 ++++++++++++++++++-
 1 file changed, 54 insertions(+), 3 deletions(-)
tools/testing/selftests/net/mptcp/mptcp_join.sh +0 -0
index 937e861e9490..2a27d6240f5b 100755
@@ -367,7 +367,13 @@ do_transfer()
 	fi
 
Quoted 3 lines

tools/testing/selftests/net/mptcp/mptcp_join.sh do_transfer() · line 370

Quoted 3 lines
tools/testing/selftests/net/mptcp/mptcp_join.sh +1 -1
 	if [ $addr_nr_ns2 -gt 0 ]; then
-		let add_nr_ns2=addr_nr_ns2
+		if [ $addr_nr_ns2 -gt 10 ]; then

Maybe more explicit if we pass 'fullmesh-X' where X is the number of addresses we need with the fullmesh flag.

local flags="subflow"

(...)

  if [[ "${addr_nr_ns2}" = "fullmesh-"* ]]; then
          flags="${flags},fullmesh"
          addr_nr_ns2=${addr_nr_ns2:9}
  fi

if [ $addr_nr_ns2 -gt 0 ]; then

          counter=3
          (...)

This can also be fixed with a squash-to patch ;)

Quoted 35 lines
Quoted 35 lines
tools/testing/selftests/net/mptcp/mptcp_join.sh +20 -1
+			let add_nr_ns2=addr_nr_ns2-10
+			flags=subflow,fullmesh
+		else
+			let add_nr_ns2=addr_nr_ns2
+			flags=subflow
+		fi
 		counter=3
 		sleep 1
 		while [ $add_nr_ns2 -gt 0 ]; do
@@ -377,7 +383,7 @@ do_transfer()
 			else
 				addr="10.0.$counter.2"
 			fi
-			ip netns exec $ns2 ./pm_nl_ctl add $addr flags subflow
+			ip netns exec $ns2 ./pm_nl_ctl add $addr flags $flags
 			let counter+=1
 			let add_nr_ns2-=1
 		done
@@ -1697,6 +1703,46 @@ deny_join_id0_tests()
 	chk_join_nr "subflow and address allow join id0 2" 1 1 1
 }
 
+fullmesh_tests()
+{
+	# fullmesh 1
+	reset
+	ip netns exec $ns1 ./pm_nl_ctl limits 0 4
+	ip netns exec $ns2 ./pm_nl_ctl limits 1 4
+	ip netns exec $ns2 ./pm_nl_ctl add 10.0.2.2 flags subflow,fullmesh
+	ip netns exec $ns2 ./pm_nl_ctl add 10.0.3.2 flags subflow,fullmesh
+	run_tests $ns1 $ns2 10.0.1.1 0 1 0 slow
+	chk_join_nr "fullmesh test 1" 4 4 4
+	chk_add_nr 1 1
+
+	# fullmesh 2
Quoted 8 lines

tools/testing/selftests/net/mptcp/mptcp_join.sh deny_join_id0_tests() · line 1723

Quoted 5 lines
tools/testing/selftests/net/mptcp/mptcp_join.sh +5 -0
+	reset
+	ip netns exec $ns1 ./pm_nl_ctl limits 1 3
+	ip netns exec $ns2 ./pm_nl_ctl limits 1 3
+	ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal
+	run_tests $ns1 $ns2 10.0.1.1 0 0 11 slow

It still took me a bit follow topology creation here. I think a comment is deserved, the first time this kind of argument is used.

Good idea!

It could be good to also rename the tests: "fullmesh test [1234]" are not very explicit.
It could be nice to put the topology there, e.g. "2x2", "2x2 w/ signal"? :)

Cheers,
Matt

Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net
#8 lore raw

Re: [MPTCP][PATCH v6 mptcp-next 4/5] selftests: mptcp: add fullmesh testcases

Hi Matt, Paolo,

Quoted 33 lines · Matthieu Baerts <[email protected]> 于2021年7月29日周四 上午1:41写道:

Hi Geliang, Paolo,

Thank you for the new version.

Quoted 20 lines · Paolo Abeni
Quoted 19 lines · Geliang Tang

From: Geliang Tang <[email protected]>

This patch added the testcases for the fullmesh address flag of the path manager.

Reuse the above 10 address numbers for the fullmesh test.

---
 .../testing/selftests/net/mptcp/mptcp_join.sh | 57 ++++++++++++++++++-
 1 file changed, 54 insertions(+), 3 deletions(-)
tools/testing/selftests/net/mptcp/mptcp_join.sh +0 -0
index 937e861e9490..2a27d6240f5b 100755
@@ -367,7 +367,13 @@ do_transfer()
     fi
 
Quoted 3 lines

tools/testing/selftests/net/mptcp/mptcp_join.sh do_transfer() · line 370

Quoted 3 lines
tools/testing/selftests/net/mptcp/mptcp_join.sh +1 -1
     if [ $addr_nr_ns2 -gt 0 ]; then
-            let add_nr_ns2=addr_nr_ns2
+            if [ $addr_nr_ns2 -gt 10 ]; then

Maybe more explicit if we pass 'fullmesh-X' where X is the number of addresses we need with the fullmesh flag.

Quoted 5 lines

local flags="subflow"

(...)

  if [[ "${addr_nr_ns2}" = "fullmesh-"* ]]; then

It doesn't work. addr_nr_ns2 is expected as a integer, we can't pass a string to it.

Otherwise, we will get this error:

./mptcp_join.sh: line 370: [: fullmesh-1: integer expression expected.

Quoted 9 lines
          flags="${flags},fullmesh"
          addr_nr_ns2=${addr_nr_ns2:9}

fi

if [ $addr_nr_ns2 -gt 0 ]; then

          counter=3
          (...)

This can also be fixed with a squash-to patch ;)

I have same new changes in this series, so I'll sent a v7.

All other comments will be added in v7.

Thanks,
-Geliang

Quoted 56 lines
Quoted 36 lines
Quoted 36 lines
tools/testing/selftests/net/mptcp/mptcp_join.sh +20 -1
+                    let add_nr_ns2=addr_nr_ns2-10
+                    flags=subflow,fullmesh
+            else
+                    let add_nr_ns2=addr_nr_ns2
+                    flags=subflow
+            fi
             counter=3
             sleep 1
             while [ $add_nr_ns2 -gt 0 ]; do
@@ -377,7 +383,7 @@ do_transfer()
                     else
                             addr="10.0.$counter.2"
                     fi
-                    ip netns exec $ns2 ./pm_nl_ctl add $addr flags subflow
+                    ip netns exec $ns2 ./pm_nl_ctl add $addr flags $flags
                     let counter+=1
                     let add_nr_ns2-=1
             done
@@ -1697,6 +1703,46 @@ deny_join_id0_tests()
     chk_join_nr "subflow and address allow join id0 2" 1 1 1
 }
 
+fullmesh_tests()
+{
+    # fullmesh 1
+    reset
+    ip netns exec $ns1 ./pm_nl_ctl limits 0 4
+    ip netns exec $ns2 ./pm_nl_ctl limits 1 4
+    ip netns exec $ns2 ./pm_nl_ctl add 10.0.2.2 flags subflow,fullmesh
+    ip netns exec $ns2 ./pm_nl_ctl add 10.0.3.2 flags subflow,fullmesh
+    run_tests $ns1 $ns2 10.0.1.1 0 1 0 slow
+    chk_join_nr "fullmesh test 1" 4 4 4
+    chk_add_nr 1 1
+
+    # fullmesh 2
Quoted 8 lines

tools/testing/selftests/net/mptcp/mptcp_join.sh deny_join_id0_tests() · line 1723

Quoted 5 lines
tools/testing/selftests/net/mptcp/mptcp_join.sh +5 -0
+    reset
+    ip netns exec $ns1 ./pm_nl_ctl limits 1 3
+    ip netns exec $ns2 ./pm_nl_ctl limits 1 3
+    ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal
+    run_tests $ns1 $ns2 10.0.1.1 0 0 11 slow

It still took me a bit follow topology creation here. I think a comment is deserved, the first time this kind of argument is used.

Good idea!

It could be good to also rename the tests: "fullmesh test [1234]" are not very explicit.
It could be nice to put the topology there, e.g. "2x2", "2x2 w/ signal"? :)

Cheers,
Matt
--
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net

maintainer Acked-by on the v6 series
#9 lore raw
In reply to Geliang Tang
Quoted 42 lines · Geliang Tang

From: Geliang Tang <[email protected]>

v6:
- drop lookup_subflow_by_addrs()
- pass three arrays instead of 'entries' in fill_local_adresses_vec()
- drop the 'remote' argument of fill_local_addresses_vec
- drop the 'local' argument of fill_remote_addresses_vec
- fix the pm.subflows.
- add limit testcase.

v5:
- patch 1, add a new helper lookup_address_in_vec.
- patch 2, update pm.subflows in the non-fullmesh case.
- patch 4, add more tests.
- tag: export/20210727T054640

v4:
- add new helpers, fill_local/remote_addresses_vec
- add max_subflows checks
- add 'local' into the local addresses array only when no fullmesh entry found.
- add signal,fullmesh check

v3:
- the in-kernel fullmesh path manager has been dropped from this patchset, only keep the fullmesh flag support code.

v2:
- Implement the fullmesh mode as an extension to the netlink PM, not a standalone PM as Paolo suggested.
- drop duplicate code.
- add a new per endpoint flag MPTCP_PM_ADDR_FLAG_FULLMESH.

Geliang Tang (5):
mptcp: remote addresses fullmesh
mptcp: local addresses fullmesh
selftests: mptcp: set and print the fullmesh flag
selftests: mptcp: add fullmesh testcases
selftests: mptcp: delete uncontinuous removing ids

Quoted 5 lines
 include/uapi/linux/mptcp.h                    |   1 +
 net/mptcp/pm_netlink.c                        | 145 ++++++++++++++++--
 .../testing/selftests/net/mptcp/mptcp_join.sh |  67 +++++++-
 tools/testing/selftests/net/mptcp/pm_nl_ctl.c |  16 +-
 4 files changed, 206 insertions(+), 23 deletions(-)

LGTM, I added some minor comment on patch 4/5, but could be addressed later/with squash-to patches.

Reviewed-by on the v6 series
#10 lore raw
In reply to Geliang Tang
Quoted 10 lines · Geliang Tang

From: Geliang Tang <[email protected]>

v6:
- drop lookup_subflow_by_addrs()
- pass three arrays instead of 'entries' in fill_local_adresses_vec()
- drop the 'remote' argument of fill_local_addresses_vec
- drop the 'local' argument of fill_remote_addresses_vec
- fix the pm.subflows.
- add limit testcase.

Thanks for the revisions! Extending the netlink PM is a much better fit.

I don't have any comments to add to Paolo and Mattheiu's squash-fix recommendations.

-Mat

Quoted 32 lines

v5:
- patch 1, add a new helper lookup_address_in_vec.
- patch 2, update pm.subflows in the non-fullmesh case.
- patch 4, add more tests.
- tag: export/20210727T054640

v4:
- add new helpers, fill_local/remote_addresses_vec
- add max_subflows checks
- add 'local' into the local addresses array only when no fullmesh entry found.
- add signal,fullmesh check

v3:
- the in-kernel fullmesh path manager has been dropped from this patchset, only keep the fullmesh flag support code.

v2:
- Implement the fullmesh mode as an extension to the netlink PM, not a standalone PM as Paolo suggested.
- drop duplicate code.
- add a new per endpoint flag MPTCP_PM_ADDR_FLAG_FULLMESH.

Geliang Tang (5):
mptcp: remote addresses fullmesh
mptcp: local addresses fullmesh
selftests: mptcp: set and print the fullmesh flag
selftests: mptcp: add fullmesh testcases
selftests: mptcp: delete uncontinuous removing ids

Quoted 11 lines
include/uapi/linux/mptcp.h                    |   1 +
net/mptcp/pm_netlink.c                        | 145 ++++++++++++++++--
.../testing/selftests/net/mptcp/mptcp_join.sh |  67 +++++++-
tools/testing/selftests/net/mptcp/pm_nl_ctl.c |  16 +-
4 files changed, 206 insertions(+), 23 deletions(-)
Signature · 1 line
2.31.1

--
Mat Martineau
Intel