All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH iproute2 net-next v1 1/6] Kernel header update for hardware offloading changes.
@ 2019-06-06 17:52 Vedang Patel
  2019-06-06 17:52 ` [PATCH iproute2 net-next v1 2/6] etf: Add skip_sock_check Vedang Patel
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Vedang Patel @ 2019-06-06 17:52 UTC (permalink / raw)
  To: netdev
  Cc: jhs, xiyou.wangcong, jiri, stephen, vinicius.gomes,
	leandro.maciel.dorileo, jakub.kicinski, m-karicheri2,
	Vedang Patel

This should only be updated after the kernel patches related to txtime-offload
have been merged into the kernel.

Signed-off-by: Vedang Patel <vedang.patel@intel.com>
---
 include/uapi/linux/pkt_sched.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h
index 8b2f993c..16b18868 100644
--- a/include/uapi/linux/pkt_sched.h
+++ b/include/uapi/linux/pkt_sched.h
@@ -990,6 +990,7 @@ struct tc_etf_qopt {
 	__u32 flags;
 #define TC_ETF_DEADLINE_MODE_ON	BIT(0)
 #define TC_ETF_OFFLOAD_ON	BIT(1)
+#define TC_ETF_SKIP_SKB_CHECK   BIT(2)
 };
 
 enum {
@@ -1169,6 +1170,8 @@ enum {
 	TCA_TAPRIO_ATTR_ADMIN_SCHED, /* The admin sched, only used in dump */
 	TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME, /* s64 */
 	TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME_EXTENSION, /* s64 */
+	TCA_TAPRIO_ATTR_OFFLOAD_FLAGS, /* u32 */
+	TCA_TAPRIO_ATTR_TXTIME_DELAY, /* s32 */
 	__TCA_TAPRIO_ATTR_MAX,
 };
 
-- 
2.17.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH iproute2 net-next v1 2/6] etf: Add skip_sock_check
  2019-06-06 17:52 [PATCH iproute2 net-next v1 1/6] Kernel header update for hardware offloading changes Vedang Patel
@ 2019-06-06 17:52 ` Vedang Patel
  2019-06-06 17:52 ` [PATCH iproute2 net-next v1 3/6] taprio: Add support for enabling offload mode Vedang Patel
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 14+ messages in thread
From: Vedang Patel @ 2019-06-06 17:52 UTC (permalink / raw)
  To: netdev
  Cc: jhs, xiyou.wangcong, jiri, stephen, vinicius.gomes,
	leandro.maciel.dorileo, jakub.kicinski, m-karicheri2,
	Vedang Patel

ETF Qdisc currently checks for a socket with SO_TXTIME socket option. If either
is not present, the packet is dropped. In the future commits, we want other
Qdiscs to add packet with launchtime to the ETF Qdisc. Also, there are some
packets (e.g. ICMP packets) which may not have a socket associated with them.
So, add an option to skip this check.

Signed-off-by: Vedang Patel <vedang.patel@intel.com>
---
 tc/q_etf.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/tc/q_etf.c b/tc/q_etf.c
index 76aca476..85003dc1 100644
--- a/tc/q_etf.c
+++ b/tc/q_etf.c
@@ -130,6 +130,13 @@ static int etf_parse_opt(struct qdisc_util *qu, int argc,
 				explain_clockid(*argv);
 				return -1;
 			}
+		} else if (strcmp(*argv, "skip_sock_check") == 0) {
+			if (opt.flags & TC_ETF_SKIP_SKB_CHECK) {
+				fprintf(stderr, "etf: duplicate \"skip_sock_check\" specification\n");
+				return -1;
+			}
+
+			opt.flags |= TC_ETF_SKIP_SKB_CHECK;
 		} else if (strcmp(*argv, "help") == 0) {
 			explain();
 			return -1;
@@ -171,8 +178,10 @@ static int etf_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
 	print_uint(PRINT_ANY, "delta", "delta %d ", qopt->delta);
 	print_string(PRINT_ANY, "offload", "offload %s ",
 				(qopt->flags & TC_ETF_OFFLOAD_ON) ? "on" : "off");
-	print_string(PRINT_ANY, "deadline_mode", "deadline_mode %s",
+	print_string(PRINT_ANY, "deadline_mode", "deadline_mode %s ",
 				(qopt->flags & TC_ETF_DEADLINE_MODE_ON) ? "on" : "off");
+	print_string(PRINT_ANY, "skip_sock_check", "skip_sock_check %s",
+				(qopt->flags & TC_ETF_SKIP_SKB_CHECK) ? "on" : "off");
 
 	return 0;
 }
-- 
2.17.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH iproute2 net-next v1 3/6] taprio: Add support for enabling offload mode
  2019-06-06 17:52 [PATCH iproute2 net-next v1 1/6] Kernel header update for hardware offloading changes Vedang Patel
  2019-06-06 17:52 ` [PATCH iproute2 net-next v1 2/6] etf: Add skip_sock_check Vedang Patel
