Skip to content

Separate periodic v/s fixed EEPROM reads between threads and optimize xcvrd boot-up time#360

Merged
mihirpat1 merged 7 commits intosonic-net:masterfrom
mihirpat1:bootup_thread_optimization
Jun 13, 2023
Merged

Separate periodic v/s fixed EEPROM reads between threads and optimize xcvrd boot-up time#360
mihirpat1 merged 7 commits intosonic-net:masterfrom
mihirpat1:bootup_thread_optimization

Conversation

@mihirpat1
Copy link
Contributor

@mihirpat1 mihirpat1 commented May 30, 2023

Description

It seems that currently, xcvrd consumes a lot of time (in the order of minutes) during the init phase to update the STATE_DB with information from transceiver EEPROM followed by spawning threads.
This initial update to state DB is a blocking call in the xcvrd main thread and hence, it increases the overall time to spawn threads. Hence, we need to ensure that CMIS init executes soon after xcvrd is spawned and parallelly proceed with STATE_DB updates with the relevant thread.
We also need to separate periodic v/s fixed EEPROM reads between threads to ensure that the DomInfoUpdateTask thread polls information from EEPROM which changes periodically and SfpStateUpdateTask updates STATE_DB with information which remains static after transceiver detection.

Motivation and Context

  1. Ensuring EEPROM fields which require to be periodically updated in State DB is driven by DomInfoUpdateTask and fields which remain constant after transceiver detection are updated in the state DB through SfpStateUpdateTask thread. Following is the summary of the changeset to achieve this
State DB update type Periodic polling required Handler Thread
post_port_sfp_info_to_db (Update TRANSCEIVER_INFO) N SfpStateUpdateTask
post_port_dom_threshold_info_to_db (Update TRANSCEIVER_DOM_THRESHOLD) N SfpStateUpdateTask
update_port_transceiver_status_table_sw (Update SW portion of TRANSCEIVER_STATUS) N SfpStateUpdateTask
post_port_dom_info_to_db (Update TRANSCEIVER_DOM_SENSOR) Y DomInfoUpdateTask
post_port_pm_info_to_db (Update TRANSCEIVER_PM) Y DomInfoUpdateTask
update_port_transceiver_status_table_hw (Update HW portion of TRANSCEIVER_STATUS) Y DomInfoUpdateTask
  1. We are now skipping updating State DB for periodic EEPROM reads during xcvrd boot-up
  2. Handling KeyError and TypeError exceptions as part of polling through DomInfoUpdateTask thread to avoid xcvrd crash during transceiver removal and "sfputil reset".
  3. Fixed crash in detect_port_in_error_status when status_dict returns None if the key 'error' is not present

How Has This Been Tested?

Ensured that the o/p of transceiver EEPROM related CLIs (based on using data through redis-db) still displays the o/p without any changes to the previous behavior. This has been verified for 400ZR, 400G, 100G and 10G optics.
The below CLI o/p was captured before and after transceiver removal and insertion to ensure that the o/p is displayed correctly.
show int transceiver info $port_num
show int transceiver eeprom -d $port_num
show int transceiver pm $port_num

redis-cli -n 6 hgetall "TRANSCEIVER_INFO|$port_num
redis-cli -n 6 hgetall "TRANSCEIVER_DOM_SENSOR|$port_num
redis-cli -n 6 hgetall "TRANSCEIVER_DOM_THRESHOLD|$port_num
redis-cli -n 6 hgetall "TRANSCEIVER_PM|$port_num
redis-cli -n 6 hgetall "TRANSCEIVER_STATUS|$port_num

o/p for 10G transceiver removal and insertion

Logs after xcvr removal
root@sonic:/var/log# docker exec pmon supervisorctl status | grep xcvrd
DY
xcvrd                            RUNNING   pid 30, uptime 2:46:35
root@sonic:/var/log# cat syslog | grep "Got SFP"
May 30 22:58:19.399800 sonic NOTICE pmon#xcvrd[30]: Ethernet160: Got SFP removed event
May 30 23:00:10.015619 sonic NOTICE pmon#xcvrd[30]: Ethernet256: Got SFP removed event
root@sonic:/var/log#

