lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1422193883-30504-5-git-send-email-amirv@mellanox.com>
Date:	Sun, 25 Jan 2015 15:51:22 +0200
From:	Amir Vadai <amirv@...lanox.com>
To:	Ben Hutchings <ben@...adent.org.uk>
Cc:	netdev@...r.kernel.org, Or Gerlitz <ogerlitz@...lanox.com>,
	Yevgeny Petrilin <yevgenyp@...lanox.com>,
	Saeed Mahameed <saeedm@...lanox.com>,
	Eyal Perry <eyalpe@...lanox.com>,
	Amir Vadai <amirv@...lanox.com>
Subject: [PATCH ethtool 4/5] ethtool: Prettify RX flow hash indirection table print

From: Eyal Perry <eyalpe@...lanox.com>

When indirection table size is not a multiple of 8, a new line is
missing at the last row of the table.
In addition, make a distinction between the attribute name and its value
by adding an indentation on the beginning of each line which contains
values.

Before the changne:
[user@...t]# ./ethtool-3.16 -x enp5s0
RX flow hash indirection table for enp5s0 with 20 RX ring(s):
    0:      0     1     2     3     4     5     6     7
    8:      8     9    10    11    12    13    14    15
   16:      0     1     2     3RSS hash key:
16:d5:5a:31:21:8d:0e:2b:55:ea:ca:70:a8:19:5e:72:2e:c0:f9:0f:9b:6c:94:8f:59:ca:42:d1:c3:58:91:4a:3d:77:a1:e5:ab:8b:6f:68

After:
[user@...t]# ./ethtool-3.16+ -x enp5s0
RX flow hash indirection table for enp5s0 with 20 RX ring(s):
    0:      0     1     2     3     4     5     6     7
    8:      8     9    10    11    12    13    14    15
   16:      0     1     2     3
RSS hash key:
    16:d5:5a:31:21:8d:0e:2b:55:ea:ca:70:a8:19:5e:72:2e:c0:f9:0f:9b:6c:94:8f:59:ca:42:d1:c3:58:91:4a:3d:77:a1:e5:ab:8b:6f:68

Signed-off-by: Eyal Perry <eyalpe@...lanox.com>
Signed-off-by: Amir Vadai <amirv@...lanox.com>
---
 ethtool.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/ethtool.c b/ethtool.c
index 8d53a53..c2f4164 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -3120,19 +3120,19 @@ static void print_indir_table(struct cmd_context *ctx,
 {
 	u32 i;
 
-	printf("RX flow hash indirection table for %s with %llu RX ring(s):\n",
+	printf("RX flow hash indirection table for %s with %llu RX ring(s):",
 	       ctx->devname, ring_count->data);
 
 	if (!indir_size)
-		printf("Operation not supported\n");
+		printf("\n  Operation not supported");
 
 	for (i = 0; i < indir_size; i++) {
 		if (i % 8 == 0)
-			printf("%5u: ", i);
+			printf("\n%5u: ", i);
 		printf(" %5u", indir[i]);
-		if (i % 8 == 7)
-			fputc('\n', stdout);
 	}
+	fputc('\n', stdout);
+
 }
 
 static int do_grxfhindir(struct cmd_context *ctx,
@@ -3220,7 +3220,7 @@ static int do_grxfh(struct cmd_context *ctx)
 	indir_bytes = rss->indir_size * sizeof(rss->rss_config[0]);
 	hkey = ((char *)rss->rss_config + indir_bytes);
 
-	printf("RSS hash key:\n");
+	printf("RSS hash key:\n    ");
 	if (!rss->key_size)
 		printf("Operation not supported\n");
 
-- 
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