From: Florian Westphal <fw@strlen.de>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>,
netdev <netdev@vger.kernel.org>,
Stas Nichiporovich <stasn77@gmail.com>,
WANG Cong <xiyou.wangcong@gmail.com>,
Jamal Hadi Salim <jhs@mojatatu.com>
Subject: Re: [net] fq_codel: fix NET_XMIT_CN behavior
Date: Sat, 4 Jun 2016 21:03:01 +0200 [thread overview]
Message-ID: <20160604190301.GA8857@strlen.de> (raw)
In-Reply-To: <1465062227.2968.7.camel@edumazet-glaptop3.roam.corp.google.com>
Eric Dumazet <eric.dumazet@gmail.com> wrote:
> From: Eric Dumazet <edumazet@google.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!
next prev parent reply other threads:[~2016-06-04 19:02 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-04 17:43 [PATCH net] fq_codel: fix NET_XMIT_CN behavior Eric Dumazet
2016-06-04 19:03 ` Florian Westphal [this message]
2016-06-04 19:40 ` [net] " Eric Dumazet
2016-06-04 19:55 ` [PATCH v2 net] " Eric Dumazet
2016-06-05 13:03 ` Jamal Hadi Salim
2016-06-05 20:30 ` Cong Wang
2016-06-05 20:54 ` Eric Dumazet
2016-06-05 20:55 ` Eric Dumazet
2016-06-05 23:30 ` Cong Wang
2016-06-06 10:49 ` Jamal Hadi Salim
2016-06-06 11:42 ` Florian Westphal
2016-06-06 14:37 ` Eric Dumazet
2016-06-06 16:18 ` Florian Westphal
2016-06-10 12:02 ` Jamal Hadi Salim
2016-06-06 14:29 ` Eric Dumazet
2016-06-07 22:39 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160604190301.GA8857@strlen.de \
--to=fw@strlen.de \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=jhs@mojatatu.com \
--cc=netdev@vger.kernel.org \
--cc=stasn77@gmail.com \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).