netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vladyslav Tarasiuk <vladyslavt@nvidia.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Moshe Shemesh <moshe@nvidia.com>,
	Jakub Kicinski <kuba@kernel.org>,
	"Moshe Shemesh" <moshe@mellanox.com>,
	"David S. Miller" <davem@davemloft.net>,
	Adrian Pop <pop.adrian61@gmail.com>,
	Michal Kubecek <mkubecek@suse.cz>, <netdev@vger.kernel.org>,
	Maxim Mikityanskiy <maximmi@nvidia.com>, <vladyslavt@nvidia.com>
Subject: Re: [PATCH net-next v2 0/2] Add support for DSFP transceiver type
Date: Mon, 4 Jan 2021 17:24:11 +0200	[thread overview]
Message-ID: <3c4a5b4f-86bd-19df-c40c-db1452ac43b2@nvidia.com> (raw)
In-Reply-To: <X+yehiw/6DYUyPzy@lunn.ch>


On 30-Dec-20 17:36, Andrew Lunn wrote:
> On Wed, Dec 30, 2020 at 03:55:02PM +0200, Vladyslav Tarasiuk wrote:
>> On 29-Dec-20 18:25, Andrew Lunn wrote:
>>>> Hi Andrew,
>>>>
>>>> Following this conversation, I wrote some pseudocode checking if I'm on
>>>> right path here.
>>>> Please review:
>>>>
>>>> struct eeprom_page {
>>>>           u8 page_number;
>>>>           u8 bank_number;
>>>>           u16 offset;
>>>>           u16 data_length;
>>>>           u8 *data;
>>>> }
>>> I'm wondering about offset and data_length, in this context. I would
>>> expect you always ask the kernel for the full page, not part of
>>> it. Even when user space asks for just part of a page. That keeps you
>>> cache management simpler.
>> As far as I know, there may be bytes, which may change on read.
>> For example, clear on read values in CMIS 4.0.
> Ah, i did not know there were such bits. I will go read the spec. But
> it should not really matter. If the SFP driver is interested in these
> bits, it will have to intercept the read and act on the values.

But in case user requests a few bytes from a page with clear-on-read
values, reading full page will clear all such bytesfrom user perspective
even if they were not requested. Driver may intercept the read, but for
user it will look like those bytes were not set.

Current user interface allows arbitrary reads, so I wanted to keep this
behavior pretty much exactly like it is now - request specific part of
a page, get this part without any extra data.

>> I wasn't aware of that. It complicates things a bit, should we add a
>> parameter of i2c address? So in this case page 0 will be with i2c
>> address A0h. And if user needs page 0 from i2c address A2h, he will
>> specify it in command line.
> Not on the command line. You should be able to determine from reading
> page 0 at A0h is the diagnostics are at A2h or a page of A0h. That is
> the whole point of this API, we decode the first page, and that tells
> us what other pages should be available. So adding the i2c address to
> the netlink message would be sensible. And i would not be too
> surprised if there are SFPs with proprietary registers on other
> addresses, which could be interesting to dump, if you can get access
> to the needed datasheets.
Without command line argument user will not be able to request a single
A2h page, for example. He will see it only in some kind of general dump -
with human-readable decoder usage or multiple page dump.

And same goes forpages on other i2c addresses. How to know what to dump,
if user does not provide i2c address and there is no way to know what to
request from proprietary SFPs?

Thanks,
Vlad


  reply	other threads:[~2021-01-04 15:25 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-23  9:19 [PATCH net-next v2 0/2] Add support for DSFP transceiver type Moshe Shemesh
2020-11-23  9:19 ` [PATCH net-next v2 1/2] ethtool: Add CMIS 4.0 module type to UAPI Moshe Shemesh
2020-11-23 22:40   ` Jesse Brandeburg
2020-11-25 10:41     ` Moshe Shemesh
2020-11-23  9:19 ` [PATCH net-next v2 2/2] net/mlx5e: Add DSFP EEPROM dump support to ethtool Moshe Shemesh
2020-11-24  1:14 ` [PATCH net-next v2 0/2] Add support for DSFP transceiver type Andrew Lunn
2020-11-24 21:16   ` Jakub Kicinski
2020-11-25 10:40     ` Moshe Shemesh
2020-11-25 14:18       ` Andrew Lunn
2020-11-26 14:23         ` Moshe Shemesh
2020-11-26 15:21           ` Andrew Lunn
2020-11-27 15:12             ` Moshe Shemesh
2020-11-27 15:56               ` Andrew Lunn
2020-12-29 10:23                 ` Vladyslav Tarasiuk
2020-12-29 16:25                   ` Andrew Lunn
2020-12-30 13:55                     ` Vladyslav Tarasiuk
2020-12-30 15:36                       ` Andrew Lunn
2021-01-04 15:24                         ` Vladyslav Tarasiuk [this message]
2021-01-04 15:48                           ` 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=3c4a5b4f-86bd-19df-c40c-db1452ac43b2@nvidia.com \
    --to=vladyslavt@nvidia.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=maximmi@nvidia.com \
    --cc=mkubecek@suse.cz \
    --cc=moshe@mellanox.com \
    --cc=moshe@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pop.adrian61@gmail.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).