mirror of
https://github.com/torvalds/linux.git
synced 2024-12-02 00:51:44 +00:00
b9b72999eb
Currently the SW-datapath ETS selftests use "ip link" stats to obtain the number of packets that went through a given band. mlxsw then uses ethtool per-priority counters. Instead, change both to use qdiscs. In SW datapath this is the obvious choice, and now that mlxsw offloads FIFO, this should work on the offloaded datapath as well. This has the effect of verifying that the FIFO offload works. Signed-off-by: Petr Machata <petrm@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
48 lines
781 B
Bash
Executable File
48 lines
781 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
|
|
collect_stats()
|
|
{
|
|
local -a streams=("$@")
|
|
local stream
|
|
|
|
for stream in ${streams[@]}; do
|
|
qdisc_parent_stats_get $swp2 10:$((stream + 1)) .bytes
|
|
done
|
|
}
|
|
|
|
ets_run
|