root@sonic:/var/log# port_num=Ethernet256
root@sonic:/var/log# show int transceiver info $port_num
ow int transceiver pm $port_num
show int transceiver status $port_num
show int status $port_num
redis-cli -n 6 hgetall "TRANSCEIVER_INFO|$port_num";printf "\n";redis-cli -n 6 hgetall "TRANSCEIVER_DOM_SENSOR|$port_num";printf "\n";redis-cli -n 6 hgetall "TRANSCEIVER_DOM_THRESHOLD|$port_num";printf "\n";redis-cli -n 6 hgetall "TRANSCEIVER_PM|$port_num";printf "\n";redis-cli -n 6 hgetall "TRANSCEIVER_STATUS|$port_num";printf "\n";show lldp table
Ethernet256: SFP EEPROM Not detected
root@sonic:/var/log# show int transceiver eeprom -d $port_num
Ethernet256: SFP EEPROM Not detected
root@sonic:/var/log# show int transceiver pm $port_num
Ethernet256: Transceiver performance monitoring not applicable
root@sonic:/var/log# show int transceiver status $port_num
Usage: show int transceiver [OPTIONS] COMMAND [ARGS]...
Try "show int transceiver -h" for help.

Error: No such command "status".
root@sonic:/var/log# show int status $port_num
  Interface    Lanes    Speed    MTU    FEC       Alias    Vlan    Oper    Admin    Type    Asym PFC
-----------  -------  -------  -----  -----  ----------  ------  ------  -------  ------  ----------
Ethernet256      258      10G   9100    N/A  Ethernet33   trunk    down       up     N/A         N/A
root@sonic:/var/log# redis-cli -n 6 hgetall "TRANSCEIVER_INFO|$port_num";printf "\n";redis-cli -n 6 hgetall "TRANSCEIVER_DOM_SENSOR|$port_num";printf "\n";redis-cli -n 6 hgetall "TRANSCEIVER_DOM_THRESHOLD|$port_num";printf "\n";redis-cli -n 6 hgetall "TRANSCEIVER_PM|$port_num";printf "\n";redis-cli -n 6 hgetall "TRANSCEIVER_STATUS|$port_num";printf "\n";show lldp table
(empty array)

(empty array)

(empty array)

(empty array)

1) "status"
2) "0"
3) "error"
4) "N/A"

Capability codes: (R) Router, (B) Bridge, (O) Other
LocalPort    RemoteDevice                  RemotePortID    Capability    RemotePortDescr
-----------  ----------------------------  --------------  ------------  ------------------------
eth0         STR43-0101-0100-01M0.phx.gbl  Ethernet1/31    BR            INFRA:MGMT:$Description$
--------------------------------------------------
Total entries displayed:  1
root@sonic:/var/log# 

Logs after xcvr insertion
root@sonic:/var/log# docker exec pmon supervisorctl status | grep xcvrd
DY
xcvrd                            RUNNING   pid 30, uptime 3:02:13
root@sonic:/var/log# cat syslog | grep "Got SFP"
May 30 22:58:19.399800 sonic NOTICE pmon#xcvrd[30]: Ethernet160: Got SFP removed event
May 30 23:00:10.015619 sonic NOTICE pmon#xcvrd[30]: Ethernet256: Got SFP removed event
May 30 23:17:12.749646 sonic NOTICE pmon#xcvrd[30]: Ethernet160: Got SFP inserted event
May 30 23:17:19.725857 sonic NOTICE pmon#xcvrd[30]: Ethernet256: Got SFP inserted event
root@sonic:/var/log# cat syslog | grep READY
May 30 20:20:53.591065 sonic NOTICE pmon#xcvrd[30]: CMIS: Ethernet16: READY
May 30 20:21:03.044395 sonic NOTICE pmon#xcvrd[30]: CMIS: Ethernet0: READY
May 30 20:21:04.029571 sonic NOTICE pmon#xcvrd[30]: CMIS: Ethernet40: READY
May 30 20:22:02.027164 sonic NOTICE pmon#xcvrd[30]: CMIS: Ethernet144: READY
May 30 20:22:03.050010 sonic NOTICE pmon#xcvrd[30]: CMIS: Ethernet160: READY
May 30 23:19:07.921322 sonic NOTICE pmon#xcvrd[30]: CMIS: Ethernet160: READY
root@sonic:/var/log#