@ 2019-06-06 17:52 ` Vedang Patel
  2019-06-06 19:43   ` Stephen Hemminger
  2019-06-06 17:52 ` [PATCH iproute2 net-next v1 4/6] taprio: add support for setting txtime_delay Vedang Patel
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Vedang Patel @ 2019-06-06 17:52 UTC (permalink / raw)
  To: netdev
  Cc: jhs, xiyou.wangcong, jiri, stephen, vinicius.gomes,
	leandro.maciel.dorileo, jakub.kicinski, m-karicheri2

From: Vinicius Costa Gomes <vinicius.gomes@intel.com>

This allows a new parameter to be passed to taprio, "offload",
accepting a hexadecimal number which selects the offloading flags
thats should be enabled.

Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@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 62c8c591..69e52ff5 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 offload_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, "offload") == 0) {
+			NEXT_ARG();
+			if (offload_flags != UINT32_MAX) {
+				fprintf(stderr, "taprio: duplicate \"offload\" specification\n");
+				return -1;
+			}
+			if (get_u32(&offload_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 (offload_flags != UINT32_MAX)
+		addattr_l(n, 1024, TCA_TAPRIO_ATTR_OFFLOAD_FLAGS, &offload_flags, sizeof(offload_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 offload_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_OFFLOAD_FLAGS])
+		offload_flags = rta_getattr_u32(tb[TCA_TAPRIO_ATTR_OFFLOAD_FLAGS]);
+
+	print_uint(PRINT_ANY, "offload", " offload %x", offload_flags);
+
 	print_schedule(f, tb);
 
 	if (tb[TCA_TAPRIO_ATTR_ADMIN_SCHED]) {
-- 
2.17.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH iproute2 net-next v1 4/6] taprio: add support for setting txtime_delay.
  2019-06-06 17:52 [PATCH iproute2 net-next v1 1/6] Kernel header update for hardware offloading changes Vedang Patel
  2019-06-06 17:52 ` [PATCH iproute2 net-next v1 2/6] etf: Add skip_sock_check Vedang Patel
  2019-06-06 17:52 ` [PATCH iproute2 net-next v1 3/6] taprio: Add support for enabling offload mode Vedang Patel
@ 2019-06-06 17:52 ` Vedang Patel
  2019-06-06 19:44   ` Stephen Hemminger
  2019-06-06 17:52 ` [PATCH iproute2 net-next v1 5/6] tc: etf: Add documentation for skip-skb-check Vedang Patel
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Vedang Patel @ 2019-06-06 17:52 UTC (permalink / raw)
  To: netdev
  Cc: jhs, xiyou.wangcong, jiri, stephen, vinicius.gomes,
	leandro.maciel.dorileo, jakub.kicinski, m-karicheri2,
	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 69e52ff5..5719450a 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;
 	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 offload_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, "offload", " offload %x", offload_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.17.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH iproute2 net-next v1 5/6] tc: etf: Add documentation for skip-skb-check.
  2019-06-06 17:52 [PATCH iproute2 net-next v1 1/6] Kernel header update for hardware offloading changes Vedang Patel
                   ` (2 preceding siblings ...)
  2019-06-06 17:52 ` [PATCH iproute2 net-next v1 4/6] taprio: add support for setting txtime_delay Vedang Patel
