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>] [day] [month] [year] [list]
Message-ID: <20231030072353.1031217-1-idosch@nvidia.com>
Date: Mon, 30 Oct 2023 09:23:53 +0200
From: Ido Schimmel <idosch@...dia.com>
To: <netdev@...r.kernel.org>
CC: <mkubecek@...e.cz>, <markwang@...dia.com>, <mlxsw@...dia.com>, "Ido
 Schimmel" <idosch@...dia.com>
Subject: [PATCH ethtool-next] ethtool: Add support for more CMIS transceiver modules

Add three more SFF-8024 Identifier Values that according to the standard
support the Common Management Interface Specification (CMIS) memory map
so that ethtool will be able to dump, parse and print their EEPROM
contents.

Reported-by: Mark Wang <markwang@...dia.com>
Tested-by: Mark Wang <markwang@...dia.com>
Signed-off-by: Ido Schimmel <idosch@...dia.com>
---
 netlink/module-eeprom.c |  3 +++
 qsfp.c                  | 10 +++++++---
 sff-common.c            |  9 +++++++++
 sff-common.h            |  5 ++++-
 4 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/netlink/module-eeprom.c b/netlink/module-eeprom.c
index 49833a2a6a38..09ad58011d2a 100644
--- a/netlink/module-eeprom.c
+++ b/netlink/module-eeprom.c
@@ -225,6 +225,9 @@ static int eeprom_parse(struct cmd_context *ctx)
 	case SFF8024_ID_QSFP_DD:
 	case SFF8024_ID_OSFP:
 	case SFF8024_ID_DSFP:
+	case SFF8024_ID_QSFP_PLUS_CMIS:
+	case SFF8024_ID_SFP_DD_CMIS:
+	case SFF8024_ID_SFP_PLUS_CMIS:
 		return cmis_show_all_nl(ctx);
 #endif
 	default:
diff --git a/qsfp.c b/qsfp.c
index 5a535c5c092b..eedf6883f7a3 100644
--- a/qsfp.c
+++ b/qsfp.c
@@ -977,9 +977,13 @@ void sff8636_show_all_ioctl(const __u8 *id, __u32 eeprom_len)
 {
 	struct sff8636_memory_map map = {};
 
-	if (id[SFF8636_ID_OFFSET] == SFF8024_ID_QSFP_DD ||
-	    id[SFF8636_ID_OFFSET] == SFF8024_ID_OSFP ||
-	    id[SFF8636_ID_OFFSET] == SFF8024_ID_DSFP) {
+	switch (id[SFF8636_ID_OFFSET]) {
+	case SFF8024_ID_QSFP_DD:
+	case SFF8024_ID_OSFP:
+	case SFF8024_ID_DSFP:
+	case SFF8024_ID_QSFP_PLUS_CMIS:
+	case SFF8024_ID_SFP_DD_CMIS:
+	case SFF8024_ID_SFP_PLUS_CMIS:
 		cmis_show_all_ioctl(id);
 		return;
 	}
diff --git a/sff-common.c b/sff-common.c
index a5c1510302a6..a412a6ec0a4e 100644
--- a/sff-common.c
+++ b/sff-common.c
@@ -162,6 +162,15 @@ void sff8024_show_identifier(const __u8 *id, int id_offset)
 	case SFF8024_ID_DSFP:
 		printf(" (DSFP Dual Small Form Factor Pluggable Transceiver)\n");
 		break;
+	case SFF8024_ID_QSFP_PLUS_CMIS:
+		printf(" (QSFP+ or later with Common Management Interface Specification (CMIS))\n");
+		break;
+	case SFF8024_ID_SFP_DD_CMIS:
+		printf(" (SFP-DD Double Density 2X Pluggable Transceiver with Common Management Interface Specification (CMIS))\n");
+		break;
+	case SFF8024_ID_SFP_PLUS_CMIS:
+		printf(" (SFP+ and later with Common Management Interface Specification (CMIS))\n");
+		break;
 	default:
 		printf(" (reserved or unknown)\n");
 		break;
diff --git a/sff-common.h b/sff-common.h
index 57bcc4a415fe..899dc5be15b1 100644
--- a/sff-common.h
+++ b/sff-common.h
@@ -64,7 +64,10 @@
 #define  SFF8024_ID_QSFP_DD				0x18
 #define  SFF8024_ID_OSFP				0x19
 #define  SFF8024_ID_DSFP				0x1B
-#define  SFF8024_ID_LAST				SFF8024_ID_DSFP
+#define  SFF8024_ID_QSFP_PLUS_CMIS			0x1E
+#define  SFF8024_ID_SFP_DD_CMIS				0x1F
+#define  SFF8024_ID_SFP_PLUS_CMIS			0x20
+#define  SFF8024_ID_LAST				SFF8024_ID_SFP_PLUS_CMIS
 #define  SFF8024_ID_UNALLOCATED_LAST	0x7F
 #define  SFF8024_ID_VENDOR_START		0x80
 #define  SFF8024_ID_VENDOR_LAST			0xFF
-- 
2.40.1


Powered by blists - more mailing lists