root@sonic:/var/log# port_num=Ethernet256
root@sonic:/var/log# show int transceiver info $port_num
ow int transceiver pm $port_num
show int transceiver status $port_num
show int status $port_num
Ethernet256: SFP EEPROM detected
        Application Advertisement: N/A
        Connector: LC
        Encoding: 64B/66B
        Extended Identifier: GBIC/SFP defined by two-wire interface ID
        Extended RateSelect Compliance: Unknown
        Identifier: SFP/SFP+/SFP28
        Length OM3(10m): 30.0
        Nominal Bit Rate(100Mbs): 103
        Specification compliance:
                10G Ethernet Compliance: 10GBASE-SR
                ESCON Compliance: Unknown
                Ethernet Compliance: Unknown
                Fibre Channel Link Length: Unknown
                Fibre Channel Speed: Unknown
                Fibre Channel Transmission Media: Unknown
                Fibre Channel Transmitter Technology: Unknown
                Infiniband Compliance: Unknown
                SFP+CableTechnology: Unknown
                SONET Compliance Codes: Unknown
        Vendor Date Code(YYYY-MM-DD Lot): 2009-06-27   
        Vendor Name: FINISAR CORP.   
        Vendor OUI: 00-90-65
        Vendor PN: FTLX8571D3BCL   
        Vendor Rev: A   
        Vendor SN: UFS073Z         
root@sonic:/var/log# show int transceiver eeprom -d $port_num
Ethernet256: SFP EEPROM detected
        Application Advertisement: N/A
        Connector: LC
        Encoding: 64B/66B
        Extended Identifier: GBIC/SFP defined by two-wire interface ID
        Extended RateSelect Compliance: Unknown
        Identifier: SFP/SFP+/SFP28
        Length OM3(10m): 30.0
        Nominal Bit Rate(100Mbs): 103
        Specification compliance:
                10G Ethernet Compliance: 10GBASE-SR
                ESCON Compliance: Unknown
                Ethernet Compliance: Unknown
                Fibre Channel Link Length: Unknown
                Fibre Channel Speed: Unknown
                Fibre Channel Transmission Media: Unknown
                Fibre Channel Transmitter Technology: Unknown
                Infiniband Compliance: Unknown
                SFP+CableTechnology: Unknown
                SONET Compliance Codes: Unknown
        Vendor Date Code(YYYY-MM-DD Lot): 2009-06-27   
        Vendor Name: FINISAR CORP.   
        Vendor OUI: 00-90-65
        Vendor PN: FTLX8571D3BCL   
        Vendor Rev: A   
        Vendor SN: UFS073Z         
        MonitorData:
                RXPower: 0.678dBm
                TXBias: 7.138mA
                TXPower: 0.521dBm
                Temperature: 21.02C
                Vcc: 3.375Volts
        ThresholdData:
                TempHighAlarm  : 78.0C
                TempHighWarning: 73.0C
                TempLowAlarm   : -13.0C
                TempLowWarning : -8.0C
                VccHighAlarm   : 3.7Volts
                VccHighWarning : 3.6Volts
                VccLowAlarm    : 2.9Volts
                VccLowWarning  : 3.0Volts
                RxPowerHighAlarm  : 0.0dBm
                RxPowerHighWarning: -1.0dBm
                RxPowerLowAlarm   : -20.0dBm
                RxPowerLowWarning : -18.013dBm
                TxBiasHighAlarm   : 11.8mA
                TxBiasHighWarning : 10.8mA
                TxBiasLowAlarm    : 4.0mA
                TxBiasLowWarning  : 5.0mA
                TxPowerHighAlarm  : -0.8dBm
                TxPowerHighWarning: -1.8dBm
                TxPowerLowAlarm   : -6.0dBm
                TxPowerLowWarning : -5.0dBm
root@sonic:/var/log# show int transceiver pm $port_num
Ethernet256: Transceiver performance monitoring not applicable
root@sonic:/var/log# show int transceiver status $port_num
Usage: show int transceiver [OPTIONS] COMMAND [ARGS]...
Try "show int transceiver -h" for help.

Error: No such command "status".
root@sonic:/var/log# show int status $port_num
  Interface    Lanes    Speed    MTU    FEC       Alias    Vlan    Oper    Admin            Type    Asym PFC
