lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 20 Dec 2010 23:12:42 +0000
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	John Fastabend <john.r.fastabend@...el.com>
Cc:	davem@...emloft.net, netdev@...r.kernel.org, hadi@...erus.ca,
	shemminger@...tta.com, tgraf@...radead.org, eric.dumazet@...il.com,
	nhorman@...driver.com
Subject: Re: [net-next-2.6 PATCH 2/4] net_sched: Allow multiple mq qdisc to
 be used as non-root

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.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