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, 13 May 2014 06:49:19 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Yang Yingliang <yangyingliang@...wei.com>
Cc:	netdev@...r.kernel.org, vtlam@...gle.com, nanditad@...gle.com,
	davem@...emloft.net
Subject: Re: [PATCH net-next] net_sched: increase drop count when packets
 are dropped

On Tue, 2014-05-13 at 17:42 +0800, Yang Yingliang wrote:
> When packets are dropped because of overlimit, the drop count
> should be increased. Replace kfree_skb() with qdisc_drop() for
> increasing drop count.
> 
> Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
> ---
>  net/sched/sch_fq.c       | 2 +-
>  net/sched/sch_fq_codel.c | 3 ++-
>  net/sched/sch_hhf.c      | 3 ++-
>  3 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/net/sched/sch_fq.c b/net/sched/sch_fq.c
> index 23c682b42f99..958ef7d4b825 100644
> --- a/net/sched/sch_fq.c
> +++ b/net/sched/sch_fq.c
> @@ -714,7 +714,7 @@ static int fq_change(struct Qdisc *sch, struct nlattr *opt)
>  
>  		if (!skb)
>  			break;
> -		kfree_skb(skb);
> +		qdisc_drop(skb, sch);
>  		drop_count++;
>  	}
>  	qdisc_tree_decrease_qlen(sch, drop_count);
> diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c
> index 0bf432c782c1..bcfe4594470f 100644
> --- a/net/sched/sch_fq_codel.c
> +++ b/net/sched/sch_fq_codel.c
> @@ -344,7 +344,8 @@ static int fq_codel_change(struct Qdisc *sch, struct nlattr *opt)
>  	while (sch->q.qlen > sch->limit) {
>  		struct sk_buff *skb = fq_codel_dequeue(sch);
>  
> -		kfree_skb(skb);
> +		qdisc_drop(skb, sch);
> +		q->drop_overlimit++;
>  		q->cstats.drop_count++;
>  	}

Could you please refrain from adding random stuff in packet schedulers ?

overlimit has a special meaning for HTB like qdisc, having a shapers.

fq_codel or hhf do not shape, there is no reason to increment
'overlimit' when they _drop_ a packet.

Example of current behavior for HTB :

class htb 1:1 root rate 40Gbit ceil 40Gbit burst 625Kb cburst 625Kb 
 Sent 8222081942286 bytes 2240972916 pkt (dropped 0, overlimits 43819454 requeues 0) 
 rate 0bit 0pps backlog 0b 0p requeues 0 
 lended: 1207852666 borrowed: 0 giants: 0
 tokens: 1999 ctokens: 1999



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