From mboxrd@z Thu Jan 1 00:00:00 1970 From: p133@seznam.cz p133@seznam.cz Date: Wed, 06 Dec 2000 18:15:04 +0000 Subject: [LARTC] =?iso-8859-2?Q?CBQ=20rate=20inheritance=3F?= Message-Id: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org
How is it with cbq rate inheritance? I kind of expected, that if I have a
cbq class with 128 kbps rate, which has three sub-classes with 128 kbps rate
each, those three sub-classes will share those 128 kbps from their parent
class together. But it looks like they are getting 128 kbps or a bit less
each. 

Is this the right behavior, or do I have something done wrong?

Also, how exactly does split and defmap work? Do I need it for this?

My setup is like this: 


10:
root

10:1       
cbq rate 128 Kbit

10:2               10:3               10:4
cbq rate 128 Kbit  cbq rate 128 Kbit  cbq rate 128 Kbit 
pfifo              sfq                sfq 


Then I use u32 filter to sort traffic to these three classes (each of the
cbq classes has a different prio).

tc qdisc add dev eth0 root handle 10: \
        cbq bandwidth 10000Kbit avpkt 1000 cell 8
tc class add dev eth0 parent 10:0 classid 10:1 \
        cbq bandwidth 128Kbit rate 128Kbit allot 1514 \
        cell 8 weight 12Kbit prio 5 maxburst 2 \
        avpkt 1000 bounded

tc class add dev eth0 parent 10:1 classid 10:2 cbq \
bandwidth 10000Kbit rate 128Kbit allot 1514 weight 12Kbit prio 1 \
avpkt 1000 maxburst 2 split 10:0 defmap 80 bounded
tc qdisc add dev eth0 parent 10:2 pfifo

tc class add dev eth0 parent 10:1 classid 10:3 cbq \
bandwidth 10000Kbit rate  128Kbit allot 1514 weight 12Kbit  prio 3 \
avpkt 1000 maxburst 2 split 10:0 defmap c0 bounded
tc qdisc add dev eth0 parent 10:3 sfq perturb 15

tc class add dev eth0 parent 10:1 classid 10:4 cbq \
bandwidth 10000Kbit rate  128Kbit  allot 1514 weight  12Kbit  prio 4 \
avpkt 1000 maxburst 2 split 10:0 defmap 3f bounded
tc qdisc add dev eth0 parent 10:4 sfq perturb 15

tc filter add dev eth0 parent 10:0 protocol ip prio 1 u32 \
   match ip sport 22 0xffff \
   match ip tos 0x8 0xff \
   match ip src 0.0.0.0/0  \
   flowid  10:4

tc filter add dev eth0 parent 10:0 protocol ip prio 1 u32 \
   match ip dport 22 0xffff \
   match ip tos 0x8 0xff \
   match ip src 0.0.0.0/0  \
   flowid  10:4

tc filter add dev eth0 parent 10:0 protocol ip prio 1 u32 \
   match ip tos 0x8 0xff \
   match ip src 0.0.0.0/0  \
   flowid  10:2

tc filter add dev eth0 parent 10:0 protocol ip prio 1 u32 \
   match ip tos 0x10 0xff \
   match ip src 0.0.0.0/0  \
   flowid  10:2 

for i in 21 23 53 33434
do
tc filter add dev eth0 parent 10:0 protocol ip prio 1 u32 \
   match ip dport $i 0xffff \
   match ip src 0.0.0.0/0  \
   flowid 10:2
done

for i in 21 23 53 33434
do 
tc filter add dev eth0 parent 10:0 protocol ip prio 1 u32 \
   match ip sport $i 0xffff \
   match ip src 0.0.0.0/0  \
   flowid 10:2
done

for i in 80 3128
do 
tc filter add dev eth0 parent 10:0 protocol ip prio 1 u32 \
   match ip sport $i 0xffff \
   match ip src 0.0.0.0/0  \
   flowid 10:3
done

tc filter add dev eth0 parent 10:0 protocol ip prio 1 u32 \
   match ip protocol 1 0xff \
   match ip src 0.0.0.0/0  \
   flowid 10:2 \

tc filter add dev eth0 parent 10:0 protocol ip prio 1 u32 \
        match ip src 0.0.0.0/0  flowid 10:4