check_not_offloaded()
{
local handle=$1; shift
local h
local offloaded
h=$(qdisc_stats_get $h1 "$handle" .handle)
[[ $h == '"'$handle'"' ]]
check_err $? "Qdisc with handle $handle does not exist"
offloaded=$(qdisc_stats_get $h1 "$handle" .offloaded)
[[ $offloaded == true ]]
check_fail $? "Qdisc with handle $handle offloaded, but should not be"
}
check_all_offloaded()
{
local handle=$1; shift
if [[ ! -z $handle ]]; then
local offloaded=$(qdisc_stats_get $h1 "$handle" .offloaded)
[[ $offloaded == true ]]
check_err $? "Qdisc with handle $handle not offloaded" fi
local unoffloaded=$(tc q sh dev $h1 invisible |
grep -v offloaded |
sed s/root/parent\ root/ |
cut -d' ' -f 5)
[[ -z $unoffloaded ]]
check_err $? "Qdiscs with following parents not offloaded: $unoffloaded"
pre_cleanup
}
with_ets()
{
local handle=$1; shift
local locus=$1; shift
tc qdisc add dev $h1 $locus handle $handle \
ets bands 8 priomap 7 6 5 4 3 2 1 0 "$@"
tc qdisc del dev $h1 $locus
}
with_prio()
{
local handle=$1; shift
local locus=$1; shift
tc qdisc add dev $h1 $locus handle $handle \
prio bands 8 priomap 7 6 5 4 3 2 1 0 "$@"
tc qdisc del dev $h1 $locus
}
with_red()
{
local handle=$1; shift
local locus=$1; shift
tc qdisc add dev $h1 $locus handle $handle \
red limit 1000000 min 200000 max 300000 probability 0.5 avpkt 1500 "$@"
tc qdisc del dev $h1 $locus
}
with_tbf()
{
local handle=$1; shift
local locus=$1; shift
tc qdisc add dev $h1 $locus handle $handle \
tbf rate 400Mbit burst 128K limit 1M "$@"
tc qdisc del dev $h1 $locus
}
with_pfifo()
{
local handle=$1; shift
local locus=$1; shift
tc qdisc add dev $h1 $locus handle $handle pfifo limit 100K "$@"
tc qdisc del dev $h1 $locus
}
with_bfifo()
{
local handle=$1; shift
local locus=$1; shift
tc qdisc add dev $h1 $locus handle $handle bfifo limit 100K "$@"
tc qdisc del dev $h1 $locus
}
with_drr()
{
local handle=$1; shift
local locus=$1; shift
tc qdisc add dev $h1 $locus handle $handle drr "$@"
tc qdisc del dev $h1 $locus
}
with_qdiscs()
{
local handle=$1; shift
local parent=$1; shift
local kind=$1; shift
local next_handle=$((handle * 2))
local locus;
if [[ $kind == "--" ]]; then
local cmd=$1; shift
$cmd $(printf %x: $parent) "$@" else if ((parent == 0)); then
locus=root else
locus=$(printf "parent %x:1" $parent) fi
do_test_combinations()
{
local handle=$1; shift
local parent=$1; shift
local cont
local leaf
local fifo
for cont in "" ets prio; do for leaf in "" red tbf "red tbf""tbf red"; do for fifo in "" pfifo bfifo; do if [[ -z "$cont$leaf$fifo" ]]; then
continue fi
do_test_offloaded $handle $parent \
$cont $leaf $fifo done done done
for cont in ets prio; do for leaf in red tbf; do
do_test_nooffload $handle $parent $cont red tbf $leaf
do_test_nooffload $handle $parent $cont tbf red $leaf done for leaf in "red red""tbf tbf"; do
do_test_nooffload $handle $parent $cont $leaf done done
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.