-----------  -------  -------  -----  -----  ----------  ------  ------  -------  --------------  ----------
Ethernet256      258      10G   9100    N/A  Ethernet33   trunk      up       up  SFP/SFP+/SFP28         N/A
root@sonic:/var/log#
root@sonic:/var/log# redis-cli -n 6 hgetall "TRANSCEIVER_INFO|$port_num";printf "\n";redis-cli -n 6 hgetall "TRANSCEIVER_DOM_SENSOR|$port_num";printf "\n";redis-cli -n 6 hgetall "TRANSCEIVER_DOM_THRESHOLD|$port_num";printf "\n";redis-cli -n 6 hgetall "TRANSCEIVER_PM|$port_num";printf "\n";redis-cli -n 6 hgetall "TRANSCEIVER_STATUS|$port_num";printf "\n";show lldp table
 1) "nominal_bit_rate"
 2) "103"
 3) "vendor_rev"
 4) "A   "
 5) "application_advertisement"
 6) "N/A"
 7) "model"
 8) "FTLX8571D3BCL   "
 9) "vendor_date"
10) "2009-06-27   "
11) "specification_compliance"
12) "{'10G Ethernet Compliance': '10GBASE-SR', 'Infiniband Compliance': 'Unknown', 'ESCON Compliance': 'Unknown', 'SONET Compliance Codes': 'Unknown', 'Ethernet Compliance': 'Unknown', 'Fibre Channel Link Length': 'Unknown', 'Fibre Channel Transmitter Technology': 'Unknown', 'SFP+CableTechnology': 'Unknown', 'Fibre Channel Transmission Media': 'Unknown', 'Fibre Channel Speed': 'Unknown'}"
13) "vendor_oui"
14) "00-90-65"
15) "serial"
16) "UFS073Z         "
17) "type"
18) "SFP/SFP+/SFP28"
19) "encoding"
20) "64B/66B"
21) "cable_length"
22) "30.0"
23) "manufacturer"
24) "FINISAR CORP.   "
25) "dom_capability"
26) "N/A"
27) "connector"
28) "LC"
29) "is_replaceable"
30) "True"
31) "ext_rateselect_compliance"
32) "Unknown"
33) "cable_type"
34) "Length OM3(10m)"
35) "ext_identifier"
36) "GBIC/SFP defined by two-wire interface ID"

 1) "rx_los"
 2) "False"
 3) "tx_fault"
 4) "False"
 5) "tx_disable"
 6) "False"
 7) "tx_disabled_channel"
 8) "0"
 9) "temperature"
10) "21.02"
11) "voltage"
12) "3.375"
13) "tx1bias"
14) "7.138"
15) "rx1power"
16) "0.678"
17) "tx1power"
18) "0.521"
19) "tx2bias"
20) "N/A"
21) "rx2power"
22) "N/A"
23) "tx2power"
24) "N/A"
25) "tx3bias"
26) "N/A"
27) "rx3power"
28) "N/A"
29) "tx3power"
30) "N/A"
31) "tx4bias"
32) "N/A"
33) "rx4power"
34) "N/A"
35) "tx4power"
36) "N/A"

 1) "temphighalarm"
 2) "78.0"
 3) "templowalarm"
 4) "-13.0"
 5) "temphighwarning"
 6) "73.0"
 7) "templowwarning"
 8) "-8.0"
 9) "vcchighalarm"
10) "3.7"
11) "vcclowalarm"
12) "2.9"
13) "vcchighwarning"
14) "3.6"
15) "vcclowwarning"
16) "3.0"
17) "rxpowerhighalarm"
18) "0.0"
19) "rxpowerlowalarm"
20) "-20.0"
21) "rxpowerhighwarning"
22) "-1.0"
23) "rxpowerlowwarning"
24) "-18.013"
25) "txpowerhighalarm"
26) "-0.8"
27) "txpowerlowalarm"
28) "-6.0"
29) "txpowerhighwarning"
30) "-1.8"
31) "txpowerlowwarning"
32) "-5.0"
33) "txbiashighalarm"
34) "11.8"
35) "txbiaslowalarm"
36) "4.0"
37) "txbiashighwarning"
38) "10.8"
39) "txbiaslowwarning"
40) "5.0"

(empty array)

1) "status"
2) "1"
3) "error"
4) "N/A"

Capability codes: (R) Router, (B) Bridge, (O) Other
LocalPort    RemoteDevice                  RemotePortID    Capability    RemotePortDescr
-----------  ----------------------------  --------------  ------------  ------------------------
Ethernet144  sonic                         Ethernet21/1    BR            Ethernet160
Ethernet160  sonic                         Ethernet19/1    BR            Ethernet144
Ethernet256  sonic                         Ethernet34      BR            Ethernet260
Ethernet260  sonic                         Ethernet33      BR            Ethernet256
eth0         STR43-0101-0100-01M0.phx.gbl  Ethernet1/31    BR            INFRA:MGMT:$Description$
--------------------------------------------------
Total entries displayed:  5
root@sonic:/var/log#

