Commit 72bcbc46 authored by Paolo Abeni's avatar Paolo Abeni Committed by David S. Miller
Browse files

mptcp: increase default max additional subflows to 2



The current default does not allowing additional subflows, mostly
as a safety restriction to avoid uncontrolled resource consumption
on busy servers.

Still the system admin and/or the application have to opt-in to
MPTCP explicitly. After that, they need to change (increase) the
default maximum number of additional subflows.

Let set that to reasonable default, and make end-users life easier.

Additionally we need to update some self-tests accordingly.

Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 29211e7d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2052,6 +2052,9 @@ static int __net_init pm_nl_init_net(struct net *net)
	struct pm_nl_pernet *pernet = net_generic(net, pm_nl_pernet_id);

	INIT_LIST_HEAD_RCU(&pernet->local_addr_list);

	/* Cit. 2 subflows ought to be enough for anybody. */
	pernet->subflows_max = 2;
	pernet->next_id = 1;
	pernet->stale_loss_cnt = 4;
	spin_lock_init(&pernet->lock);
+4 −1
Original line number Diff line number Diff line
@@ -945,12 +945,15 @@ subflows_tests()

	# subflow limited by client
	reset
	ip netns exec $ns1 ./pm_nl_ctl limits 0 0
	ip netns exec $ns2 ./pm_nl_ctl limits 0 0
	ip netns exec $ns2 ./pm_nl_ctl add 10.0.3.2 flags subflow
	run_tests $ns1 $ns2 10.0.1.1
	chk_join_nr "single subflow, limited by client" 0 0 0

	# subflow limited by server
	reset
	ip netns exec $ns1 ./pm_nl_ctl limits 0 0
	ip netns exec $ns2 ./pm_nl_ctl limits 0 1
	ip netns exec $ns2 ./pm_nl_ctl add 10.0.3.2 flags subflow
	run_tests $ns1 $ns2 10.0.1.1
@@ -973,7 +976,7 @@ subflows_tests()
	run_tests $ns1 $ns2 10.0.1.1
	chk_join_nr "multiple subflows" 2 2 2

	# multiple subflows limited by serverf
	# multiple subflows limited by server
	reset
	ip netns exec $ns1 ./pm_nl_ctl limits 0 1
	ip netns exec $ns2 ./pm_nl_ctl limits 0 2
+3 −3
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ check()

check "ip netns exec $ns1 ./pm_nl_ctl dump" "" "defaults addr list"
check "ip netns exec $ns1 ./pm_nl_ctl limits" "accept 0
subflows 0" "defaults limits"
subflows 2" "defaults limits"

ip netns exec $ns1 ./pm_nl_ctl add 10.0.1.1
ip netns exec $ns1 ./pm_nl_ctl add 10.0.1.2 flags subflow dev lo
@@ -118,11 +118,11 @@ check "ip netns exec $ns1 ./pm_nl_ctl dump" "" "flush addrs"

ip netns exec $ns1 ./pm_nl_ctl limits 9 1
check "ip netns exec $ns1 ./pm_nl_ctl limits" "accept 0
subflows 0" "rcv addrs above hard limit"
subflows 2" "rcv addrs above hard limit"

ip netns exec $ns1 ./pm_nl_ctl limits 1 9
check "ip netns exec $ns1 ./pm_nl_ctl limits" "accept 0
subflows 0" "subflows above hard limit"
subflows 2" "subflows above hard limit"

ip netns exec $ns1 ./pm_nl_ctl limits 8 8
check "ip netns exec $ns1 ./pm_nl_ctl limits" "accept 8