Skip to contentSkip to conversation

Add QSFP-DD support

PATCH Superseded Adrian Pop 2 participants 3 messages Aug 13, 2020

Subsystems (3)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Adrian Pop

author
#0 lore raw

PATCH v3 1/1 Add QSFP-DD support

The Common Management Interface Specification (CMIS) for QSFP-DD shares some similarities with other form factors such as QSFP or SFP, but due to the fact that the module memory map is different, the current ethtool version is not able to provide relevant information about an interface.

This patch adds QSFP-DD support to ethtool. The changes are similar to the ones already existing in qsfp.c, but customized to use the memory addresses and logic as defined in the specifications document.

Several functions from qsfp.c could be reused, so an additional parameter was added to each and the functions were moved to sff-common.c.

Changelog (diff from v2):
* Remove functions assuming the existance of page 0x10 and 0x11
* Remove structs and constants related to the page 0x10 and 0x11

---
 Makefile.am  |   2 +-
 qsfp-dd.c    | 333 +++++++++++++++++++++++++++++++++++++++++++++++++++
 qsfp-dd.h    | 125 +++++++++++++++++++
 qsfp.c       |  47 ++------
 qsfp.h       |   8 --
 sff-common.c |  51 ++++++++
 sff-common.h |  26 +++-
 7 files changed, 543 insertions(+), 49 deletions(-)
 create mode 100644 qsfp-dd.c
 create mode 100644 qsfp-dd.h
Makefile.am +1 -1
index 2abb274..38dde09 100644
@@ -17,7 +17,7 @@ ethtool_SOURCES += \
 		  smsc911x.c at76c50x-usb.c sfc.c stmmac.c	\
 		  sff-common.c sff-common.h sfpid.c sfpdiag.c	\
 		  ixgbevf.c tse.c vmxnet3.c qsfp.c qsfp.h fjes.c lan78xx.c \
-		  igc.c
+		  igc.c qsfp-dd.c qsfp-dd.h
 endif
 
 if ENABLE_BASH_COMPLETION
qsfp-dd.c new file +333 -0

333 lines not on this page · raw message

qsfp-dd.h new file +125 -0

125 lines not on this page · raw message

qsfp.c +11 -36

81 lines not on this page · raw message

qsfp.h +0 -8
index 3215932..9636b0c 100644
@@ -31,14 +31,6 @@
 #define	SFF8636_ID_OFFSET	0x00
 
 #define	SFF8636_REV_COMPLIANCE_OFFSET	0x01
-#define	 SFF8636_REV_UNSPECIFIED		0x00
-#define	 SFF8636_REV_8436_48			0x01
-#define	 SFF8636_REV_8436_8636			0x02
-#define	 SFF8636_REV_8636_13			0x03
-#define	 SFF8636_REV_8636_14			0x04
-#define	 SFF8636_REV_8636_15			0x05
-#define	 SFF8636_REV_8636_20			0x06
-#define	 SFF8636_REV_8636_27			0x07
 
 #define	SFF8636_STATUS_2_OFFSET	0x02
 /* Flat Memory:0- Paging, 1- Page 0 only */
sff-common.c +51 -0

66 lines not on this page · raw message

sff-common.h +22 -4
index 5562b4d..0d04851 100644
@@ -26,7 +26,17 @@
 #include <stdio.h>
 #include "internal.h"
 
-#define SFF8024_ID_OFFSET				0x00
+/* Revision compliance */
+#define	 SFF8636_REV_UNSPECIFIED		0x00
+#define	 SFF8636_REV_8436_48			0x01
+#define	 SFF8636_REV_8436_8636			0x02
+#define	 SFF8636_REV_8636_13			0x03
+#define	 SFF8636_REV_8636_14			0x04
+#define	 SFF8636_REV_8636_15			0x05
+#define	 SFF8636_REV_8636_20			0x06
+#define	 SFF8636_REV_8636_27			0x07
+
+#define  SFF8024_ID_OFFSET				0x00
 #define  SFF8024_ID_UNKNOWN				0x00
 #define  SFF8024_ID_GBIC				0x01
 #define  SFF8024_ID_SOLDERED_MODULE		0x02
@@ -51,7 +61,8 @@
 #define  SFF8024_ID_HD8X_FANOUT			0x15
 #define  SFF8024_ID_CDFP_S3				0x16
 #define  SFF8024_ID_MICRO_QSFP			0x17
