[bug?] bug in the htb netlink messages ?
Fabrice HOBAYA
fabrice.hobaya at toulouse.viveris.com
Tue Feb 21 12:01:16 EST 2012
Actually the nl_object_dump() I've reported was before I send it to the
kernel (via rtnl_class_add()).
So before the sending (due to previous messages):
class htb dev (null) id 2:700 parent 2:50 rate 1.83KiB/s (15Kbit) log
2147483648
ceil 1.83KiB/s (15Kbit) log 2147483648 prio 0
and after the sending:
class htb dev (null) id 2:700 parent 2:50 rate 1.83KiB/s (15Kbit) log 8
ceil 1.83KiB/s (15Kbit) log 8 prio 0
Seems like the kernel expects something different ? Right ? What can I do ?
Thanks a lot,
Fabrice.
Le 21/02/2012 17:25, Thomas Graf a écrit :
> On Tue, Feb 21, 2012 at 11:12:32AM +0100, Fabrice HOBAYA wrote:
>> I'm using the libnl 3.2.3 for rtnl_htb functions, here is my problem:
>>
>> When I set the rate (and ceil) of a branch of the htb
>> (rtnl_htb_set_rate(...) and rtnl_htb_set_ceil), the real observed
>> rate is 16 times bigger whereas the get functions
>> (rtnl_htb_get_rate(...) and rtnl_htb_get_ceil(...)) and the
>> nl_object_dump function (result at the end of the mail) return the
>> right set rate and ceil.
>>
>> For example when I set rate and ceil to 15kbits/sec, the observed
>> rate is 240kbits/sec (the parent has the same settings).
> Seems like the rate calculation is no longer valid. The kernel has
> updated the way it expects userpace to provide rates a while ago.
>
> Can you nl_object_dump() your htb class/qdisc before you send it
> to the kernel? That will show us if the calculation is wrong or if
> the kernel expects something different from us.
>
>> When I tried to debug with NLCB=debug, the request message for the
>> setting of the htb is well acknowledged (error message with code 0)
>> but seems to have a wrong total length (see below). The second
>> attribute [ATTR 02] of the request is not readable without a
>> documentation, so I can not continue debugging without help.
> These corresponding to TCA_* in<linux/rtnetlink.h>
>
> ATTR 01 is TCA_KIND
> ATTR 02 is TCA_OPTIONS
>
>> For information I've used a tc script (on the same system), and
>> everything has worked normally.
>>
>> Could someone gives me any idea on that ? Thanks in advance.
>>
>> Best Regards,
>> Fabrice.
>>
>> -- Debug: Sent Message:
>> -------------------------- BEGIN NETLINK MESSAGE
>> ---------------------------
>> [HEADER] 16 octets
>> .nlmsg_len = 2152 (*instead of 16+20+4+2104 = 2144 ???*)
> You also have to account for attribute headers:
>
> 16 + 20 + (4 + 4) + (4 + 2104) = 2152
--
Fabrice HOBAYA
PhD - Ingénieur d'études Viveris Technologies
1 Avenue de l'Europe - Parc technologique du Canal -
Bat C - 1er étage - 31400 Toulouse - France
fabrice.hobaya at toulouse.viveris.com
More information about the libnl
mailing list