Hello,
We have a strange problem with the filters on our setup...
We have a PERL module which creates, upon connection of a user, a new
class for bandwidth limiting. We then create a filter for that user
based on his IP address.
Code :
  "$TC class add dev $this->{device} parent $this->{parent} " .
                "classid 1:$pid cbq bandwidth $this->{MaxRate} rate
$rlimit " .
                "allot $this->{allot} weight $weight$runit  prio 5
" .
                "avpkt $this->{avpkt} bounded" ;
  "$TC filter add dev $this->{device} protocol ip parent " .
                  "$this->{root} prio $pid u32 match ip dst $ipdst
" .
                  "flowid 1:$pid 2>/dev/null" ;
Where :    $this->{device} is eth1
                $this->{allot} = 1514
                $this->{avgpkt} = 1000
                $weight is a 10% of $rlimit
                $this->{maxrate} is the rate of the eth interface
                $pid is a number between 300 and 16000 specific for each
class/filter
                $this->{root} is 1:
                $this->parent is 1:1
Example :
    class cbq 1: root rate 100Mbit (bounded,isolated) prio no-transmit
    class cbq 1:1 parent 1: rate 100Mbit prio 1
    class cbq 1:516 parent 1:1 rate 400Kbit (bounded) prio 5
    class cbq 1:460 parent 1:1 rate 400Kbit (bounded) prio 5
Ok.. .the problem we have is with the filters. Limiting is working
beautifully but when we do a tc filter ls dev eth1 | grep 516 (to see
the number of filters with that particular priority), we should normally
see only one filter related to our flowid, right ? However, we have one
copy of the filter **for each** priority...
Example for prio 516 :
filter parent 1: protocol ip pref 450 u32 fh 8d7::800 order 2048 key ht
8d7 bkt 0 flowid 1:516
filter parent 1: protocol ip pref 460 u32 fh 8d7::800 order 2048 key ht
8d7 bkt 0 flowid 1:516
filter parent 1: protocol ip pref 516 u32
filter parent 1: protocol ip pref 516 u32 fh 878: ht divisor 1
filter parent 1: protocol ip pref 516 u32 fh 878::800 order 2048 key ht
878 bkt 0 flowid 1:2467
filter parent 1: protocol ip pref 516 u32 fh 877: ht divisor 1
filter parent 1: protocol ip pref 516 u32 fh 877::800 order 2048 key ht
877 bkt 0 flowid 1:2466
....
....
....
filter parent 1: protocol ip pref 2463 u32 fh 8d7::800 order 2048 key ht
8d7 bkt 0 flowid 1:516
filter parent 1: protocol ip pref 2464 u32 fh 8d7::800 order 2048 key ht
8d7 bkt 0 flowid 1:516
filter parent 1: protocol ip pref 2465 u32 fh 8d7::800 order 2048 key ht
8d7 bkt 0 flowid 1:516
filter parent 1: protocol ip pref 2466 u32 fh 8d7::800 order 2048 key ht
8d7 bkt 0 flowid 1:516
filter parent 1: protocol ip pref 2467 u32 fh 8d7::800 order 2048 key ht
8d7 bkt 0 flowid 1:516
Any idea what we are doing wrong ? Or maybe it is a problem in the tc
filter ls command ?
BTW, we are using kernel 2.4.3 with iproute2 version 2.2.4-10 (from
RH7.1)
Thanks and best regards,
Frederic Lens & Thierry Coutelier