From 20dde0c1bca95432b5a00c7eab6fe05e0645232b Mon Sep 17 00:00:00 2001 From: judyjoseph <53951155+judyjoseph@users.noreply.github.com> Date: Mon, 28 Mar 2022 10:31:39 -0700 Subject: [PATCH] Fix for handling broadcom DNX ASIC to have ipv4 and ipv6 ACL rules in separate tables. (#2178) Use the sub_platform env variable which is populated via swss_vars and sonic_version.yml --- orchagent/aclorch.cpp | 5 ++++- orchagent/orch.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/orchagent/aclorch.cpp b/orchagent/aclorch.cpp index dbe2f0537984..9e873a47db19 100644 --- a/orchagent/aclorch.cpp +++ b/orchagent/aclorch.cpp @@ -2645,6 +2645,7 @@ void AclOrch::init(vector& connectors, PortsOrch *portOrch, Mirr // Broadcom and Mellanox. Virtual switch is also supported for testing // purposes. string platform = getenv("platform") ? getenv("platform") : ""; + string sub_platform = getenv("sub_platform") ? getenv("sub_platform") : ""; if (platform == BRCM_PLATFORM_SUBSTRING || platform == CISCO_8000_PLATFORM_SUBSTRING || platform == MLNX_PLATFORM_SUBSTRING || @@ -2676,9 +2677,11 @@ void AclOrch::init(vector& connectors, PortsOrch *portOrch, Mirr m_mirrorTableCapabilities[TABLE_TYPE_MIRRORV6] ? "yes" : "no"); // In Mellanox platform, V4 and V6 rules are stored in different tables + // In Broadcom DNX platform also, V4 and V6 rules are stored in different tables if (platform == MLNX_PLATFORM_SUBSTRING || platform == CISCO_8000_PLATFORM_SUBSTRING || - platform == MRVL_PLATFORM_SUBSTRING) + platform == MRVL_PLATFORM_SUBSTRING || + (platform == BRCM_PLATFORM_SUBSTRING && sub_platform == BRCM_DNX_PLATFORM_SUBSTRING)) { m_isCombinedMirrorV6Table = false; } diff --git a/orchagent/orch.h b/orchagent/orch.h index ea5b48278475..f6b13aa9c684 100644 --- a/orchagent/orch.h +++ b/orchagent/orch.h @@ -34,6 +34,7 @@ const char state_db_key_delimiter = '|'; #define INVM_PLATFORM_SUBSTRING "innovium" #define MLNX_PLATFORM_SUBSTRING "mellanox" #define BRCM_PLATFORM_SUBSTRING "broadcom" +#define BRCM_DNX_PLATFORM_SUBSTRING "broadcom-dnx" #define BFN_PLATFORM_SUBSTRING "barefoot" #define VS_PLATFORM_SUBSTRING "vs" #define NPS_PLATFORM_SUBSTRING "nephos"