sonic-net / sonic-platform-daemons

Platform module daemons for SONiC
Other
25 stars 159 forks source link

reset active application code as 'N/A' when port shutdown #550

Open chiourung opened 1 month ago

chiourung commented 1 month ago

Description

Motivation and Context

In the add_rack test, it would compare the TRANSCEIVER_INFO for two cases: case 1. config reload (the admin status of Ethernet64 is down in config_db.json) case 2. config reload (the admin status of Ethernet64 is up in config_db.json) and then shutdown Ethernet64

In case 1. it would not do CMIS init and the active application is 'N/A'. In case 2. it would do CMIS init first and then disable TX. The active application would retain the value of the last CMIS init. => Modify the code to reset the active application on port shutdown to ensure that the active application would be the same for the above two cases.

How Has This Been Tested?

root@ais800-64o-1:/# show interfaces status Ethernet0
  Interface        Lanes    Speed    MTU    FEC          Alias    Vlan    Oper    Admin                           Type    Asym PFC
-----------  -----------  -------  -----  -----  -------------  ------  ------  -------  -----------------------------  ----------
  Ethernet0  25,26,27,28     400G   9100    N/A  Eth1/1(Port1)  routed      up       up  OSFP 8X Pluggable Transceiver         off
root@ais800-64o-1:/# show interfaces transceiver eeprom Ethernet0
Ethernet0: SFP EEPROM detected
        Active Firmware: N/A
        Active application selected code assigned to host lane 1: 2
        Active application selected code assigned to host lane 2: 2
        Active application selected code assigned to host lane 3: 2
        Active application selected code assigned to host lane 4: 2
        Active application selected code assigned to host lane 5: N/A
        Active application selected code assigned to host lane 6: N/A
        Active application selected code assigned to host lane 7: N/A
        Active application selected code assigned to host lane 8: N/A
        Application Advertisement: 800G L C2M (placeholder) - Host Assign (0x1) - 800GBASE-DR8-2 (placeholder) - Media Assign (0x1)
                                   400GAUI-4-L C2M (Annex 120G) - Host Assign (0x11) - 400G-FR4/400GBASE-FR4 (Cl 151) - Media Assign (0x11)
                                   200GAUI-2-L C2M (Annex 120G) - Host Assign (0x55) - Undefined - Media Assign (0x55)
                                   100GAUI-1-L C2M (Annex 120G) - Host Assign (0xff) - 100G-FR/100GBASE-FR1 (Cl 140) - Media Assign (0xff)
                                   200GAUI-4 C2M (Annex 120E) - Host Assign (0x11) - 200GBASE-FR4 (Cl 122) - Media Assign (0x11)
        CMIS Rev: 5.0
        Connector: LC
        Encoding: N/A
        Extended Identifier: Power Class 7 (14.0W Max)
        Extended RateSelect Compliance: N/A
        Host Lane Count: 4
        Identifier: OSFP 8X Pluggable Transceiver
        Inactive Firmware: N/A
        Length Cable Assembly(m): 0.0
        Media Interface Technology: 1310 nm EML
        Media Lane Count: 4
        Module Hardware Rev: 1.0
        Nominal Bit Rate(100Mbs): 0
        Specification compliance: sm_media_interface
        Supported Max Laser Frequency: N/A
        Supported Max TX Power: N/A
        Supported Min Laser Frequency: N/A
        Supported Min TX Power: N/A
        Vendor Date Code(YYYY-MM-DD Lot): 2024-03-22
        Vendor Name: Edgecore
        Vendor OUI: 3c-2c-99
        Vendor PN: ET8001-2FR4
        Vendor Rev: 50
        Vendor SN: L12412000257
root@ais800-64o-1:/# config interface shutdown Ethernet0
root@ais800-64o-1:/# show interfaces transceiver eeprom Ethernet0
Ethernet0: SFP EEPROM detected
        Active Firmware: N/A
        Active application selected code assigned to host lane 1: N/A
        Active application selected code assigned to host lane 2: N/A
        Active application selected code assigned to host lane 3: N/A
        Active application selected code assigned to host lane 4: N/A
        Active application selected code assigned to host lane 5: N/A
        Active application selected code assigned to host lane 6: N/A
        Active application selected code assigned to host lane 7: N/A
        Active application selected code assigned to host lane 8: N/A
        Application Advertisement: 800G L C2M (placeholder) - Host Assign (0x1) - 800GBASE-DR8-2 (placeholder) - Media Assign (0x1)
                                   400GAUI-4-L C2M (Annex 120G) - Host Assign (0x11) - 400G-FR4/400GBASE-FR4 (Cl 151) - Media Assign (0x11)
                                   200GAUI-2-L C2M (Annex 120G) - Host Assign (0x55) - Undefined - Media Assign (0x55)
                                   100GAUI-1-L C2M (Annex 120G) - Host Assign (0xff) - 100G-FR/100GBASE-FR1 (Cl 140) - Media Assign (0xff)
                                   200GAUI-4 C2M (Annex 120E) - Host Assign (0x11) - 200GBASE-FR4 (Cl 122) - Media Assign (0x11)
        CMIS Rev: 5.0
        Connector: LC
        Encoding: N/A
        Extended Identifier: Power Class 7 (14.0W Max)
        Extended RateSelect Compliance: N/A
        Host Lane Count: N/A
        Identifier: OSFP 8X Pluggable Transceiver
        Inactive Firmware: N/A
        Length Cable Assembly(m): 0.0
        Media Interface Technology: 1310 nm EML
        Media Lane Count: N/A
        Module Hardware Rev: 1.0
        Nominal Bit Rate(100Mbs): 0
        Specification compliance: sm_media_interface
        Supported Max Laser Frequency: N/A
        Supported Max TX Power: N/A
        Supported Min Laser Frequency: N/A
        Supported Min TX Power: N/A
        Vendor Date Code(YYYY-MM-DD Lot): 2024-03-22
        Vendor Name: Edgecore
        Vendor OUI: 3c-2c-99
        Vendor PN: ET8001-2FR4
        Vendor Rev: 50
        Vendor SN: L12412000257

Additional Information (Optional)

prgeor commented 1 month ago

@chiourung please share the output of show interface transceiver info when port is up and port is down

prgeor commented 1 month ago

@chiourung please fix the build error

chiourung commented 1 month ago

@chiourung please share the output of show interface transceiver info when port is up and port is down

Update in Description

chiourung commented 1 month ago

@chiourung please fix the build error

Done