1
0
mirror of https://github.com/corundum/corundum.git synced 2025-01-16 08:12:53 +08:00

Add MTU settings to scripts

This commit is contained in:
Alex Forencich 2022-05-31 21:04:22 -07:00
parent dd2853bf40
commit b50073417d
3 changed files with 36 additions and 0 deletions

View File

@ -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..."

View File

@ -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..."

View File

@ -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..."