Skip to content

Commit ad5c620

Browse files
stepanblyschaktheasianpianist
authored andcommitted
[aclorch] Fix TODO: use SAI object API to query capabilities (sonic-net#2743)
- What I did Resolved TODO - Why I did it To resolve TODO - How I verified it Build and run. Verify capabilities written in STATE DB: 127.0.0.1:6379[6]> hgetall "SWITCH_CAPABILITY|switch" ... 13) "ACL_ACTION|PACKET_ACTION" 14) "DROP,FORWARD" ... Signed-off-by: Stepan Blyschak <[email protected]>
1 parent 96dff6c commit ad5c620

1 file changed

Lines changed: 3 additions & 12 deletions

File tree

orchagent/aclorch.cpp

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ static acl_rule_attr_lookup_t aclDTelActionLookup =
111111
{ ACTION_DTEL_REPORT_ALL_PACKETS, SAI_ACL_ENTRY_ATTR_ACTION_DTEL_REPORT_ALL_PACKETS }
112112
};
113113

114-
static acl_rule_attr_lookup_t aclOtherActionLookup =
114+
static acl_rule_attr_lookup_t aclOtherActionLookup =
115115
{
116116
{ ACTION_COUNTER, SAI_ACL_ENTRY_ATTR_ACTION_COUNTER}
117117
};
@@ -437,7 +437,7 @@ static map<sai_acl_counter_attr_t, sai_acl_counter_attr_t> aclCounterLookup =
437437
{SAI_ACL_COUNTER_ATTR_ENABLE_PACKET_COUNT, SAI_ACL_COUNTER_ATTR_PACKETS},
438438
};
439439

440-
static map<AclObjectStatus, string> aclObjectStatusLookup =
440+
static map<AclObjectStatus, string> aclObjectStatusLookup =
441441
{
442442
{AclObjectStatus::ACTIVE, "Active"},
443443
{AclObjectStatus::INACTIVE, "Inactive"},
@@ -3573,8 +3573,6 @@ void AclOrch::queryAclActionAttrEnumValues(const string &action_name,
35733573
SWSS_LOG_THROW("%s is not an enum", action_name.c_str());
35743574
}
35753575

3576-
// TODO: once sai object api is available make this code compile
3577-
#ifdef SAIREDIS_SUPPORT_OBJECT_API
35783576
vector<int32_t> values_list(meta->enummetadata->valuescount);
35793577
sai_s32_list_t values;
35803578
values.count = static_cast<uint32_t>(values_list.size());
@@ -3593,7 +3591,7 @@ void AclOrch::queryAclActionAttrEnumValues(const string &action_name,
35933591
}
35943592
else
35953593
{
3596-
SWSS_LOG_WARN("Failed to query enum values supported for ACL action %s - ",
3594+
SWSS_LOG_WARN("Failed to query enum values supported for ACL action %s - "
35973595
"API is not implemented, assuming all values are supported for this action",
35983596
action_name.c_str());
35993597
/* assume all enum values are supported */
@@ -3602,13 +3600,6 @@ void AclOrch::queryAclActionAttrEnumValues(const string &action_name,
36023600
m_aclEnumActionCapabilities[acl_action].insert(meta->enummetadata->values[i]);
36033601
}
36043602
}
3605-
#else
3606-
/* assume all enum values are supported until sai object api is available */
3607-
for (size_t i = 0; i < meta->enummetadata->valuescount; i++)
3608-
{
3609-
m_aclEnumActionCapabilities[acl_action].insert(meta->enummetadata->values[i]);
3610-
}
3611-
#endif
36123603

36133604
// put supported values in DB
36143605
for (const auto& it: lookupMap)

0 commit comments

Comments
 (0)