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

Re: about TBF:



Hello,
A little time ago I had experience the same problem. A bug in 2.2 kernels
exists that causes under certain conditions the transimition of packets that
are waiting on the queue, when no new enqueues are performed, to vary. At
2.3 kernels this is fixed, the same patched can be applied to 2.2.x kernels
and it seems to work correctly (I have tested it). I attach the message and
the patch I am refferning at the end.
Bye
Panagiotis

Charo Aizp&idigr;n Burguete wrote:

> Hi
>
> I'm using TBF qdisc, and I want to have a rate for any flow, then what I
> need to know is, why the time between last packets leaving the buffer
> increases a lot (from 0.1 sec to 2 sec) while it has been more or less
> constant during all the flow.
>
>     This is the result I get when I use a buffer limit of 11.000Kbytes,
> and a burst of 1.5kB.
>
> However, when I use a buffer limit of 1.000kbytes and keep the same
> burst, what it happens is that the time between the packets remains more
> or less constant. WHY??????
>
> Related to this subject, I have another question, what limit in advance
> the rate? the rate of the class or the rate of the qdisc TBF??? Or shall
> I take the lower of both in order to limit the rate??
>
> thanks in advance
>
>     Edurne.

Hello!

OK, I found those your mails.

> tc qdisc add dev $DEV handle 1:0 root tbf rate 80Kbps buffer 3Kb limit
40Kb
> DEV=atm0 or eth0 (it has been tested with both)

In this case maximal timeout cannot be more than ~40msec.
If it is greater, it is bug.

EOI has nothing to do with this, it cannot decrease burstiness,
burst size is controlled by and only by "burst" (=buffer).

Alexey


PS, try the following unofficial patch.

diff -ur ../vger-000131/linux/include/net/pkt_sched.h
linux/include/net/pkt_sched.h
--- ../vger-000131/linux/include/net/pkt_sched.h        Sat May  1 16:28:20
1999
+++ linux/include/net/pkt_sched.h       Mon Jan 31 22:29:12 2000
@@ -387,7 +387,7 @@
 void qdisc_run_queues(void);
 int qdisc_restart(struct device *dev);

-extern __inline__ void qdisc_wakeup(struct device *dev)
+extern __inline__ void qdisc_wakeup_one(struct device *dev)
 {
        if (!dev->tbusy) {
                struct Qdisc *q = dev->qdisc;
@@ -397,6 +397,23 @@
                }
        }
 }
+
+extern __inline__ void qdisc_wakeup(struct device *dev)
+{
+       if (!dev->tbusy) {
+               struct Qdisc *q = dev->qdisc;
+               int res;
+
+               while ((res = qdisc_restart(dev)) < 0 && !dev->tbusy)
+                       /* NOTHING */;
+
+               if (res && q->h.forw == NULL) {
+                       q->h.forw = qdisc_head.forw;
+                       qdisc_head.forw = &q->h;
+               }
+       }
+}
+

 extern __inline__ unsigned psched_mtu(struct device *dev)
 {


-----------------------------------------------------
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
------------------------------------------------------