提交 4113b048 编写于 作者: P Petr Machata 提交者: David S. Miller

selftests: forwarding: lib.sh: Add start_tcp_traffic

Extract a helper __start_traffic() configurable by protocol type. Allow
passing through extra mausezahn arguments. Add a wrapper,
start_tcp_traffic().
Signed-off-by: NPetr Machata <petrm@mellanox.com>
Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
Signed-off-by: NJiri Pirko <jiri@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 2b99e54b
......@@ -1132,18 +1132,29 @@ flood_test()
flood_multicast_test $br_port $host1_if $host2_if
}
start_traffic()
__start_traffic()
{
local proto=$1; shift
local h_in=$1; shift # Where the traffic egresses the host
local sip=$1; shift
local dip=$1; shift
local dmac=$1; shift
$MZ $h_in -p 8000 -A $sip -B $dip -c 0 \
-a own -b $dmac -t udp -q &
-a own -b $dmac -t "$proto" -q "$@" &
sleep 1
}
start_traffic()
{
__start_traffic udp "$@"
}
start_tcp_traffic()
{
__start_traffic tcp "$@"
}
stop_traffic()
{
# Suppress noise from killing mausezahn.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册