mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Don Bollinger" <don@thebollingers.org>
To: "'Andrew Lunn'" <andrew@lunn.ch>
Cc: "'Jakub Kicinski'" <kuba@kernel.org>, <arndb@arndb.de>,
	<gregkh@linuxfoundation.org>, <linux-kernel@vger.kernel.org>,
	<brandon_chuang@edge-core.com>, <wally_wang@accton.com>,
	<aken_liu@edge-core.com>, <gulv@microsoft.com>,
	<jolevequ@microsoft.com>, <xinxliu@microsoft.com>,
	"'netdev'" <netdev@vger.kernel.org>,
	"'Moshe Shemesh'" <moshe@nvidia.com>, <don@thebollingers.org>
Subject: RE: [PATCH v2] eeprom/optoe: driver to read/write SFP/QSFP/CMIS EEPROMS
Date: Fri, 26 Mar 2021 14:09:36 -0700	[thread overview]
Message-ID: <011c01d72284$544c8f50$fce5adf0$@thebollingers.org> (raw)
In-Reply-To: <YF5GA1RbaM1Ht3nl@lunn.ch>

On Fri, Mar 26, 2021 at 01:37PM -0700, Andrew Lunn wrote:
> On Fri, Mar 26, 2021 at 01:16:14PM -0700, Don Bollinger wrote:
> > > > In my community, the SFP/QSFP/CMIS devices (32 to 128 of them per
> > > > switch) often cost more than the switch itself.  Consumers (both
> > > > vendors and
> > > > customers) extensively test these devices to ensure correct and
> > > > reliable operation.  Then they buy them literally by the millions.
> > > > Quirks lead to quick rejection in favor of reliable parts from
> > > > reliable vendors.  In this environment, for completely different
> > > > reasons, optoe does not need to handle quirks.
> > >
> > > Well, if optoe were to be merged, it would not be just for your
> community.
> > It
> > > has to work for everybody who wants to use the Linux kernel with an
> SFP.
> > > You cannot decide to add a KAPI which just supports a subset of
> > > SFPs. It needs to support as many as possible, warts and all.
> > >
> > > So how would you handle these SFPs with the optoe KAPI?
> >
> > Just like they are handled now.  Folks who use your stack would filter
> > through sfp.c, with all the quirk handling, and eventually call optoe
> > for the actual device access.  Folks who don't use kernel networking
> > would call optoe directly and limit themselves to well behaved SFPs,
> > or would handle quirks in user space.  You think that's dumb, but
> > there is clearly a market for that approach.  It is working, at scale,
today.
> >
> > BTW, why can't we have a driver
> 
> You keep missing the point. I always refer to the KAPI. The driver we can
> rework and rework, throw away and reimplement, as much as we want.
> The KAPI cannot be changed, it is ABI. It is pretty much frozen the day
the
> code is first committed.

Maybe I don't understand what you mean by KAPI.  The KAPI that optoe exposes
is in two parts.

First, it makes the EEPROM accessible via the nvmem() interface, an existing
KAPI that I call from optoe.  at24 implemented it, I made use of it.  This
interface exposes EEPROM data to user space through a defined sysfs() file.
I didn't invent this, nor am I proposing it, it already exists.

Second, it specifies how the data in the EEPROM is accessed.  It says that
low memory is in offset 0-127, and paged memory starts at offset (128 +
(page * 128)).  For SFP devices, memory at i2c address 0x50 is the first 256
bytes, and everything at 0x51 is pushed up 256 bytes.  This is exactly the
behavior of ethtool.  Again, I didn't invent this, I adopted the existing
convention for how to flatten the SFP/QSFP/CMIS address space.

With these two parts, EEPROM data can be accessed by standard open(2),
seek(2), read(2), write(2) calls.  Nothing special there, the actual syntax
is as old school and standard as you can possibly get.

So, what is wrong with that KAPI?

The only thing wrong I can see is that it doesn't use the kernel network
stack.  Here's where "you keep missing the point".  The kernel network stack
is not being used in these systems.  Implementing EEPROM access through
ethtool is of course possible, but it is a lot of work with no benefit on
these systems.  The simple approach works.  Let me use it.

> 
> The optoe KAPI needs to handle these 'interesting' SFP modules. The KAPI
> design needs to be flexible enough that the driver underneath it can be
> extended to support these SFPs. The code does not need to be there, but
> the KAPI design needs to allow it. And i personally cannot see how the
optoe
> KAPI can efficiently support these SFPs.

Help me understand.  Your KAPI specifies ethtool as the KAPI, and the
ethtool/netlink stack as the interface through which the data flows.  As I
see it, your KAPI only specifies i2c address, page, bank, offset and length.
How does your KAPI support interesting SFP modules but mine does not?  optoe
could be reworked ad infinitum to implement support for quirks, just as
yours can.  Neither has any hint of quirks in the KAPI.

Don


  reply	other threads:[~2021-03-26 21:10 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-15 19:38 Don Bollinger
2021-02-26 22:34 ` Andrew Lunn
2021-02-27  2:46   ` Don Bollinger
2021-02-27 16:23     ` Andrew Lunn
2021-03-01 20:00     ` Don Bollinger
2021-03-01 20:45       ` Andrew Lunn
2021-03-05 19:07         ` Don Bollinger
2021-03-05 22:55           ` Jakub Kicinski
2021-03-06  2:30             ` Don Bollinger
2021-03-06  3:31               ` Andrew Lunn
2021-03-12 19:04                 ` Don Bollinger
2021-03-12 19:59                   ` Andrew Lunn
2021-03-13 21:35                     ` Don Bollinger
2021-03-15 17:39                       ` Jakub Kicinski
2021-03-15 18:09                         ` Don Bollinger
2021-03-17 18:15                           ` Andrew Lunn
2021-03-20 16:10                             ` Pali Rohár
2021-03-26 18:43                               ` Don Bollinger
2021-03-29 22:13                                 ` Pali Rohár
2021-03-23 20:32                             ` Don Bollinger
2021-03-23 22:29                               ` Andrew Lunn
2021-03-26 18:43                                 ` Don Bollinger
2021-03-26 19:46                                   ` Andrew Lunn
2021-03-26 20:16                                     ` Don Bollinger
2021-03-26 20:37                                       ` Andrew Lunn
2021-03-26 21:09                                         ` Don Bollinger [this message]
2021-03-26 21:54                                           ` Andrew Lunn
2021-03-26 22:30                                             ` Don Bollinger
2021-03-27 15:25                                               ` Andrew Lunn
2021-03-27 21:20                                                 ` Don Bollinger
2021-03-27 12:40                                           ` Greg KH
2021-03-23 14:12 ` Greg KH
2021-03-23 18:43   ` Don Bollinger
2021-03-23 18:59     ` 'Greg KH'
2021-03-23 19:08       ` Don Bollinger
2021-03-23 19:12         ` 'Greg KH'

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='011c01d72284$544c8f50$fce5adf0$@thebollingers.org' \
    --to=don@thebollingers.org \
    --cc=aken_liu@edge-core.com \
    --cc=andrew@lunn.ch \
    --cc=arndb@arndb.de \
    --cc=brandon_chuang@edge-core.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gulv@microsoft.com \
    --cc=jolevequ@microsoft.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=moshe@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®