[RFC 0/2] move module EEPROM decoding to a transceiver library
Morten Brørup
mb at smartsharesystems.com
Tue Nov 3 07:29:43 CET 2026
> From: Roman Khromenok [mailto:roma55592 at yandex.ru]
> Sent: Tuesday, 3 November 2026 05.19
>
> 02/11/2026 12:07, Morten Brørup:
> > Are there any APIs to tell if a transceiver module is plugged into
> the
> > transceiver module socket on the NIC, either in the ethdev library or
> > under this new transceiver library?
>
> There is no dedicated "module present" API in DPDK today.
>
> Module presence is only detected indirectly:
> rte_eth_dev_get_module_info()
> and rte_eth_dev_get_module_eeprom() return an error, for example -EIO,
> when no module is plugged, but only for drivers implementing these
> operations (ixgbe, i40e, ice, hns3, cnxk, ...). The link state is not a
> reliable indicator either: a plugged module can be down, and some
> modules (DAC cables) report link without optical diagnostics.
>
> The transceiver library cannot detect presence by design: it works on
> the raw EEPROM bytes only and has no dependency on any device, driver
> or even EAL initialization. This is also what makes it usable for
> kernel ports read with the ethtool ioctls.
>
> Physically, module presence is a MOD_ABS pin of the socket, not
> something that can be read from the EEPROM, so it belongs to the
> driver level. If an explicit presence API is wanted, I think it should
> be a separate ethdev device operation, for example
> .get_module_presence, so drivers could report it without attempting an
> EEPROM read. That would be a follow-up series, independent of this one.
>
> Thanks,
> Roman
Thank you for the detailed reply.
I agree with your conclusions.
-Morten
More information about the dev
mailing list