Skip to content

Commit 19b18c4

Browse files
chiourungprgeor
authored andcommitted
[Xcvrd] Skip to get dom/threshold/pm for flat memory
Signed-off-by: chiourung_huang <[email protected]>
1 parent 0f61e15 commit 19b18c4

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

sonic-xcvrd/xcvrd/xcvrd.py

+18
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,15 @@ def _wrapper_get_transceiver_pm(physical_port):
308308
pass
309309
return {}
310310

311+
def _wrapper_is_flat_memory(physical_port):
312+
if platform_chassis is not None:
313+
try:
314+
sfp = platform_chassis.get_sfp(physical_port)
315+
api = sfp.get_xcvr_api()
316+
return api.is_flat_memory()
317+
except NotImplementedError:
318+
pass
319+
return None
311320

312321
# Soak SFP insert event until management init completes
313322
def _wrapper_soak_sfp_insert_event(sfp_insert_events, port_dict):
@@ -584,6 +593,9 @@ def post_port_dom_threshold_info_to_db(logical_port_name, port_mapping, table,
584593
if not _wrapper_get_presence(physical_port):
585594
continue
586595

596+
if _wrapper_is_flat_memory(physical_port) == True:
597+
continue
598+
587599
port_name = get_physical_port_name(logical_port_name,
588600
ganged_member_num, ganged_port)
589601
ganged_member_num += 1
@@ -619,6 +631,9 @@ def post_port_dom_info_to_db(logical_port_name, port_mapping, table, stop_event=
619631
if not _wrapper_get_presence(physical_port):
620632
continue
621633

634+
if _wrapper_is_flat_memory(physical_port) == True:
635+
continue
636+
622637
try:
623638
if dom_info_cache is not None and physical_port in dom_info_cache:
624639
# If cache is enabled and dom information is in cache, just read from cache, no need read from EEPROM
@@ -650,6 +665,9 @@ def post_port_pm_info_to_db(logical_port_name, port_mapping, table, stop_event=t
650665
if not _wrapper_get_presence(physical_port):
651666
continue
652667

668+
if _wrapper_is_flat_memory(physical_port) == True:
669+
continue
670+
653671
if pm_info_cache is not None and physical_port in pm_info_cache:
654672
# If cache is enabled and pm info is in cache, just read from cache, no need read from EEPROM
655673
pm_info_dict = pm_info_cache[physical_port]

0 commit comments

Comments
 (0)