linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Don Bollinger <don@thebollingers.org>
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>
Subject: Re: [PATCH v2] eeprom/optoe: driver to read/write SFP/QSFP/CMIS EEPROMS
Date: Fri, 26 Mar 2021 22:54:09 +0100	[thread overview]
Message-ID: <YF5YAQvQXCn4QapJ@lunn.ch> (raw)
In-Reply-To: <011c01d72284$544c8f50$fce5adf0$@thebollingers.org>

> 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.

Nearly. It specifies netlink and the netlink messages definitions.
They happen to be in the ethtool group, but there is no requirement to
use ethtool(1).

But there is a bit more to it.

Either the MAC driver implements the needed code, or it defers to the
generic sfp.c code. In both cases, you have access to the GPIO
lines.

If you are using the generic sfp.c, the Device Tree definitions of the
GPIOs become part of the KAPI. DT is consider ABI.

So the low level code knows when there was been a hotplug. It then can
determine what quirks to apply for all future reads until the module
is unplugged.

Your KAPI is missing how optoe gets access to the GPIOs. Without
knowing if the module has been hotplugged, in a robust manor, you have
problems with quirks. For every userspace read, you need to assume the
module has been changed, read the ID information from the EEPROM a
byte at a time, figure out what quirks to apply, and then do the user
requested read. I doubt that is good for performance. The design which
has been chosen is that userspace is monitoring the GPIO lines. So to
make it efficient, your KAPI need some way to pass down that the
module has/has not been hot-plugged since the last read.

Or do you see some other way to implement these quirks?

       Andrew

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

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-15 19:38 [PATCH v2] eeprom/optoe: driver to read/write SFP/QSFP/CMIS EEPROMS 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
2021-03-26 21:54                                           ` Andrew Lunn [this message]
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=YF5YAQvQXCn4QapJ@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=aken_liu@edge-core.com \
    --cc=arndb@arndb.de \
    --cc=brandon_chuang@edge-core.com \
    --cc=don@thebollingers.org \
    --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;
as well as URLs for NNTP newsgroup(s).