@ 2019-06-06 17:52 ` Vedang Patel
  2019-06-06 17:52 ` [PATCH iproute2 net-next v1 6/6] tc: taprio: Update documentation Vedang Patel
  2019-06-06 21:15 ` [PATCH iproute2 net-next v1 1/6] Kernel header update for hardware offloading changes Patel, Vedang
  5 siblings, 0 replies; 14+ messages in thread
From: Vedang Patel @ 2019-06-06 17:52 UTC (permalink / raw)
  To: netdev
  Cc: jhs, xiyou.wangcong, jiri, stephen, vinicius.gomes,
	leandro.maciel.dorileo, jakub.kicinski, m-karicheri2,
	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 30a12de7..2e01a591 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.17.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH iproute2 net-next v1 6/6] tc: taprio: Update documentation
  2019-06-06 17:52 [PATCH iproute2 net-next v1 1/6] Kernel header update for hardware offloading changes Vedang Patel
                   ` (3 preceding siblings ...)
  2019-06-06 17:52 ` [PATCH iproute2 net-next v1 5/6] tc: etf: Add documentation for skip-skb-check Vedang Patel
@ 2019-06-06 17:52 ` Vedang Patel
  2019-06-06 21:15 ` [PATCH iproute2 net-next v1 1/6] Kernel header update for hardware offloading changes Patel, Vedang
  5 siblings, 0 replies; 14+ messages in thread
From: Vedang Patel @ 2019-06-06 17:52 UTC (permalink / raw)
  To: netdev
  Cc: jhs, xiyou.wangcong, jiri, stephen, vinicius.gomes,
	leandro.maciel.dorileo, jakub.kicinski, m-karicheri2,
	Vedang Patel

Add documentation for the latest options, offload 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 | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/man/man8/tc-taprio.8 b/man/man8/tc-taprio.8
index 850be9b0..5209c6ad 100644
--- a/man/man8/tc-taprio.8
+++ b/man/man8/tc-taprio.8
@@ -112,6 +112,23 @@ 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
+offload
+.br
+Specifies the offload mode for taprio. If set to 1, it will try to offload the
+schedule to be run on the network controller. Hardware and driver support
+needed. If set to 2, txtime offload mode is enabled which will
+utilize the ETF qdisc to set the transmit of the packets.
+
+.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 +154,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 \\
+              offload 2 \\
+              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.17.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH iproute2 net-next v1 3/6] taprio: Add support for enabling offload mode
  2019-06-06 17:52 ` [PATCH iproute2 net-next v1 3/6] taprio: Add support for enabling offload mode Vedang Patel
@ 2019-06-06 19:43   ` Stephen Hemminger
  2019-06-06 21:13     ` Patel, Vedang
  0 siblings, 1 reply; 14+ messages in thread
From: Stephen Hemminger @ 2019-06-06 19:43 UTC (permalink / raw)
  To: Vedang Patel
  Cc: netdev, jhs, xiyou.wangcong, jiri, vinicius.gomes,
	leandro.maciel.dorileo, jakub.kicinski, m-karicheri2

On Thu,  6 Jun 2019 10:52:18 -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 offload_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_OFFLOAD_FLAGS])
> +		offload_flags = rta_getattr_u32(tb[TCA_TAPRIO_ATTR_OFFLOAD_FLAGS]);
> +
> +	print_uint(PRINT_ANY, "offload", " offload %x", offload_flags);

I don't think offload flags should be  printed at all if not present.

