Skip to content

Commit 72bcbc4

Browse files
Paolo Abenidavem330
authored andcommitted
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: Paolo Abeni <[email protected]> Signed-off-by: Mat Martineau <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 29211e7 commit 72bcbc4

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

net/mptcp/pm_netlink.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2052,6 +2052,9 @@ static int __net_init pm_nl_init_net(struct net *net)
20522052
struct pm_nl_pernet *pernet = net_generic(net, pm_nl_pernet_id);
20532053

20542054
INIT_LIST_HEAD_RCU(&pernet->local_addr_list);
2055+
2056+
/* Cit. 2 subflows ought to be enough for anybody. */
2057+
pernet->subflows_max = 2;
20552058
pernet->next_id = 1;
20562059
pernet->stale_loss_cnt = 4;
20572060
spin_lock_init(&pernet->lock);

tools/testing/selftests/net/mptcp/mptcp_join.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,12 +945,15 @@ subflows_tests()
945945

946946
# subflow limited by client
947947
reset
948+
ip netns exec $ns1 ./pm_nl_ctl limits 0 0
949+
ip netns exec $ns2 ./pm_nl_ctl limits 0 0
948950
ip netns exec $ns2 ./pm_nl_ctl add 10.0.3.2 flags subflow
949951
run_tests $ns1 $ns2 10.0.1.1
950952
chk_join_nr "single subflow, limited by client" 0 0 0
951953

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

976-
# multiple subflows limited by serverf
979+
# multiple subflows limited by server
977980
reset
978981
ip netns exec $ns1 ./pm_nl_ctl limits 0 1
979982
ip netns exec $ns2 ./pm_nl_ctl limits 0 2

tools/testing/selftests/net/mptcp/pm_netlink.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ check()
7070

7171
check "ip netns exec $ns1 ./pm_nl_ctl dump" "" "defaults addr list"
7272
check "ip netns exec $ns1 ./pm_nl_ctl limits" "accept 0
73-
subflows 0" "defaults limits"
73+
subflows 2" "defaults limits"
7474

7575
ip netns exec $ns1 ./pm_nl_ctl add 10.0.1.1
7676
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"
118118

119119
ip netns exec $ns1 ./pm_nl_ctl limits 9 1
120120
check "ip netns exec $ns1 ./pm_nl_ctl limits" "accept 0
121-
subflows 0" "rcv addrs above hard limit"
121+
subflows 2" "rcv addrs above hard limit"
122122

123123
ip netns exec $ns1 ./pm_nl_ctl limits 1 9
124124
check "ip netns exec $ns1 ./pm_nl_ctl limits" "accept 0
125-
subflows 0" "subflows above hard limit"
125+
subflows 2" "subflows above hard limit"
126126

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

0 commit comments

Comments
 (0)