@@ -366,6 +366,12 @@ do_transfer()
366366 fi
367367 fi
368368
369+ flags=" subflow"
370+ if [[ " ${addr_nr_ns2} " = " fullmesh_" * ]]; then
371+ flags=" ${flags} ,fullmesh"
372+ addr_nr_ns2=${addr_nr_ns2: 9}
373+ fi
374+
369375 if [ $addr_nr_ns2 -gt 0 ]; then
370376 let add_nr_ns2=addr_nr_ns2
371377 counter=3
@@ -377,7 +383,7 @@ do_transfer()
377383 else
378384 addr=" 10.0.$counter .2"
379385 fi
380- ip netns exec $ns2 ./pm_nl_ctl add $addr flags subflow
386+ ip netns exec $ns2 ./pm_nl_ctl add $addr flags $flags
381387 let counter+=1
382388 let add_nr_ns2-=1
383389 done
@@ -1686,6 +1692,55 @@ deny_join_id0_tests()
16861692 chk_join_nr " subflow and address allow join id0 2" 1 1 1
16871693}
16881694
1695+ fullmesh_tests ()
1696+ {
1697+ # fullmesh 1
1698+ # 2 fullmesh addrs in ns2, added before the connection,
1699+ # 1 non-fullmesh addr in ns1, added during the connection.
1700+ reset
1701+ ip netns exec $ns1 ./pm_nl_ctl limits 0 4
1702+ ip netns exec $ns2 ./pm_nl_ctl limits 1 4
1703+ ip netns exec $ns2 ./pm_nl_ctl add 10.0.2.2 flags subflow,fullmesh
1704+ ip netns exec $ns2 ./pm_nl_ctl add 10.0.3.2 flags subflow,fullmesh
1705+ run_tests $ns1 $ns2 10.0.1.1 0 1 0 slow
1706+ chk_join_nr " fullmesh test 2x1" 4 4 4
1707+ chk_add_nr 1 1
1708+
1709+ # fullmesh 2
1710+ # 1 non-fullmesh addr in ns1, added before the connection,
1711+ # 1 fullmesh addr in ns2, added during the connection.
1712+ reset
1713+ ip netns exec $ns1 ./pm_nl_ctl limits 1 3
1714+ ip netns exec $ns2 ./pm_nl_ctl limits 1 3
1715+ ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal
1716+ run_tests $ns1 $ns2 10.0.1.1 0 0 fullmesh_1 slow
1717+ chk_join_nr " fullmesh test 1x1" 3 3 3
1718+ chk_add_nr 1 1
1719+
1720+ # fullmesh 3
1721+ # 1 non-fullmesh addr in ns1, added before the connection,
1722+ # 2 fullmesh addrs in ns2, added during the connection.
1723+ reset
1724+ ip netns exec $ns1 ./pm_nl_ctl limits 2 5
1725+ ip netns exec $ns2 ./pm_nl_ctl limits 1 5
1726+ ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal
1727+ run_tests $ns1 $ns2 10.0.1.1 0 0 fullmesh_2 slow
1728+ chk_join_nr " fullmesh test 1x2" 5 5 5
1729+ chk_add_nr 1 1
1730+
1731+ # fullmesh 4
1732+ # 1 non-fullmesh addr in ns1, added before the connection,
1733+ # 2 fullmesh addrs in ns2, added during the connection,
1734+ # limit max_subflows to 4.
1735+ reset
1736+ ip netns exec $ns1 ./pm_nl_ctl limits 2 4
1737+ ip netns exec $ns2 ./pm_nl_ctl limits 1 4
1738+ ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal
1739+ run_tests $ns1 $ns2 10.0.1.1 0 0 fullmesh_2 slow
1740+ chk_join_nr " fullmesh test 1x2, limited" 4 4 4
1741+ chk_add_nr 1 1
1742+ }
1743+
16891744all_tests ()
16901745{
16911746 subflows_tests
@@ -1701,6 +1756,7 @@ all_tests()
17011756 syncookies_tests
17021757 checksum_tests
17031758 deny_join_id0_tests
1759+ fullmesh_tests
17041760}
17051761
17061762usage ()
@@ -1719,6 +1775,7 @@ usage()
17191775 echo " -k syncookies_tests"
17201776 echo " -S checksum_tests"
17211777 echo " -d deny_join_id0_tests"
1778+ echo " -m fullmesh_tests"
17221779 echo " -c capture pcap files"
17231780 echo " -C enable data checksum"
17241781 echo " -h help"
@@ -1754,7 +1811,7 @@ if [ $do_all_tests -eq 1 ]; then
17541811 exit $ret
17551812fi
17561813
1757- while getopts ' fsltra64bpkdchCS ' opt; do
1814+ while getopts ' fsltra64bpkdmchCS ' opt; do
17581815 case $opt in
17591816 f)
17601817 subflows_tests
@@ -1795,6 +1852,9 @@ while getopts 'fsltra64bpkdchCS' opt; do
17951852 d)
17961853 deny_join_id0_tests
17971854 ;;
1855+ m)
1856+ fullmesh_tests
1857+ ;;
17981858 c)
17991859 ;;
18001860 C)
0 commit comments