All of lore.kernel.org
 help / color / mirror / Atom feed
From: Don Bollinger <don@thebollingers.org>
To: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, brandon_chuang@edge-core.com,
	wally_wang@accton.com, roy_lee@edge-core.com,
	rick_burchett@edge-core.com, quentin.chang@quantatw.com,
	steven.noble@bigswitch.com, jeffrey.townsend@bigswitch.com,
	scotte@cumulusnetworks.com, roopa@cumulusnetworks.com,
	David Ahern <dsa@cumulusnetworks.com>,
	luke.williams@canonical.com, Guohan Lu <gulv@microsoft.com>,
	Xin Liu <xinxliu@microsoft.com>,
	steve.joiner@finisar.com
Subject: Re: [PATCH] optoe: driver to read/write SFP/QSFP EEPROMs
Date: Mon, 11 Jun 2018 14:01:04 -0700	[thread overview]
Message-ID: <20180611210104.cdmzcdexkyte4klz@thebollingers.org> (raw)
In-Reply-To: <496e06b9-9f02-c4ae-4156-ab6221ba23fd@amd.com>

On Mon, Jun 11, 2018 at 01:33:07PM -0500, Tom Lendacky wrote:
> On 6/10/2018 11:25 PM, Don Bollinger wrote:
> > optoe is an i2c based driver that supports read/write access to all
> > the pages (tables) of MSA standard SFP and similar devices (conforming
> > to the SFF-8472 spec) and MSA standard QSFP and similar devices
> > (conforming to the SFF-8436 spec).
> > 
> > These devices provide identification, operational status and control
> > registers via an EEPROM model. These devices support one or 3 fixed
> > pages (128 bytes) of data, and one page that is selected via a page
> > register on the first fixed page.  Thus the driver's main task is
> > to map these pages onto a simple linear address space for user space
> > management applications.  See the driver code for a detailed layout.
> > 
> > EEPROM data is accessible via a bin_attribute file called 'eeprom',
> > e.g. /sys/bus/i2c/devices/24-0050/eeprom.
> > 
> > Signed-off-by: Don Bollinger <don@thebollingers.org>
> > ---
> > 
> > Why should this driver be in the Linux kernel?  SFP and QSFP devices plug
> > into switches to convert electrical to optical signals and drive the
> > optical signal over fiber optic cables.  They provide status and control
> > registers through an i2c interface similar to to other EEPROMS.  However,
> > they have a paging mechanism that is unique, which requires a different
> > driver from (for example) at24.  Various drivers have been developed for
> > this purpose, none of them support both SFP and QSFP, provide both read
> > and write access, and access all 256 architected pages.  optoe does all
> > of these.
> > 
> > optoe has been adopted and is shipping to customers  as a base module,
> > available to all platforms (switches) and used by multiple vendors and
> > platforms on both ONL (Open Network Linux) and SONiC (Microsoft's
> > 'Software for Open Networking in the Cloud').
> > 
> > This patch has been built on the latest staging-testing kernel.  It has
> > built and tested with SFP and QSFP devices on an ARM platform with a 4.9
> > kernel, and an x86 switch with a 3.16 kernel.  This patch should install
> > and build clean on any kernel from 3.16 up to the latest (as of 6/10/2018).
> > 
> > 
> >  Documentation/misc-devices/optoe.txt |   56 ++
> >  drivers/misc/eeprom/Kconfig          |   18 +
> >  drivers/misc/eeprom/Makefile         |    1 +
> >  drivers/misc/eeprom/optoe.c          | 1141 ++++++++++++++++++++++++++++++++++
> >  4 files changed, 1216 insertions(+)
> >  create mode 100644 Documentation/misc-devices/optoe.txt
> >  create mode 100644 drivers/misc/eeprom/optoe.c
> > 
> 
> There's an SFP driver under drivers/net/phy.  Can that driver be extended
> to provide this support?  Adding Russel King who developed sfp.c, as well
> at the netdev mailing list.
> 
> Thanks,
> Tom

I don't think that would work very well.  It's software, anything is
possible, but...

sfp.c appears to be working with mdio, gpio and 'sfp_bus', in addition
to i2c.  optoe only access the EEPROM, and only via i2c.  The linux
standard i2c interfaces are the only dependencies for optoe.

Also, sfp.c does not support QSFP (best I can tell), and it does not
support additional pages beyond the 256 bytes at i2c address 0x50 and
0x51.

Best I can tell, sfp.c supports SFP devices on NIC cards.  Those cards
have a very different hardware architecture from the network switches
that optoe is targeting.

  reply	other threads:[~2018-06-11 21:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-11  4:25 [PATCH] optoe: driver to read/write SFP/QSFP EEPROMs Don Bollinger
2018-06-11  4:56 ` Randy Dunlap
2018-06-11 18:31   ` Don Bollinger
2018-06-11 13:43 ` Arnd Bergmann
2018-06-14  0:40   ` Don Bollinger
2018-06-14  7:46     ` Arnd Bergmann
2018-06-15  2:41       ` Don Bollinger
2018-06-11 18:33 ` Tom Lendacky
2018-06-11 21:01   ` Don Bollinger [this message]
2018-06-12 18:11   ` Andrew Lunn
2018-06-15  2:26     ` Don Bollinger
2018-06-15  3:24       ` Florian Fainelli
2018-06-18 19:13         ` Don Bollinger
2018-06-15  7:54       ` Andrew Lunn
2018-06-18 19:41         ` Don Bollinger
2018-06-19 15:15           ` Andrew Lunn
     [not found]             ` <20180621052425.pa464laxjrebm5s3@thebollingers.org>
2018-06-21  8:11               ` Andrew Lunn
2018-06-21 20:28                 ` Don Bollinger
2018-06-22  7:28                   ` Andrew Lunn

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=20180611210104.cdmzcdexkyte4klz@thebollingers.org \
    --to=don@thebollingers.org \
    --cc=arnd@arndb.de \
    --cc=brandon_chuang@edge-core.com \
    --cc=dsa@cumulusnetworks.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gulv@microsoft.com \
    --cc=jeffrey.townsend@bigswitch.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luke.williams@canonical.com \
    --cc=quentin.chang@quantatw.com \
    --cc=rick_burchett@edge-core.com \
    --cc=roopa@cumulusnetworks.com \
    --cc=roy_lee@edge-core.com \
    --cc=scotte@cumulusnetworks.com \
    --cc=steve.joiner@finisar.com \
    --cc=steven.noble@bigswitch.com \
    --cc=thomas.lendacky@amd.com \
    --cc=wally_wang@accton.com \
    --cc=xinxliu@microsoft.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.