intel / intel/ethernet-linux-ice

ICE not able to read paged QSFP EEPROM

Open
#14 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
60
Forks
21
PR merge metrics
No merged PRs in 30d

Description

Driver versions ice-1.14.x and above are not able to read paged QSFP EEPROM correctly and always return multiple copies of Page 00 due to following bug in file src/ice_common.c

```
- cmd->eeprom_page = le16_encode_bits(page, ICE_AQC_SFF_EEPROM_PAGE_S);
+ cmd->eeprom_page = le16_encode_bits(page, ICE_AQC_SFF_EEPROM_PAGE_M);
```

Also the implementation of ice_get_module_eeprom() in file src/ice_ethtool.c doesn't test for presence of additional pages correctly, which causes problems and multi-seconds read delays with Intel optical transceivers which don't implement Page 01.
The code should look like this:

```
/* Bit 2 of EEPROM address 0x02 declares upper pages are disabled on QSFP modules.
* Bits 6, 7 at Page 00 address 195 declare presence of upper pages 01 and 02
* SFP modules only ever use page 0.
*/

paged_mem: Page 00 Byte 02 & 4 == 0
page_mask: Page 00 Byte 195 >> 6

if (page == 0 || (paged_mem && (page == 3 || page & page_mask))) {

```
Since the reads are not page-aligned, reading bytes from offsets not being multiple of 8 bytes produces incorrect results.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.