Additional Information (Optional)

mihirpat1 added 2 commits May 29, 2023 21:05
… xcvrd boot-up time

Signed-off-by: Mihir Patel <patelmi@microsoft.com>
… xcvrd boot-up time

Signed-off-by: Mihir Patel <patelmi@microsoft.com>
@mihirpat1 mihirpat1 changed the title Bootup thread optimization Separate periodic v/s fixed EEPROM reads between threads and optimize xcvrd boot-up time May 30, 2023
@mihirpat1 mihirpat1 marked this pull request as ready for review May 31, 2023 01:12
@prgeor
Copy link
Collaborator

prgeor commented May 31, 2023

@keboliu @Junchao-Mellanox @shyam77git please review

post_port_pm_info_to_db(logical_port_name, self.port_mapping, self.xcvr_table_helper.get_pm_tbl(asic_index), self.task_stopping_event, pm_info_cache=pm_info_cache)
except (KeyError, TypeError):
#continue to process next port since execption could be raised due to port reset, transceiver removal
continue
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we log something here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have now added a warning message for each of the 3 functions.


# Do not notify media settings during warm reboot to avoid dataplane traffic impact
if is_warm_start == False:
notify_media_setting(logical_port_name, transceiver_dict, xcvr_table_helper.get_app_port_tbl(asic_index), port_mapping)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does cmis manager depend on notify_media_setting? Before the change, notify_media_setting is always called before starting cmis manager; after the change, notify_media_setting may start in parallel of cmis manager.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it doesn't seem that CMIS manager depends on notify_media_setting.

@prgeor
Copy link
Collaborator

prgeor commented May 31, 2023

@keboliu @Junchao-Mellanox do you mind testing this change in your platform. @liat-grozovik vis

@prgeor
Copy link
Collaborator

prgeor commented May 31, 2023

@mihirpat1 can u test this on Dell Z9332F and confirm the media settings are getting updated in APPL_DB by Xcvrd

@prgeor
Copy link
Collaborator

prgeor commented May 31, 2023

@mihirpat1 can u test during warm-boot on DellZ9332F Xcvrd does not post the media setting to APPL_DB

@mihirpat1
Copy link
Contributor Author

@mihirpat1 can u test this on Dell Z9332F and confirm the media settings are getting updated in APPL_DB by Xcvrd

Yes, I have now tested on X9332F and have confirmed that the media settings are being updated in APPL_DB.

@mihirpat1
Copy link
Contributor Author

mihirpat1 commented May 31, 2023

@mihirpat1 can u test during warm-boot on DellZ9332F Xcvrd does not post the media setting to APPL_DB

Yes, verified that xcvrd doesn't post the media setting to APPL_DB after warm-reboot.
On a side note, I do see that the APPL_DB get deleted few minutes after the switch comes back up again (similar behavior is observed with sonic master nightly image as well).

After warm-reboot
root@Z9332F:/var/log# redis-cli -n 0 hgetall "PORT_TABLE:Ethernet16"

  1. "alias"
  2. "etp3"
  3. "post3"
  4. "0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000"
  5. "pre1"
  6. "0xfffffff0,0xfffffff0,0xfffffff0,0xfffffff0,0xfffffff0,0xfffffff0,0xfffffff0,0xfffffff0"
  7. "pre2"
  8. "0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000"
  9. "index"
  10. "3"
  11. "main"
  12. "0x00000088,0x00000088,0x00000088,0x00000088,0x00000088,0x00000088,0x00000088,0x00000088"
  13. "oper_status"
  14. "up"
  15. "description"
  16. ""
  17. "speed"
  18. "400000"
  19. "mtu"
  20. "9100"
  21. "post2"
  22. "0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000"
  23. "lanes"
  24. "49,50,51,52,53,54,55,56"
  25. "post1"
  26. "0xfffffff0,0xfffffff0,0xfffffff0,0xfffffff0,0xfffffff0,0xfffffff0,0xfffffff0,0xfffffff0"
  27. "admin_status"
  28. "up"

