Skip to content

Commit

Permalink
Fix for handling broadcom DNX ASIC to have ipv4 and ipv6 ACL rules in…
Browse files Browse the repository at this point in the history
… separate tables. (sonic-net#2178)

Use the sub_platform env variable which is populated via swss_vars and sonic_version.yml
  • Loading branch information
judyjoseph committed Mar 28, 2022
1 parent 5b7c949 commit 20dde0c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion orchagent/aclorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2645,6 +2645,7 @@ void AclOrch::init(vector<TableConnector>& 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 ||
Expand Down Expand Up @@ -2676,9 +2677,11 @@ void AclOrch::init(vector<TableConnector>& 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;
}
Expand Down
1 change: 1 addition & 0 deletions orchagent/orch.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 20dde0c

Please sign in to comment.