On Fri, 18 Nov 2011 21:11:52 -0600
Joshua Montgomery <joshua.montgom...@civicwifi.com> wrote:

> Package: iproute
> Version: 20100519-3
> 
> When a tc qdisc is added with a handle that is more than 4 characters
> long, the handle does not display correctly when the tc -s option is
> used.
> 
> Here is a transcript:
> 
> > tc class add dev eth1 parent 2:1 classid 2:2 htb rate 50kbit prio 2
> > tc qdisc add dev eth1 parent 2:2 handle 0xF1111 sfq perturb 10
> > tc -s qdisc show dev eth1
> qdisc sfq 1111: parent 2:2 limit 127p quantum 1514b perturb 10sec
>  Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
>  rate 0bit 0pps backlog 0b 0p requeues 0
> > tc qdisc del dev eth1 parent 2:2 handle 0xF1111 sfq perturb 10
> 
> Notes:  In the example above a tc qdisc entry is being added with the
> handle "0xF1111".
> 
> When the "tc -s qdisc show" command is then used.  The ouput displays
> "qdisc sfq 1111:"
> 
> At this point the qdisc can be deleted using either of these two commands:
> 
> tc qdisc del dev eth1 parent 2:2 handle 0xF1111 sfq perturb 10
> -or-
> tc qdisc del dev eth1 parent 2:2 handle 0x1111 sfq perturb 10
> 
> The truncated handle is also displayed in the output of the associated
> class, so for example in a setup where the end user is using tc and
> filter to rate limit:
> 
> >tc class add dev eth1 parent 2:1 classid 2:2 htb rate 50kbit ceil 1024kbit 
> >prio 2
> >tc qdisc add dev eth1 parent 2:2 handle 0xf1111 sfq perturb 10
> >tc filter add dev eth1 parent 2:0 prio 0 protocol ip pref 2 handle 0xf1111 
> >fw flowid 2:2
> 
> Looking at the output of the show command for the class:
> 
> >tc -s class show dev eth1
> class htb 2:2 parent 2:1 leaf 1111: prio 2 rate 50000bit ceil 1024Kbit
> burst 1600b cburst 1600
> 
> This should be:
> class htb 2:2 parent 2:1 leaf f1111: prio 2 rate 50000bit ceil
> 1024Kbit burst 1600b cburst 1600

IMHO this is a not a bug but a side effect of the generic handle mechanism
in TC.

The handle is a "cookie" used in the kernel classification system. The handle
is 32 bits, but split into 16 bit major and minor portions. The upper bits
are the major portion, the lower bits are hte minor portion.

The interpretation of major and minor is dependent on the qdisc.
For prio, the major part refers to the separate priority queues.
For sfq, there is only one queue therefore major part of the handle
is meaningless and ignored.





--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to