Skip to content

Commit

Permalink
Do some enhancement to ACLorch for mclag
Browse files Browse the repository at this point in the history
* Aclorch can be the consumer of the APP_ACL_TABLE_NAME and
  APP_ACL_RULE_TABLE_NAME tables in APP_DB
* ACL rule can match out port

Signed-off-by: shine.chen <shine.chen@nephosinc.com>
  • Loading branch information
shine.chen committed May 5, 2019
1 parent 9326978 commit 5079d97
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
11 changes: 9 additions & 2 deletions orchagent/aclorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,13 @@ bool AclTable::create()
table_attrs.push_back(attr);
}

if (type == ACL_TABLE_L3)
{
attr.id = SAI_ACL_TABLE_ATTR_FIELD_OUT_PORTS;
attr.value.booldata = true;
table_attrs.push_back(attr);
}

sai_status_t status = sai_acl_api->create_acl_table(&m_oid, gSwitchId, (uint32_t)table_attrs.size(), table_attrs.data());

if (status == SAI_STATUS_SUCCESS)
Expand Down Expand Up @@ -1883,12 +1890,12 @@ void AclOrch::doTask(Consumer &consumer)

string table_name = consumer.getTableName();

if (table_name == CFG_ACL_TABLE_NAME)
if (table_name == CFG_ACL_TABLE_NAME || table_name == APP_ACL_TABLE_NAME)
{
unique_lock<mutex> lock(m_countersMutex);
doAclTableTask(consumer);
}
else if (table_name == CFG_ACL_RULE_TABLE_NAME)
else if (table_name == CFG_ACL_RULE_TABLE_NAME || table_name == APP_ACL_RULE_TABLE_NAME)
{
unique_lock<mutex> lock(m_countersMutex);
doAclRuleTask(consumer);
Expand Down
6 changes: 5 additions & 1 deletion orchagent/orchdaemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,14 @@ bool OrchDaemon::init()

TableConnector confDbAclTable(m_configDb, CFG_ACL_TABLE_NAME);
TableConnector confDbAclRuleTable(m_configDb, CFG_ACL_RULE_TABLE_NAME);
TableConnector appDbAclTable(m_applDb, APP_ACL_TABLE_NAME);
TableConnector appDbAclRuleTable(m_applDb, APP_ACL_RULE_TABLE_NAME);

vector<TableConnector> acl_table_connectors = {
confDbAclTable,
confDbAclRuleTable
confDbAclRuleTable,
appDbAclTable,
appDbAclRuleTable
};

vector<string> dtel_tables = {
Expand Down

0 comments on commit 5079d97

Please sign in to comment.