]> Gentwo Git Trees - linux/.git/commit
eth: fbnic: Read module EEPROM
authorMohsin Bashir <mohsin.bashr@gmail.com>
Mon, 22 Sep 2025 23:18:55 +0000 (16:18 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 25 Sep 2025 09:58:49 +0000 (11:58 +0200)
commitbb6a22651b893c08c7855b34aa618b2a71bece9e
tree9b0699a1b9842adb21563b7c7071b1c94ab62ad1
parenta1f1f2422e098485b09e55a492de05cf97f9954d
eth: fbnic: Read module EEPROM

Add support to read module EEPROM for fbnic. Towards this, add required
support to issue a new command to the firmware and to receive the response
to the corresponding command.

Create a local copy of the data in the completion struct before writing to
ethtool_module_eeprom to avoid writing to data in case it is freed. Given
that EEPROM pages are small, the overhead of additional copy is
negligible.

Do not block API with explicit checks since API has appropriate checks in
place for length, offset, and page.

Explicitly check bank, page, offset, and length in
fbnic_fw_parse_qsfp_read_resp() to match EEPROM read responses to the
correct request. This is important because if the driver times out waiting
for an EEPROM read response, a subsequent read request with different
values is susceptible to receiving an erroneous response (i.e., the
response to the previous request).

Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Mohsin Bashir <mohsin.bashr@gmail.com>
Link: https://patch.msgid.link/20250922231855.3717483-1-mohsin.bashr@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c
drivers/net/ethernet/meta/fbnic/fbnic_fw.c
drivers/net/ethernet/meta/fbnic/fbnic_fw.h