netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vinicius Costa Gomes <vinicius.gomes@intel.com>
To: David Ahern <dsahern@gmail.com>, netdev@vger.kernel.org
Cc: jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us,
	jesus.sanchez-palencia@intel.com, ilias.apalodimas@linaro.org,
	simon.fok@baesystems.com
Subject: Re: [PATCH iproute2 net-next v1 5/6] tc: Add support for configuring the taprio scheduler
Date: Wed, 03 Oct 2018 10:13:41 -0700	[thread overview]
Message-ID: <87zhvvt0l6.fsf@intel.com> (raw)
In-Reply-To: <eff804f8-a415-637a-94bd-e4ce8d7e7b9f@gmail.com>

Hi David,

David Ahern <dsahern@gmail.com> writes:

> On 9/28/18 7:10 PM, Vinicius Costa Gomes wrote:
>> This traffic scheduler allows traffic classes states (transmission
>> allowed/not allowed, in the simplest case) to be scheduled, according
>> to a pre-generated time sequence. This is the basis of the IEEE
>> 802.1Qbv specification.
>> 
>> Example configuration:
>> 
>> tc qdisc replace dev enp3s0 parent root handle 100 taprio \
>>           num_tc 3 \
>> 	  map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \
>> 	  queues 1@0 1@1 2@2 \
>> 	  base-time 1528743495910289987 \
>> 	  sched-entry S 01 300000 \
>> 	  sched-entry S 02 300000 \
>> 	  sched-entry S 04 300000 \
>> 	  clockid CLOCK_TAI
>> 
>> The configuration format is similar to mqprio. The main difference is
>> the presence of a schedule, built by multiple "sched-entry"
>> definitions, each entry has the following format:
>> 
>>      sched-entry <CMD> <GATE MASK> <INTERVAL>
>> 
>> The only supported <CMD> is "S", which means "SetGateStates",
>
> ...
>
>> +static int str_to_entry_cmd(const char *str)
>> +{
>> +	if (strcmp(str, "S") == 0)
>> +		return TC_TAPRIO_CMD_SET_GATES;
>> +
>> +	if (strcmp(str, "H") == 0)
>> +		return TC_TAPRIO_CMD_SET_AND_HOLD;
>> +
>> +	if (strcmp(str, "R") == 0)
>> +		return TC_TAPRIO_CMD_SET_AND_RELEASE;
>
> If 'S' is the only supported command, what are 'H' and 'R'?

It is the only command that works (for now): taprio is a software only
implementation now.

Just to give some background, 'H' (Set-And-Hold-MAC) and 'R'
(Set-And-Release-MAC) will be used when Frame Preemption is added, 'H'
means that any preemtible frame should have finished being transmitted
before this "entry" starts and frame preemption is disabled, 'R' means
preemptible frames may be transmitted during this entry's interval and
frame preemption is re-enabled.

Will remove these references for now. 

>
>> +
>> +	return -1;
>> +}
>> +
>
>> +
>> +static const char *command_to_str(__u8 cmd)
>> +{
>> +	switch (cmd) {
>> +	case TC_TAPRIO_CMD_SET_GATES:
>> +		return "S";
>> +	case TC_TAPRIO_CMD_SET_AND_HOLD:
>> +		return "H";
>> +	case TC_TAPRIO_CMD_SET_AND_RELEASE:
>> +		return "R";
>> +	default:
>> +		return "Invalid";
>> +	}
>> +}
>
> And can you keep str-to-command and command-to-str helpers close
> together in the code.

Sure. WIll fix it for v2.


Cheers,

  reply	other threads:[~2018-10-04  0:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-29  1:10 [PATCH iproute2 net-next v1 0/6] introduce the taprio scheduler Vinicius Costa Gomes
2018-09-29  1:10 ` [PATCH iproute2 net-next v1 1/6] utils: Implement get_s64() Vinicius Costa Gomes
2018-09-29  1:10 ` [PATCH iproute2 net-next v1 2/6] include: Add helper to retrieve a __s64 from a netlink msg Vinicius Costa Gomes
2018-09-29  1:10 ` [PATCH iproute2 net-next v1 3/6] libnetlink: Add helper for getting a __s32 from netlink msgs Vinicius Costa Gomes
2018-09-29  1:10 ` [PATCH iproute2 net-next v1 4/6] include: add definitions for taprio [DO NOT COMMIT] Vinicius Costa Gomes
2018-09-29  1:10 ` [PATCH iproute2 net-next v1 5/6] tc: Add support for configuring the taprio scheduler Vinicius Costa Gomes
2018-10-03 16:36   ` David Ahern
2018-10-03 17:13     ` Vinicius Costa Gomes [this message]
2018-09-29  1:10 ` [PATCH iproute2 net-next v1 6/6] taprio: Add manpage for tc-taprio(8) Vinicius Costa Gomes

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=87zhvvt0l6.fsf@intel.com \
    --to=vinicius.gomes@intel.com \
    --cc=dsahern@gmail.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jesus.sanchez-palencia@intel.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=simon.fok@baesystems.com \
    --cc=xiyou.wangcong@gmail.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;
as well as URLs for NNTP newsgroup(s).