ethtool/backport-ethtool-Add-support-for-OSFP-transceiver-modules.patch
Jiantao Xiao 63c347cf61 ethtool: Add support for more CMIS transceiver modules
This commit adds a framework to support querying CMIS module information

category: Feature
bugzilla: https://gitee.com/src-openeuler/ethtool/issues/I9VV62
2024-06-07 11:08:12 +08:00

86 lines
2.7 KiB
Diff

From f7d99859bc603649705e439472c8f79386a8b217 Mon Sep 17 00:00:00 2001
From: Danielle Ratson <danieller@nvidia.com>
Date: Mon, 7 Feb 2022 11:12:31 +0200
Subject: [PATCH 25/26] ethtool: Add support for OSFP transceiver modules
OSFP transceiver modules use the same management interface specification
(CMIS) as QSFP-DD and DSFP modules.
Allow ethtool to dump, parse and print their EEPROM contents by adding
their SFF-8024 Identifier Value (0x19).
This is required for future NVIDIA Spectrum-4 based systems that will be
equipped with OSFP transceivers.
While at it, add the DSFP identifier to the IOCTL path, as it was
missing.
commit: b9f25ea
Reference: https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/commit/?id=b9f25ea9058d
Signed-off-by: Danielle Ratson <danieller@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
---
netlink/module-eeprom.c | 1 +
qsfp.c | 4 +++-
sff-common.c | 3 +++
sff-common.h | 1 +
4 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/netlink/module-eeprom.c b/netlink/module-eeprom.c
index f359aee..49833a2 100644
--- a/netlink/module-eeprom.c
+++ b/netlink/module-eeprom.c
@@ -223,6 +223,7 @@ static int eeprom_parse(struct cmd_context *ctx)
case SFF8024_ID_QSFP_PLUS:
return sff8636_show_all_nl(ctx);
case SFF8024_ID_QSFP_DD:
+ case SFF8024_ID_OSFP:
case SFF8024_ID_DSFP:
return cmis_show_all_nl(ctx);
#endif
diff --git a/qsfp.c b/qsfp.c
index 57aac86..1fe5de1 100644
--- a/qsfp.c
+++ b/qsfp.c
@@ -947,7 +947,9 @@ 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) {
+ if (id[SFF8636_ID_OFFSET] == SFF8024_ID_QSFP_DD ||
+ id[SFF8636_ID_OFFSET] == SFF8024_ID_OSFP ||
+ id[SFF8636_ID_OFFSET] == SFF8024_ID_DSFP) {
cmis_show_all_ioctl(id);
return;
}
diff --git a/sff-common.c b/sff-common.c
index 2815951..e951cf1 100644
--- a/sff-common.c
+++ b/sff-common.c
@@ -139,6 +139,9 @@ void sff8024_show_identifier(const __u8 *id, int id_offset)
case SFF8024_ID_QSFP_DD:
printf(" (QSFP-DD Double Density 8X Pluggable Transceiver (INF-8628))\n");
break;
+ case SFF8024_ID_OSFP:
+ printf(" (OSFP 8X Pluggable Transceiver)\n");
+ break;
case SFF8024_ID_DSFP:
printf(" (DSFP Dual Small Form Factor Pluggable Transceiver)\n");
break;
diff --git a/sff-common.h b/sff-common.h
index 9e32300..dd12dda 100644
--- a/sff-common.h
+++ b/sff-common.h
@@ -62,6 +62,7 @@
#define SFF8024_ID_CDFP_S3 0x16
#define SFF8024_ID_MICRO_QSFP 0x17
#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_UNALLOCATED_LAST 0x7F
--
2.30.0