Skip to content

[xcvr api] cmis.get_error_description does not show correct error status when there is split #21878

@Junchao-Mellanox

Description

@Junchao-Mellanox

Description

cmis.get_error_description always checks all lanes of the module. If any lane returns an error state, the function returns error state. For example, the port are splitted to 8, only the first sub port is admin up.

Ethernet496      496     100G   9100     rs   etp63a   trunk      up       up  OSFP 8X Pluggable Transceiver         off
Ethernet497      497     100G   9100     rs   etp63b  routed    down     down  OSFP 8X Pluggable Transceiver         off
Ethernet498      498     100G   9100     rs   etp63c  routed    down     down  OSFP 8X Pluggable Transceiver         off
Ethernet499      499     100G   9100     rs   etp63d  routed    down     down  OSFP 8X Pluggable Transceiver         off
Ethernet500      500     100G   9100     rs   etp63e  routed    down     down  OSFP 8X Pluggable Transceiver         off
Ethernet501      501     100G   9100     rs   etp63f  routed    down     down  OSFP 8X Pluggable Transceiver         off
Ethernet502      502     100G   9100     rs   etp63g  routed    down     down  OSFP 8X Pluggable Transceiver         off
Ethernet503      503     100G   9100     rs   etp63h  routed    down     down  OSFP 8X Pluggable Transceiver         off

get_error_description would return DataPathInitialized for all sub ports:

sudo sfputil show error-status --fetch-from-hardware
Ethernet496  DataPathInitialized
Ethernet497  DataPathInitialized
Ethernet498  DataPathInitialized
Ethernet499  DataPathInitialized
Ethernet500  DataPathInitialized
Ethernet501  DataPathInitialized
Ethernet502  DataPathInitialized
Ethernet503  DataPathInitialized

However, the actual datapath state of Ethernet496 is DataPathActivated:

>>> import sonic_platform
>>> c=sonic_platform.platform.Platform().get_chassis()
>>> s = c.get_sfp(63)
>>> api = s.get_xcvr_api()
>>> d = api.get_datapath_state()
>>> d
{'DP1State': 'DataPathActivated', 'DP2State': 'DataPathInitialized', 'DP3State': 'DataPathInitialized', 'DP4State': 'DataPathInitialized', 'DP5State': 'DataPathInitialized', 'DP6State': 'DataPathInitialized', 'DP7State': 'DataPathInitialized', 'DP8State': 'DataPathInitialized'}

Reproduce Steps

  1. Split port to 2 or 4 or 8
  2. Set first sub port admin up, rest of them are admin down
  3. Call sudo sfputil show error-status --fetch-from-hardware

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions