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  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:	Sat, 4 Jun 2016 21:03:01 +0200
From:	Florian Westphal <fw@...len.de>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	David Miller <davem@...emloft.net>,
	netdev <netdev@...r.kernel.org>,
	Stas Nichiporovich <stasn77@...il.com>,
	WANG Cong <xiyou.wangcong@...il.com>,
	Jamal Hadi Salim <jhs@...atatu.com>
Subject: Re: [net] fq_codel: fix NET_XMIT_CN behavior

Eric Dumazet <eric.dumazet@...il.com> wrote:
> From: Eric Dumazet <edumazet@...gle.com>
> 
> My prior attempt to fix the backlogs of parents failed.
> 
> If we return NET_XMIT_CN, our parents wont increase their backlog,
> so our qdisc_tree_reduce_backlog() should take this into account.

[..]

> diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c
> index 6883a8971562..c57ec480a2da 100644
> --- a/net/sched/sch_fq_codel.c
> +++ b/net/sched/sch_fq_codel.c
> @@ -240,11 +240,19 @@ static int fq_codel_enqueue(struct sk_buff *skb, struct Qdisc *sch)
>  	q->drop_overlimit += prev_qlen - sch->q.qlen;
>  	if (memory_limited)
>  		q->drop_overmemory += prev_qlen - sch->q.qlen;
> -	/* As we dropped packet(s), better let upper stack know this */
> -	qdisc_tree_reduce_backlog(sch, prev_qlen - sch->q.qlen,
> -				  prev_backlog - sch->qstats.backlog);
> -
> -	return ret == idx ? NET_XMIT_CN : NET_XMIT_SUCCESS;
> +	/* As we dropped packet(s), better let upper stack know this.
> +	 * If we dropped a packet for this flow, return NET_XMIT_CN,
> +	 * but in this case, our parents wont increase their backlogs.
> +	 */
> +	prev_qlen -= sch->q.qlen;
> +	prev_backlog -= sch->qstats.backlog;
> +	if (ret == idx) {
> +		qdisc_tree_reduce_backlog(sch, prev_qlen - 1,
> +					  prev_backlog - qdisc_pkt_len(skb));
> +		return NET_XMIT_CN;

Is skb still valid here? AFAICS its possible that fq_codel_drop() drops it.

Other than that this looks good, thanks Eric!

Powered by blists - more mailing lists