From: Eric Dumazet <eric.dumazet@gmail.com>
To: John Fastabend <john.r.fastabend@intel.com>
Cc: davem@davemloft.net, jarkao2@gmail.com, hadi@cyberus.ca,
shemminger@vyatta.com, tgraf@infradead.org,
bhutchings@solarflare.com, nhorman@tuxdriver.com,
netdev@vger.kernel.org
Subject: Re: [net-next-2.6 PATCH v4 2/2] net_sched: implement a root container qdisc sch_mclass
Date: Tue, 04 Jan 2011 07:46:43 +0100 [thread overview]
Message-ID: <1294123603.2711.33.camel@edumazet-laptop> (raw)
In-Reply-To: <20110104030558.13187.27076.stgit@jf-dev1-dcblab>
Le lundi 03 janvier 2011 à 19:05 -0800, John Fastabend a écrit :
> This implements a mqprio queueing discipline that by default creates
> a pfifo_fast qdisc per tx queue and provides the needed configuration
> interface.
> +static int mqprio_dump(struct Qdisc *sch, struct sk_buff *skb)
> +{
> + struct net_device *dev = qdisc_dev(sch);
> + struct mqprio_sched *priv = qdisc_priv(sch);
> + unsigned char *b = skb_tail_pointer(skb);
> + struct tc_mqprio_qopt opt;
> + struct Qdisc *qdisc;
> + unsigned int i;
> +
> + sch->q.qlen = 0;
> + memset(&sch->bstats, 0, sizeof(sch->bstats));
> + memset(&sch->qstats, 0, sizeof(sch->qstats));
> +
> + for (i = 0; i < dev->num_tx_queues; i++) {
> + qdisc = netdev_get_tx_queue(dev, i)->qdisc;
> + spin_lock_bh(qdisc_lock(qdisc));
> + sch->q.qlen += qdisc->q.qlen;
> + sch->bstats.bytes += qdisc->bstats.bytes;
> + sch->bstats.packets += qdisc->bstats.packets;
> + sch->qstats.qlen += qdisc->qstats.qlen;
> + sch->qstats.backlog += qdisc->qstats.backlog;
> + sch->qstats.drops += qdisc->qstats.drops;
> + sch->qstats.requeues += qdisc->qstats.requeues;
> + sch->qstats.overlimits += qdisc->qstats.overlimits;
> + spin_unlock_bh(qdisc_lock(qdisc));
> + }
> +
I understand this code already exists in mq, I just want to note that
some qdiscs update their stats in their dump() subroutine, because their
enqueue()/dequeue() doesnt update all fields.
We might add a gather_stats() method, eventually, to get rid of all
oddities we currently have with 0 backlogs (or qlen) here and here ;)
For example, I am not even sure qdisc->qstats.qlen should not be
replaced by to qdisc->qstats.qlen in your loop, as done in
mqprio_dump_class_stats()
Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com>
next prev parent reply other threads:[~2011-01-04 6:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-04 3:05 [net-next-2.6 PATCH v4 1/2] net: implement mechanism for HW based QOS John Fastabend
2011-01-04 3:05 ` [net-next-2.6 PATCH v4 2/2] net_sched: implement a root container qdisc sch_mclass John Fastabend
2011-01-04 6:46 ` Eric Dumazet [this message]
2011-01-04 11:18 ` Jarek Poplawski
2011-01-04 18:16 ` John Fastabend
2011-01-04 12:32 ` [net-next-2.6 PATCH v4 1/2] net: implement mechanism for HW based QOS jamal
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=1294123603.2711.33.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=hadi@cyberus.ca \
--cc=jarkao2@gmail.com \
--cc=john.r.fastabend@intel.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
--cc=shemminger@vyatta.com \
--cc=tgraf@infradead.org \
/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