lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 3 Nov 2009 08:00:22 +0000
From:	Jarek Poplawski <jarkao2@...il.com>
To:	xiaosuo@...il.com
Cc:	Jamal Hadi Salim <hadi@...erus.ca>, devik@....cz,
	netdev@...r.kernel.org
Subject: Re: [PATCH] sch_htb.c consume the classes's tokens bellow the
	HTB_CAN_SEND level

On 03-11-2009 03:41, Changli Gao wrote:
> sch_htb.c consume the classes's tokens bellow the HTB_CAN_SEND level.
> 
> When a class enters HTB_MAY_BORROW state, it relies on its parents to
> sent packets. The parent class in HTB_CAN_SEND state only consumes
> itself and its parents's tokens, but ADD tokens to the classes under its
> level. It is totally wrong.

Current code is OK.

> It means that a class, which sends packets
> in ceil rate, can also enter HTB_CAN_SEND state now and then.

Yes, a class is entitled to send on it's own then with it's guaranteed
rate, without depending on borrowing.

Jarek P.

> 
> Signed-off-by: Changli Gao <xiaosuo@...il.com>
> 
> ----
> net/sched/sch_htb.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
> index 85acab9..2705702 100644
> --- a/net/sched/sch_htb.c
> +++ b/net/sched/sch_htb.c
> @@ -629,11 +629,10 @@ static void htb_charge_class(struct htb_sched *q, struct htb_class *cl,
>  		if (cl->level >= level) {
>  			if (cl->level == level)
>  				cl->xstats.lends++;
> -			htb_accnt_tokens(cl, bytes, diff);
>  		} else {
>  			cl->xstats.borrows++;
> -			cl->tokens += diff;	/* we moved t_c; update tokens */
>  		}
> +		htb_accnt_tokens(cl, bytes, diff);
>  		htb_accnt_ctokens(cl, bytes, diff);
>  		cl->t_c = q->now;
> 
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