-#define  SFF8024_ID_LAST				SFF8024_ID_MICRO_QSFP
+#define  SFF8024_ID_QSFP_DD				0x18
+#define  SFF8024_ID_LAST				SFF8024_ID_QSFP_DD
 #define  SFF8024_ID_UNALLOCATED_LAST	0x7F
 #define  SFF8024_ID_VENDOR_START		0x80
 #define  SFF8024_ID_VENDOR_LAST			0xFF
@@ -76,8 +87,14 @@
 #define  SFF8024_CTOR_RJ45				0x22
 #define  SFF8024_CTOR_NO_SEPARABLE		0x23
 #define  SFF8024_CTOR_MXC_2x16			0x24
-#define  SFF8024_CTOR_LAST				SFF8024_CTOR_MXC_2x16
-#define  SFF8024_CTOR_UNALLOCATED_LAST	0x7F
+#define  SFF8024_CTOR_CS_OPTICAL		0x25
+#define  SFF8024_CTOR_CS_OPTICAL_MINI		0x26
+#define  SFF8024_CTOR_MPO_2X12		    	0x27
+#define  SFF8024_CTOR_MPO_1X16		    	0x28
+#define  SFF8024_CTOR_LAST			SFF8024_CTOR_MPO_1X16
+
+#define  SFF8024_CTOR_NO_SEP_QSFP_DD 		0x6F
+#define  SFF8024_CTOR_UNALLOCATED_LAST		0x7F
 #define  SFF8024_CTOR_VENDOR_START		0x80
 #define  SFF8024_CTOR_VENDOR_LAST		0xFF
 
@@ -185,5 +202,6 @@ void sff8024_show_oui(const __u8 *id, int id_offset);
 void sff8024_show_identifier(const __u8 *id, int id_offset);
 void sff8024_show_connector(const __u8 *id, int ctor_offset);
 void sff8024_show_encoding(const __u8 *id, int encoding_offset, int sff_type);
+void sff_show_revision_compliance(const __u8 *id, int rev_offset);
 
 #endif /* SFF_COMMON_H__ */
Signature · 1 line
2.17.1
#1 lore raw
Quoted 9 lines · Adrian Pop

The Common Management Interface Specification (CMIS) for QSFP-DD shares some similarities with other form factors such as QSFP or SFP, but due to the fact that the module memory map is different, the current ethtool version is not able to provide relevant information about an interface.

This patch adds QSFP-DD support to ethtool. The changes are similar to the ones already existing in qsfp.c, but customized to use the memory addresses and logic as defined in the specifications document.

Quoted 6 lines

Several functions from qsfp.c could be reused, so an additional parameter was added to each and the functions were moved to sff-common.c.

Changelog (diff from v2):
* Remove functions assuming the existance of page 0x10 and 0x11
* Remove structs and constants related to the page 0x10 and 0x11

Adrian, you're missing diff from v1 and Signed-off-by tag.

Please send v4 with these changes.

And please CC Michal Kubecek <[email protected]> on ethtool patches since he maintains the tool.

Thanks

Quoted 1 line

---

author
#2 lore raw

Hi!

Sorry for that. I'll resubmit v4 and I'll add diff from v1, diff from v2 and diff from v3.
I will also add Michal Kubecek.

Adrian

Quoted 28 lines · Ido Schimmel
Quoted 9 lines · Adrian Pop

The Common Management Interface Specification (CMIS) for QSFP-DD shares some similarities with other form factors such as QSFP or SFP, but due to the fact that the module memory map is different, the current ethtool version is not able to provide relevant information about an interface.

This patch adds QSFP-DD support to ethtool. The changes are similar to the ones already existing in qsfp.c, but customized to use the memory addresses and logic as defined in the specifications document.

Quoted 6 lines

Several functions from qsfp.c could be reused, so an additional parameter was added to each and the functions were moved to sff-common.c.

Changelog (diff from v2):
* Remove functions assuming the existance of page 0x10 and 0x11
* Remove structs and constants related to the page 0x10 and 0x11

Adrian, you're missing diff from v1 and Signed-off-by tag.

Please send v4 with these changes.

And please CC Michal Kubecek <[email protected]> on ethtool patches since he maintains the tool.

Thanks

Quoted 1 line

---