From 37e533d1f153ba04107b2ed3eb41fbdae466f690 Mon Sep 17 00:00:00 2001 From: Kumaresh Babu JP <100332470+kbabujp@users.noreply.github.com> Date: Mon, 25 Nov 2024 21:48:21 +0530 Subject: [PATCH] Changes to support chip name change from innovium to marvell-teralynx (#14330) Adding the changes to support chip name change from Innovium to marvell-teralynx Summary: The chip name for innvium is changed to marvell-teralynx. Same need to be modified in sonic-mgmt where we do conditional checks for different scripts. This PR has dependencies on the below sonic-buildimage PR sonic-net/sonic-buildimage#19829 --- .../files/acstests/everflow_policer_test.py | 8 ++++--- .../test/files/acstests/everflow_tb_test.py | 4 ++-- tests/common/innovium_data.py | 2 -- tests/common/marvell_teralynx_data.py | 2 ++ .../tests_mark_conditions.yaml | 23 ++++++++++--------- tests/common/system_utils/docker.py | 4 ++-- tests/everflow/everflow_test_utilities.py | 4 ++-- tests/everflow/test_everflow_testbed.py | 2 +- tests/fib/test_fib.py | 2 +- tests/ipfwd/test_nhop_group.py | 6 ++--- tests/qos/test_buffer.py | 6 ++--- tests/saitests/py3/sai_qos_tests.py | 4 ++-- 12 files changed, 35 insertions(+), 32 deletions(-) delete mode 100644 tests/common/innovium_data.py create mode 100644 tests/common/marvell_teralynx_data.py diff --git a/ansible/roles/test/files/acstests/everflow_policer_test.py b/ansible/roles/test/files/acstests/everflow_policer_test.py index 09c5cc96b9f..00f611b7474 100644 --- a/ansible/roles/test/files/acstests/everflow_policer_test.py +++ b/ansible/roles/test/files/acstests/everflow_policer_test.py @@ -216,7 +216,8 @@ def checkMirroredFlow(self): if self.asic_type in ["mellanox"]: import binascii payload = binascii.unhexlify("0"*44) + str(payload) # Add the padding - elif self.asic_type in ["innovium"] or self.hwsku in ["rd98DX35xx_cn9131", "rd98DX35xx", "Nokia-7215-A1"]: + elif self.asic_type in ["marvell-teralynx"] or \ + self.hwsku in ["rd98DX35xx_cn9131", "rd98DX35xx", "Nokia-7215-A1"]: import binascii payload = binascii.unhexlify("0"*24) + str(payload) # Add the padding @@ -248,7 +249,7 @@ def checkMirroredFlow(self): masked_exp_pkt.set_do_not_care_scapy(scapy.IP, "flags") masked_exp_pkt.set_do_not_care_scapy(scapy.IP, "chksum") - if self.asic_type in ["innovium"]: + if self.asic_type in ["marvell-teralynx"]: masked_exp_pkt.set_do_not_care_scapy(scapy.GRE, "seqnum_present") if self.asic_type in ["marvell"]: masked_exp_pkt.set_do_not_care_scapy(scapy.IP, "id") @@ -270,7 +271,8 @@ def match_payload(pkt): pkt = scapy.Ether(pkt).load pkt = pkt[22:] # Mask the Mellanox specific inner header pkt = scapy.Ether(pkt) - elif self.asic_type in ["innovium"] or self.hwsku in ["rd98DX35xx_cn9131", "rd98DX35xx", "Nokia-7215-A1"]: + elif self.asic_type in ["marvell-teralynx"] or \ + self.hwsku in ["rd98DX35xx_cn9131", "rd98DX35xx", "Nokia-7215-A1"]: pkt = scapy.Ether(pkt)[scapy.GRE].payload pkt_str = str(pkt) pkt = scapy.Ether(pkt_str[8:]) diff --git a/ansible/roles/test/files/acstests/everflow_tb_test.py b/ansible/roles/test/files/acstests/everflow_tb_test.py index 6cfb48dfa72..5977332873a 100644 --- a/ansible/roles/test/files/acstests/everflow_tb_test.py +++ b/ansible/roles/test/files/acstests/everflow_tb_test.py @@ -146,7 +146,7 @@ def sendReceive(self, pkt2send, src_port, destination_ports): payload = str(scapy_pkt[scapy.GRE].payload)[22:] if self.asic_type in ["barefoot"]: payload = str(scapy_pkt[scapy.GRE].payload)[12:] - if self.asic_type in ["innovium"]: + if self.asic_type in ["marvell-teralynx"]: payload = str(scapy_pkt[scapy.GRE].payload)[8:] inner_pkt = scapy.Ether(payload) @@ -270,4 +270,4 @@ def runTest(self): (tests_passed, tests_total) = self.runEverflowTests() print("Passed %d test of %d" % (tests_passed, tests_total)) - assert(tests_passed == tests_total) + assert (tests_passed == tests_total) diff --git a/tests/common/innovium_data.py b/tests/common/innovium_data.py deleted file mode 100644 index c0daa5de02b..00000000000 --- a/tests/common/innovium_data.py +++ /dev/null @@ -1,2 +0,0 @@ -def is_innovium_device(dut): - return dut.facts["asic_type"] == "innovium" diff --git a/tests/common/marvell_teralynx_data.py b/tests/common/marvell_teralynx_data.py new file mode 100644 index 00000000000..1662c3e56e0 --- /dev/null +++ b/tests/common/marvell_teralynx_data.py @@ -0,0 +1,2 @@ +def is_marvell_teralynx_device(dut): + return dut.facts["asic_type"] == "marvell-teralynx" diff --git a/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml b/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml index 967725fa32a..4342670258e 100644 --- a/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml +++ b/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml @@ -53,9 +53,9 @@ arp/test_neighbor_mac_noptf.py: arp/test_unknown_mac.py: skip: - reason: "Behavior on cisco-8000 & Innovium(Marvell) platform for unknown MAC is flooding rather than DROP, hence skipping." + reason: "Behavior on cisco-8000 & (Marvell) platform for unknown MAC is flooding rather than DROP, hence skipping." conditions: - - "asic_type in ['cisco-8000','innovium']" + - "asic_type in ['cisco-8000','marvell-teralynx']" arp/test_wr_arp.py: skip: @@ -295,17 +295,17 @@ decap/test_decap.py::test_decap[ttl=pipe, dscp=pipe, vxlan=set_unset]: decap/test_decap.py::test_decap[ttl=pipe, dscp=uniform, vxlan=disable]: skip: conditions_logical_operator: or - reason: "Not supported on backend, broadcom before 202012 release, innovium platform. Skip 7260CX3 T1 topo in 202305 release" + reason: "Not supported on backend, broadcom before 202012 release, marvell-teralynx platform. Skip 7260CX3 T1 topo in 202305 release" conditions: - - "(topo_name in ['t1-backend', 't0-backend']) or (asic_type in ['broadcom'] and release in ['201811', '201911']) or asic_type in ['innovium']" + - "(topo_name in ['t1-backend', 't0-backend']) or (asic_type in ['broadcom'] and release in ['201811', '201911']) or asic_type in ['marvell-teralynx']" - "'7260CX3' in hwsku and release in ['202305'] and 't1' in topo_type" decap/test_decap.py::test_decap[ttl=pipe, dscp=uniform, vxlan=set_unset]: skip: - reason: "Not supported on backend, T2 topologies , broadcom platforms before 202012 release, innovium, x86_64-8111_32eh_o-r0 platform. Skip on mellanox dualtor setups for github issue #9646. Skip on 7260CX3 T1 topo in 202305 release" + reason: "Not supported on backend, T2 topologies , broadcom platforms before 202012 release, marvell-teralynx, x86_64-8111_32eh_o-r0 platform. Skip on mellanox dualtor setups for github issue #9646. Skip on 7260CX3 T1 topo in 202305 release" conditions_logical_operator: or conditions: - - "('t2' in topo_name) or (topo_name in ['t1-backend', 't0-backend']) or (asic_type in ['broadcom'] and release in ['201811', '201911']) or asic_type in ['innovium'] or platform in ['x86_64-8111_32eh_o-r0']" + - "('t2' in topo_name) or (topo_name in ['t1-backend', 't0-backend']) or (asic_type in ['broadcom'] and release in ['201811', '201911']) or asic_type in ['marvell-teralynx'] or platform in ['x86_64-8111_32eh_o-r0']" - "https://github.com/sonic-net/sonic-mgmt/issues/9646 and 'dualtor' in topo_name and asic_type in ['mellanox']" - "'7260CX3' in hwsku and release in ['202305'] and 't1' in topo_type" @@ -1087,11 +1087,12 @@ ip/test_ip_packet.py: ip/test_ip_packet.py::TestIPPacket::test_forward_ip_packet_with_0xffff_chksum_drop: skip: - reason: "Broadcom, Cisco, Barefoot, Innovium and Marvell Asic will tolorate IP packets with 0xffff checksum + reason: "Broadcom, Cisco, Barefoot, and Marvell Asic will tolorate IP packets with 0xffff checksum / Skipping ip packet test since can't provide enough interfaces" conditions_logical_operator: or conditions: - - "asic_type in ['broadcom', 'cisco-8000', 'marvell', 'barefoot', 'innovium'] and asic_subtype not in ['broadcom-dnx']" + + - "asic_type in ['broadcom', 'cisco-8000', 'marvell', 'barefoot', 'marvell-teralynx'] and asic_subtype not in ['broadcom-dnx']" - "len(minigraph_interfaces) < 2 and len(minigraph_portchannels) < 2" ip/test_ip_packet.py::TestIPPacket::test_forward_ip_packet_with_0xffff_chksum_tolerant: @@ -1837,7 +1838,7 @@ sub_port_interfaces: skip: reason: "Unsupported platform or asic" conditions: - - "is_multi_asic==True or asic_gen not in ['td2', 'spc1', 'spc2', 'spc3', 'spc4'] and asic_type not in ['barefoot','innovium']" + - "is_multi_asic==True or asic_gen not in ['td2', 'spc1', 'spc2', 'spc3', 'spc4'] and asic_type not in ['barefoot','marvell-teralynx']" sub_port_interfaces/test_show_subinterface.py::test_subinterface_status[port]: skip: @@ -1845,7 +1846,7 @@ sub_port_interfaces/test_show_subinterface.py::test_subinterface_status[port]: conditions_logical_operator: or conditions: - "asic_type in ['vs'] and https://github.com/sonic-net/sonic-buildimage/issues/19735" - - "is_multi_asic==True or asic_gen not in ['td2', 'spc1', 'spc2', 'spc3', 'spc4'] and asic_type not in ['barefoot','innovium']" + - "is_multi_asic==True or asic_gen not in ['td2', 'spc1', 'spc2', 'spc3', 'spc4'] and asic_type not in ['barefoot','marvell-teralynx']" sub_port_interfaces/test_show_subinterface.py::test_subinterface_status[port_in_lag]: skip: @@ -1861,7 +1862,7 @@ sub_port_interfaces/test_sub_port_interfaces.py::TestSubPorts::test_tunneling_be conditions_logical_operator: or conditions: - "asic_type=='cisco-8000'" - - "is_multi_asic==True or asic_gen not in ['td2', 'spc1', 'spc2', 'spc3', 'spc4'] and asic_type not in ['barefoot','innovium']" + - "is_multi_asic==True or asic_gen not in ['td2', 'spc1', 'spc2', 'spc3', 'spc4'] and asic_type not in ['barefoot','marvell-teralynx']" sub_port_interfaces/test_sub_port_interfaces.py::TestSubPorts::test_untagged_packet_not_routed[port_in_lag] : skip: diff --git a/tests/common/system_utils/docker.py b/tests/common/system_utils/docker.py index e6beb2c4730..dc7fdf06a35 100644 --- a/tests/common/system_utils/docker.py +++ b/tests/common/system_utils/docker.py @@ -10,7 +10,7 @@ from tests.common.mellanox_data import is_mellanox_device from tests.common.errors import RunAnsibleModuleFail from tests.common.cisco_data import is_cisco_device -from tests.common.innovium_data import is_innovium_device +from tests.common.marvell_teralynx_data import is_marvell_teralynx_device from tests.common.helpers.constants import DEFAULT_NAMESPACE logger = logging.getLogger(__name__) @@ -244,7 +244,7 @@ def _get_vendor_id(duthost): vendor_id = "mlnx" elif is_cisco_device(duthost): vendor_id = "cisco" - elif is_innovium_device(duthost): + elif is_marvell_teralynx_device(duthost): vendor_id = "invm" else: error_message = '"{}" does not currently support swap_syncd'.format(duthost.facts["asic_type"]) diff --git a/tests/everflow/everflow_test_utilities.py b/tests/everflow/everflow_test_utilities.py index 8377cb40548..fa694220fdc 100644 --- a/tests/everflow/everflow_test_utilities.py +++ b/tests/everflow/everflow_test_utilities.py @@ -862,7 +862,7 @@ def get_expected_mirror_packet(mirror_session, setup, duthost, direction, mirror else: payload = binascii.unhexlify("0" * 44) + bytes(payload) if ( - duthost.facts["asic_type"] in ["barefoot", "cisco-8000", "innovium"] + duthost.facts["asic_type"] in ["barefoot", "cisco-8000", "marvell-teralynx"] or duthost.facts.get("platform_asic") in ["broadcom-dnx"] or duthost.facts["hwsku"] in ["rd98DX35xx", "rd98DX35xx_cn9131", "Nokia-7215-A1"] @@ -893,7 +893,7 @@ def get_expected_mirror_packet(mirror_session, setup, duthost, direction, mirror if duthost.facts["asic_type"] == 'marvell': expected_packet.set_do_not_care_scapy(packet.IP, "id") expected_packet.set_do_not_care_scapy(packet.GRE, "seqnum_present") - if duthost.facts["asic_type"] in ["cisco-8000", "innovium"] or \ + if duthost.facts["asic_type"] in ["cisco-8000", "marvell-teralynx"] or \ duthost.facts.get("platform_asic") in ["broadcom-dnx"]: expected_packet.set_do_not_care_scapy(packet.GRE, "seqnum_present") diff --git a/tests/everflow/test_everflow_testbed.py b/tests/everflow/test_everflow_testbed.py index cfe3c8f109e..114f7549e91 100644 --- a/tests/everflow/test_everflow_testbed.py +++ b/tests/everflow/test_everflow_testbed.py @@ -529,7 +529,7 @@ def test_everflow_dscp_with_policer( hostvars = everflow_dut.host.options['variable_manager']._hostvars[everflow_dut.hostname] everflow_tolerance = 10 - if vendor == 'innovium': + if vendor == 'marvell-teralynx': everflow_tolerance = 11 rate_limit = 100 diff --git a/tests/fib/test_fib.py b/tests/fib/test_fib.py index e65b90d81e2..d98337ae71b 100644 --- a/tests/fib/test_fib.py +++ b/tests/fib/test_fib.py @@ -189,7 +189,7 @@ def hash_keys(duthost): hash_keys.remove('ip-proto') if 'ingress-port' in hash_keys: hash_keys.remove('ingress-port') - if duthost.facts['asic_type'] in ["innovium", "cisco-8000"]: + if duthost.facts['asic_type'] in ["marvell-teralynx", "cisco-8000"]: if 'ip-proto' in hash_keys: hash_keys.remove('ip-proto') # remove the ingress port from multi asic platform diff --git a/tests/ipfwd/test_nhop_group.py b/tests/ipfwd/test_nhop_group.py index 86a1500b685..0a801b12d1f 100644 --- a/tests/ipfwd/test_nhop_group.py +++ b/tests/ipfwd/test_nhop_group.py @@ -14,7 +14,7 @@ from tests.common.helpers.assertions import pytest_require, pytest_assert from tests.common.cisco_data import is_cisco_device from tests.common.mellanox_data import is_mellanox_device, get_chip_type -from tests.common.innovium_data import is_innovium_device +from tests.common.marvell_teralynx_data import is_marvell_teralynx_device from tests.common.vs_data import is_vs_device from tests.common.utilities import wait_until from tests.common.platform.device_utils import fanout_switch_port_lookup, toggle_one_link @@ -356,7 +356,7 @@ def test_nhop_group_member_count(duthost, tbinfo, loganalyzer): polling_interval = 1 sleep_time = 380 sleep_time_sync_before = 120 - elif is_innovium_device(duthost): + elif is_marvell_teralynx_device(duthost): default_max_nhop_paths = 3 polling_interval = 10 sleep_time = 120 @@ -414,7 +414,7 @@ def test_nhop_group_member_count(duthost, tbinfo, loganalyzer): # Consider both available nhop_grp and nhop_grp_mem before creating nhop_groups nhop_group_mem_count = int((nhop_group_mem_count) / default_max_nhop_paths * CISCO_NHOP_GROUP_FILL_PERCENTAGE) nhop_group_count = min(nhop_group_mem_count, nhop_group_count) - elif is_innovium_device(duthost): + elif is_marvell_teralynx_device(duthost): crm_stat = get_crm_info(duthost, asic) nhop_group_count = crm_stat["available_nhop_grp"] else: diff --git a/tests/qos/test_buffer.py b/tests/qos/test_buffer.py index 784054ca54a..43fc3415507 100644 --- a/tests/qos/test_buffer.py +++ b/tests/qos/test_buffer.py @@ -11,8 +11,8 @@ from tests.common.utilities import wait_until from tests.common.helpers.assertions import pytest_assert, pytest_require from tests.common.fixtures.conn_graph_facts import conn_graph_facts # noqa F401 +from tests.common.marvell_teralynx_data import is_marvell_teralynx_device from tests.common.mellanox_data import is_mellanox_device, get_chip_type -from tests.common.innovium_data import is_innovium_device from tests.common.plugins.loganalyzer.loganalyzer import LogAnalyzer from tests.common.utilities import check_qos_db_fv_reference_with_table from tests.common.utilities import skip_release @@ -332,7 +332,7 @@ def setup_module(duthosts, rand_one_dut_hostname, request): duthost = duthosts[rand_one_dut_hostname] detect_buffer_model(duthost) - if not is_mellanox_device(duthost) and not is_innovium_device(duthost): + if not is_mellanox_device(duthost) and not is_marvell_teralynx_device(duthost): load_lossless_headroom_data(duthost) yield return @@ -2929,7 +2929,7 @@ def _check_port_buffer_info_and_return(dut_db_info, table, ids, port, expected_p buffer_items_to_check_dict = { "up": buffer_table_up, "down": buffer_table_down} - if is_innovium_device(duthost): + if is_marvell_teralynx_device(duthost): buffer_items_to_check_dict["up"][KEY_2_LOSSLESS_QUEUE][3] = ( 'BUFFER_QUEUE_TABLE', '5-7', '[BUFFER_PROFILE_TABLE:egress_lossy_profile]') buffer_items_to_check_dict["down"][KEY_2_LOSSLESS_QUEUE][3] = ( diff --git a/tests/saitests/py3/sai_qos_tests.py b/tests/saitests/py3/sai_qos_tests.py index e7ef618eb49..aa564f20436 100755 --- a/tests/saitests/py3/sai_qos_tests.py +++ b/tests/saitests/py3/sai_qos_tests.py @@ -3229,7 +3229,7 @@ def runTest(self): print("pkts sent: %d, lower bound: %d, actual headroom pool watermark: %d, upper_bound: %d" % ( wm_pkt_num, expected_wm, hdrm_pool_wm, upper_bound_wm), file=sys.stderr) - if 'innovium' not in self.asic_type: + if 'marvell-teralynx' not in self.asic_type: assert (expected_wm <= hdrm_pool_wm) assert (hdrm_pool_wm <= upper_bound_wm) if self.platform_asic and self.platform_asic == "broadcom-dnx": @@ -3294,7 +3294,7 @@ def runTest(self): self.src_client, self.buf_pool_roid) sys.stderr.write('After PG headroom filled, actual headroom pool watermark {}, upper_bound {}\n'.format( hdrm_pool_wm, upper_bound_wm)) - if 'innovium' not in self.asic_type: + if 'marvell-teralynx' not in self.asic_type: assert (expected_wm <= hdrm_pool_wm) assert (hdrm_pool_wm <= upper_bound_wm) # at this point headroom pool should be full. send few more packets to continue causing drops