mbox series

[ethtool-next,0/8] ethtool: Add support for CMIS diagnostic information

Message ID 20211123174102.3242294-1-idosch@idosch.org (mailing list archive)
Headers show
Series ethtool: Add support for CMIS diagnostic information | expand

Message

Ido Schimmel Nov. 23, 2021, 5:40 p.m. UTC
From: Ido Schimmel <idosch@nvidia.com>

This patchset extends ethtool(8) to retrieve, parse and print CMIS
diagnostic information. This information includes module-level monitors
(e.g., temperature, voltage), channel-level monitors (e.g., Tx optical
power) and related thresholds and flags.

ethtool(8) already supports SFF-8636 (e.g., QSFP) and SFF-8472 (e.g.,
SFP) diagnostic information, but until recently CMIS diagnostic
information was unavailable to ethtool(8) as it resides in optional and
banked pages.

Testing
=======

Build tested each patch with the following configuration options:

netlink | pretty-dump
--------|------------
v       | v
x       | x
v       | x
x       | v

Except fields that were added, no difference in output before and after
the patchset. Tested with both PC and AOC QSFP-DD modules.

No reports from AddressSanitizer / valgrind.

Patchset overview
=================

Patches #1-#2 are small preparations.

Patches #3-#4 retrieve (over netlink) and initialize the optional and
banked pages in the CMIS memory map. These pages contain the previously
mentioned diagnostic information.

Patch #5 parses and prints the CMIS diagnostic information in a similar
fashion to the way it is done for SFF-8636.

Patches #6-#7 print a few additional fields from the CMIS EEPROM dump.
The examples contain an ethtool command that is supported by the kernel,
but not yet by ethtool(8). It will be sent as a follow-up patchset.

Patch #8 prints the equivalent module-level fields for SFF-8636.

Ido Schimmel (8):
  sff-8636: Use an SFF-8636 specific define for maximum number of
    channels
  sff-common: Move OFFSET_TO_U16_PTR() to common header file
  cmis: Initialize Page 02h in memory map
  cmis: Initialize Banked Page 11h in memory map
  cmis: Parse and print diagnostic information
  cmis: Print Module State and Fault Cause
  cmis: Print Module-Level Controls
  sff-8636: Print Power set and Power override bits

 cmis.c       | 611 ++++++++++++++++++++++++++++++++++++++++++++++++---
 cmis.h       | 107 +++++++++
 qsfp.c       |  16 +-
 qsfp.h       |   2 +-
 sff-common.h |   6 +-
 5 files changed, 702 insertions(+), 40 deletions(-)

Comments

Michal Kubecek Dec. 2, 2021, 9:45 p.m. UTC | #1
On Tue, Nov 23, 2021 at 07:40:54PM +0200, Ido Schimmel wrote:
> From: Ido Schimmel <idosch@nvidia.com>
> 
> This patchset extends ethtool(8) to retrieve, parse and print CMIS
> diagnostic information. This information includes module-level monitors
> (e.g., temperature, voltage), channel-level monitors (e.g., Tx optical
> power) and related thresholds and flags.
> 
> ethtool(8) already supports SFF-8636 (e.g., QSFP) and SFF-8472 (e.g.,
> SFP) diagnostic information, but until recently CMIS diagnostic
> information was unavailable to ethtool(8) as it resides in optional and
> banked pages.
> 
> Testing
> =======
> 
> Build tested each patch with the following configuration options:
> 
> netlink | pretty-dump
> --------|------------
> v       | v
> x       | x
> v       | x
> x       | v
> 
> Except fields that were added, no difference in output before and after
> the patchset. Tested with both PC and AOC QSFP-DD modules.
> 
> No reports from AddressSanitizer / valgrind.
> 
> Patchset overview
> =================
> 
> Patches #1-#2 are small preparations.
> 
> Patches #3-#4 retrieve (over netlink) and initialize the optional and
> banked pages in the CMIS memory map. These pages contain the previously
> mentioned diagnostic information.
> 
> Patch #5 parses and prints the CMIS diagnostic information in a similar
> fashion to the way it is done for SFF-8636.
> 
> Patches #6-#7 print a few additional fields from the CMIS EEPROM dump.
> The examples contain an ethtool command that is supported by the kernel,
> but not yet by ethtool(8). It will be sent as a follow-up patchset.
> 
> Patch #8 prints the equivalent module-level fields for SFF-8636.

The series looks good to me and I'm ready to merge it but as it is
marked "ethtool-next", I better make sure: is it OK to merge it into
master branch (targeting ethtool 5.16)? In other words, do I see
correctly that it does not depend on any features that would be missing
in 5.16 kernel?

Michal
Ido Schimmel Dec. 2, 2021, 9:52 p.m. UTC | #2
On Thu, Dec 02, 2021 at 10:45:18PM +0100, Michal Kubecek wrote:
> The series looks good to me and I'm ready to merge it but as it is
> marked "ethtool-next", I better make sure: is it OK to merge it into
> master branch (targeting ethtool 5.16)? In other words, do I see
> correctly that it does not depend on any features that would be missing
> in 5.16 kernel?

Yes
patchwork-bot+netdevbpf@kernel.org Dec. 2, 2021, 10 p.m. UTC | #3
Hello:

This series was applied to ethtool/ethtool.git (master)
by Michal Kubecek <mkubecek@suse.cz>:

On Tue, 23 Nov 2021 19:40:54 +0200 you wrote:
> From: Ido Schimmel <idosch@nvidia.com>
> 
> This patchset extends ethtool(8) to retrieve, parse and print CMIS
> diagnostic information. This information includes module-level monitors
> (e.g., temperature, voltage), channel-level monitors (e.g., Tx optical
> power) and related thresholds and flags.
> 
> [...]

Here is the summary with links:
  - [ethtool-next,1/8] sff-8636: Use an SFF-8636 specific define for maximum number of channels
    https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/commit/?id=73091cd94023
  - [ethtool-next,2/8] sff-common: Move OFFSET_TO_U16_PTR() to common header file
    https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/commit/?id=837c1662ebd6
  - [ethtool-next,3/8] cmis: Initialize Page 02h in memory map
    https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/commit/?id=8658852e0ef7
  - [ethtool-next,4/8] cmis: Initialize Banked Page 11h in memory map
    https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/commit/?id=27b42a92286b
  - [ethtool-next,5/8] cmis: Parse and print diagnostic information
    https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/commit/?id=340d88ee1289
  - [ethtool-next,6/8] cmis: Print Module State and Fault Cause
    https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/commit/?id=eae6a99f3d13
  - [ethtool-next,7/8] cmis: Print Module-Level Controls
    https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/commit/?id=82012f2dbfeb
  - [ethtool-next,8/8] sff-8636: Print Power set and Power override bits
    https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/commit/?id=d7b100713f73

You are awesome, thank you!
Michal Kubecek Dec. 2, 2021, 10:01 p.m. UTC | #4
On Thu, Dec 02, 2021 at 11:52:59PM +0200, Ido Schimmel wrote:
> On Thu, Dec 02, 2021 at 10:45:18PM +0100, Michal Kubecek wrote:
> > The series looks good to me and I'm ready to merge it but as it is
> > marked "ethtool-next", I better make sure: is it OK to merge it into
> > master branch (targeting ethtool 5.16)? In other words, do I see
> > correctly that it does not depend on any features that would be missing
> > in 5.16 kernel?
> 
> Yes

Thank you. The series is merged into master branch now.

Michal