# @name Ethernet performance using IPERF on two interfaces simultaneously
# @desc Run Iperf as a server in a host PC on two different interfaces 
# and as a client in the target machine
# Test different window sizes, from 8K to 256K
# @requires net/dual_mac

ETH_S_PERF_DUAL_ETH_IPERF_TCP_16K_1448B source 'common.sh'; iface=`get_eth_all_iface_name.sh` || die "error getting eth interface name"; arr=($iface); echo ${arr[@]}; if [ "${#arr[@]}" -ne "2" ] ; then die "Only two ethernet interfaces are expected but found ${#arr[@]} interfaces. This is a dual mac test."; fi; iperfhost_env=(); for intface in "${arr[@]}"; do iperfhost_env+=($'IPERF'$intface'HOST'); done; echo "${iperfhost_env[@]}"; run_processes.sh -c "run_iperf.sh -v 3 -H $"${iperfhost_env[0]}" -- -f M --bidir -t 60 -w 16K# run_iperf.sh -v 3 -H $"${iperfhost_env[1]}" -- -f M --bidir -t 60 -w 16K"
ETH_S_PERF_DUAL_ETH_IPERF_TCP_32K_1448B source 'common.sh'; iface=`get_eth_all_iface_name.sh` || die "error getting eth interface name"; arr=($iface); echo ${arr[@]}; if [ "${#arr[@]}" -ne "2" ] ; then die "Only two ethernet interfaces are expected but found ${#arr[@]} interfaces. This is a dual mac test."; fi; iperfhost_env=(); for intface in "${arr[@]}"; do iperfhost_env+=($'IPERF'$intface'HOST'); done; echo "${iperfhost_env[@]}"; run_processes.sh -c "run_iperf.sh -v 3 -H $"${iperfhost_env[0]}" -- -f M --bidir -t 60 -w 32K# run_iperf.sh -v 3 -H $"${iperfhost_env[1]}" -- -f M --bidir -t 60 -w 32K"
ETH_S_PERF_DUAL_ETH_IPERF_TCP_64K_1448B source 'common.sh'; iface=`get_eth_all_iface_name.sh` || die "error getting eth interface name"; arr=($iface); echo ${arr[@]}; if [ "${#arr[@]}" -ne "2" ] ; then die "Only two ethernet interfaces are expected but found ${#arr[@]} interfaces. This is a dual mac test."; fi; iperfhost_env=(); for intface in "${arr[@]}"; do iperfhost_env+=($'IPERF'$intface'HOST'); done; echo "${iperfhost_env[@]}"; run_processes.sh -c "run_iperf.sh -v 3 -H $"${iperfhost_env[0]}" -- -f M --bidir -t 60 -w 64K# run_iperf.sh -v 3 -H $"${iperfhost_env[1]}" -- -f M --bidir -t 60 -w 64K"
ETH_S_PERF_DUAL_ETH_IPERF_TCP_128K_1448B source 'common.sh'; iface=`get_eth_all_iface_name.sh` || die "error getting eth interface name"; arr=($iface); echo ${arr[@]}; if [ "${#arr[@]}" -ne "2" ] ; then die "Only two ethernet interfaces are expected but found ${#arr[@]} interfaces. This is a dual mac test."; fi; iperfhost_env=(); for intface in "${arr[@]}"; do iperfhost_env+=($'IPERF'$intface'HOST'); done; echo "${iperfhost_env[@]}"; run_processes.sh -c "run_iperf.sh -v 3 -H $"${iperfhost_env[0]}" -- -f M --bidir -t 60 -w 128K# run_iperf.sh -v 3 -H $"${iperfhost_env[1]}" -- -f M --bidir -t 60 -w 128K"
ETH_S_PERF_DUAL_ETH_IPERF_TCP_256K_1448B source 'common.sh'; iface=`get_eth_all_iface_name.sh` || die "error getting eth interface name"; arr=($iface); echo ${arr[@]}; if [ "${#arr[@]}" -ne "2" ] ; then die "Only two ethernet interfaces are expected but found ${#arr[@]} interfaces. This is a dual mac test."; fi; iperfhost_env=(); for intface in "${arr[@]}"; do iperfhost_env+=($'IPERF'$intface'HOST'); done; echo "${iperfhost_env[@]}"; run_processes.sh -c "run_iperf.sh -v 3 -H $"${iperfhost_env[0]}" -- -f M --bidir -t 60 -w 256K# run_iperf.sh -v 3 -H $"${iperfhost_env[1]}" -- -f M --bidir -t 60 -w 256K"

