mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
selftests: forwarding: Move start_/stop_traffic from mlxsw to lib.sh
These two functions are used for starting several streams of traffic, and then stopping them later. They will be handy for the test coverage of ETS Qdisc. Move them from mlxsw-specific qos_lib.sh to the generic lib.sh. Signed-off-by: Petr Machata <[email protected]> Reviewed-by: Ido Schimmel <[email protected]> Acked-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
1 parent
19f405b988
commit
4cf9b8f992
2 files changed
+18
-18
No files matched your search
@@ -24,24 +24,6 @@ rate()
|
||||
echo $((8 * (t1 - t0) / interval))
|
||||
}
|
||||
|
||||
start_traffic()
|
||||
{
|
||||
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 &
|
||||
sleep 1
|
||||
}
|
||||
|
||||
stop_traffic()
|
||||
{
|
||||
# Suppress noise from killing mausezahn.
|
||||
{ kill %% && wait %%; } 2>/dev/null
|
||||
}
|
||||
|
||||
check_rate()
|
||||
{
|
||||
local rate=$1; shift
|
||||
|
||||
@@ -1065,3 +1065,21 @@ flood_test()
|
||||
flood_unicast_test $br_port $host1_if $host2_if
|
||||
flood_multicast_test $br_port $host1_if $host2_if
|
||||
}
|
||||
|
||||
start_traffic()
|
||||
{
|
||||
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 &
|
||||
sleep 1
|
||||
}
|
||||
|
||||
stop_traffic()
|
||||
{
|
||||
# Suppress noise from killing mausezahn.
|
||||
{ kill %% && wait %%; } 2>/dev/null
|
||||
}
|
||||
Reference in new issue
Block a user