* [PATCH iproute2 net-next v3 2/5] taprio: Add support for setting flags
2019-07-15 22:51 [PATCH iproute2 net-next v3 1/5] etf: Add skip_sock_check Vedang Patel
@ 2019-07-15 22:51 ` Vedang Patel
2019-07-15 23:37 ` Stephen Hemminger
2019-07-15 22:51 ` [PATCH iproute2 net-next v3 3/5] taprio: add support for setting txtime_delay Vedang Patel
` (2 subsequent siblings)
3 siblings, 1 reply; 12+ messages in thread
From: Vedang Patel @ 2019-07-15 22:51 UTC (permalink / raw)
To: netdev
Cc: jhs, xiyou.wangcong, jiri, stephen, vinicius.gomes,
leandro.maciel.dorileo, jakub.kicinski, m-karicheri2, dsahern,
Vedang Patel
From: Vinicius Costa Gomes <vinicius.gomes@intel.com>
This allows a new parameter, flags, to be passed to taprio. Currently, it
only supports enabling the txtime-assist mode. But, we plan to add
different modes for taprio (e.g. hardware offloading) and this parameter
will be useful in enabling those modes.
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Signed-off-by: Vedang Patel <vedang.patel@intel.com>
---
tc/q_taprio.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/tc/q_taprio.c b/tc/q_taprio.c
index 62c8c591da99..930ecb9d1eef 100644
--- a/tc/q_taprio.c
+++ b/tc/q_taprio.c
@@ -154,6 +154,7 @@ static struct sched_entry *create_entry(uint32_t gatemask, uint32_t interval, ui
static int taprio_parse_opt(struct qdisc_util *qu, int argc,
char **argv, struct nlmsghdr *n, const char *dev)
{
+ __u32 taprio_flags = UINT32_MAX;
__s32 clockid = CLOCKID_INVALID;
struct tc_mqprio_qopt opt = { };
__s64 cycle_time_extension = 0;
@@ -281,6 +282,17 @@ static int taprio_parse_opt(struct qdisc_util *qu, int argc,
explain_clockid(*argv);
return -1;
}
+ } else if (strcmp(*argv, "flags") == 0) {
+ NEXT_ARG();
+ if (taprio_flags != UINT32_MAX) {
+ fprintf(stderr, "taprio: duplicate \"flags\" specification\n");
+ return -1;
+ }
+ if (get_u32(&taprio_flags, *argv, 0)) {
+ PREV_ARG();
+ return -1;
+ }
+
} else if (strcmp(*argv, "help") == 0) {
explain();
return -1;
@@ -297,6 +309,9 @@ static int taprio_parse_opt(struct qdisc_util *qu, int argc,
if (clockid != CLOCKID_INVALID)
addattr_l(n, 1024, TCA_TAPRIO_ATTR_SCHED_CLOCKID, &clockid, sizeof(clockid));
+ if (taprio_flags != UINT32_MAX)
+ addattr_l(n, 1024, TCA_TAPRIO_ATTR_FLAGS, &taprio_flags, sizeof(taprio_flags));
+
if (opt.num_tc > 0)
addattr_l(n, 1024, TCA_TAPRIO_ATTR_PRIOMAP, &opt, sizeof(opt));
@@ -405,6 +420,7 @@ static int taprio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
struct rtattr *tb[TCA_TAPRIO_ATTR_MAX + 1];
struct tc_mqprio_qopt *qopt = 0;
__s32 clockid = CLOCKID_INVALID;
+ __u32 taprio_flags = 0;
int i;
if (opt == NULL)
@@ -442,6 +458,11 @@ static int taprio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
print_string(PRINT_ANY, "clockid", "clockid %s", get_clock_name(clockid));
+ if (tb[TCA_TAPRIO_ATTR_FLAGS]) {
+ taprio_flags = rta_getattr_u32(tb[TCA_TAPRIO_ATTR_FLAGS]);
+ print_uint(PRINT_ANY, "flags", " flags %x", taprio_flags);
+ }
+
print_schedule(f, tb);
if (tb[TCA_TAPRIO_ATTR_ADMIN_SCHED]) {
--
2.7.3
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH iproute2 net-next v3 2/5] taprio: Add support for setting flags
2019-07-15 22:51 ` [PATCH iproute2 net-next v3 2/5] taprio: Add support for setting flags Vedang Patel
@ 2019-07-15 23:37 ` Stephen Hemminger
2019-07-16 0:15 ` Jakub Kicinski
2019-07-16 1:15 ` Patel, Vedang
0 siblings, 2 replies; 12+ messages in thread
From: Stephen Hemminger @ 2019-07-15 23:37 UTC (permalink / raw)
To: Vedang Patel
Cc: netdev, jhs, xiyou.wangcong, jiri, vinicius.gomes,
leandro.maciel.dorileo, jakub.kicinski, m-karicheri2, dsahern
On Mon, 15 Jul 2019 15:51:41 -0700
Vedang Patel <vedang.patel@intel.com> wrote:
> @@ -405,6 +420,7 @@ static int taprio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
> struct rtattr *tb[TCA_TAPRIO_ATTR_MAX + 1];
> struct tc_mqprio_qopt *qopt = 0;
> __s32 clockid = CLOCKID_INVALID;
> + __u32 taprio_flags = 0;
> int i;
>
> if (opt == NULL)
> @@ -442,6 +458,11 @@ static int taprio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
>
> print_string(PRINT_ANY, "clockid", "clockid %s", get_clock_name(clockid));
>
> + if (tb[TCA_TAPRIO_ATTR_FLAGS]) {
> + taprio_flags = rta_getattr_u32(tb[TCA_TAPRIO_ATTR_FLAGS]);
> + print_uint(PRINT_ANY, "flags", " flags %x", taprio_flags);
> + }
> +
Overall this looks fine, but three small comments:
1. It is better not to do unnecessary variable initialization
2. It is better to move variables into the basic block where they are used.
3. Use the print_0xhex() instead of print_uint() for hex values. The difference
is that in the JSON output, print_uint would be decimal but the print_0xhex
is always hex. And use "flags %#x" so that it is clear you are printing flags in hex.
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH iproute2 net-next v3 2/5] taprio: Add support for setting flags
2019-07-15 23:37 ` Stephen Hemminger
@ 2019-07-16 0:15 ` Jakub Kicinski
2019-07-16 0:24 ` Stephen Hemminger
2019-07-16 1:15 ` Patel, Vedang
1 sibling, 1 reply; 12+ messages in thread
From: Jakub Kicinski @ 2019-07-16 0:15 UTC (permalink / raw)
To: Stephen Hemminger
Cc: Vedang Patel, netdev, jhs, xiyou.wangcong, jiri, vinicius.gomes,
leandro.maciel.dorileo, m-karicheri2, dsahern
On Mon, 15 Jul 2019 16:37:43 -0700, Stephen Hemminger wrote:
> On Mon, 15 Jul 2019 15:51:41 -0700
> Vedang Patel <vedang.patel@intel.com> wrote:
> > @@ -442,6 +458,11 @@ static int taprio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
> >
> > print_string(PRINT_ANY, "clockid", "clockid %s", get_clock_name(clockid));
> >
> > + if (tb[TCA_TAPRIO_ATTR_FLAGS]) {
> > + taprio_flags = rta_getattr_u32(tb[TCA_TAPRIO_ATTR_FLAGS]);
> > + print_uint(PRINT_ANY, "flags", " flags %x", taprio_flags);
> > + }
>[...]
> 3. Use the print_0xhex() instead of print_uint() for hex values. The difference
> is that in the JSON output, print_uint would be decimal but the print_0xhex
> is always hex. And use "flags %#x" so that it is clear you are printing flags in hex.
In my humble personal experience scripting tests using iproute2 and
bpftool with Python I found printing the "hex string" instead of just
outputing the integer value counter productive :( Even tho it looks
better to the eye, JSON is primarily for machine processing and hex
strings have to be manually converted.
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH iproute2 net-next v3 2/5] taprio: Add support for setting flags
2019-07-16 0:15 ` Jakub Kicinski
@ 2019-07-16 0:24 ` Stephen Hemminger
2019-07-16 0:34 ` Jakub Kicinski
0 siblings, 1 reply; 12+ messages in thread
From: Stephen Hemminger @ 2019-07-16 0:24 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Vedang Patel, netdev, jhs, xiyou.wangcong, jiri, vinicius.gomes,
leandro.maciel.dorileo, m-karicheri2, dsahern
On Mon, 15 Jul 2019 17:15:15 -0700
Jakub Kicinski <jakub.kicinski@netronome.com> wrote:
> On Mon, 15 Jul 2019 16:37:43 -0700, Stephen Hemminger wrote:
> > On Mon, 15 Jul 2019 15:51:41 -0700
> > Vedang Patel <vedang.patel@intel.com> wrote:
> > > @@ -442,6 +458,11 @@ static int taprio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
> > >
> > > print_string(PRINT_ANY, "clockid", "clockid %s", get_clock_name(clockid));
> > >
> > > + if (tb[TCA_TAPRIO_ATTR_FLAGS]) {
> > > + taprio_flags = rta_getattr_u32(tb[TCA_TAPRIO_ATTR_FLAGS]);
> > > + print_uint(PRINT_ANY, "flags", " flags %x", taprio_flags);
> > > + }
> >[...]
> > 3. Use the print_0xhex() instead of print_uint() for hex values. The difference
> > is that in the JSON output, print_uint would be decimal but the print_0xhex
> > is always hex. And use "flags %#x" so that it is clear you are printing flags in hex.
>
> In my humble personal experience scripting tests using iproute2 and
> bpftool with Python I found printing the "hex string" instead of just
> outputing the integer value counter productive :( Even tho it looks
> better to the eye, JSON is primarily for machine processing and hex
> strings have to be manually converted.
If it is hex on normal output, it should be hex on JSON output.
And what ever the normal output format is has to be accepted on command line as input.
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH iproute2 net-next v3 2/5] taprio: Add support for setting flags
2019-07-16 0:24 ` Stephen Hemminger
@ 2019-07-16 0:34 ` Jakub Kicinski
0 siblings, 0 replies; 12+ messages in thread
From: Jakub Kicinski @ 2019-07-16 0:34 UTC (permalink / raw)
To: Stephen Hemminger
Cc: Vedang Patel, netdev, jhs, xiyou.wangcong, jiri, vinicius.gomes,
leandro.maciel.dorileo, m-karicheri2, dsahern
On Mon, 15 Jul 2019 17:24:22 -0700, Stephen Hemminger wrote:
> On Mon, 15 Jul 2019 17:15:15 -0700
> Jakub Kicinski <jakub.kicinski@netronome.com> wrote:
> > On Mon, 15 Jul 2019 16:37:43 -0700, Stephen Hemminger wrote:
> > > On Mon, 15 Jul 2019 15:51:41 -0700
> > > Vedang Patel <vedang.patel@intel.com> wrote:
> > > > @@ -442,6 +458,11 @@ static int taprio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
> > > >
> > > > print_string(PRINT_ANY, "clockid", "clockid %s", get_clock_name(clockid));
> > > >
> > > > + if (tb[TCA_TAPRIO_ATTR_FLAGS]) {
> > > > + taprio_flags = rta_getattr_u32(tb[TCA_TAPRIO_ATTR_FLAGS]);
> > > > + print_uint(PRINT_ANY, "flags", " flags %x", taprio_flags);
> > > > + }
> > >[...]
> > > 3. Use the print_0xhex() instead of print_uint() for hex values. The difference
> > > is that in the JSON output, print_uint would be decimal but the print_0xhex
> > > is always hex. And use "flags %#x" so that it is clear you are printing flags in hex.
> >
> > In my humble personal experience scripting tests using iproute2 and
> > bpftool with Python I found printing the "hex string" instead of just
> > outputing the integer value counter productive :( Even tho it looks
> > better to the eye, JSON is primarily for machine processing and hex
> > strings have to be manually converted.
>
> If it is hex on normal output, it should be hex on JSON output.
> And what ever the normal output format is has to be accepted on command line as input.
Ah, I forgot the output == input principle in iproute2!
In any case if there was ever a vote whether to limit this principle to
non-JSON output, and make machines' life easier, I'd vote 'yes' :)
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH iproute2 net-next v3 2/5] taprio: Add support for setting flags
2019-07-15 23:37 ` Stephen Hemminger
2019-07-16 0:15 ` Jakub Kicinski
@ 2019-07-16 1:15 ` Patel, Vedang
1 sibling, 0 replies; 12+ messages in thread
From: Patel, Vedang @ 2019-07-16 1:15 UTC (permalink / raw)
To: Stephen Hemminger
Cc: netdev@vger.kernel.org, Jamal Hadi Salim, Cong Wang,
jiri@resnulli.us, Gomes, Vinicius, Dorileo, Leandro,
jakub.kicinski@netronome.com, m-karicheri2@ti.com,
dsahern@gmail.com
Hi Stephen,
> On Jul 15, 2019, at 4:37 PM, Stephen Hemminger <stephen@networkplumber.org> wrote:
>
> On Mon, 15 Jul 2019 15:51:41 -0700
> Vedang Patel <vedang.patel@intel.com> wrote:
>
>> @@ -405,6 +420,7 @@ static int taprio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
>> struct rtattr *tb[TCA_TAPRIO_ATTR_MAX + 1];
>> struct tc_mqprio_qopt *qopt = 0;
>> __s32 clockid = CLOCKID_INVALID;
>> + __u32 taprio_flags = 0;
>> int i;
>>
>> if (opt == NULL)
>> @@ -442,6 +458,11 @@ static int taprio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
>>
>> print_string(PRINT_ANY, "clockid", "clockid %s", get_clock_name(clockid));
>>
>> + if (tb[TCA_TAPRIO_ATTR_FLAGS]) {
>> + taprio_flags = rta_getattr_u32(tb[TCA_TAPRIO_ATTR_FLAGS]);
>> + print_uint(PRINT_ANY, "flags", " flags %x", taprio_flags);
>> + }
>> +
>
> Overall this looks fine, but three small comments:
> 1. It is better not to do unnecessary variable initialization
> 2. It is better to move variables into the basic block where they are used.
> 3. Use the print_0xhex() instead of print_uint() for hex values. The difference
> is that in the JSON output, print_uint would be decimal but the print_0xhex
> is always hex. And use "flags %#x" so that it is clear you are printing flags in hex.
Thanks for they inputs. I will incorporate your comments and send the updated series in a couple of days.
-Vedang
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH iproute2 net-next v3 3/5] taprio: add support for setting txtime_delay.
2019-07-15 22:51 [PATCH iproute2 net-next v3 1/5] etf: Add skip_sock_check Vedang Patel
2019-07-15 22:51 ` [PATCH iproute2 net-next v3 2/5] taprio: Add support for setting flags Vedang Patel
@ 2019-07-15 22:51 ` Vedang Patel
2019-07-15 23:38 ` Stephen Hemminger
2019-07-15 22:51 ` [PATCH iproute2 net-next v3 4/5] tc: etf: Add documentation for skip-skb-check Vedang Patel
2019-07-15 22:51 ` [PATCH iproute2 net-next v3 5/5] tc: taprio: Update documentation Vedang Patel
3 siblings, 1 reply; 12+ messages in thread
From: Vedang Patel @ 2019-07-15 22:51 UTC (permalink / raw)
To: netdev
Cc: jhs, xiyou.wangcong, jiri, stephen, vinicius.gomes,
leandro.maciel.dorileo, jakub.kicinski, m-karicheri2, dsahern,
Vedang Patel
This adds support for setting the txtime_delay parameter which is useful
for the txtime offload mode of taprio.
Signed-off-by: Vedang Patel <vedang.patel@intel.com>
---
tc/q_taprio.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/tc/q_taprio.c b/tc/q_taprio.c
index 930ecb9d1eef..13bd5c44cac9 100644
--- a/tc/q_taprio.c
+++ b/tc/q_taprio.c
@@ -52,7 +52,7 @@ static void explain(void)
" [num_tc NUMBER] [map P0 P1 ...] "
" [queues COUNT@OFFSET COUNT@OFFSET COUNT@OFFSET ...] "
" [ [sched-entry index cmd gate-mask interval] ... ] "
- " [base-time time] "
+ " [base-time time] [txtime-delay delay]"
"\n"
"CLOCKID must be a valid SYS-V id (i.e. CLOCK_TAI)\n");
}
@@ -162,6 +162,7 @@ static int taprio_parse_opt(struct qdisc_util *qu, int argc,
struct rtattr *tail, *l;
__s64 cycle_time = 0;
__s64 base_time = 0;
+ __s32 txtime_delay = 0;
int err, idx;
INIT_LIST_HEAD(&sched_entries);
@@ -293,6 +294,17 @@ static int taprio_parse_opt(struct qdisc_util *qu, int argc,
return -1;
}
+ } else if (strcmp(*argv, "txtime-delay") == 0) {
+ NEXT_ARG();
+ if (txtime_delay != 0) {
+ fprintf(stderr, "taprio: duplicate \"txtime-delay\" specification\n");
+ return -1;
+ }
+ if (get_s32(&txtime_delay, *argv, 0)) {
+ PREV_ARG();
+ return -1;
+ }
+
} else if (strcmp(*argv, "help") == 0) {
explain();
return -1;
@@ -315,6 +327,9 @@ static int taprio_parse_opt(struct qdisc_util *qu, int argc,
if (opt.num_tc > 0)
addattr_l(n, 1024, TCA_TAPRIO_ATTR_PRIOMAP, &opt, sizeof(opt));
+ if (txtime_delay)
+ addattr_l(n, 1024, TCA_TAPRIO_ATTR_TXTIME_DELAY, &txtime_delay, sizeof(txtime_delay));
+
if (base_time)
addattr_l(n, 1024, TCA_TAPRIO_ATTR_SCHED_BASE_TIME, &base_time, sizeof(base_time));
@@ -421,6 +436,7 @@ static int taprio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
struct tc_mqprio_qopt *qopt = 0;
__s32 clockid = CLOCKID_INVALID;
__u32 taprio_flags = 0;
+ __s32 txtime_delay = 0;
int i;
if (opt == NULL)
@@ -463,6 +479,11 @@ static int taprio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
print_uint(PRINT_ANY, "flags", " flags %x", taprio_flags);
}
+ if (tb[TCA_TAPRIO_ATTR_TXTIME_DELAY]) {
+ txtime_delay = rta_getattr_s32(tb[TCA_TAPRIO_ATTR_TXTIME_DELAY]);
+ print_int(PRINT_ANY, "txtime_delay", " txtime delay %d", txtime_delay);
+ }
+
print_schedule(f, tb);
if (tb[TCA_TAPRIO_ATTR_ADMIN_SCHED]) {
--
2.7.3
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH iproute2 net-next v3 3/5] taprio: add support for setting txtime_delay.
2019-07-15 22:51 ` [PATCH iproute2 net-next v3 3/5] taprio: add support for setting txtime_delay Vedang Patel
@ 2019-07-15 23:38 ` Stephen Hemminger
2019-07-16 1:17 ` Patel, Vedang
0 siblings, 1 reply; 12+ messages in thread
From: Stephen Hemminger @ 2019-07-15 23:38 UTC (permalink / raw)
To: Vedang Patel
Cc: netdev, jhs, xiyou.wangcong, jiri, vinicius.gomes,
leandro.maciel.dorileo, jakub.kicinski, m-karicheri2, dsahern
On Mon, 15 Jul 2019 15:51:42 -0700
Vedang Patel <vedang.patel@intel.com> wrote:
> + if (get_s32(&txtime_delay, *argv, 0)) {
Is txtime_delay of a negative value meaningful?
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH iproute2 net-next v3 3/5] taprio: add support for setting txtime_delay.
2019-07-15 23:38 ` Stephen Hemminger
@ 2019-07-16 1:17 ` Patel, Vedang
0 siblings, 0 replies; 12+ messages in thread
From: Patel, Vedang @ 2019-07-16 1:17 UTC (permalink / raw)
To: Stephen Hemminger
Cc: netdev@vger.kernel.org, Jamal Hadi Salim, Cong Wang, Jiri Pirko,
Gomes, Vinicius, Dorileo, Leandro, jakub.kicinski@netronome.com,
m-karicheri2@ti.com, dsahern@gmail.com
> On Jul 15, 2019, at 4:38 PM, Stephen Hemminger <stephen@networkplumber.org> wrote:
>
> On Mon, 15 Jul 2019 15:51:42 -0700
> Vedang Patel <vedang.patel@intel.com> wrote:
>
>> + if (get_s32(&txtime_delay, *argv, 0)) {
>
> Is txtime_delay of a negative value meaningful?
No, txtime-delay should always be a positive value. I will change this to u32 here. I will also make the corresponding changes in the kernel and send the updated patch.
Thanks,
Vedang
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH iproute2 net-next v3 4/5] tc: etf: Add documentation for skip-skb-check.
2019-07-15 22:51 [PATCH iproute2 net-next v3 1/5] etf: Add skip_sock_check Vedang Patel
2019-07-15 22:51 ` [PATCH iproute2 net-next v3 2/5] taprio: Add support for setting flags Vedang Patel
2019-07-15 22:51 ` [PATCH iproute2 net-next v3 3/5] taprio: add support for setting txtime_delay Vedang Patel
@ 2019-07-15 22:51 ` Vedang Patel
2019-07-15 22:51 ` [PATCH iproute2 net-next v3 5/5] tc: taprio: Update documentation Vedang Patel
3 siblings, 0 replies; 12+ messages in thread
From: Vedang Patel @ 2019-07-15 22:51 UTC (permalink / raw)
To: netdev
Cc: jhs, xiyou.wangcong, jiri, stephen, vinicius.gomes,
leandro.maciel.dorileo, jakub.kicinski, m-karicheri2, dsahern,
Vedang Patel
Document the newly added option (skip-skb-check) on the etf man-page.
Signed-off-by: Vedang Patel <vedang.patel@intel.com>
---
man/man8/tc-etf.8 | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/man/man8/tc-etf.8 b/man/man8/tc-etf.8
index 30a12de7d2c7..2e01a591dbaa 100644
--- a/man/man8/tc-etf.8
+++ b/man/man8/tc-etf.8
@@ -106,6 +106,16 @@ referred to as "Launch Time" or "Time-Based Scheduling" by the
documentation of network interface controllers.
The default is for this option to be disabled.
+.TP
+skip_skb_check
+.br
+.BR etf(8)
+currently drops any packet which does not have a socket associated with it or
+if the socket does not have SO_TXTIME socket option set. But, this will not
+work if the launchtime is set by another entity inside the kernel (e.g. some
+other Qdisc). Setting the skip_skb_check will skip checking for a socket
+associated with the packet.
+
.SH EXAMPLES
ETF is used to enforce a Quality of Service. It controls when each
--
2.7.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH iproute2 net-next v3 5/5] tc: taprio: Update documentation
2019-07-15 22:51 [PATCH iproute2 net-next v3 1/5] etf: Add skip_sock_check Vedang Patel
` (2 preceding siblings ...)
2019-07-15 22:51 ` [PATCH iproute2 net-next v3 4/5] tc: etf: Add documentation for skip-skb-check Vedang Patel
@ 2019-07-15 22:51 ` Vedang Patel
3 siblings, 0 replies; 12+ messages in thread
From: Vedang Patel @ 2019-07-15 22:51 UTC (permalink / raw)
To: netdev
Cc: jhs, xiyou.wangcong, jiri, stephen, vinicius.gomes,
leandro.maciel.dorileo, jakub.kicinski, m-karicheri2, dsahern,
Vedang Patel
Add documentation for the latest options, flags and txtime-delay, to the
taprio manpage.
This also adds an example to run tc in txtime offload mode.
Signed-off-by: Vedang Patel <vedang.patel@intel.com>
---
man/man8/tc-taprio.8 | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/man/man8/tc-taprio.8 b/man/man8/tc-taprio.8
index 850be9b03649..e1d19ba19089 100644
--- a/man/man8/tc-taprio.8
+++ b/man/man8/tc-taprio.8
@@ -112,6 +112,26 @@ means that traffic class 0 is "active" for that schedule entry.
long that state defined by <command> and <gate mask> should be held
before moving to the next entry.
+.TP
+flags
+.br
+Specifies different modes for taprio. Currently, only txtime-assist is
+supported which can be enabled by setting it to 0x1. In this mode, taprio will
+set the transmit timestamp depending on the interval in which the packet needs
+to be transmitted. It will then utililize the
+.BR etf(8)
+qdisc to sort and transmit the packets at the right time. The second example
+can be used as a reference to configure this mode.
+
+.TP
+txtime-delay
+.br
+This parameter is specific to the txtime offload mode. It specifies the maximum
+time a packet might take to reach the network card from the taprio qdisc. The
+value should always be greater than the delta specified in the
+.BR etf(8)
+qdisc.
+
.SH EXAMPLES
The following example shows how an traffic schedule with three traffic
@@ -137,6 +157,26 @@ reference CLOCK_TAI. The schedule is composed of three entries each of
clockid CLOCK_TAI
.EE
+Following is an example to enable the txtime offload mode in taprio. See
+.BR etf(8)
+for more information about configuring the ETF qdisc.
+
+.EX
+# tc qdisc replace dev eth0 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@0 1@0 \\
+ base-time 1528743495910289987 \\
+ sched-entry S 01 300000 \\
+ sched-entry S 02 300000 \\
+ sched-entry S 04 400000 \\
+ flags 0x1 \\
+ txtime-delay 200000 \\
+ clockid CLOCK_TAI
+
+# tc qdisc replace dev $IFACE parent 100:1 etf skip_skb_check \\
+ offload delta 200000 clockid CLOCK_TAI
+.EE
.SH AUTHORS
Vinicius Costa Gomes <vinicius.gomes@intel.com>
--
2.7.3
^ permalink raw reply related [flat|nested] 12+ messages in thread