public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: John Fastabend <john.r.fastabend@intel.com>
Cc: shemminger@vyatta.com, netdev@vger.kernel.org
Subject: Re: [PATCH] iproute2: tc add mqprio qdisc support
Date: Thu, 14 Apr 2011 00:10:22 +0100	[thread overview]
Message-ID: <1302736222.2873.39.camel@bwh-desktop> (raw)
In-Reply-To: <20110412155727.4656.42756.stgit@jf-dev1-dcblab>

I know that this has already been applied, but:

On Tue, 2011-04-12 at 08:57 -0700, John Fastabend wrote:
> Add mqprio qdisc support. Output matches the following,
> 
> # ./tc/tc qdisc
> qdisc mq 0: dev eth1 root
> qdisc mq 0: dev eth2 root
> qdisc mqprio 8001: dev eth3 root  tc 8 map 0 1 2 3 4 5 6 7 1 1 1 1 1 1 1 1
>              queues:(0:7) (8:15) (16:23) (24:31) (32:39) (40:47) (48:55) (56:63)
> 
> And usage is,
> 
> # ./tc/tc qdisc add dev eth3 root mqprio help
> Usage: ... mclass [num_tc NUMBER] [map P0 P1...]

mclass?

>                   [offset txq0 txq1 ...] [count cnt0 cnt1 ...] [hw 1|0]

Of course I wrote something similar to this, but I never finished it
off, so thanks.

I don't think it makes sense to require count and offset to be specified
as separate lists.  The arguments could be interleaved but that adds
more opportunity for error.  Since offsets have to be in order and you
generally don't want to have gaps then the offsets could normally be
inferred.  So maybe something like:

	queues cnt0[@txq0] cnt1[@txq1] ...

[...]
> +static int mqprio_parse_opt(struct qdisc_util *qu, int argc,
> +			    char **argv, struct nlmsghdr *n)
> +{
> +	int idx;
> +	struct tc_mqprio_qopt opt = {
> +				     8,
> +				     {0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 1, 1, 3, 3, 3, 3},
> +				     1,
> +				    };

It would be clearer to name the fields being initialised.

[...]
> +int mqprio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
> +{
> +	int i;
> +	struct tc_mqprio_qopt *qopt;
> +
> +	if (opt == NULL)
> +		return 0;
> +
> +	qopt = RTA_DATA(opt);
> +
> +	fprintf(f, " tc %u map ", qopt->num_tc);
> +	for (i = 0; i <= TC_PRIO_MAX; i++)
> +		fprintf(f, "%d ", qopt->prio_tc_map[i]);
> +	fprintf(f, "\n             queues:");
> +	for (i = 0; i < qopt->num_tc; i++)
> +		fprintf(f, "(%i:%i) ", qopt->offset[i],
> +			qopt->offset[i] + qopt->count[i] - 1);
[...]

Shouldn't this output be consistent with the command-line syntax?

Ben.

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


  parent reply	other threads:[~2011-04-13 23:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-12 15:57 [PATCH] iproute2: tc add mqprio qdisc support John Fastabend
2011-04-12 16:23 ` Stephen Hemminger
2011-04-13 23:10 ` Ben Hutchings [this message]
2011-04-13 23:37   ` 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=1302736222.2873.39.camel@bwh-desktop \
    --to=bhutchings@solarflare.com \
    --cc=john.r.fastabend@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.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