[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0d65385b-a59d-4dd0-a351-2c66a11068f8@lunn.ch>
Date: Tue, 21 May 2024 22:21:19 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Krzysztof Olędzki <ole@....pl>
Cc: Michal Kubecek <mkubecek@...e.cz>, Moshe Shemesh <moshe@...dia.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: "netlink error: Invalid argument" with ethtool-5.13+ on recent
kernels due to "ethtool: Add netlink handler for getmodule (-m)" -
25b64c66f58d3df0ad7272dda91c3ab06fe7a303, also no SFP-DOM support via
netlink?
> sending genetlink packet (76 bytes):
> msg length 76 ethool ETHTOOL_MSG_MODULE_EEPROM_GET
> ETHTOOL_MSG_MODULE_EEPROM_GET
> ETHTOOL_A_MODULE_EEPROM_HEADER
> ETHTOOL_A_HEADER_DEV_NAME = "eth3"
> ETHTOOL_A_MODULE_EEPROM_LENGTH = 128
> ETHTOOL_A_MODULE_EEPROM_OFFSET = 128
> ETHTOOL_A_MODULE_EEPROM_PAGE = 3
> ETHTOOL_A_MODULE_EEPROM_BANK = 0
> ETHTOOL_A_MODULE_EEPROM_I2C_ADDRESS = 80
> received genetlink packet (96 bytes):
> msg length 96 error errno=-22
This is a mellanox card right?
mlx4_en_get_module_info() and mlx4_en_get_module_eeprom() implement
the old API for reading data from an SFP module. So the ethtool core
will be mapping the new API to the old API. The interesting function
is probably fallback_set_params():
https://elixir.bootlin.com/linux/latest/source/net/ethtool/eeprom.c#L29
and my guess is, you are hitting:
if (offset >= modinfo->eeprom_len)
return -EINVAL;
offset is 3 * 128 + 128 = 512.
mlx4_en_get_module_info() is probably returning eeprom_len of 256?
Could you verify this?
Andrew
Powered by blists - more mailing lists