From: Eric Dumazet <eric.dumazet@gmail.com>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: netdev@vger.kernel.org, Jamal Hadi Salim <jhs@mojatatu.com>
Subject: Re: [Patch net-next v2 2/4] net_sched: update hierarchical backlog too
Date: Fri, 30 Oct 2015 12:30:50 -0700 [thread overview]
Message-ID: <1446233450.6254.29.camel@edumazet-glaptop2.roam.corp.google.com> (raw)
In-Reply-To: <1446229351-13412-3-git-send-email-xiyou.wangcong@gmail.com>
On Fri, 2015-10-30 at 11:22 -0700, Cong Wang wrote:
> When the bottom qdisc decides to, for example, drop some packet,
> it calls qdisc_tree_decrease_qlen() to update the queue length
> for all its ancestors, we need to update the backlog too to
> keep the stats on root qdisc accurate.
>
> Cc: Jamal Hadi Salim <jhs@mojatatu.com>
> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
...
>
> diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c
> index 3abab53..498f0a2 100644
> --- a/net/sched/sch_sfq.c
> +++ b/net/sched/sch_sfq.c
> @@ -346,7 +346,7 @@ static int
> sfq_enqueue(struct sk_buff *skb, struct Qdisc *sch)
> {
> struct sfq_sched_data *q = qdisc_priv(sch);
> - unsigned int hash;
> + unsigned int hash, dropped;
> sfq_index x, qlen;
> struct sfq_slot *slot;
> int uninitialized_var(ret);
> @@ -461,7 +461,7 @@ sfq_enqueue(struct sk_buff *skb, struct Qdisc *sch)
> return NET_XMIT_SUCCESS;
>
> qlen = slot->qlen;
> - sfq_drop(sch);
> + dropped = sfq_drop(sch);
> /* Return Congestion Notification only if we dropped a packet
> * from this flow.
> */
> @@ -469,7 +469,7 @@ sfq_enqueue(struct sk_buff *skb, struct Qdisc *sch)
> return NET_XMIT_CN;
I believe you missed the NET_XMIT_CN cases.
SFQ can drop a prior packet, and queue current packet.
qdisc_tree_reduce_backlog() wont be called to update parents.
Not sure about other qdisc(s)
next prev parent reply other threads:[~2015-10-30 19:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-30 18:22 [Patch net-next v2 0/4] net_sched: update backlog for hierarchical qdisc's Cong Wang
2015-10-30 18:22 ` [Patch net-next v2 1/4] net_sched: introduce qdisc_replace() helper Cong Wang
2015-10-30 18:22 ` [Patch net-next v2 2/4] net_sched: update hierarchical backlog too Cong Wang
2015-10-30 19:30 ` Eric Dumazet [this message]
2015-11-02 21:09 ` Cong Wang
2015-11-02 21:20 ` Eric Dumazet
2015-11-02 21:50 ` Cong Wang
2015-10-30 18:22 ` [Patch net-next v2 3/4] sch_htb: update backlog as well Cong Wang
2015-10-30 18:22 ` [Patch net-next v2 4/4] sch_dsmark: " Cong Wang
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=1446233450.6254.29.camel@edumazet-glaptop2.roam.corp.google.com \
--to=eric.dumazet@gmail.com \
--cc=jhs@mojatatu.com \
--cc=netdev@vger.kernel.org \
--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).