Re: [PATCH net-next 1/2] net: ethtool: Add new parameters and a function to support EPL
From: Andrew Lunn
Date: Fri Sep 06 2024 - 11:36:37 EST
> +/* For accessing the EPL field on page 9Fh, the allowable length extension is
> + * min(i, 255) byte octets where i specifies the allowable additional number of
> + * byte octets in a READ or a WRITE.
> + */
> +u32 ethtool_cmis_get_max_epl_size(u8 num_of_byte_octs)
> +{
> + return 8 * (1 + min_t(u8, num_of_byte_octs, 255));
> +}
Does this get mapped to a 255 byte I2C bus transfer?
https://elixir.bootlin.com/linux/v6.11-rc6/source/drivers/net/phy/sfp.c#L218
/* SFP_EEPROM_BLOCK_SIZE is the size of data chunk to read the EEPROM
* at a time. Some SFP modules and also some Linux I2C drivers do not like
* reads longer than 16 bytes.
*/
#define SFP_EEPROM_BLOCK_SIZE 16
If an SMBUS is being used, rather than I2C, there is a hard limit of
32 bytes in a message transfer.
I've not looked in details at these patches, but maybe you need a
mechanism to ask the hardware or I2C driver what it can actually do?
Is it possible to say LPL is the only choice?
Andrew