[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221004120028.679586-1-vladimir.oltean@nxp.com>
Date: Tue, 4 Oct 2022 15:00:27 +0300
From: Vladimir Oltean <vladimir.oltean@....com>
To: netdev@...r.kernel.org
Cc: David Ahern <dsahern@...nel.org>,
Stephen Hemminger <stephen@...workplumber.org>,
Vinicius Costa Gomes <vinicius.gomes@...el.com>,
Jamal Hadi Salim <jhs@...atatu.com>,
Cong Wang <xiyou.wangcong@...il.com>,
Jiri Pirko <jiri@...nulli.us>
Subject: [PATCH v2 iproute2-next 1/2] taprio: don't print the clockid if invalid
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@....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
Powered by blists - more mailing lists