ETH_S_PERF_DUALETH_TCP_INTPACING_16K_1448B source 'common.sh'; iface=`get_eth_all_iface_name.sh` || die "error getting eth interface name"; arr=($iface); echo ${arr[@]}; if [ "${#arr[@]}" -ne "2" ] ; then die "Only two ethernet interfaces are expected but found ${#arr[@]} interfaces. This is a dual mac test."; fi; iperfhost_env=(); for intface in "${arr[@]}"; do do_cmd "set_ethtool_coalesce_options.sh --bidir $intface -p 'rx-usecs' -n 500"; iperfhost_env+=($'IPERF'$intface'HOST'); done; echo "${iperfhost_env[@]}"; run_processes.sh -c "run_iperf.sh -v 3 -H $"${iperfhost_env[0]}" -- -f M --bidir -t 60 -w 16K# run_iperf.sh -v 3 -H $"${iperfhost_env[1]}" -- -f M --bidir -t 60 -w 16K"; for intface in "${arr[@]}"; do do_cmd "set_ethtool_coalesce_options.sh --bidir $intface -p 'rx-usecs' -n 16"; done
ETH_S_PERF_DUALETH_TCP_INTPACING_32K_1448B source 'common.sh'; iface=`get_eth_all_iface_name.sh` || die "error getting eth interface name"; arr=($iface); echo ${arr[@]}; if [ "${#arr[@]}" -ne "2" ] ; then die "Only two ethernet interfaces are expected but found ${#arr[@]} interfaces. This is a dual mac test."; fi; iperfhost_env=(); for intface in "${arr[@]}"; do do_cmd "set_ethtool_coalesce_options.sh --bidir $intface -p 'rx-usecs' -n 500"; iperfhost_env+=($'IPERF'$intface'HOST'); done; echo "${iperfhost_env[@]}"; run_processes.sh -c "run_iperf.sh -v 3 -H $"${iperfhost_env[0]}" -- -f M --bidir -t 60 -w 32K# run_iperf.sh -v 3 -H $"${iperfhost_env[1]}" -- -f M --bidir -t 60 -w 32K"; for intface in "${arr[@]}"; do do_cmd "set_ethtool_coalesce_options.sh --bidir $intface -p 'rx-usecs' -n 16"; done
ETH_S_PERF_DUALETH_TCP_INTPACING_64K_1448B source 'common.sh'; iface=`get_eth_all_iface_name.sh` || die "error getting eth interface name"; arr=($iface); echo ${arr[@]}; if [ "${#arr[@]}" -ne "2" ] ; then die "Only two ethernet interfaces are expected but found ${#arr[@]} interfaces. This is a dual mac test."; fi; iperfhost_env=(); for intface in "${arr[@]}"; do do_cmd "set_ethtool_coalesce_options.sh --bidir $intface -p 'rx-usecs' -n 500"; iperfhost_env+=($'IPERF'$intface'HOST'); done; echo "${iperfhost_env[@]}"; run_processes.sh -c "run_iperf.sh -v 3 -H $"${iperfhost_env[0]}" -- -f M --bidir -t 60 -w 64K# run_iperf.sh -v 3 -H $"${iperfhost_env[1]}" -- -f M --bidir -t 60 -w 64K"; for intface in "${arr[@]}"; do do_cmd "set_ethtool_coalesce_options.sh --bidir $intface -p 'rx-usecs' -n 16"; done
ETH_S_PERF_DUALETH_TCP_INTPACING_128K_1448B source 'common.sh'; iface=`get_eth_all_iface_name.sh` || die "error getting eth interface name"; arr=($iface); echo ${arr[@]}; if [ "${#arr[@]}" -ne "2" ] ; then die "Only two ethernet interfaces are expected but found ${#arr[@]} interfaces. This is a dual mac test."; fi; iperfhost_env=(); for intface in "${arr[@]}"; do do_cmd "set_ethtool_coalesce_options.sh --bidir $intface -p 'rx-usecs' -n 500"; iperfhost_env+=($'IPERF'$intface'HOST'); done; echo "${iperfhost_env[@]}"; run_processes.sh -c "run_iperf.sh -v 3 -H $"${iperfhost_env[0]}" -- -f M --bidir -t 60 -w 128K# run_iperf.sh -v 3 -H $"${iperfhost_env[1]}" -- -f M --bidir -t 60 -w 128K"; for intface in "${arr[@]}"; do do_cmd "set_ethtool_coalesce_options.sh --bidir $intface -p 'rx-usecs' -n 16"; done
ETH_S_PERF_DUALETH_TCP_INTPACING_256K_1448B source 'common.sh'; iface=`get_eth_all_iface_name.sh` || die "error getting eth interface name"; arr=($iface); echo ${arr[@]}; if [ "${#arr[@]}" -ne "2" ] ; then die "Only two ethernet interfaces are expected but found ${#arr[@]} interfaces. This is a dual mac test."; fi; iperfhost_env=(); for intface in "${arr[@]}"; do do_cmd "set_ethtool_coalesce_options.sh --bidir $intface -p 'rx-usecs' -n 500"; iperfhost_env+=($'IPERF'$intface'HOST'); done; echo "${iperfhost_env[@]}"; run_processes.sh -c "run_iperf.sh -v 3 -H $"${iperfhost_env[0]}" -- -f M --bidir -t 60 -w 256K# run_iperf.sh -v 3 -H $"${iperfhost_env[1]}" -- -f M --bidir -t 60 -w 256K"; for intface in "${arr[@]}"; do do_cmd "set_ethtool_coalesce_options.sh --bidir $intface -p 'rx-usecs' -n 16"; done

