* [RFC] HTB initialize upper bound properly
@ 2006-07-14 19:03 Stephen Hemminger
2006-07-14 22:06 ` Jamal Hadi Salim
0 siblings, 1 reply; 4+ messages in thread
From: Stephen Hemminger @ 2006-07-14 19:03 UTC (permalink / raw)
To: David S. Miller, Jamal; +Cc: netdev
The upper bound for HTB time diff needs to be scaled to PSCHED
units rather than just assuming usecs. The field mbuffer is used
in TDIFF_SAFE(), as an upper bound. Untested...
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
--- netem-2.6.orig/net/sched/sch_htb.c
+++ netem-2.6/net/sched/sch_htb.c
@@ -196,7 +196,7 @@ struct htb_class
struct qdisc_rate_table *rate; /* rate table of the class itself */
struct qdisc_rate_table *ceil; /* ceiling rate (limits borrows too) */
long buffer,cbuffer; /* token bucket depth/rate */
- long mbuffer; /* max wait time */
+ psched_tdiff_t mbuffer; /* max wait time */
long tokens,ctokens; /* current number of tokens */
psched_time_t t_c; /* checkpoint time */
};
@@ -1601,7 +1601,7 @@ static int htb_change_class(struct Qdisc
/* set class to be in HTB_CAN_SEND state */
cl->tokens = hopt->buffer;
cl->ctokens = hopt->cbuffer;
- cl->mbuffer = 60000000; /* 1min */
+ cl->mbuffer = PSCHED_JIFFIE2US(HZ*60) /* 1min */
PSCHED_GET_TIME(cl->t_c);
cl->cmode = HTB_CAN_SEND;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC] HTB initialize upper bound properly
2006-07-14 19:03 [RFC] HTB initialize upper bound properly Stephen Hemminger
@ 2006-07-14 22:06 ` Jamal Hadi Salim
2006-07-14 23:32 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Jamal Hadi Salim @ 2006-07-14 22:06 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David S. Miller, netdev
On Fri, 2006-14-07 at 12:03 -0700, Stephen Hemminger wrote:
> The upper bound for HTB time diff needs to be scaled to PSCHED
> units rather than just assuming usecs. The field mbuffer is used
> in TDIFF_SAFE(), as an upper bound. Untested...
>
> Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Looks good to me.
cheers,
jamal
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC] HTB initialize upper bound properly
2006-07-14 22:06 ` Jamal Hadi Salim
@ 2006-07-14 23:32 ` David Miller
2006-07-15 15:09 ` Yoichi Yuasa
0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2006-07-14 23:32 UTC (permalink / raw)
To: hadi; +Cc: shemminger, netdev
From: Jamal Hadi Salim <hadi@cyberus.ca>
Date: Fri, 14 Jul 2006 18:06:26 -0400
> On Fri, 2006-14-07 at 12:03 -0700, Stephen Hemminger wrote:
> > The upper bound for HTB time diff needs to be scaled to PSCHED
> > units rather than just assuming usecs. The field mbuffer is used
> > in TDIFF_SAFE(), as an upper bound. Untested...
> >
> > Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
>
> Looks good to me.
Me too, thanks Stephen.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC] HTB initialize upper bound properly
2006-07-14 23:32 ` David Miller
@ 2006-07-15 15:09 ` Yoichi Yuasa
0 siblings, 0 replies; 4+ messages in thread
From: Yoichi Yuasa @ 2006-07-15 15:09 UTC (permalink / raw)
To: David Miller; +Cc: yoichi_yuasa, hadi, shemminger, netdev
On Fri, 14 Jul 2006 16:32:45 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:
> From: Jamal Hadi Salim <hadi@cyberus.ca>
> Date: Fri, 14 Jul 2006 18:06:26 -0400
>
> > On Fri, 2006-14-07 at 12:03 -0700, Stephen Hemminger wrote:
> > > The upper bound for HTB time diff needs to be scaled to PSCHED
> > > units rather than just assuming usecs. The field mbuffer is used
> > > in TDIFF_SAFE(), as an upper bound. Untested...
> > >
> > > Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
> >
> > Looks good to me.
>
> Me too, thanks Stephen.
You forgot a semicolon.
Yoichi
Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
diff -pruN -X 2.6.18-rc1/Documentation/dontdiff 2.6.18-rc1-orig/net/sched/sch_htb.c 2.6.18-rc1/net/sched/sch_htb.c
--- 2.6.18-rc1-orig/net/sched/sch_htb.c 2006-07-15 17:16:48.561070000 +0900
+++ 2.6.18-rc1/net/sched/sch_htb.c 2006-07-15 17:15:44.513067250 +0900
@@ -1601,7 +1601,7 @@ static int htb_change_class(struct Qdisc
/* set class to be in HTB_CAN_SEND state */
cl->tokens = hopt->buffer;
cl->ctokens = hopt->cbuffer;
- cl->mbuffer = PSCHED_JIFFIE2US(HZ*60) /* 1min */
+ cl->mbuffer = PSCHED_JIFFIE2US(HZ*60); /* 1min */
PSCHED_GET_TIME(cl->t_c);
cl->cmode = HTB_CAN_SEND;
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-07-15 15:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-14 19:03 [RFC] HTB initialize upper bound properly Stephen Hemminger
2006-07-14 22:06 ` Jamal Hadi Salim
2006-07-14 23:32 ` David Miller
2006-07-15 15:09 ` Yoichi Yuasa
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.