From: Andrew Lunn <andrew@lunn.ch>
To: Moshe Shemesh <moshe@nvidia.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Adrian Pop <pop.adrian61@gmail.com>,
Michal Kubecek <mkubecek@suse.cz>,
Don Bollinger <don@thebollingers.org>,
netdev@vger.kernel.org,
Vladyslav Tarasiuk <vladyslavt@nvidia.com>
Subject: Re: [RFC PATCH V3 net-next 1/5] ethtool: Allow network drivers to dump arbitrary EEPROM data
Date: Thu, 18 Mar 2021 23:16:16 +0100 [thread overview]
Message-ID: <YFPRMEa/CfZKsMyA@lunn.ch> (raw)
In-Reply-To: <3d8b9b2b-25e2-3812-2daf-09f1c5088eb0@nvidia.com>
> > > +Request contents:
> > > +
> > > + ===================================== ====== ==========================
> > > + ``ETHTOOL_A_EEPROM_DATA_HEADER`` nested request header
> > > + ``ETHTOOL_A_EEPROM_DATA_OFFSET`` u32 offset within a page
> > > + ``ETHTOOL_A_EEPROM_DATA_LENGTH`` u32 amount of bytes to read
> > I wonder if offset and length should be u8. At most, we should only be
> > returning a 1/2 page, so 128 bytes. We don't need a u32.
>
>
> That's right when page is given, but user may have commands that
> used to work on the ioctl KAPI with offset higher than one page.
CMIS section 5.4.1 says:
The slave maintains an internal current byte address counter
containing the byte address accessed during the latest read or write
operation incremented by one with roll-over as follows: The current
byte address counter rolls-over after a read or write operation at
the last byte address of the current 128-byte memory page (127 or
255) to the first byte address (0 or 128) of the same 128-byte
memory page.
This wrapping is somewhat unexpected. If the user access is for a read
starting at 120 and a length of 20, they get bytes 120-127 followed by
0-11. The user is more likely to be expecting 120-139.
We have two ways to address this:
1) We limit reads to a maximum of a 1/2 page, and the start and end
point needs to be within that 1/2 page.
2) We detect that the read is going to go across a 1/2 page boarder,
and perform two reads to the MAC driver, and glue the data back
together again in the ethtool core.
What i don't want is to leave the individual drivers to solve this,
because i expect some of them will get it wrong.
Andrew
next prev parent reply other threads:[~2021-03-18 22:17 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-15 17:12 [RFC PATCH V3 net-next 0/5] ethtool: Extend module EEPROM dump API Moshe Shemesh
2021-03-15 17:12 ` [RFC PATCH V3 net-next 1/5] ethtool: Allow network drivers to dump arbitrary EEPROM data Moshe Shemesh
2021-03-15 21:01 ` Jakub Kicinski
2021-03-16 17:59 ` Moshe Shemesh
2021-03-15 22:31 ` Don Bollinger
2021-03-16 18:23 ` Moshe Shemesh
2021-03-16 21:00 ` Don Bollinger
2021-03-18 22:36 ` Andrew Lunn
2021-03-18 13:03 ` Andrew Lunn
2021-03-18 14:25 ` Moshe Shemesh
2021-03-18 22:16 ` Andrew Lunn [this message]
2021-03-18 15:16 ` Michal Kubecek
2021-03-15 17:12 ` [RFC PATCH V3 net-next 2/5] net/mlx5: Refactor module EEPROM query Moshe Shemesh
2021-03-15 17:12 ` [RFC PATCH V3 net-next 3/5] net/mlx5: Implement get_module_eeprom_data_by_page() Moshe Shemesh
2021-03-15 17:12 ` [RFC PATCH V3 net-next 4/5] net/mlx5: Add support for DSFP module EEPROM dumps Moshe Shemesh
2021-03-15 17:12 ` [RFC PATCH V3 net-next 5/5] ethtool: Add fallback to get_module_eeprom from netlink command Moshe Shemesh
2021-03-15 22:31 ` Don Bollinger
2021-03-16 18:26 ` Moshe Shemesh
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=YFPRMEa/CfZKsMyA@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=don@thebollingers.org \
--cc=kuba@kernel.org \
--cc=mkubecek@suse.cz \
--cc=moshe@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pop.adrian61@gmail.com \
--cc=vladyslavt@nvidia.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.