netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: John Fastabend <john.r.fastabend@intel.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org, hadi@cyberus.ca,
	shemminger@vyatta.com, tgraf@infradead.org,
	eric.dumazet@gmail.com, nhorman@tuxdriver.com
Subject: Re: [net-next-2.6 PATCH 2/4] net_sched: Allow multiple mq qdisc to be used as non-root
Date: Mon, 20 Dec 2010 23:12:42 +0000	[thread overview]
Message-ID: <1292886762.3055.38.camel@bwh-desktop> (raw)
In-Reply-To: <20101217153445.12170.73420.stgit@jf-dev1-dcblab>

On Fri, 2010-12-17 at 07:34 -0800, John Fastabend wrote:
[...]
> diff --git a/net/sched/sch_mq.c b/net/sched/sch_mq.c
> index ecc302f..35ed26d 100644
> --- a/net/sched/sch_mq.c
> +++ b/net/sched/sch_mq.c
> @@ -19,17 +19,39 @@
>  
>  struct mq_sched {
>  	struct Qdisc		**qdiscs;
> +	u8 num_tc;
>  };
>  
> +static void mq_queues(struct net_device *dev, struct Qdisc *sch,
> +		      unsigned int *count, unsigned int *offset)
> +{
> +	struct mq_sched *priv = qdisc_priv(sch);
> +	if (priv->num_tc) {
> +		int queue = TC_H_MIN(sch->parent) - 1;
> +		if (count)
> +			*count = dev->tc_to_txq[queue].count;
> +		if (offset)
> +			*offset = dev->tc_to_txq[queue].offset;
> +	} else {
> +		if (count)
> +			*count = dev->num_tx_queues;
> +		if (offset)
> +			*offset = 0;
> +	}
> +}
[...]

It looks like num_tc will be set even for the root qdisc if the device
is capable of QoS.  Would mq_queues() behave correctly then, i.e. is the
queue range for priority 0 required to be [0, dev->num_tx_queues)?

Also it would be neater to return count and offset together as struct
netdev_tc_txq, rather than through optional out-parameters.  Even better
would be to cache these in struct mq_sched, if that's possible.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


  reply	other threads:[~2010-12-20 23:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-17 15:34 [net-next-2.6 PATCH 1/4] net: implement mechanism for HW based QOS John Fastabend
2010-12-17 15:34 ` [net-next-2.6 PATCH 2/4] net_sched: Allow multiple mq qdisc to be used as non-root John Fastabend
2010-12-20 23:12   ` Ben Hutchings [this message]
2010-12-21 19:21     ` John Fastabend
2010-12-17 15:34 ` [net-next-2.6 PATCH 3/4] net_sched: implement a root container qdisc sch_mclass John Fastabend
2010-12-17 15:34 ` [net-next-2.6 PATCH 4/4] net_sched: add MQSAFE flag to qdisc to identify mq like qdiscs John Fastabend
2010-12-20 23:22   ` Ben Hutchings
2010-12-21 19:21     ` John Fastabend
2010-12-17 16:54 ` [net-next-2.6 PATCH 1/4] net: implement mechanism for HW based QOS John Fastabend

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=1292886762.3055.38.camel@bwh-desktop \
    --to=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=hadi@cyberus.ca \
    --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;
as well as URLs for NNTP newsgroup(s).