SFP eeprom read

534 views
Skip to first unread message

Hadas ddd

unread,
Dec 10, 2016, 4:50:41 PM12/10/16
to opennetworklinux

Hi ONL's,

 

 As part of writing a library for managing SFP modules (SFP and QSFP), I'm using the onlp_sfp_eeprom_read() and sff_eeprom_parse() API's. these API's using the low level API onlp_sfpi_eeprom_read() which should be implemented for each platform.

 API's refer the eeprom as 256 first data bytes of module memory.

Should these 256 are be read from module memory and written to eeprom file when device is detected?

Should I implement it in a way that onlp_sfpi_eeprom_read() API will read directly from device memory?

I'm wondering what is the expected and best way for implementation…


Thanks

Hadas

thegr...@gmail.com

unread,
Dec 16, 2016, 3:47:51 PM12/16/16
to opennetworklinux
I am not an ONL expert here. But I provided my 2 cents anyway. See my comments below.

Diego


On Saturday, December 10, 2016 at 4:50:41 PM UTC-5, Hadas ddd wrote:

Hi ONL's,

 

 As part of writing a library for managing SFP modules (SFP and QSFP), I'm using the onlp_sfp_eeprom_read() and sff_eeprom_parse() API's. these API's using the low level API onlp_sfpi_eeprom_read() which should be implemented for each platform.

   [Diego] Correct. 
 

 API's refer the eeprom as 256 first data bytes of module memory.

Should these 256 are be read from module memory and written to eeprom file when device is detected?

   [Diego] It is not clear what you mean here. What is 'eeprom file'? These 256 bytes are read from the transceiver into a buffer. This buffer then is copied into  the sff_eeprom_t structure and parsed (the two function calls you mentioned above).  

Should I implement it in a way that onlp_sfpi_eeprom_read() API will read directly from device memory?

I'm wondering what is the expected and best way for implementation…

[Diego] IMHO, the eeprom info from the transceiver is  runtime information. No need to save it to a file. You can maintain an array of sff_eeprom_t structures for all your transceivers and refresh it when a transceiver is inserted (onlp_sfpi_eeprom_read() will read it from the transceiver). You have to be careful how you manage that array -  you want to avoid providing stale information. For example, you can clear an entry when its transceiver is removed, and/or qualify it with transceiver presence status; set the 'identified' member appropriately when transceiver is inserted,...

 

Thanks

Hadas

Reply all
Reply to author
Forward
0 new messages