* [PATCH iproute2 1/1] tc: print raw qdisc handle.
@ 2016-11-07 2:16 Roman Mashak
2016-11-07 13:13 ` Sergei Shtylyov
0 siblings, 1 reply; 4+ messages in thread
From: Roman Mashak @ 2016-11-07 2:16 UTC (permalink / raw)
To: davem; +Cc: netdev, jhs, stephen, Roman Mashak, Jamal Hadi Salim
Signed-off-by: Roman Mashak <mrv@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
---
tc/tc_qdisc.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/tc/tc_qdisc.c b/tc/tc_qdisc.c
index a63c476..9b06b8f 100644
--- a/tc/tc_qdisc.c
+++ b/tc/tc_qdisc.c
@@ -238,7 +238,14 @@ int print_qdisc(const struct sockaddr_nl *who,
if (n->nlmsg_type == RTM_DELQDISC)
fprintf(fp, "deleted ");
- fprintf(fp, "qdisc %s %x: ", rta_getattr_str(tb[TCA_KIND]), t->tcm_handle>>16);
+ if (!show_raw) {
+ fprintf(fp, "qdisc %s %x: ", rta_getattr_str(tb[TCA_KIND]),
+ t->tcm_handle >> 16);
+ } else {
+ fprintf(fp, "qdisc %s %x:[%08x] ", rta_getattr_str(tb[TCA_KIND]),
+ t->tcm_handle >> 16, t->tcm_handle);
+ }
+
if (filter_ifindex == 0)
fprintf(fp, "dev %s ", ll_index_to_name(t->tcm_ifindex));
if (t->tcm_parent == TC_H_ROOT)
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH iproute2 1/1] tc: print raw qdisc handle.
2016-11-07 2:16 Roman Mashak
@ 2016-11-07 13:13 ` Sergei Shtylyov
0 siblings, 0 replies; 4+ messages in thread
From: Sergei Shtylyov @ 2016-11-07 13:13 UTC (permalink / raw)
To: Roman Mashak, davem; +Cc: netdev, jhs, stephen, Jamal Hadi Salim
Hello.
On 11/7/2016 5:16 AM, Roman Mashak wrote:
> Signed-off-by: Roman Mashak <mrv@mojatatu.com>
> Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
> ---
> tc/tc_qdisc.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/tc/tc_qdisc.c b/tc/tc_qdisc.c
> index a63c476..9b06b8f 100644
> --- a/tc/tc_qdisc.c
> +++ b/tc/tc_qdisc.c
> @@ -238,7 +238,14 @@ int print_qdisc(const struct sockaddr_nl *who,
> if (n->nlmsg_type == RTM_DELQDISC)
> fprintf(fp, "deleted ");
>
> - fprintf(fp, "qdisc %s %x: ", rta_getattr_str(tb[TCA_KIND]), t->tcm_handle>>16);
> + if (!show_raw) {
> + fprintf(fp, "qdisc %s %x: ", rta_getattr_str(tb[TCA_KIND]),
> + t->tcm_handle >> 16);
> + } else {
> + fprintf(fp, "qdisc %s %x:[%08x] ", rta_getattr_str(tb[TCA_KIND]),
> + t->tcm_handle >> 16, t->tcm_handle);
The above/below code seems to indent with tabs only, why are you using spaces?
> + }
> +
> if (filter_ifindex == 0)
> fprintf(fp, "dev %s ", ll_index_to_name(t->tcm_ifindex));
> if (t->tcm_parent == TC_H_ROOT)
MBR, Sergei
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH iproute2 1/1] tc: print raw qdisc handle.
@ 2016-11-10 15:06 Roman Mashak
2016-11-13 6:53 ` Stephen Hemminger
0 siblings, 1 reply; 4+ messages in thread
From: Roman Mashak @ 2016-11-10 15:06 UTC (permalink / raw)
To: stephen; +Cc: netdev, jhs, Roman Mashak
Resending patch after fixing indentation and spaces.
Signed-off-by: Roman Mashak <mrv@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
---
tc/tc_qdisc.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/tc/tc_qdisc.c b/tc/tc_qdisc.c
index 93c9a4c..a8c8386 100644
--- a/tc/tc_qdisc.c
+++ b/tc/tc_qdisc.c
@@ -231,7 +231,15 @@ int print_qdisc(const struct sockaddr_nl *who,
if (n->nlmsg_type == RTM_DELQDISC)
fprintf(fp, "deleted ");
- fprintf(fp, "qdisc %s %x: ", rta_getattr_str(tb[TCA_KIND]), t->tcm_handle>>16);
+ if (!show_raw) {
+ fprintf(fp, "qdisc %s %x: ", rta_getattr_str(tb[TCA_KIND]),
+ t->tcm_handle >> 16);
+ } else {
+ fprintf(fp, "qdisc %s %x:[%08x] ",
+ rta_getattr_str(tb[TCA_KIND]),
+ t->tcm_handle >> 16, t->tcm_handle);
+ }
+
if (filter_ifindex == 0)
fprintf(fp, "dev %s ", ll_index_to_name(t->tcm_ifindex));
if (t->tcm_parent == TC_H_ROOT)
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH iproute2 1/1] tc: print raw qdisc handle.
2016-11-10 15:06 [PATCH iproute2 1/1] tc: print raw qdisc handle Roman Mashak
@ 2016-11-13 6:53 ` Stephen Hemminger
0 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2016-11-13 6:53 UTC (permalink / raw)
To: Roman Mashak; +Cc: netdev, jhs
On Thu, 10 Nov 2016 10:06:32 -0500
Roman Mashak <mrv@mojatatu.com> wrote:
> Resending patch after fixing indentation and spaces.
>
> Signed-off-by: Roman Mashak <mrv@mojatatu.com>
> Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
iproute2 uses kernel coding style. This patch fails basic checkpatch.
WARNING: suspect code indent for conditional statements (8, 11)
#31: FILE: tc/tc_qdisc.c:241:
+ if (!show_raw) {
+ fprintf(fp, "qdisc %s %x: ", rta_getattr_str(tb[TCA_KIND]),
total: 0 errors, 1 warnings, 15 lines checked
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-11-13 6:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-10 15:06 [PATCH iproute2 1/1] tc: print raw qdisc handle Roman Mashak
2016-11-13 6:53 ` Stephen Hemminger
-- strict thread matches above, loose matches on Subject: below --
2016-11-07 2:16 Roman Mashak
2016-11-07 13:13 ` Sergei Shtylyov
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).