Why not?
	if (tb[TCA_TAPRIO_ATTR_OFFLOLAD_FLAGS]) {
		__u32 offload_flags = rta_getattr_u32(tb[TCA_TAPRIO_ATTR_OFFLOAD_FLAGS]);

		print_uint(PRINT_ANY, "offload", " offload %x", offload_flags);
	}

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH iproute2 net-next v1 4/6] taprio: add support for setting txtime_delay.
  2019-06-06 17:52 ` [PATCH iproute2 net-next v1 4/6] taprio: add support for setting txtime_delay Vedang Patel
@ 2019-06-06 19:44   ` Stephen Hemminger
  2019-06-06 21:11     ` Patel, Vedang
  0 siblings, 1 reply; 14+ messages in thread
From: Stephen Hemminger @ 2019-06-06 19:44 UTC (permalink / raw)
  To: Vedang Patel
  Cc: netdev, jhs, xiyou.wangcong, jiri, vinicius.gomes,
	leandro.maciel.dorileo, jakub.kicinski, m-karicheri2

On Thu,  6 Jun 2019 10:52:19 -0700
Vedang Patel <vedang.patel@intel.com> wrote:

> +	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);
> +

Once again do not print anything if option is not present.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH iproute2 net-next v1 4/6] taprio: add support for setting txtime_delay.
  2019-06-06 19:44   ` Stephen Hemminger
@ 2019-06-06 21:11     ` Patel, Vedang
  0 siblings, 0 replies; 14+ messages in thread
From: Patel, Vedang @ 2019-06-06 21:11 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: netdev, Jamal Hadi Salim, Cong Wang, Jiri Pirko, Gomes, Vinicius,
	Dorileo, Leandro, jakub.kicinski, m-karicheri2



> On Jun 6, 2019, at 12:44 PM, Stephen Hemminger <stephen@networkplumber.org> wrote:
> 
> On Thu,  6 Jun 2019 10:52:19 -0700
> Vedang Patel <vedang.patel@intel.com> wrote:
> 
>> +	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);
>> +
> 
> Once again do not print anything if option is not present.
Yeah It makes sense. I will make the change. Thanks for the inputs.

-Vedang

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH iproute2 net-next v1 3/6] taprio: Add support for enabling offload mode
  2019-06-06 19:43   ` Stephen Hemminger
@ 2019-06-06 21:13     ` Patel, Vedang
  2019-06-06 21:46       ` Stephen Hemminger
  0 siblings, 1 reply; 14+ messages in thread
From: Patel, Vedang @ 2019-06-06 21:13 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: netdev, Jamal Hadi Salim, Cong Wang, Jiri Pirko, Gomes, Vinicius,
	Dorileo, Leandro, jakub.kicinski, m-karicheri2



> On Jun 6, 2019, at 12:43 PM, Stephen Hemminger <stephen@networkplumber.org> wrote:
> 
> On Thu,  6 Jun 2019 10:52:18 -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 offload_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_OFFLOAD_FLAGS])
>> +		offload_flags = rta_getattr_u32(tb[TCA_TAPRIO_ATTR_OFFLOAD_FLAGS]);
>> +
>> +	print_uint(PRINT_ANY, "offload", " offload %x", offload_flags);
> 
> I don't think offload flags should be  printed at all if not present.
> 
> Why not?
Will make this in the next version.
> 	if (tb[TCA_TAPRIO_ATTR_OFFLOLAD_FLAGS]) {
> 		__u32 offload_flags = rta_getattr_u32(tb[TCA_TAPRIO_ATTR_OFFLOAD_FLAGS]);
> 
> 		print_uint(PRINT_ANY, "offload", " offload %x", offload_flags);
> 	}


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH iproute2 net-next v1 1/6] Kernel header update for hardware offloading changes.
  2019-06-06 17:52 [PATCH iproute2 net-next v1 1/6] Kernel header update for hardware offloading changes Vedang Patel
                   ` (4 preceding siblings ...)
  2019-06-06 17:52 ` [PATCH iproute2 net-next v1 6/6] tc: taprio: Update documentation Vedang Patel
