All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: stephen@networkplumber.org, jhs@mojatatu.com, mlxsw@mellanox.com
Subject: [patch iproute2] tc: move action cookie print out of the stats if
Date: Fri, 24 Nov 2017 09:28:21 +0100	[thread overview]
Message-ID: <20171124082821.1758-1-jiri@resnulli.us> (raw)

From: Jiri Pirko <jiri@mellanox.com>

Cookie print was made dependent on show_stats for no good reason. Fix
this bu pushing cookie print ot of the stats if.

Fixes: fd8b3d2c1b9b ("actions: Add support for user cookies")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 tc/m_action.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/tc/m_action.c b/tc/m_action.c
index 0dce97f..c2fc4f1 100644
--- a/tc/m_action.c
+++ b/tc/m_action.c
@@ -301,19 +301,18 @@ static int tc_print_one_action(FILE *f, struct rtattr *arg)
 		return err;
 
 	if (show_stats && tb[TCA_ACT_STATS]) {
-
 		fprintf(f, "\tAction statistics:\n");
 		print_tcstats2_attr(f, tb[TCA_ACT_STATS], "\t", NULL);
-		if (tb[TCA_ACT_COOKIE]) {
-			int strsz = RTA_PAYLOAD(tb[TCA_ACT_COOKIE]);
-			char b1[strsz * 2 + 1];
-
-			fprintf(f, "\n\tcookie len %d %s ", strsz,
-				hexstring_n2a(RTA_DATA(tb[TCA_ACT_COOKIE]),
-					      strsz, b1, sizeof(b1)));
-		}
 		fprintf(f, "\n");
 	}
+	if (tb[TCA_ACT_COOKIE]) {
+		int strsz = RTA_PAYLOAD(tb[TCA_ACT_COOKIE]);
+		char b1[strsz * 2 + 1];
+
+		fprintf(f, "\tcookie len %d %s\n", strsz,
+			hexstring_n2a(RTA_DATA(tb[TCA_ACT_COOKIE]),
+				      strsz, b1, sizeof(b1)));
+	}
 
 	return 0;
 }
-- 
2.9.5

             reply	other threads:[~2017-11-24  8:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-24  8:28 Jiri Pirko [this message]
2017-11-24 17:11 ` [patch iproute2] tc: move action cookie print out of the stats if Stephen Hemminger
2017-11-25  8:35   ` Jiri Pirko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171124082821.1758-1-jiri@resnulli.us \
    --to=jiri@resnulli.us \
    --cc=jhs@mojatatu.com \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.