diff --git a/scripts/iperf_benchmark.sh b/scripts/iperf_benchmark.sh index caa202831..da882d68c 100755 --- a/scripts/iperf_benchmark.sh +++ b/scripts/iperf_benchmark.sh @@ -37,6 +37,7 @@ netdev= ifaddr= netns= base_port=9000 +mtu= base_logdir=./logs/ while getopts i:n:P:c:p:r:-: option; do @@ -55,6 +56,12 @@ while getopts i:n:P:c:p:r:-: option; do netns=*) netns=${OPTARG#*=} ;; + mtu) + mtu="${!OPTIND}"; OPTIND=$(( $OPTIND + 1 )) + ;; + mtu=*) + mtu=${OPTARG#*=} + ;; logdir) base_logdir="${!OPTIND}"; OPTIND=$(( $OPTIND + 1 )) ;; @@ -124,6 +131,11 @@ if [ ! -z "$ifaddr" ]; then $netns_cmd ip addr add $ifaddr dev $netdev fi +if [ ! -z "$mtu" ]; then + echo "Changing MTU to $mtu on '$netdev'" + $netns_cmd ip link set mtu $mtu dev $netdev +fi + function cleanup() { echo "Cleaning up..." diff --git a/scripts/piperf.sh b/scripts/piperf.sh index a1abe19d0..0067f1e8e 100755 --- a/scripts/piperf.sh +++ b/scripts/piperf.sh @@ -35,6 +35,7 @@ ifaddr= netns= base_port=9000 ptp4l= +mtu= while getopts i:n:p:-: option; do case "${option}" in @@ -52,6 +53,12 @@ while getopts i:n:p:-: option; do netns=*) netns=${OPTARG#*=} ;; + mtu) + mtu="${!OPTIND}"; OPTIND=$(( $OPTIND + 1 )) + ;; + mtu=*) + mtu=${OPTARG#*=} + ;; ptp4l) ptp4l=1 ;; @@ -108,6 +115,11 @@ if [ ! -z "$ifaddr" ]; then $netns_cmd ip addr add $ifaddr dev $netdev fi +if [ ! -z "$mtu" ]; then + echo "Changing MTU to $mtu on '$netdev'" + $netns_cmd ip link set mtu $mtu dev $netdev +fi + function cleanup() { echo "Cleaning up..." diff --git a/scripts/test_mqnic.sh b/scripts/test_mqnic.sh index c7541da8b..689c520df 100755 --- a/scripts/test_mqnic.sh +++ b/scripts/test_mqnic.sh @@ -39,6 +39,7 @@ iperf_repeats=1 iperf_p=4 dest_ip= iperf_base_port=9000 +mtu= utils_path=../utils/ mqnic_fw=$utils_path/mqnic-fw @@ -60,6 +61,12 @@ while getopts i:n:P:c:p:r:-: option; do netns=*) netns=${OPTARG#*=} ;; + mtu) + mtu="${!OPTIND}"; OPTIND=$(( $OPTIND + 1 )) + ;; + mtu=*) + mtu=${OPTARG#*=} + ;; logdir) base_logdir="${!OPTIND}"; OPTIND=$(( $OPTIND + 1 )) ;; @@ -113,6 +120,11 @@ if [ ! -z "$ifaddr" ]; then $netns_cmd ip addr add $ifaddr dev $netdev fi +if [ ! -z "$mtu" ]; then + echo "Changing MTU to $mtu on '$netdev'" + $netns_cmd ip link set mtu $mtu dev $netdev +fi + function cleanup() { echo "Cleaning up..."