@ 2019-06-06 21:15 ` Patel, Vedang
  5 siblings, 0 replies; 14+ messages in thread
From: Patel, Vedang @ 2019-06-06 21:15 UTC (permalink / raw)
  To: netdev
  Cc: Jamal Hadi Salim, Cong Wang, Jiri Pirko, stephen, Gomes,
	Vinicius, Dorileo, Leandro, jakub.kicinski, m-karicheri2

It looks like I sent out the wrong version of this series.  Another version coming in momentarily. 

Sorry for the spam.

-Vedang

> On Jun 6, 2019, at 10:52 AM, Patel, Vedang <vedang.patel@intel.com> wrote:
> 
> This should only be updated after the kernel patches related to txtime-offload
> have been merged into the kernel.
> 
> Signed-off-by: Vedang Patel <vedang.patel@intel.com>
> ---
> include/uapi/linux/pkt_sched.h | 3 +++
> 1 file changed, 3 insertions(+)
> 
> diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h
> index 8b2f993c..16b18868 100644
> --- a/include/uapi/linux/pkt_sched.h
> +++ b/include/uapi/linux/pkt_sched.h
> @@ -990,6 +990,7 @@ struct tc_etf_qopt {
> 	__u32 flags;
> #define TC_ETF_DEADLINE_MODE_ON	BIT(0)
> #define TC_ETF_OFFLOAD_ON	BIT(1)
> +#define TC_ETF_SKIP_SKB_CHECK   BIT(2)
> };
> 
> enum {
> @@ -1169,6 +1170,8 @@ enum {
> 	TCA_TAPRIO_ATTR_ADMIN_SCHED, /* The admin sched, only used in dump */
> 	TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME, /* s64 */
> 	TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME_EXTENSION, /* s64 */
> +	TCA_TAPRIO_ATTR_OFFLOAD_FLAGS, /* u32 */
> +	TCA_TAPRIO_ATTR_TXTIME_DELAY, /* s32 */
> 	__TCA_TAPRIO_ATTR_MAX,
> };
> 
> -- 
> 2.17.0
> 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH iproute2 net-next v1 3/6] taprio: Add support for enabling offload mode
  2019-06-06 21:13     ` Patel, Vedang
@ 2019-06-06 21:46       ` Stephen Hemminger
  2019-06-06 22:22         ` Patel, Vedang
  0 siblings, 1 reply; 14+ messages in thread
From: Stephen Hemminger @ 2019-06-06 21:46 UTC (permalink / raw)
  To: Patel, Vedang
  Cc: netdev, Jamal Hadi Salim, Cong Wang, Jiri Pirko, Gomes, Vinicius,
	Dorileo, Leandro, jakub.kicinski, m-karicheri2

On Thu, 6 Jun 2019 21:13:50 +0000
"Patel, Vedang" <vedang.patel@intel.com> wrote:

> > On Jun 6, 2019, at 12:43 PM, Stephen Hemminger <stephen@networkplumber.org> wrote:
> > 
> > On Thu,  6 Jun 2019 10:52:18 -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 offload_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_OFFLOAD_FLAGS])
> >> +		offload_flags = rta_getattr_u32(tb[TCA_TAPRIO_ATTR_OFFLOAD_FLAGS]);
> >> +
> >> +	print_uint(PRINT_ANY, "offload", " offload %x", offload_flags);  
> > 
> > I don't think offload flags should be  printed at all if not present.
> > 
> > Why not?  
> Will make this in the next version.

Mostly this is so that output doesn't change for users who aren't using offload or have old kernel.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH iproute2 net-next v1 3/6] taprio: Add support for enabling offload mode
  2019-06-06 21:46       ` Stephen Hemminger
@ 2019-06-06 22:22         ` Patel, Vedang
  0 siblings, 0 replies; 14+ messages in thread
From: Patel, Vedang @ 2019-06-06 22:22 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: netdev, Jamal Hadi Salim, Cong Wang, Jiri Pirko, Gomes, Vinicius,
	Dorileo, Leandro, jakub.kicinski, m-karicheri2



> On Jun 6, 2019, at 2:46 PM, Stephen Hemminger <stephen@networkplumber.org> wrote:
> 
> On Thu, 6 Jun 2019 21:13:50 +0000
> "Patel, Vedang" <vedang.patel@intel.com> wrote:
> 
>>> On Jun 6, 2019, at 12:43 PM, Stephen Hemminger <stephen@networkplumber.org> wrote:
>>> 
>>> On Thu,  6 Jun 2019 10:52:18 -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 offload_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_OFFLOAD_FLAGS])
>>>> +		offload_flags = rta_getattr_u32(tb[TCA_TAPRIO_ATTR_OFFLOAD_FLAGS]);
>>>> +
>>>> +	print_uint(PRINT_ANY, "offload", " offload %x", offload_flags);  
>>> 
>>> I don't think offload flags should be  printed at all if not present.
>>> 
>>> Why not?  
>> Will make this in the next version.
> 
> Mostly this is so that output doesn't change for users who aren't using offload or have old kernel.
Yes, I agree with that. But, this change alone won’t be enough. There is a minor kernel change also required which will not send the parameters if they are not set. I will include that change in the next version of my kernel patches. 

Iproute2 patches incoming momentarily. This is the v2 which I was supposed to send out.

Thanks,
Vedang

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH iproute2 net-next v1 1/6] Kernel header update for hardware offloading changes.
@ 2019-05-28 17:52 Vedang Patel
  0 siblings, 0 replies; 14+ messages in thread
From: Vedang Patel @ 2019-05-28 17:52 UTC (permalink / raw)
  To: netdev
  Cc: jhs, xiyou.wangcong, jiri, stephen, vinicius.gomes,
	leandro.maciel.dorileo, Vedang Patel

This should only be updated after the kernel patches related to txtime-offload
have been merged into the kernel.

Signed-off-by: Vedang Patel <vedang.patel@intel.com>
---
 include/uapi/linux/pkt_sched.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h
index 8b2f993c..16b18868 100644
--- a/include/uapi/linux/pkt_sched.h
+++ b/include/uapi/linux/pkt_sched.h
@@ -990,6 +990,7 @@ struct tc_etf_qopt {
 	__u32 flags;
 #define TC_ETF_DEADLINE_MODE_ON	BIT(0)
 #define TC_ETF_OFFLOAD_ON	BIT(1)
+#define TC_ETF_SKIP_SKB_CHECK   BIT(2)
 };
 
 enum {
@@ -1169,6 +1170,8 @@ enum {
 	TCA_TAPRIO_ATTR_ADMIN_SCHED, /* The admin sched, only used in dump */
 	TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME, /* s64 */
 	TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME_EXTENSION, /* s64 */
+	TCA_TAPRIO_ATTR_OFFLOAD_FLAGS, /* u32 */
+	TCA_TAPRIO_ATTR_TXTIME_DELAY, /* s32 */
 	__TCA_TAPRIO_ATTR_MAX,
 };
 
-- 
2.17.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2019-06-06 22:22 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-06 17:52 [PATCH iproute2 net-next v1 1/6] Kernel header update for hardware offloading changes Vedang Patel
2019-06-06 17:52 ` [PATCH iproute2 net-next v1 2/6] etf: Add skip_sock_check Vedang Patel
2019-06-06 17:52 ` [PATCH iproute2 net-next v1 3/6] taprio: Add support for enabling offload mode Vedang Patel
2019-06-06 19:43   ` Stephen Hemminger
2019-06-06 21:13     ` Patel, Vedang
2019-06-06 21:46       ` Stephen Hemminger
2019-06-06 22:22         ` Patel, Vedang
2019-06-06 17:52 ` [PATCH iproute2 net-next v1 4/6] taprio: add support for setting txtime_delay Vedang Patel
2019-06-06 19:44   ` Stephen Hemminger
2019-06-06 21:11     ` Patel, Vedang
2019-06-06 17:52 ` [PATCH iproute2 net-next v1 5/6] tc: etf: Add documentation for skip-skb-check Vedang Patel
2019-06-06 17:52 ` [PATCH iproute2 net-next v1 6/6] tc: taprio: Update documentation Vedang Patel
2019-06-06 21:15 ` [PATCH iproute2 net-next v1 1/6] Kernel header update for hardware offloading changes Patel, Vedang
  -- strict thread matches above, loose matches on Subject: below --
2019-05-28 17:52 Vedang Patel

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.