After cold-reboot
root@Z9332F:/var/log# redis-cli -n 0 hgetall "PORT_TABLE:Ethernet16"

  1. "alias"
  2. "etp3"
  3. "lanes"
  4. "49,50,51,52,53,54,55,56"
  5. "main"
  6. "0x00000088,0x00000088,0x00000088,0x00000088,0x00000088,0x00000088,0x00000088,0x00000088"
  7. "pre2"
  8. "0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000"
  9. "pre1"
  10. "0xfffffff0,0xfffffff0,0xfffffff0,0xfffffff0,0xfffffff0,0xfffffff0,0xfffffff0,0xfffffff0"
  11. "speed"
  12. "400000"
  13. "post2"
  14. "0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000"
  15. "oper_status"
  16. "up"
  17. "post1"
  18. "0xfffffff0,0xfffffff0,0xfffffff0,0xfffffff0,0xfffffff0,0xfffffff0,0xfffffff0,0xfffffff0"
  19. "post3"
  20. "0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000"
  21. "description"
  22. ""
  23. "index"
  24. "3"
  25. "admin_status"
  26. "up"
  27. "mtu"
  28. "9100"

@Junchao-Mellanox
Copy link
Collaborator

@keboliu @Junchao-Mellanox do you mind testing this change in your platform. @liat-grozovik vis

Will do

@mihirpat1
Copy link
Contributor Author

@keboliu @Junchao-Mellanox do you mind testing this change in your platform. @liat-grozovik vis

Will do

@Junchao-Mellanox - Did you get a chance to test the changes?

@Junchao-Mellanox
Copy link
Collaborator

In progress, will update result in a day or two.

@mihirpat1
Copy link
Contributor Author

In progress, will update result in a day or two.

Thank you!

@Junchao-Mellanox
Copy link
Collaborator

I have finished the test, looks good.

@mihirpat1
Copy link
Contributor Author

I have finished the test, looks good.

Thank you!

return event

# Update port sfp info and dom threshold in db during xcvrd bootup
def _post_port_sfp_info_dom_thr_to_db_during_xcvrd_bootup(self, port_mapping, xcvr_table_helper, stop_event=threading.Event()):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to ? post_port_sfp_info_and_dom_thr_to_db_once()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have addressed this now.

Comment on lines +1837 to +1861
transceiver_dict = {}
retry_eeprom_set = set()

warmstart = swsscommon.WarmStart()
warmstart.initialize("xcvrd", "pmon")
warmstart.checkWarmStart("xcvrd", "pmon", False)
is_warm_start = warmstart.isWarmStart()

# Post all the current interface sfp/dom threshold info to STATE_DB
logical_port_list = port_mapping.logical_port_list
for logical_port_name in logical_port_list:
if stop_event.is_set():
break

# Get the asic to which this port belongs
asic_index = port_mapping.get_asic_id_for_logical_port(logical_port_name)
if asic_index is None:
helper_logger.log_warning("Got invalid asic index for {}, ignored while posting SFP info during boot-up".format(logical_port_name))
continue
rc = post_port_sfp_info_to_db(logical_port_name, port_mapping, xcvr_table_helper.get_intf_tbl(asic_index), transceiver_dict, stop_event)
if rc != SFP_EEPROM_NOT_READY:
post_port_dom_threshold_info_to_db(logical_port_name, port_mapping, xcvr_table_helper.get_dom_threshold_tbl(asic_index), stop_event)

# Do not notify media settings during warm reboot to avoid dataplane traffic impact
if is_warm_start == False:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mihirpat1 I think we can further break down this fn into two where notif media setting is called and the 2nd part is called after CMIS init is completed. May be a TODO for future?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, have noted this to address while working on #356.

prgeor
prgeor previously approved these changes Jun 12, 2023
@mihirpat1 mihirpat1 merged commit 55996c7 into sonic-net:master Jun 13, 2023
@mihirpat1
Copy link
Contributor Author

mihirpat1 commented Jun 13, 2023

@yxieca - It will be great if you can help in merging this to 202205
@StormLiangMS - It will be great if you can help in merging this to 202211

ADO is 23051688

yxieca pushed a commit that referenced this pull request Jun 15, 2023
… xcvrd boot-up time (#360)

* Separate periodic v/s fixed EEPROM reads between threads and optimize xcvrd boot-up time

Signed-off-by: Mihir Patel <patelmi@microsoft.com>
lotus-nexthop pushed a commit to lotus-nexthop/sonic-platform-daemons that referenced this pull request Oct 28, 2025
…pulled while a bulk get method is interrogating said module (sonic-net#360)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants