A mirror of the official Linux kernel repository just in case
Go to file
Jakub Kicinski fe28afe23e Merge branch 'mlxsw-core-extend-qsfp-eeprom-size'
Ido Schimmel says:

====================
Vadim says:

This patch set extends the size of QSFP EEPROM for the cable types
SSF-8436 and SFF-8636 from 256 bytes to 640 bytes. This allows ethtool
to show correct information for these cable types (more details below).

Patch #1 adds a macro that computes the EEPROM page number from the
provided offset specified in the request.

Patch #2 teaches the driver to access the information stored in the
upper pages of the QSFP memory map.

Details and examples:

SFF-8436 specification defines pages 0, 1, 2 and 3. Page 0 contains
lower memory page offsets (from 0x00 to 0x7f) and upper page offsets
(from 0x80 to 0xfe). Upper pages 1, 2 and 3 are optional and can be
empty.

Page 1 is provided if upper page 0 byte 0xc3 bit 6 is set.
Page 2 is provided if upper page 0 byte 0xc3 bit 7 is set.
Page 3 is provided if lower page 0 byte 0x02 bit 2 is cleared.
Offset 0xc3 for the upper page is provided as 0x43 = 0xc3 - 0x80.

As a result of exposing 256 bytes only, ethtool shows wrong information
for pages 1, 2 and 3. In the below hex dump from ethtool for a cable
compliant to SFF-8636 specification, it can be seen that EEPROM of this
device contains optical diagnostic page (lower page 0 byte 0x02 bit 2 is
cleared), but it is not exposed, as the length defined for this type is
256 bytes.

$ ethtool -m sfp42 hex on
Offset          Values
------          ------
0x0000:         11 07 00 ff 00 ff 00 00 00 55 55 00 00 00 00 00
0x0010:         00 00 00 00 00 00 2a 90 00 00 82 ae 00 00 00 00
0x0020:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0030:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0040:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0050:         00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00
0x0060:         00 00 ff 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0070:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0080:         11 8c 0c 80 00 00 00 00 00 00 00 05 ff 00 00 23
0x0090:         00 00 32 00 4d 65 6c 6c 61 6e 6f 78 20 20 20 20
0x00a0:         20 20 20 20 00 00 02 c9 4d 4d 41 31 42 30 30 2d
0x00b0:         53 53 31 20 20 20 20 20 41 32 42 68 0b b8 46 05
0x00c0:         02 07 f5 9e 4d 54 31 38 33 34 46 54 30 33 38 34
0x00d0:         36 20 20 20 31 38 30 37 30 33 00 00 0c 10 67 c2
0x00e0:         38 32 36 46 4d 41 32 32 36 49 30 31 31 35 20 20
0x00f0:         00 00 00 00 00 00 00 00 00 00 01 00 0e 00 00 00

After changing the length returned by get_module_info() callback from
256 bytes to 640 bytes, the upper pages 1, 2 and 3 are exposed by
ethtool. In the below hex dump from the same cable it can be seen that
the optical diagnostic page (page 3, from offset 0x0200) has non-zero
data.

$ ethtool -m sfp42 hex on
Offset          Values
------          ------
0x0000:         11 07 00 ff 00 ff 00 00 00 55 55 00 00 00 00 00
0x0010:         00 00 00 00 00 00 27 79 00 00 82 c5 00 00 00 00
0x0020:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0030:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0040:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0050:         00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00
0x0060:         00 00 ff 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0070:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0080:         11 8c 0c 80 00 00 00 00 00 00 00 05 ff 00 00 23
0x0090:         00 00 32 00 4d 65 6c 6c 61 6e 6f 78 20 20 20 20
0x00a0:         20 20 20 20 00 00 02 c9 4d 4d 41 31 42 30 30 2d
0x00b0:         53 53 31 20 20 20 20 20 41 32 42 68 0b b8 46 05
0x00c0:         02 07 f5 9e 4d 54 31 38 33 34 46 54 30 33 38 34
0x00d0:         36 20 20 20 31 38 30 37 30 33 00 00 0c 10 67 c2
0x00e0:         38 32 36 46 4d 41 32 32 36 49 30 31 31 35 20 20
0x00f0:         00 00 00 00 00 00 00 00 00 00 01 00 0e 00 00 00
0x0100:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0110:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0120:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0130:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0140:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0150:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0160:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0170:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0180:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0190:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x01a0:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x01b0:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x01c0:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x01d0:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x01e0:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x01f0:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0200:         50 00 f6 00 46 00 00 00 00 00 00 00 00 00 00 00
0x0210:         88 b8 79 18 87 5a 7a 76 00 00 00 00 00 00 00 00
0x0220:         00 00 00 00 00 00 00 00 00 00 18 30 0e 61 60 b7
0x0230:         87 71 01 d3 43 e2 03 a5 10 9a 0a ba 0f a0 0b b8
0x0240:         87 71 02 d4 43 e2 05 a5 00 00 00 00 00 00 00 00
0x0250:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0260:         a7 03 00 00 00 00 00 00 00 00 44 44 22 22 11 11
0x0270:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

