]> git.baikalelectronics.ru Git - kernel.git/commit
net_sched: drr: warn when qdisc is not work conserving
authorFlorian Westphal <fw@strlen.de>
Wed, 11 Jun 2014 18:35:18 +0000 (20:35 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 11 Jun 2014 22:50:59 +0000 (15:50 -0700)
commit2e2f9415d2cf446f36f11583c94d7c68ff27ba1a
tree0e5295da4f6d42fae7336285367c577b5db7de50
parent0fe7d7baed695bf70f376476c52e803471fd7ea0
net_sched: drr: warn when qdisc is not work conserving

The DRR scheduler requires that items on the active list are work
conserving, i.e. do not hold on to skbs for throttling purposes, etc.
Attaching e.g. tbf renders DRR useless because all other classes on the
active list are delayed as well.

So, warn users that this configuration won't work as expected; we
already do this in couple of other qdiscs, see e.g.

commit 7b4ea4fb0e47e4816fcd0f84c9d5d43719e30304
('pkt_sched: sch_hfsc: sch_htb: Add non-work-conserving warning handler')

The 'const' change is needed to avoid compiler warning ("discards 'const'
qualifier from pointer target type").

tested with:
drr_hier() {
        parent=$1
        classes=$2
        for i in  $(seq 1 $classes); do
                classid=$parent$(printf %x $i)
                tc class add dev eth0 parent $parent classid $classid drr
tc qdisc add dev eth0 parent $classid tbf rate 64kbit burst 256kbit limit 64kbit
        done
}
tc qdisc add dev eth0 root handle 1: drr
drr_hier 1: 32
tc filter add dev eth0 protocol all pref 1 parent 1: handle 1 flow hash keys dst perturb 1 divisor 32

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/pkt_sched.h
net/sched/sch_api.c
net/sched/sch_drr.c