mptcp: increase default max additional subflows to 2
authorPaolo Abeni <pabeni@redhat.com>
Fri, 15 Oct 2021 23:05:51 +0000 (16:05 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 16 Oct 2021 07:46:08 +0000 (08:46 +0100)
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 <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mptcp/pm_netlink.c
tools/testing/selftests/net/mptcp/mptcp_join.sh
tools/testing/selftests/net/mptcp/pm_netlink.sh

index 050eea2..f7d33a9 100644 (file)
@@ -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);
index 255793c..293d349 100755 (executable)
@@ -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
index 3c741ab..cbacf9f 100755 (executable)
@@ -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