And 'ethtool -m sfp42' shows the real values for the below fields, while
before it exposed zeros for these fields:

Laser bias current high alarm threshold   : 8.500 mA
Laser bias current low alarm threshold    : 5.492 mA
Laser bias current high warning threshold : 8.000 mA
Laser bias current low warning threshold  : 6.000 mA
Laser output power high alarm threshold   : 3.4673 mW / 5.40 dBm
Laser output power low alarm threshold    : 0.0724 mW / -11.40 dBm
Laser output power high warning threshold : 1.7378 mW / 2.40 dBm
Laser output power low warning threshold  : 0.1445 mW / -8.40 dBm
Module temperature high alarm threshold   : 80.00 degrees C / 176.00 F
Module temperature low alarm threshold    : -10.00 degrees C / 14.00 F
Module temperature high warning threshold : 70.00 degrees C / 158.00 F
Module temperature low warning threshold  : 0.00 degrees C / 32.00 F
Module voltage high alarm threshold       : 3.5000 V
Module voltage low alarm threshold        : 3.1000 V
====================

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
2019-10-22 11:21:00 -07:00
arch Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-10-20 10:43:00 -07:00
block blk-rq-qos: fix first node deletion of rq_qos_del() 2019-10-15 10:13:13 -06:00
certs PKCS#7: Refactor verify_pkcs7_signature() 2019-08-05 18:40:18 -04:00
crypto Merge branch 'next-lockdown' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2019-09-28 08:14:15 -07:00
Documentation Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-10-20 10:43:00 -07:00
drivers mlxsw: core: Extend QSFP EEPROM size for ethtool 2019-10-22 10:30:41 -07:00
fs Merge branch 'akpm' (patches from Andrew) 2019-10-19 06:53:59 -04:00
include Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-10-20 10:43:00 -07:00
init init: Support mounting root file systems over SMB 2019-10-02 12:15:15 -04:00
ipc ipc/sem.c: convert to use built-in RCU list checking 2019-09-25 17:51:41 -07:00
kernel Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-10-20 10:43:00 -07:00
lib copy-struct-from-user-v5.4-rc4 2019-10-18 18:19:04 -04:00
LICENSES LICENSES: Rename other to deprecated 2019-05-03 06:34:32 -06:00
mm mm/thp: allow dropping THP from page cache 2019-10-19 06:32:33 -04:00
net net/sched: act_police: re-use tcf_tm_dump() 2019-10-21 11:22:40 -07:00
samples Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-10-20 10:43:00 -07:00
scripts Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-10-20 10:43:00 -07:00
security Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-10-20 10:43:00 -07:00
sound ALSA: hda - Force runtime PM on Nvidia HDMI codecs 2019-10-17 17:45:32 +02:00
tools tc-testing: updated pedit TDC tests 2019-10-21 10:38:51 -07:00
usr kbuild: update compile-test header list for v5.4-rc2 2019-10-05 15:29:49 +09:00
virt KVM/arm fixes for 5.4, take #1 2019-10-03 12:08:50 +02:00
.clang-format clang-format: Update with the latest for_each macro list 2019-08-31 10:00:51 +02:00
.cocciconfig
.get_maintainer.ignore Opt out of scripts/get_maintainer.pl 2019-05-16 10:53:40 -07:00
.gitattributes
.gitignore Modules updates for v5.4 2019-09-22 10:34:46 -07:00
.mailmap Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2019-09-18 12:34:53 -07:00
COPYING COPYING: use the new text with points to the license files 2018-03-23 12:41:45 -06:00
CREDITS MAINTAINERS: Remove Simon as Renesas SoC Co-Maintainer 2019-10-10 08:12:51 -07:00
Kbuild kbuild: do not descend to ./Kbuild when cleaning 2019-08-21 21:03:58 +09:00
Kconfig docs: kbuild: convert docs to ReST and rename to *.rst 2019-06-14 14:21:21 -06:00
MAINTAINERS Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-10-20 10:43:00 -07:00
Makefile Linux 5.4-rc3 2019-10-13 16:37:36 -07:00
README Drop all 00-INDEX files from Documentation/ 2018-09-09 15:08:58 -06:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.