linux/net/ethtool
Ido Schimmel eaa517b77e ethtool: cmis_cdb: Fix incorrect read / write length extension
The 'read_write_len_ext' field in 'struct ethtool_cmis_cdb_cmd_args'
stores the maximum number of bytes that can be read from or written to
the Local Payload (LPL) page in a single multi-byte access.

Cited commit started overwriting this field with the maximum number of
bytes that can be read from or written to the Extended Payload (LPL)
pages in a single multi-byte access. Transceiver modules that support
auto paging can advertise a number larger than 255 which is problematic
as 'read_write_len_ext' is a 'u8', resulting in the number getting
truncated and firmware flashing failing [1].

Fix by ignoring the maximum EPL access size as the kernel does not
currently support auto paging (even if the transceiver module does) and
will not try to read / write more than 128 bytes at once.

[1]
Transceiver module firmware flashing started for device enp177s0np0
Transceiver module firmware flashing in progress for device enp177s0np0
Progress: 0%
Transceiver module firmware flashing encountered an error for device enp177s0np0
Status message: Write FW block EPL command failed, LPL length is longer
	than CDB read write length extension allows.

Fixes: 9a3b0d078b ("net: ethtool: Add support for writing firmware blocks using EPL payload")
Reported-by: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>
Closes: https://lore.kernel.org/netdev/20250402183123.321036-3-michael.chan@broadcom.com/
Tested-by: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Link: https://patch.msgid.link/20250409112440.365672-1-idosch@nvidia.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2025-04-10 14:32:43 +02:00
..
bitset.c ethtool: Fix wrong mod state in case of verbose and no_mask bitset 2024-12-04 18:54:43 -08:00
bitset.h ethtool: add ethnl_parse_bitset() helper 2020-03-12 15:32:32 -07:00
cabletest.c net: move misc netdev_lock flavors to a separate header 2025-03-08 09:06:50 -08:00
channels.c ethtool: refactor checking max channels 2024-08-09 21:52:13 -07:00
cmis.h ethtool: cmis_cdb: Fix incorrect read / write length extension 2025-04-10 14:32:43 +02:00
cmis_cdb.c ethtool: cmis_cdb: Fix incorrect read / write length extension 2025-04-10 14:32:43 +02:00
cmis_fw_update.c net: move misc netdev_lock flavors to a separate header 2025-03-08 09:06:50 -08:00
coalesce.c net: ethtool: Fix the panic caused by dev being null when dumping coalesce 2024-07-01 13:43:50 +01:00
common.c net: ethtool: fix ethtool_ringparam_get_cfg() returns a hds_thresh value always as 0. 2025-04-07 11:00:00 -07:00
common.h net: ethtool: Export the link_mode_params definitions 2025-03-18 09:03:11 +01:00
debug.c ethtool: netlink: always pass genl_info to .prepare_data 2023-08-15 15:01:03 -07:00
eee.c net: ethtool: eee: Remove legacy _u32 from keee 2024-02-28 12:18:05 +00:00
eeprom.c ethtool: move firmware flashing flag to struct ethtool_netdev_state 2024-07-04 15:45:15 -07:00
features.c net: move misc netdev_lock flavors to a separate header 2025-03-08 09:06:50 -08:00
fec.c ethtool: netlink: always pass genl_info to .prepare_data 2023-08-15 15:01:03 -07:00
ioctl.c net: hold instance lock during NETDEV_CHANGE 2025-04-07 11:13:39 -07:00
linkinfo.c ethtool: Don't check for NULL info in prepare_data callbacks 2024-08-01 09:03:52 -07:00
linkmodes.c ethtool: Don't check for NULL info in prepare_data callbacks 2024-08-01 09:03:52 -07:00
linkstate.c net: ethtool: netlink: Allow NULL nlattrs when getting a phy_device 2025-03-04 17:12:01 -08:00
Makefile net: ethtool: Add support for tsconfig command to get/set hwtstamp config 2024-12-16 12:51:41 +00:00
mm.c ethtool: netlink: always pass genl_info to .prepare_data 2023-08-15 15:01:03 -07:00
module.c net: move misc netdev_lock flavors to a separate header 2025-03-08 09:06:50 -08:00
module_fw.h ethtool: Add ability to flash transceiver modules' firmware 2024-06-28 10:48:23 +01:00
netlink.c net: ethtool: Don't call .cleanup_data when prepare_data fails 2025-04-08 15:34:15 +02:00
netlink.h net: ethtool: netlink: Allow NULL nlattrs when getting a phy_device 2025-03-04 17:12:01 -08:00
pause.c ethtool: netlink: always pass genl_info to .prepare_data 2023-08-15 15:01:03 -07:00
phc_vclocks.c ethtool: netlink: always pass genl_info to .prepare_data 2023-08-15 15:01:03 -07:00
phy.c net: move misc netdev_lock flavors to a separate header 2025-03-08 09:06:50 -08:00
plca.c net: ethtool: netlink: Allow NULL nlattrs when getting a phy_device 2025-03-04 17:12:01 -08:00
privflags.c ethtool: netlink: always pass genl_info to .prepare_data 2023-08-15 15:01:03 -07:00
pse-pd.c net: ethtool: netlink: Allow NULL nlattrs when getting a phy_device 2025-03-04 17:12:01 -08:00
rings.c net: ethtool: fix ioctl confusing drivers about desired HDS user config 2025-02-24 14:15:42 -08:00
rss.c net: move misc netdev_lock flavors to a separate header 2025-03-08 09:06:50 -08:00
stats.c net: ethtool: netlink: Allow NULL nlattrs when getting a phy_device 2025-03-04 17:12:01 -08:00
strset.c net: ethtool: netlink: Allow NULL nlattrs when getting a phy_device 2025-03-04 17:12:01 -08:00
ts.h net: ethtool: tsinfo: Enhance tsinfo to support several hwtstamp by net topology 2024-12-16 12:51:41 +00:00
tsconfig.c net: ethtool: tsconfig: Fix netlink type of hwtstamp flags 2025-02-06 16:35:21 -08:00
tsinfo.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-03-13 23:08:11 +01:00
tunnels.c genetlink: use attrs from struct genl_info 2023-08-15 15:00:45 -07:00
wol.c net: move ethtool-related netdev state into its own struct 2024-06-28 18:53:17 -07:00