All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH ethtool v4 0/4] Extend module EEPROM API
@ 2021-06-17 17:05 Moshe Shemesh
  2021-06-17 17:05 ` [PATCH ethtool v4 1/4] ethtool: Add netlink handler for getmodule (-m) Moshe Shemesh
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Moshe Shemesh @ 2021-06-17 17:05 UTC (permalink / raw)
  To: Michal Kubecek, Andrew Lunn, Jakub Kicinski, Don Bollinger, netdev
  Cc: Vladyslav Tarasiuk, Moshe Shemesh

Ethtool supports module EEPROM dumps via the `ethtool -m <dev>` command.
But in current state its functionality is limited - offset and length
parameters, which are used to specify a linear desired region of EEPROM
data to dump, is not enough, considering emergence of complex module
EEPROM layouts such as CMIS.

Moreover, CMIS extends the amount of pages that may be accessible by
introducing another parameter for page addressing - banks. Besides,
currently module EEPROM is represented as a chunk of concatenated pages,
where lower 128 bytes of all pages, except page 00h, are omitted. Offset
and length are used to address parts of this fake linear memory. But in
practice drivers, which implement get_module_info() and
get_module_eeprom() ethtool ops still calculate page number and set I2C
address on their own.

This series adds support in `ethtool -m` of dumping an arbitrary page
specified by page number, bank number and I2C address. Implement netlink
handler for `ethtool -m` in order to make such requests to the kernel
and extend CLI by adding corresponding parameters.
New command line format:
 ethtool -m <dev> [hex on|off] [raw on|off] [offset N] [length N] [page N] [bank N] [i2c N]

Netlink infrastructure works on per-page basis and allows dumps of a
single page at once. But in case user requests human-readable output,
which currently may require more than one page, userspace can make such
additional calls to kernel on demand and place pages in a linked list.
It allows to get pages from cache on demand and pass them to refactored
SFF decoders.

Change Log:
v3 -> v4:
- Fixed cmis_show_all() prototype

v2 -> v3:
- Removed spec version from CMIS identifiers by changing 'CMIS4' and 'cmis4' to 'CMIS' and 'cmis' respectively.

v1 -> v2:
- Changed offset defines to specification values.
- Added default offset value (128) if page number is specified.
- Fixed return values.
- Removed page_available()



Vladyslav Tarasiuk (4):
  ethtool: Add netlink handler for getmodule (-m)
  ethtool: Refactor human-readable module EEPROM output for new API
  ethtool: Rename QSFP-DD identifiers to use CMIS
  ethtool: Update manpages to reflect changes to getmodule (-m) command

 Makefile.am             |   3 +-
 cmis.c                  | 359 +++++++++++++++++++++++++++++++++++++++++
 cmis.h                  | 128 +++++++++++++++
 ethtool.8.in            |  14 ++
 ethtool.c               |   4 +
 internal.h              |  12 ++
 list.h                  |  34 ++++
 netlink/desc-ethtool.c  |  13 ++
 netlink/extapi.h        |   2 +
 netlink/module-eeprom.c | 416 ++++++++++++++++++++++++++++++++++++++++++++++++
 qsfp-dd.c               | 333 --------------------------------------
 qsfp-dd.h               | 125 ---------------
 qsfp.c                  | 130 ++++++++-------
 qsfp.h                  |  51 +++---
 sff-common.c            |   3 +
 sff-common.h            |   3 +-
 16 files changed, 1090 insertions(+), 540 deletions(-)
 create mode 100644 cmis.c
 create mode 100644 cmis.h
 create mode 100644 list.h
 create mode 100644 netlink/module-eeprom.c
 delete mode 100644 qsfp-dd.c
 delete mode 100644 qsfp-dd.h

-- 
1.8.2.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-07-08 23:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-17 17:05 [PATCH ethtool v4 0/4] Extend module EEPROM API Moshe Shemesh
2021-06-17 17:05 ` [PATCH ethtool v4 1/4] ethtool: Add netlink handler for getmodule (-m) Moshe Shemesh
2021-06-17 17:05 ` [PATCH ethtool v4 2/4] ethtool: Refactor human-readable module EEPROM output for new API Moshe Shemesh
2021-06-17 17:05 ` [PATCH ethtool v4 3/4] ethtool: Rename QSFP-DD identifiers to use CMIS Moshe Shemesh
2021-06-17 17:05 ` [PATCH ethtool v4 4/4] ethtool: Update manpages to reflect changes to getmodule (-m) command Moshe Shemesh
2021-07-08 23:40 ` [PATCH ethtool v4 0/4] Extend module EEPROM API Michal Kubecek

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.