[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting rate for tbf



Hi,
Rate is used indirtectly in qdisc's: that's at  tc rate is used to calculate
the transimition time required for each packet sized from mpu to mtu: rate
table, rtab[i]=packets_size_funtion(i)/rate. So at the kernel this rate table
is passed through netlink sockets, not the rate itself. A solution for your
problem woulb be to enter at tc two or more possible rate values, then
calculate the corresponding table kai use each one of them at the proper
time. Have you examined however implementing the scheme you want using
multiple tbf 's in a cbq and filter?
Panagiotis

Karan Gupta wrote:

> Hi,
>         I want to change the rate of the tbf after the queuing discipline
> is installed.
>         I was looking  the code and think that
>         static int tbf_change(struct Qdisc* sch, struct rtattr *opt) this
> function should come in handy. I want to call this function from
> tbf_enqueue not for all the packets but few special ones.
>
> The problem :
>         tbf_change needs a rtattr structure pointer.
>
> 1. I cannot build this structure as tc does it as I do not have
> struct nlmsghdr.
>
> 2. So during tbf_init call I store a pointer to the rtattr sturcture as I
> have added struct rtattr in the tbf_sched_data.
>
>         Now I can pass this structure to tbf_change but how should I set
> the rate to the desired rate I want.In tbf_change.....
>         Does setting the rate in the qopt->rate.rate to the new rate
> suffice? This is before the call to rtab = qdisc_get_rtab(&qopt->rate,
> tb[TCA_TBF_RTAB-1]);
>
> I shall highly appreciate any inputs or other ways of tackling the
> problem.
>
> Regards,
> Karan Gupta

--
-----------------------------------------------------
Panagiotis G.Stathopoulos
National Technical University of Athens
Telecommunications Laboratory
E-mail: pstath@telecom.ntua.gr
Tel: +30 1 772 1479     Fax: +30 1 772 2534
------------------------------------------------------