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-next>] [day] [month] [year] [list]
Message-ID: <42186456B4D1324A9EB53C74DBCBB1BB0657DE@HKI-EXC-1.stonesoft.com>
Date:	Tue, 24 May 2011 10:58:20 +0000
From:	Esa-Pekka Pyƶkkimies 
	<esa-pekka.pyokkimies@...nesoft.com>
To:	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC:	"bhutchings@...arflare.com" <bhutchings@...arflare.com>
Subject: [PATCH] ethtool: Pause frame reporting fixes

Hello. Our software needs to modify pause parameters dynamically.
For this to work reliably the SUPPORTED_Pause and SUPPORTED_Asym_Pause
flags need to be set correctly by the driver. As it turns out, some drivers
leave them at zero even though they implement pause frames.
This patch adds reporting for these flags to ethtool.
For some reason the current code reports ADVERTISED_Pause
but not SUPPORTED_Pause. Also there was a small bug
in the reporting for ADVERTISED_Pause.

Esa-Pekka Pyokkimies, Software Specialist, Stonesoft

 ethtool.c |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/ethtool.c b/ethtool.c
index 34fe107..cf6c4b2 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -1193,6 +1193,19 @@ static void dump_supported(struct ethtool_cmd *ep)
 		did1++; fprintf(stdout, "10000baseT/Full ");
 	}
 	fprintf(stdout, "\n");
+        
+	fprintf(stdout, "	Supported pause frame use: ");
+	if (mask & SUPPORTED_Pause) {
+		if (mask & SUPPORTED_Asym_Pause)
+			fprintf(stdout, "Receive-only\n");
+		else
+			fprintf(stdout, "Symmetric\n");
+	} else {
+		if (mask & SUPPORTED_Asym_Pause)
+			fprintf(stdout, "Transmit-only\n");
+		else
+			fprintf(stdout, "No\n");
+        }
 
 	fprintf(stdout, "	Supports auto-negotiation: ");
 	if (mask & SUPPORTED_Autoneg)
@@ -1255,10 +1268,10 @@ static void dump_advertised(struct ethtool_cmd *ep,
 
 	fprintf(stdout, "	%s pause frame use: ", prefix);
 	if (mask & ADVERTISED_Pause) {
-		fprintf(stdout, "Symmetric");
 		if (mask & ADVERTISED_Asym_Pause)
-			fprintf(stdout, " Receive-only");
-		fprintf(stdout, "\n");
+			fprintf(stdout, "Receive-only\n");
+                else
+			fprintf(stdout, "Symmetric\n");
 	} else {
 		if (mask & ADVERTISED_Asym_Pause)
 			fprintf(stdout, "Transmit-only\n");
--
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