From c7806b45da315457c81c8879efcf594d01fa6a28 Mon Sep 17 00:00:00 2001 From: syuan Date: Thu, 17 Jun 2021 16:35:25 -0700 Subject: [PATCH] Recirc port is not used as front panel port. So avoid front panel port handling on recirc port. --- sonic_platform_base/sonic_sfp/sfputilbase.py | 7 ++++--- sonic_platform_base/sonic_sfp/sfputilhelper.py | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/sonic_platform_base/sonic_sfp/sfputilbase.py b/sonic_platform_base/sonic_sfp/sfputilbase.py index 9e3d30d15..aeb3c8960 100644 --- a/sonic_platform_base/sonic_sfp/sfputilbase.py +++ b/sonic_platform_base/sonic_sfp/sfputilbase.py @@ -15,7 +15,7 @@ from natsort import natsorted from portconfig import get_port_config from sonic_py_common import device_info - from sonic_py_common.interface import backplane_prefix, inband_prefix + from sonic_py_common.interface import backplane_prefix, inband_prefix, recirc_prefix from sonic_eeprom import eeprom_dts from .sff8472 import sff8472InterfaceId # Dot module supports both Python 2 and Python 3 using explicit relative import methods @@ -498,8 +498,9 @@ def read_porttab_mappings(self, porttabfile, asic_inst=0): # so we use the port's position in the file (zero-based) as bcm_port portname = line.split()[0] - # Ignore if this is an internal backplane interface and Inband interface - if portname.startswith(backplane_prefix()) or portname.startswith(inband_prefix()): + # Ignore if this is an internal backplane, Inband, or recirc interface + if portname.startswith(backplane_prefix()) or portname.startswith(inband_prefix()) or \ + portname.startswith(recirc_prefix()): continue bcm_port = str(port_pos_in_file) diff --git a/sonic_platform_base/sonic_sfp/sfputilhelper.py b/sonic_platform_base/sonic_sfp/sfputilhelper.py index ece2885dd..74b8ec116 100644 --- a/sonic_platform_base/sonic_sfp/sfputilhelper.py +++ b/sonic_platform_base/sonic_sfp/sfputilhelper.py @@ -14,7 +14,7 @@ from natsort import natsorted from portconfig import get_port_config from sonic_py_common import device_info - from sonic_py_common.interface import backplane_prefix, inband_prefix + from sonic_py_common.interface import backplane_prefix, inband_prefix, recirc_prefix except ImportError as e: raise ImportError("%s - required module not found" % str(e)) @@ -127,8 +127,9 @@ def read_porttab_mappings(self, porttabfile, asic_inst=0): # so we use the port's position in the file (zero-based) as bcm_port portname = line.split()[0] - # Ignore if this is an internal backplane interface and Inband interface - if portname.startswith(backplane_prefix()) or portname.startswith(inband_prefix()): + # Ignore if this is an internal backplane, Inband, or recirc interface + if portname.startswith(backplane_prefix()) or portname.startswith(inband_prefix()) or \ + portname.startswith(recirc_prefix()): continue bcm_port = str(port_pos_in_file)