* [PATCH ethtool 0/8] cmis: Miscellaneous fixes
@ 2026-07-16 6:45 Ido Schimmel
2026-07-16 6:45 ` [PATCH ethtool 1/8] cmis: Fix printing of Tx bias current Ido Schimmel
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: Ido Schimmel @ 2026-07-16 6:45 UTC (permalink / raw)
To: netdev; +Cc: mkubecek, danieller, Ido Schimmel
Patch #1 fixes an issue reported by a user. The rest fix valid issues
pointed out by Claude Code after I asked it to validate the CMIS parser
against the CMIS specification.
Note that these are not regressions (never worked).
Ido Schimmel (8):
cmis: Fix printing of Tx bias current
cmis: Fix printing of channel-level flags
cmis: Fix printing of CDB EPL pages
module-common: Fix printing of transmitter technology for CMIS
transceivers
module-common: Avoid undefined behavior with CMIS transceivers
module-common: Add missing CMIS transmitter technologies
cmis: Fix printing of attenuation and wavelength
cmis: Fix printing of link length
cmis.c | 65 +++++++++++++++++++++++++++++++---------------
cmis.h | 1 +
module-common.c | 68 +++++++++++++++++++++++++++----------------------
module-common.h | 57 +++++++++++++++--------------------------
qsfp.c | 5 ++--
sff-common.h | 4 +--
6 files changed, 108 insertions(+), 92 deletions(-)
--
2.55.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH ethtool 1/8] cmis: Fix printing of Tx bias current
2026-07-16 6:45 [PATCH ethtool 0/8] cmis: Miscellaneous fixes Ido Schimmel
@ 2026-07-16 6:45 ` Ido Schimmel
2026-07-16 6:45 ` [PATCH ethtool 2/8] cmis: Fix printing of channel-level flags Ido Schimmel
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Ido Schimmel @ 2026-07-16 6:45 UTC (permalink / raw)
To: netdev; +Cc: mkubecek, danieller, Ido Schimmel
In CMIS, unlike SFF-8636 and SFF-8472, the Tx bias current can be scaled
(i.e., multiplied by 1 / 2 / 4). Fix the application of the scaling
factor from shift right to shift left. In addition, increase the size of
the field that stores the scaled value from 16-bits to 32-bits to avoid
truncation.
Fixes: 340d88ee1289 ("cmis: Parse and print diagnostic information")
Reviewed-by: Danielle Ratson <danieller@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
cmis.c | 10 +++++-----
sff-common.h | 4 ++--
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/cmis.c b/cmis.c
index f494268ba3b7..a4bf455c2a77 100644
--- a/cmis.c
+++ b/cmis.c
@@ -517,7 +517,7 @@ cmis_parse_dom_chan_lvl_monitors_bank(const struct cmis_memory_map *map,
sd->scd[chan].bias_cur = OFFSET_TO_U16_PTR(page_11h,
tx_bias_offset);
- sd->scd[chan].bias_cur >>= bias_mul;
+ sd->scd[chan].bias_cur <<= bias_mul;
sd->scd[chan].rx_power = OFFSET_TO_U16_PTR(page_11h,
rx_power_offset);
sd->scd[chan].tx_power = OFFSET_TO_U16_PTR(page_11h,
@@ -544,16 +544,16 @@ static void cmis_parse_dom_chan_lvl_thresh(const struct cmis_memory_map *map,
sd->bias_cur[HALRM] = OFFSET_TO_U16_PTR(map->page_02h,
CMIS_TX_BIAS_HALRM_OFFSET);
- sd->bias_cur[HALRM] >>= bias_mul;
+ sd->bias_cur[HALRM] <<= bias_mul;
sd->bias_cur[LALRM] = OFFSET_TO_U16_PTR(map->page_02h,
CMIS_TX_BIAS_LALRM_OFFSET);
- sd->bias_cur[LALRM] >>= bias_mul;
+ sd->bias_cur[LALRM] <<= bias_mul;
sd->bias_cur[HWARN] = OFFSET_TO_U16_PTR(map->page_02h,
CMIS_TX_BIAS_HWARN_OFFSET);
- sd->bias_cur[HWARN] >>= bias_mul;
+ sd->bias_cur[HWARN] <<= bias_mul;
sd->bias_cur[LWARN] = OFFSET_TO_U16_PTR(map->page_02h,
CMIS_TX_BIAS_LWARN_OFFSET);
- sd->bias_cur[LWARN] >>= bias_mul;
+ sd->bias_cur[LWARN] <<= bias_mul;
sd->tx_power[HALRM] = OFFSET_TO_U16_PTR(map->page_02h,
CMIS_TX_PWR_HALRM_OFFSET);
diff --git a/sff-common.h b/sff-common.h
index 3c02a69ec7f6..59ae21038c9c 100644
--- a/sff-common.h
+++ b/sff-common.h
@@ -126,7 +126,7 @@
/* Channel Monitoring Fields */
struct sff_channel_diags {
- __u16 bias_cur; /* Measured bias current in 2uA units */
+ __u32 bias_cur; /* Measured bias current in 2uA units */
__u16 rx_power; /* Measured RX Power */
__u16 tx_power; /* Measured TX Power */
};
@@ -157,7 +157,7 @@ struct sff_diags {
/* SFP Temp in 16-bit signed 1/256 Celcius */
__s16 sfp_temp[5];
/* Measured bias current in 2uA units */
- __u16 bias_cur[5];
+ __u32 bias_cur[5];
/* Measured TX Power */
__u16 tx_power[5];
/* Measured RX Power */
--
2.55.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH ethtool 2/8] cmis: Fix printing of channel-level flags
2026-07-16 6:45 [PATCH ethtool 0/8] cmis: Miscellaneous fixes Ido Schimmel
2026-07-16 6:45 ` [PATCH ethtool 1/8] cmis: Fix printing of Tx bias current Ido Schimmel
@ 2026-07-16 6:45 ` Ido Schimmel
2026-07-16 6:45 ` [PATCH ethtool 3/8] cmis: Fix printing of CDB EPL pages Ido Schimmel
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Ido Schimmel @ 2026-07-16 6:45 UTC (permalink / raw)
To: netdev; +Cc: mkubecek, danieller, Ido Schimmel
CMIS encodes different channel-level flags (e.g., "Laser bias current
high alarm") in different bytes where each bit corresponds to the value
of the flag in a different channel. Since CMIS supports more than 8
channels, these flags can be banked (e.g., channels 1-8 in bank 0,
channels 9-16 in bank 1 etc.).
The code is currently applying the wrong bit mask (the channel number
itself) when extracting the per-channel flag. Fix the calculation of the
bit mask so that the channel offset (0-7) in the current bank determines
the number of bits that are shifted.
Fixes: 340d88ee1289 ("cmis: Parse and print diagnostic information")
Reviewed-by: Danielle Ratson <danieller@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
cmis.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmis.c b/cmis.c
index a4bf455c2a77..16f168a3b1af 100644
--- a/cmis.c
+++ b/cmis.c
@@ -766,7 +766,7 @@ static void cmis_show_dom_chan_lvl_flag(const struct cmis_memory_map *map,
char str[80];
bool value;
- value = page_11h[module_aw_chan_flags[flag].offset] & chan;
+ value = page_11h[module_aw_chan_flags[flag].offset] & (1 << i);
if (is_json_context()) {
print_bool(PRINT_JSON, NULL, NULL, value);
} else {
--
2.55.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH ethtool 3/8] cmis: Fix printing of CDB EPL pages
2026-07-16 6:45 [PATCH ethtool 0/8] cmis: Miscellaneous fixes Ido Schimmel
2026-07-16 6:45 ` [PATCH ethtool 1/8] cmis: Fix printing of Tx bias current Ido Schimmel
2026-07-16 6:45 ` [PATCH ethtool 2/8] cmis: Fix printing of channel-level flags Ido Schimmel
@ 2026-07-16 6:45 ` Ido Schimmel
2026-07-16 6:45 ` [PATCH ethtool 4/8] module-common: Fix printing of transmitter technology for CMIS transceivers Ido Schimmel
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Ido Schimmel @ 2026-07-16 6:45 UTC (permalink / raw)
To: netdev; +Cc: mkubecek, danieller, Ido Schimmel
The "CdbMaxPagesEPL" field is 4-bits. The code currently assumes that
the value of the field directly determines the number of EPL pages, but
values 5 / 6 / 7 correspond to 8 / 12 / 16 EPL pages.
Fix the printing of the number of EPL pages by using a translation table
and avoid printing the field if the value is reserved (i.e., 8-15).
Fixes: fe8e296aa023 ("cmis: Print CDB messaging support advertisement")
Reviewed-by: Danielle Ratson <danieller@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
cmis.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/cmis.c b/cmis.c
index 16f168a3b1af..da1ced75e4ef 100644
--- a/cmis.c
+++ b/cmis.c
@@ -924,10 +924,14 @@ static void cmis_show_cdb_mode(const struct cmis_memory_map *map)
static void cmis_show_cdb_epl_pages(const struct cmis_memory_map *map)
{
- __u8 epl_pages = map->page_01h[CMIS_CDB_ADVER_OFFSET] &
- CMIS_CDB_ADVER_EPL_MASK;
+ static const __u8 epl_page_count[] = { 0, 1, 2, 3, 4, 8, 12, 16 };
+ __u8 epl = map->page_01h[CMIS_CDB_ADVER_OFFSET] &
+ CMIS_CDB_ADVER_EPL_MASK;
- module_print_any_uint("CDB EPL pages", epl_pages, NULL);
+ if (epl >= ARRAY_SIZE(epl_page_count))
+ return;
+
+ module_print_any_uint("CDB EPL pages", epl_page_count[epl], NULL);
}
static void cmis_show_cdb_rw_len(const struct cmis_memory_map *map)
--
2.55.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH ethtool 4/8] module-common: Fix printing of transmitter technology for CMIS transceivers
2026-07-16 6:45 [PATCH ethtool 0/8] cmis: Miscellaneous fixes Ido Schimmel
` (2 preceding siblings ...)
2026-07-16 6:45 ` [PATCH ethtool 3/8] cmis: Fix printing of CDB EPL pages Ido Schimmel
@ 2026-07-16 6:45 ` Ido Schimmel
2026-07-16 6:45 ` [PATCH ethtool 5/8] module-common: Avoid undefined behavior with " Ido Schimmel
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Ido Schimmel @ 2026-07-16 6:45 UTC (permalink / raw)
To: netdev; +Cc: mkubecek, danieller, Ido Schimmel
In CMIS, the transceiver technology is encoded in the
"MediaInterfaceTechnology" field which is 8-bits, while in SFF-8636 it
is encoded in the 4 MSBs of the "Device Technology" field. Both
specifications share the same encoding for the common values (0-15), but
CMIS supports more values given the field is 8-bits.
Given the common encoding, cited commit consolidated the printing of
this field between CMIS and SFF-8636. The CMIS parser passes the
"MediaInterfaceTechnology" field and the SFF-8636 parser passes the
"Device Technology" field while masking the 4 LSBs. This creates a
situation where both parsers pass different values for the same
transmitter technology (e.g., "1310 nm VCSEL" is 0x01 in CMIS and 0x10
in SFF-8636). To overcome this, the common code matches on two values
for each transmitter technology.
While this works most of the time, it is going to create a problem for
CMIS transceivers that utilize the 4 MSBs of the
"MediaInterfaceTechnology" field.
Fix by creating a common encoding for the transmitter technology field
and have the SFF-8636 parser pass the shifted value of the "Device
Technology" field to the common code. That way both parsers pass the
same value for a given transmitter technology.
Fixes: 504c4f573571 ("module_common: Add a new file to all the common code for all module types")
Reviewed-by: Danielle Ratson <danieller@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
cmis.c | 4 ++--
module-common.c | 47 +++++++++++++++-----------------------------
module-common.h | 52 +++++++++++++++----------------------------------
qsfp.c | 5 ++---
4 files changed, 36 insertions(+), 72 deletions(-)
diff --git a/cmis.c b/cmis.c
index da1ced75e4ef..19a3eb7cf925 100644
--- a/cmis.c
+++ b/cmis.c
@@ -254,11 +254,11 @@ static void cmis_show_sig_integrity(const struct cmis_memory_map *map)
*/
static void cmis_show_mit_compliance(const struct cmis_memory_map *map)
{
- u16 value = map->page_00h[CMIS_MEDIA_INTF_TECH_OFFSET];
+ __u8 value = map->page_00h[CMIS_MEDIA_INTF_TECH_OFFSET];
module_show_mit_compliance(value);
- if (value >= CMIS_COPPER_UNEQUAL) {
+ if (value >= MODULE_TT_COPPER_UNEQUAL) {
module_print_any_uint("Attenuation at 5GHz",
map->page_00h[CMIS_COPPER_ATT_5GHZ], "db");
module_print_any_uint("Attenuation at 7GHz",
diff --git a/module-common.c b/module-common.c
index 42fccf68301b..997dd2b37ce7 100644
--- a/module-common.c
+++ b/module-common.c
@@ -575,71 +575,56 @@ void module_show_mit_compliance(u16 value)
char description[SFF_MAX_DESC_LEN];
switch (value) {
- case MODULE_850_VCSEL:
+ case MODULE_TT_850_VCSEL:
strncpy(description, "850 nm VCSEL", SFF_MAX_DESC_LEN);
break;
- case CMIS_1310_VCSEL:
- case SFF8636_TRANS_1310_VCSEL:
+ case MODULE_TT_1310_VCSEL:
strncpy(description, "1310 nm VCSEL", SFF_MAX_DESC_LEN);
break;
- case CMIS_1550_VCSEL:
- case SFF8636_TRANS_1550_VCSEL:
+ case MODULE_TT_1550_VCSEL:
strncpy(description, "1550 nm VCSEL", SFF_MAX_DESC_LEN);
break;
- case CMIS_1310_FP:
- case SFF8636_TRANS_1310_FP:
+ case MODULE_TT_1310_FP:
strncpy(description, "1310 nm FP", SFF_MAX_DESC_LEN);
break;
- case CMIS_1310_DFB:
- case SFF8636_TRANS_1310_DFB:
+ case MODULE_TT_1310_DFB:
strncpy(description, "1310 nm DFB", SFF_MAX_DESC_LEN);
break;
- case CMIS_1550_DFB:
- case SFF8636_TRANS_1550_DFB:
+ case MODULE_TT_1550_DFB:
strncpy(description, "1550 nm DFB", SFF_MAX_DESC_LEN);
break;
- case CMIS_1310_EML:
- case SFF8636_TRANS_1310_EML:
+ case MODULE_TT_1310_EML:
strncpy(description, "1310 nm EML", SFF_MAX_DESC_LEN);
break;
- case CMIS_1550_EML:
- case SFF8636_TRANS_1550_EML:
+ case MODULE_TT_1550_EML:
strncpy(description, "1550 nm EML", SFF_MAX_DESC_LEN);
break;
- case CMIS_OTHERS:
- case SFF8636_TRANS_OTHERS:
+ case MODULE_TT_OTHERS:
strncpy(description, "Others/Undefined", SFF_MAX_DESC_LEN);
break;
- case CMIS_1490_DFB:
- case SFF8636_TRANS_1490_DFB:
+ case MODULE_TT_1490_DFB:
strncpy(description, "1490 nm DFB", SFF_MAX_DESC_LEN);
break;
- case CMIS_COPPER_UNEQUAL:
- case SFF8636_TRANS_COPPER_PAS_UNEQUAL:
+ case MODULE_TT_COPPER_UNEQUAL:
snprintf(description, SFF_MAX_DESC_LEN, "%s unequalized", cc);
break;
- case CMIS_COPPER_PASS_EQUAL:
- case SFF8636_TRANS_COPPER_PAS_EQUAL:
+ case MODULE_TT_COPPER_PASS_EQUAL:
snprintf(description, SFF_MAX_DESC_LEN, "%s passive equalized",
cc);
break;
- case CMIS_COPPER_NF_EQUAL:
- case SFF8636_TRANS_COPPER_LNR_FAR_EQUAL:
+ case MODULE_TT_COPPER_NF_EQUAL:
snprintf(description, SFF_MAX_DESC_LEN,
"%s near and far end limiting active equalizers", cc);
break;
- case CMIS_COPPER_F_EQUAL:
- case SFF8636_TRANS_COPPER_FAR_EQUAL:
+ case MODULE_TT_COPPER_F_EQUAL:
snprintf(description, SFF_MAX_DESC_LEN,
"%s far end limiting active equalizers", cc);
break;
- case CMIS_COPPER_N_EQUAL:
- case SFF8636_TRANS_COPPER_NEAR_EQUAL:
+ case MODULE_TT_COPPER_N_EQUAL:
snprintf(description, SFF_MAX_DESC_LEN,
"%s near end limiting active equalizers", cc);
break;
- case CMIS_COPPER_LINEAR_EQUAL:
- case SFF8636_TRANS_COPPER_LNR_EQUAL:
+ case MODULE_TT_COPPER_LINEAR_EQUAL:
snprintf(description, SFF_MAX_DESC_LEN, "%s linear active equalizers",
cc);
break;
diff --git a/module-common.h b/module-common.h
index 4063448f3eea..fba1d36f7f86 100644
--- a/module-common.h
+++ b/module-common.h
@@ -83,42 +83,22 @@ enum module_type {
#define MODULE_CTOR_VENDOR_LAST 0xFF
/* Transmitter Technology */
-#define MODULE_850_VCSEL 0x00
-
-/* SFF8636 */
-#define SFF8636_TRANS_TECH_MASK 0xF0
-#define SFF8636_TRANS_COPPER_LNR_EQUAL (15 << 4)
-#define SFF8636_TRANS_COPPER_NEAR_EQUAL (14 << 4)
-#define SFF8636_TRANS_COPPER_FAR_EQUAL (13 << 4)
-#define SFF8636_TRANS_COPPER_LNR_FAR_EQUAL (12 << 4)
-#define SFF8636_TRANS_COPPER_PAS_EQUAL (11 << 4)
-#define SFF8636_TRANS_COPPER_PAS_UNEQUAL (10 << 4)
-#define SFF8636_TRANS_1490_DFB (9 << 4)
-#define SFF8636_TRANS_OTHERS (8 << 4)
-#define SFF8636_TRANS_1550_EML (7 << 4)
-#define SFF8636_TRANS_1310_EML (6 << 4)
-#define SFF8636_TRANS_1550_DFB (5 << 4)
-#define SFF8636_TRANS_1310_DFB (4 << 4)
-#define SFF8636_TRANS_1310_FP (3 << 4)
-#define SFF8636_TRANS_1550_VCSEL (2 << 4)
-#define SFF8636_TRANS_1310_VCSEL (1 << 4)
-
-/* CMIS */
-#define CMIS_1310_VCSEL 0x01
-#define CMIS_1550_VCSEL 0x02
-#define CMIS_1310_FP 0x03
-#define CMIS_1310_DFB 0x04
-#define CMIS_1550_DFB 0x05
-#define CMIS_1310_EML 0x06
-#define CMIS_1550_EML 0x07
-#define CMIS_OTHERS 0x08
-#define CMIS_1490_DFB 0x09
-#define CMIS_COPPER_UNEQUAL 0x0A
-#define CMIS_COPPER_PASS_EQUAL 0x0B
-#define CMIS_COPPER_NF_EQUAL 0x0C
-#define CMIS_COPPER_F_EQUAL 0x0D
-#define CMIS_COPPER_N_EQUAL 0x0E
-#define CMIS_COPPER_LINEAR_EQUAL 0x0F
+#define MODULE_TT_850_VCSEL 0x00
+#define MODULE_TT_1310_VCSEL 0x01
+#define MODULE_TT_1550_VCSEL 0x02
+#define MODULE_TT_1310_FP 0x03
+#define MODULE_TT_1310_DFB 0x04
+#define MODULE_TT_1550_DFB 0x05
+#define MODULE_TT_1310_EML 0x06
+#define MODULE_TT_1550_EML 0x07
+#define MODULE_TT_OTHERS 0x08
+#define MODULE_TT_1490_DFB 0x09
+#define MODULE_TT_COPPER_UNEQUAL 0x0A
+#define MODULE_TT_COPPER_PASS_EQUAL 0x0B
+#define MODULE_TT_COPPER_NF_EQUAL 0x0C
+#define MODULE_TT_COPPER_F_EQUAL 0x0D
+#define MODULE_TT_COPPER_N_EQUAL 0x0E
+#define MODULE_TT_COPPER_LINEAR_EQUAL 0x0F
/* Module Flags (Page 0) */
#define CMIS_VCC_AW_OFFSET 0x09
diff --git a/qsfp.c b/qsfp.c
index c82a3dec9b0b..20b6c2173284 100644
--- a/qsfp.c
+++ b/qsfp.c
@@ -562,12 +562,11 @@ static void sff8636_show_rate_identifier(const struct sff8636_memory_map *map)
static void
sff8636_show_wavelength_or_copper_compliance(const struct sff8636_memory_map *map)
{
- u16 value = map->page_00h[SFF8636_DEVICE_TECH_OFFSET] &
- SFF8636_TRANS_TECH_MASK;
+ __u8 value = map->page_00h[SFF8636_DEVICE_TECH_OFFSET] >> 4;
module_show_mit_compliance(value);
- if (value >= SFF8636_TRANS_COPPER_PAS_UNEQUAL) {
+ if (value >= MODULE_TT_COPPER_UNEQUAL) {
module_print_any_uint("Attenuation at 2.5GHz",
map->page_00h[SFF8636_WAVELEN_HIGH_BYTE_OFFSET],
"db");
--
2.55.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH ethtool 5/8] module-common: Avoid undefined behavior with CMIS transceivers
2026-07-16 6:45 [PATCH ethtool 0/8] cmis: Miscellaneous fixes Ido Schimmel
` (3 preceding siblings ...)
2026-07-16 6:45 ` [PATCH ethtool 4/8] module-common: Fix printing of transmitter technology for CMIS transceivers Ido Schimmel
@ 2026-07-16 6:45 ` Ido Schimmel
2026-07-16 6:45 ` [PATCH ethtool 6/8] module-common: Add missing CMIS transmitter technologies Ido Schimmel
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Ido Schimmel @ 2026-07-16 6:45 UTC (permalink / raw)
To: netdev; +Cc: mkubecek, danieller, Ido Schimmel
While the function that handles the printing of the transmitter
technology handles all the values passed by the SFF-8636 parser (0-15),
it does not handle all the values that can be passed by the CMIS parser
where this field is 8-bits.
Fix by adding a default case that will initialize "description" to
"Reserved or unknown".
Fixes: 88ca347ef35a ("Add QSFP-DD support")
Reviewed-by: Danielle Ratson <danieller@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
module-common.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/module-common.c b/module-common.c
index 997dd2b37ce7..ea4514ab3899 100644
--- a/module-common.c
+++ b/module-common.c
@@ -628,6 +628,9 @@ void module_show_mit_compliance(u16 value)
snprintf(description, SFF_MAX_DESC_LEN, "%s linear active equalizers",
cc);
break;
+ default:
+ strncpy(description, "Reserved or unknown", SFF_MAX_DESC_LEN);
+ break;
}
sff_print_any_hex_field("Transmitter technology",
--
2.55.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH ethtool 6/8] module-common: Add missing CMIS transmitter technologies
2026-07-16 6:45 [PATCH ethtool 0/8] cmis: Miscellaneous fixes Ido Schimmel
` (4 preceding siblings ...)
2026-07-16 6:45 ` [PATCH ethtool 5/8] module-common: Avoid undefined behavior with " Ido Schimmel
@ 2026-07-16 6:45 ` Ido Schimmel
2026-07-16 6:45 ` [PATCH ethtool 7/8] cmis: Fix printing of attenuation and wavelength Ido Schimmel
2026-07-16 6:45 ` [PATCH ethtool 8/8] cmis: Fix printing of link length Ido Schimmel
7 siblings, 0 replies; 9+ messages in thread
From: Ido Schimmel @ 2026-07-16 6:45 UTC (permalink / raw)
To: netdev; +Cc: mkubecek, danieller, Ido Schimmel
Add missing transmitter technologies from table 8-40 in CMIS 5.3. This
is a prerequisite for the next patch to help us distinguish between
copper and optical transceivers.
Fixes: 88ca347ef35a ("Add QSFP-DD support")
Reviewed-by: Danielle Ratson <danieller@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
module-common.c | 18 ++++++++++++++++++
module-common.h | 5 +++++
2 files changed, 23 insertions(+)
diff --git a/module-common.c b/module-common.c
index ea4514ab3899..f8e4681d8d63 100644
--- a/module-common.c
+++ b/module-common.c
@@ -628,6 +628,24 @@ void module_show_mit_compliance(u16 value)
snprintf(description, SFF_MAX_DESC_LEN, "%s linear active equalizers",
cc);
break;
+ case MODULE_TT_C_BAND_LASER:
+ strncpy(description, "C-band tunable laser", SFF_MAX_DESC_LEN);
+ break;
+ case MODULE_TT_L_BAND_LASER:
+ strncpy(description, "L-band tunable laser", SFF_MAX_DESC_LEN);
+ break;
+ case MODULE_TT_COPPER_NF_LINEAR:
+ snprintf(description, SFF_MAX_DESC_LEN,
+ "%s near and far end linear active equalizers", cc);
+ break;
+ case MODULE_TT_COPPER_F_LINEAR:
+ snprintf(description, SFF_MAX_DESC_LEN,
+ "%s far end linear active equalizers", cc);
+ break;
+ case MODULE_TT_COPPER_N_LINEAR:
+ snprintf(description, SFF_MAX_DESC_LEN,
+ "%s near end linear active equalizers", cc);
+ break;
default:
strncpy(description, "Reserved or unknown", SFF_MAX_DESC_LEN);
break;
diff --git a/module-common.h b/module-common.h
index fba1d36f7f86..e9bf8c19a9bb 100644
--- a/module-common.h
+++ b/module-common.h
@@ -99,6 +99,11 @@ enum module_type {
#define MODULE_TT_COPPER_F_EQUAL 0x0D
#define MODULE_TT_COPPER_N_EQUAL 0x0E
#define MODULE_TT_COPPER_LINEAR_EQUAL 0x0F
+#define MODULE_TT_C_BAND_LASER 0x10
+#define MODULE_TT_L_BAND_LASER 0x11
+#define MODULE_TT_COPPER_NF_LINEAR 0x12
+#define MODULE_TT_COPPER_F_LINEAR 0x13
+#define MODULE_TT_COPPER_N_LINEAR 0x14
/* Module Flags (Page 0) */
#define CMIS_VCC_AW_OFFSET 0x09
--
2.55.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH ethtool 7/8] cmis: Fix printing of attenuation and wavelength
2026-07-16 6:45 [PATCH ethtool 0/8] cmis: Miscellaneous fixes Ido Schimmel
` (5 preceding siblings ...)
2026-07-16 6:45 ` [PATCH ethtool 6/8] module-common: Add missing CMIS transmitter technologies Ido Schimmel
@ 2026-07-16 6:45 ` Ido Schimmel
2026-07-16 6:45 ` [PATCH ethtool 8/8] cmis: Fix printing of link length Ido Schimmel
7 siblings, 0 replies; 9+ messages in thread
From: Ido Schimmel @ 2026-07-16 6:45 UTC (permalink / raw)
To: netdev; +Cc: mkubecek, danieller, Ido Schimmel
The CMIS parser uses the same trick as the SFF-8636 parser to identify
copper cables for which attenuation should be printed. That is, it
considers every transmitter technology value above 0x09 as an indication
that it is dealing with a copper cable. This is not true for CMIS
transceivers which support more transmitter technologies compared to
SFF-8636. For example, according to table 8-40 in CMIS 5.3, 0x10 is
"C-band tunable laser".
Fix the identification of copper cables by only matching on the relevant
transmitter technology values. For all the rest, only print the
wavelength if Page 01h is supported and the nominal wavelength is not 0.
Fixes: 88ca347ef35a ("Add QSFP-DD support")
Reviewed-by: Danielle Ratson <danieller@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
cmis.c | 33 ++++++++++++++++++++++++---------
1 file changed, 24 insertions(+), 9 deletions(-)
diff --git a/cmis.c b/cmis.c
index 19a3eb7cf925..351e18484854 100644
--- a/cmis.c
+++ b/cmis.c
@@ -255,10 +255,20 @@ static void cmis_show_sig_integrity(const struct cmis_memory_map *map)
static void cmis_show_mit_compliance(const struct cmis_memory_map *map)
{
__u8 value = map->page_00h[CMIS_MEDIA_INTF_TECH_OFFSET];
+ float wl, wl_tol;
module_show_mit_compliance(value);
- if (value >= MODULE_TT_COPPER_UNEQUAL) {
+ switch (value) {
+ case MODULE_TT_COPPER_UNEQUAL:
+ case MODULE_TT_COPPER_PASS_EQUAL:
+ case MODULE_TT_COPPER_NF_EQUAL:
+ case MODULE_TT_COPPER_F_EQUAL:
+ case MODULE_TT_COPPER_N_EQUAL:
+ case MODULE_TT_COPPER_LINEAR_EQUAL:
+ case MODULE_TT_COPPER_NF_LINEAR:
+ case MODULE_TT_COPPER_F_LINEAR:
+ case MODULE_TT_COPPER_N_LINEAR:
module_print_any_uint("Attenuation at 5GHz",
map->page_00h[CMIS_COPPER_ATT_5GHZ], "db");
module_print_any_uint("Attenuation at 7GHz",
@@ -269,15 +279,20 @@ static void cmis_show_mit_compliance(const struct cmis_memory_map *map)
module_print_any_uint("Attenuation at 25.8GHz",
map->page_00h[CMIS_COPPER_ATT_25P8GHZ],
"db");
- } else if (map->page_01h) {
- module_print_any_float("Laser wavelength",
- (((map->page_01h[CMIS_NOM_WAVELENGTH_MSB] << 8) |
- map->page_01h[CMIS_NOM_WAVELENGTH_LSB]) * 0.05),
- "nm");
- module_print_any_float("Laser wavelength tolerance",
- (((map->page_01h[CMIS_WAVELENGTH_TOL_MSB] << 8) |
- map->page_01h[CMIS_WAVELENGTH_TOL_LSB]) * 0.005),
+ break;
+ default:
+ if (!map->page_01h)
+ break;
+ wl = ((map->page_01h[CMIS_NOM_WAVELENGTH_MSB] << 8) |
+ map->page_01h[CMIS_NOM_WAVELENGTH_LSB]) * 0.05;
+ wl_tol = ((map->page_01h[CMIS_WAVELENGTH_TOL_MSB] << 8) |
+ map->page_01h[CMIS_WAVELENGTH_TOL_LSB]) * 0.005;
+ if (!wl)
+ break;
+ module_print_any_float("Laser wavelength", wl, "nm");
+ module_print_any_float("Laser wavelength tolerance", wl_tol,
"nm");
+ break;
}
}
--
2.55.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH ethtool 8/8] cmis: Fix printing of link length
2026-07-16 6:45 [PATCH ethtool 0/8] cmis: Miscellaneous fixes Ido Schimmel
` (6 preceding siblings ...)
2026-07-16 6:45 ` [PATCH ethtool 7/8] cmis: Fix printing of attenuation and wavelength Ido Schimmel
@ 2026-07-16 6:45 ` Ido Schimmel
7 siblings, 0 replies; 9+ messages in thread
From: Ido Schimmel @ 2026-07-16 6:45 UTC (permalink / raw)
To: netdev; +Cc: mkubecek, danieller, Ido Schimmel
The CMIS parser only supports link length multipliers of 0.1 and 1, but
revision 5.0 of the specification (May 2021) added a multiplier of 10
and revision 5.3 (September 2024) added multipliers of 50, 100, 200 and
500.
Add support for the missing multipliers.
Fixes: 88ca347ef35a ("Add QSFP-DD support")
Reviewed-by: Danielle Ratson <danieller@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
cmis.c | 8 +++++++-
cmis.h | 1 +
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/cmis.c b/cmis.c
index 351e18484854..7a7e928ebb2f 100644
--- a/cmis.c
+++ b/cmis.c
@@ -188,6 +188,7 @@ static void cmis_show_cbl_asm_len(const struct cmis_memory_map *map)
*/
static void cmis_print_smf_cbl_len(const struct cmis_memory_map *map)
{
+ static const float smf_mul2[] = { 50.0f, 100.0f, 200.0f, 500.0f };
static const char *fn = "Length (SMF)";
float mul = 1.0f;
float val = 0.0f;
@@ -203,7 +204,12 @@ static void cmis_print_smf_cbl_len(const struct cmis_memory_map *map)
case CMIS_MULTIPLIER_01:
mul = 1.0f;
break;
- default:
+ case CMIS_MULTIPLIER_10:
+ mul = 10.0f;
+ break;
+ case CMIS_MULTIPLIER_11:
+ mul = smf_mul2[(map->page_01h[CMIS_SMF_LEN_MUL2_OFFSET] &
+ CMIS_LEN_MUL_MASK) >> 6];
break;
}
diff --git a/cmis.h b/cmis.h
index 82fd2456a3ec..387809e00cd5 100644
--- a/cmis.h
+++ b/cmis.h
@@ -120,6 +120,7 @@
#define CMIS_OM4_LEN_OFFSET 0x86
#define CMIS_OM3_LEN_OFFSET 0x87
#define CMIS_OM2_LEN_OFFSET 0x88
+#define CMIS_SMF_LEN_MUL2_OFFSET 0x89
/* Wavelength (Page 1) */
#define CMIS_NOM_WAVELENGTH_MSB 0x8A
--
2.55.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-07-16 6:48 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-16 6:45 [PATCH ethtool 0/8] cmis: Miscellaneous fixes Ido Schimmel
2026-07-16 6:45 ` [PATCH ethtool 1/8] cmis: Fix printing of Tx bias current Ido Schimmel
2026-07-16 6:45 ` [PATCH ethtool 2/8] cmis: Fix printing of channel-level flags Ido Schimmel
2026-07-16 6:45 ` [PATCH ethtool 3/8] cmis: Fix printing of CDB EPL pages Ido Schimmel
2026-07-16 6:45 ` [PATCH ethtool 4/8] module-common: Fix printing of transmitter technology for CMIS transceivers Ido Schimmel
2026-07-16 6:45 ` [PATCH ethtool 5/8] module-common: Avoid undefined behavior with " Ido Schimmel
2026-07-16 6:45 ` [PATCH ethtool 6/8] module-common: Add missing CMIS transmitter technologies Ido Schimmel
2026-07-16 6:45 ` [PATCH ethtool 7/8] cmis: Fix printing of attenuation and wavelength Ido Schimmel
2026-07-16 6:45 ` [PATCH ethtool 8/8] cmis: Fix printing of link length Ido Schimmel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox