Netdev List
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@nvidia.com>
To: netdev@vger.kernel.org
Cc: mkubecek@suse.cz, danieller@nvidia.com, Ido Schimmel <idosch@nvidia.com>
Subject: [PATCH ethtool 8/8] cmis: Fix printing of link length
Date: Thu, 16 Jul 2026 09:45:32 +0300	[thread overview]
Message-ID: <20260716064532.1522382-9-idosch@nvidia.com> (raw)
In-Reply-To: <20260716064532.1522382-1-idosch@nvidia.com>

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


      parent reply	other threads:[~2026-07-16  6:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Ido Schimmel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260716064532.1522382-9-idosch@nvidia.com \
    --to=idosch@nvidia.com \
    --cc=danieller@nvidia.com \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox