All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Fastabend <john.r.fastabend@intel.com>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"hadi@cyberus.ca" <hadi@cyberus.ca>,
	"shemminger@vyatta.com" <shemminger@vyatta.com>,
	"tgraf@infradead.org" <tgraf@infradead.org>,
	"eric.dumazet@gmail.com" <eric.dumazet@gmail.com>,
	"nhorman@tuxdriver.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: Tue, 21 Dec 2010 11:21:21 -0800	[thread overview]
Message-ID: <4D10FE31.1050304@intel.com> (raw)
In-Reply-To: <1292886762.3055.38.camel@bwh-desktop>

On 12/20/2010 3:12 PM, Ben Hutchings wrote:
> 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)?

If num_tc is set the mclass qdisc is loaded by default and not the mq qdisc. When mclass is destroyed it sets num_tc to zero. So I believe mq_queues() will behave correctly ie if mq is the root qdisc [0, dev->num_tx_queues) will be used.

> 
> 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.
> 

Yes should be possible to embed this in mq_sched.

> Ben.
> 


  reply	other threads:[~2010-12-21 19:21 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
2010-12-21 19:21     ` John Fastabend [this message]
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=4D10FE31.1050304@intel.com \
    --to=john.r.fastabend@intel.com \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=hadi@cyberus.ca \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.