From 836d65d616f30270886073ebb34ec57dcacb9557 Mon Sep 17 00:00:00 2001 From: "Marty Y. Lok" <76118573+mlok-nokia@users.noreply.github.com> Date: Mon, 13 Mar 2023 13:58:32 -0400 Subject: [PATCH] [EVERFLOW][ACL_ATBLE] Fix for everflow ACL_TABLE in config_db not having the routed ports when no -ASIC in the asic_port_name (#13532) Why I did it After the renaming of the asic_port_name in port_config.ini file (PR: #13053 ), the asic_ifname in port_config.ini is changed from '-ASIC' to just port. Example: 'Eth0-ASIC0' to 'Eth0'. However, with this change a config_db generated via config load_minigraph would cause the EVERFLOW and EVERFLOWV6 tables under ACL_TABLE to not have any of non-LAG front panel interfaces. This was causing the EVERFLOW suite to fail. How I did it In parse_asic_external_neigbhors in minigraph.py there was a check that the asic_name.lower() (like asic0) is present in the port_alias_asic_map. However with -ASIC removed from the asic_ifname, the port_alias_asic_map would not have the asic_name and thus any non-LAG neighbor would not be included. Fix was the ignore the asic name change as the port_alias_asic_map is already only looking for ports in just the same asic as asic_name. How to verify it Execute "config load_minigraph" with the mingraph which is generated by sonic-mgmt gen-minigraph script. And confirm ono-lag interface are present in the Everfloe table in the config_dbs. Signed-off-by: mlok --- src/sonic-config-engine/minigraph.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 68f20b4677..f409d926ce 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -333,15 +333,13 @@ def parse_asic_external_link(link, asic_name, hostname): # if chassis internal is false, the interface name will be # interface alias which should be converted to asic port name if (enddevice.lower() == hostname.lower()): - if ((endport in port_alias_asic_map) and - (asic_name.lower() in port_alias_asic_map[endport].lower())): + if endport in port_alias_asic_map: endport = port_alias_asic_map[endport] neighbors[port_alias_map[endport]] = {'name': startdevice, 'port': startport} if bandwidth: port_speeds[port_alias_map[endport]] = bandwidth elif (startdevice.lower() == hostname.lower()): - if ((startport in port_alias_asic_map) and - (asic_name.lower() in port_alias_asic_map[startport].lower())): + if startport in port_alias_asic_map: startport = port_alias_asic_map[startport] neighbors[port_alias_map[startport]] = {'name': enddevice, 'port': endport} if bandwidth: