Petr Machata ddd3fd750f selftests: forwarding: sch_ets: Add test coverage for ETS Qdisc
This tests the newly-added ETS Qdisc. It runs two to three streams of
traffic, each with a different priority. ETS Qdisc is supposed to allocate
bandwidth according to the DRR algorithm and given weights. After running
the traffic for a while, counters are compared for each stream to check
that the expected ratio is in fact observed.

In order for the DRR process to kick in, a traffic bottleneck must exist in
the first place. In slow path, such bottleneck can be implemented by
wrapping the ETS Qdisc inside a TBF or other shaper. This might however
make the configuration unoffloadable. Instead, on HW datapath, the
bottleneck would be set up by lowering port speed and configuring shared
buffer suitably.

Therefore the test is structured as a core component that implements the
testing, with two wrapper scripts that implement the details of slow path
resp. fast path configuration.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-12-18 13:32:30 -08:00

45 lines
704 B
Bash
Executable File

#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
# A driver for the ETS selftest that implements testing in slowpath.
lib_dir=.
source sch_ets_core.sh
ALL_TESTS="
ping_ipv4
priomap_mode
ets_test_strict
ets_test_mixed
ets_test_dwrr
classifier_mode
ets_test_strict
ets_test_mixed
ets_test_dwrr
"
switch_create()
{
ets_switch_create
# Create a bottleneck so that the DWRR process can kick in.
tc qdisc add dev $swp2 root handle 1: tbf \
rate 1Gbit burst 1Mbit latency 100ms
PARENT="parent 1:"
}
switch_destroy()
{
ets_switch_destroy
tc qdisc del dev $swp2 root
}
# Callback from sch_ets_tests.sh
get_stats()
{
local stream=$1; shift
link_stats_get $h2.1$stream rx bytes
}
ets_run