Skip to content

Commit 8526858

Browse files
nnelluri-ciscoyifan-nexthop
authored andcommitted
fix for qos failures for master branch due to backplane changes (sonic-net#19495)
Approach exclude new DPU interfaces Ethernet-224 to Ethernet-280 What is the motivation for this PR? The new DPU interfaces Ethernet-224 to Ethernet-280 is breaking test_qos_sai.py regression in latest master branch. How did you verify/test it? Ran complete test_qos_sai.py regression under sonic-mgmt. with new changes and all tests pass. Signed-off-by: YiFan Wang <yifan@nexthop.ai>
1 parent 653623b commit 8526858

2 files changed

Lines changed: 28 additions & 11 deletions

File tree

tests/common/devices/sonic.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
from tests.common import constants
2828

2929
logger = logging.getLogger(__name__)
30-
3130
PROCESS_TO_CONTAINER_MAP = {
3231
"orchagent": "swss",
3332
"syncd": "syncd"
@@ -2411,6 +2410,17 @@ def is_backend_portchannel(self, port_channel, mg_facts):
24112410
def is_backend_port(self, port, mg_facts):
24122411
return True if "Ethernet-BP" in port else False
24132412

2413+
def get_backplane_ports(self):
2414+
# get current interface data from config_db.json
2415+
config_facts = self.config_facts(host=self.hostname, source='running', verbose=False)['ansible_facts']
2416+
config_db_ports = config_facts["PORT"]
2417+
# Build set of Ethernet ports with 18.x.202.0/31 IPs to exclude
2418+
excluded_ports = set()
2419+
for port, val in config_db_ports.items():
2420+
if "role" in val:
2421+
excluded_ports.add(port)
2422+
return excluded_ports
2423+
24142424
def active_ip_interfaces(self, ip_ifs, tbinfo, ns_arg=DEFAULT_NAMESPACE, intf_num="all", ip_type="ipv4"):
24152425
"""
24162426
Return a dict of active IP (Ethernet or PortChannel) interfaces, with
@@ -2421,10 +2431,10 @@ def active_ip_interfaces(self, ip_ifs, tbinfo, ns_arg=DEFAULT_NAMESPACE, intf_nu
24212431
"""
24222432
active_ip_intf_cnt = 0
24232433
mg_facts = self.get_extended_minigraph_facts(tbinfo, ns_arg)
2424-
config_facts_ports = self.config_facts(host=self.hostname, source="running")["ansible_facts"].get("PORT", {})
2434+
excluded_ports = self.get_backplane_ports()
24252435
ip_ifaces = {}
24262436
for k, v in list(ip_ifs.items()):
2427-
if ((k.startswith("Ethernet") and config_facts_ports.get(k, {}).get("role", "") != "Dpc" and
2437+
if ((k.startswith("Ethernet") and (k not in excluded_ports) and
24282438
(not k.startswith("Ethernet-BP")) and not is_inband_port(k)) or
24292439
(k.startswith("PortChannel") and not self.is_backend_portchannel(k, mg_facts))):
24302440
if ip_type == "ipv4":

tests/qos/qos_sai_base.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,16 +1006,23 @@ def dutConfig(
10061006
dst_dut = get_src_dst_asic_and_duts['dst_dut']
10071007
src_mgFacts = src_dut.get_extended_minigraph_facts(tbinfo)
10081008
topo = tbinfo["topo"]["name"]
1009-
src_mgFacts['minigraph_ptf_indices'] = {
1009+
1010+
# Build a set of Ethernet ports to exclude (with 18.x.202.0/31 IPs)
1011+
excluded_ports = set()
1012+
excluded_ports.update(duthosts[0].get_backplane_ports())
1013+
# Filter minigraph_ptf_indices to exclude dynamic ports
1014+
src_mgFacts["minigraph_ptf_indices"] = {
10101015
key: value
1011-
for key, value in src_mgFacts['minigraph_ptf_indices'].items()
1012-
if not key.startswith("Ethernet-BP")
1013-
}
1014-
src_mgFacts['minigraph_ports'] = {
1016+
for key, value in src_mgFacts["minigraph_ptf_indices"].items()
1017+
if key not in excluded_ports
1018+
}
1019+
1020+
# Filter minigraph_ports to exclude dynamic ports
1021+
src_mgFacts["minigraph_ports"] = {
10151022
key: value
1016-
for key, value in src_mgFacts['minigraph_ports'].items()
1017-
if not key.startswith("Ethernet-BP")
1018-
}
1023+
for key, value in src_mgFacts["minigraph_ports"].items()
1024+
if key not in excluded_ports
1025+
}
10191026
bgp_peer_ip_key = "peer_ipv6" if ip_type == "ipv6" else "peer_ipv4"
10201027
ip_version = 6 if ip_type == "ipv6" else 4
10211028
vlan_info = {}

0 commit comments

Comments
 (0)