selftests: mptcp: enable checksum in mptcp_connect.sh
This patch added a new argument "-C" for the mptcp_connect.sh script to set the sysctl checksum_enabled to 1 in ns1, ns2, ns3 and ns4 to enable the data checksum. Acked-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Geliang Tang <geliangtang@gmail.com> Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
401e3030e6
commit
94d66ba1d8
1 changed files with 12 additions and 1 deletions
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
time_start=$(date +%s)
|
time_start=$(date +%s)
|
||||||
|
|
||||||
optstring="S:R:d:e:l:r:h4cm:f:t"
|
optstring="S:R:d:e:l:r:h4cm:f:tC"
|
||||||
ret=0
|
ret=0
|
||||||
sin=""
|
sin=""
|
||||||
sout=""
|
sout=""
|
||||||
|
@ -22,6 +22,7 @@ sndbuf=0
|
||||||
rcvbuf=0
|
rcvbuf=0
|
||||||
options_log=true
|
options_log=true
|
||||||
do_tcp=0
|
do_tcp=0
|
||||||
|
checksum=false
|
||||||
filesize=0
|
filesize=0
|
||||||
|
|
||||||
if [ $tc_loss -eq 100 ];then
|
if [ $tc_loss -eq 100 ];then
|
||||||
|
@ -47,6 +48,7 @@ usage() {
|
||||||
echo -e "\t-R: set rcvbuf value (default: use kernel default)"
|
echo -e "\t-R: set rcvbuf value (default: use kernel default)"
|
||||||
echo -e "\t-m: test mode (poll, sendfile; default: poll)"
|
echo -e "\t-m: test mode (poll, sendfile; default: poll)"
|
||||||
echo -e "\t-t: also run tests with TCP (use twice to non-fallback tcp)"
|
echo -e "\t-t: also run tests with TCP (use twice to non-fallback tcp)"
|
||||||
|
echo -e "\t-C: enable the MPTCP data checksum"
|
||||||
}
|
}
|
||||||
|
|
||||||
while getopts "$optstring" option;do
|
while getopts "$optstring" option;do
|
||||||
|
@ -104,6 +106,9 @@ while getopts "$optstring" option;do
|
||||||
"t")
|
"t")
|
||||||
do_tcp=$((do_tcp+1))
|
do_tcp=$((do_tcp+1))
|
||||||
;;
|
;;
|
||||||
|
"C")
|
||||||
|
checksum=true
|
||||||
|
;;
|
||||||
"?")
|
"?")
|
||||||
usage $0
|
usage $0
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -200,6 +205,12 @@ ip -net "$ns4" route add default via dead:beef:3::2
|
||||||
# use TCP syn cookies, even if no flooding was detected.
|
# use TCP syn cookies, even if no flooding was detected.
|
||||||
ip netns exec "$ns2" sysctl -q net.ipv4.tcp_syncookies=2
|
ip netns exec "$ns2" sysctl -q net.ipv4.tcp_syncookies=2
|
||||||
|
|
||||||
|
if $checksum; then
|
||||||
|
for i in "$ns1" "$ns2" "$ns3" "$ns4";do
|
||||||
|
ip netns exec $i sysctl -q net.mptcp.checksum_enabled=1
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
set_ethtool_flags() {
|
set_ethtool_flags() {
|
||||||
local ns="$1"
|
local ns="$1"
|
||||||
local dev="$2"
|
local dev="$2"
|
||||||
|
|
Loading…
Add table
Reference in a new issue