diff mbox

[net-next,4/7] htb: initialize cl->tokens and cl->ctokens correctly

Message ID 1360328327-7144-5-git-send-email-jiri@resnulli.us
State Changes Requested, archived
Headers show

Commit Message

Jiri Pirko Feb. 8, 2013, 12:58 p.m. UTC
These are in ns so convert from ticks to ns.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
 net/sched/sch_htb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Eric Dumazet Feb. 8, 2013, 4:36 p.m. UTC | #1
On Fri, 2013-02-08 at 13:58 +0100, Jiri Pirko wrote:
> These are in ns so convert from ticks to ns.
> 
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
> ---
>  net/sched/sch_htb.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
> index 547912e9..2b22544 100644
> --- a/net/sched/sch_htb.c
> +++ b/net/sched/sch_htb.c
> @@ -1459,8 +1459,8 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
>  		cl->parent = parent;
>  
>  		/* set class to be in HTB_CAN_SEND state */
> -		cl->tokens = hopt->buffer;
> -		cl->ctokens = hopt->cbuffer;
> +		cl->tokens = PSCHED_TICKS2NS(hopt->buffer);
> +		cl->ctokens = PSCHED_TICKS2NS(hopt->cbuffer);
>  		cl->mbuffer = 60 * PSCHED_TICKS_PER_SEC;	/* 1min */
>  		cl->t_c = psched_get_time();
>  		cl->cmode = HTB_CAN_SEND;

Acked-by: Eric Dumazet <edumazet@google.com>



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 547912e9..2b22544 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -1459,8 +1459,8 @@  static int htb_change_class(struct Qdisc *sch, u32 classid,
 		cl->parent = parent;
 
 		/* set class to be in HTB_CAN_SEND state */
-		cl->tokens = hopt->buffer;
-		cl->ctokens = hopt->cbuffer;
+		cl->tokens = PSCHED_TICKS2NS(hopt->buffer);
+		cl->ctokens = PSCHED_TICKS2NS(hopt->cbuffer);
 		cl->mbuffer = 60 * PSCHED_TICKS_PER_SEC;	/* 1min */
 		cl->t_c = psched_get_time();
 		cl->cmode = HTB_CAN_SEND;