Commit 1531cc63 authored by Petr Machata's avatar Petr Machata Committed by Paolo Abeni

selftests: forwarding: lib: Add start_traffic_pktsize() helpers

Add two helpers, start_traffic_pktsize() and start_tcp_traffic_pktsize(),
that allow explicit overriding of packet size. Change start_traffic() and
start_tcp_traffic() to dispatch through these helpers with the default
packet size.
Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent c864769a
...@@ -1375,25 +1375,40 @@ flood_test() ...@@ -1375,25 +1375,40 @@ flood_test()
__start_traffic() __start_traffic()
{ {
local pktsize=$1; shift
local proto=$1; shift local proto=$1; shift
local h_in=$1; shift # Where the traffic egresses the host local h_in=$1; shift # Where the traffic egresses the host
local sip=$1; shift local sip=$1; shift
local dip=$1; shift local dip=$1; shift
local dmac=$1; shift local dmac=$1; shift
$MZ $h_in -p 8000 -A $sip -B $dip -c 0 \ $MZ $h_in -p $pktsize -A $sip -B $dip -c 0 \
-a own -b $dmac -t "$proto" -q "$@" & -a own -b $dmac -t "$proto" -q "$@" &
sleep 1 sleep 1
} }
start_traffic_pktsize()
{
local pktsize=$1; shift
__start_traffic $pktsize udp "$@"
}
start_tcp_traffic_pktsize()
{
local pktsize=$1; shift
__start_traffic $pktsize tcp "$@"
}
start_traffic() start_traffic()
{ {
__start_traffic udp "$@" start_traffic_pktsize 8000 "$@"
} }
start_tcp_traffic() start_tcp_traffic()
{ {
__start_traffic tcp "$@" start_tcp_traffic_pktsize 8000 "$@"
} }
stop_traffic() stop_traffic()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment