netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 iproute2-next 1/2] taprio: don't print the clockid if invalid
@ 2022-10-04 12:00 Vladimir Oltean
  2022-10-04 12:00 ` [PATCH v2 iproute2-next 2/2] taprio: support dumping and setting per-tc max SDU Vladimir Oltean
  2022-10-09 19:50 ` [PATCH v2 iproute2-next 1/2] taprio: don't print the clockid if invalid patchwork-bot+netdevbpf
  0 siblings, 2 replies; 5+ messages in thread
From: Vladimir Oltean @ 2022-10-04 12:00 UTC (permalink / raw)
  To: netdev
  Cc: David Ahern, Stephen Hemminger, Vinicius Costa Gomes,
	Jamal Hadi Salim, Cong Wang, Jiri Pirko

The clockid will not be reported by the kernel if the qdisc is fully
offloaded, since it is implicitly the PTP Hardware Clock of the device.

Currently "tc qdisc show" points us to a "clockid invalid" for a qdisc
created with "flags 0x2", let's hide that attribute instead.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
v1->v2: patch is new

 tc/q_taprio.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/tc/q_taprio.c b/tc/q_taprio.c
index e43db9d0e952..e3af3f3fa047 100644
--- a/tc/q_taprio.c
+++ b/tc/q_taprio.c
@@ -434,7 +434,6 @@ 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;
 	int i;
 
 	if (opt == NULL)
@@ -467,10 +466,13 @@ static int taprio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
 
 	print_nl();
 
-	if (tb[TCA_TAPRIO_ATTR_SCHED_CLOCKID])
-		clockid = rta_getattr_s32(tb[TCA_TAPRIO_ATTR_SCHED_CLOCKID]);
+	if (tb[TCA_TAPRIO_ATTR_SCHED_CLOCKID]) {
+		__s32 clockid;
 
-	print_string(PRINT_ANY, "clockid", "clockid %s", get_clock_name(clockid));
+		clockid = rta_getattr_s32(tb[TCA_TAPRIO_ATTR_SCHED_CLOCKID]);
+		print_string(PRINT_ANY, "clockid", "clockid %s",
+			     get_clock_name(clockid));
+	}
 
 	if (tb[TCA_TAPRIO_ATTR_FLAGS]) {
 		__u32 flags;
-- 
2.34.1


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

end of thread, other threads:[~2022-10-12  9:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-04 12:00 [PATCH v2 iproute2-next 1/2] taprio: don't print the clockid if invalid Vladimir Oltean
2022-10-04 12:00 ` [PATCH v2 iproute2-next 2/2] taprio: support dumping and setting per-tc max SDU Vladimir Oltean
2022-10-09 20:07   ` David Ahern
2022-10-12  9:53     ` Vladimir Oltean
2022-10-09 19:50 ` [PATCH v2 iproute2-next 1/2] taprio: don't print the clockid if invalid patchwork-bot+netdevbpf

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).