Skip to content

Commit

Permalink
[muxorch] Bind all ports to drop ACL table (sonic-net#2027)
Browse files Browse the repository at this point in the history
*BInd all physical ports to drop ACL table
  • Loading branch information
devpatha authored Nov 19, 2021
1 parent 99929cd commit 797dab4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
20 changes: 19 additions & 1 deletion orchagent/muxorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -793,9 +793,9 @@ void MuxAclHandler::createMuxAclTable(sai_object_id_t port, string strTable)

acl_table.type = ACL_TABLE_DROP;
acl_table.id = strTable;
acl_table.link(port);
acl_table.stage = ACL_STAGE_INGRESS;
gAclOrch->addAclTable(acl_table);
bindAllPorts(acl_table);
}

void MuxAclHandler::createMuxAclRule(shared_ptr<AclRuleMux> rule, string strTable)
Expand All @@ -820,6 +820,24 @@ void MuxAclHandler::createMuxAclRule(shared_ptr<AclRuleMux> rule, string strTabl
gAclOrch->addAclRule(rule, strTable);
}

void MuxAclHandler::bindAllPorts(AclTable &acl_table)
{
SWSS_LOG_ENTER();

auto allPorts = gPortsOrch->getAllPorts();
for (auto &it: allPorts)
{
Port port = it.second;
if (port.m_type == Port::PHY)
{
SWSS_LOG_INFO("Binding port %" PRIx64 " to ACL table %s", port.m_port_id, acl_table.id.c_str());

acl_table.link(port.m_port_id);
acl_table.bind(port.m_port_id);
}
}
}

sai_object_id_t MuxOrch::createNextHopTunnel(std::string tunnelKey, swss::IpAddress& ipAddr)
{
auto it = mux_tunnel_nh_.find(ipAddr);
Expand Down
1 change: 1 addition & 0 deletions orchagent/muxorch.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class MuxAclHandler
private:
void createMuxAclTable(sai_object_id_t port, string strTable);
void createMuxAclRule(shared_ptr<AclRuleMux> rule, string strTable);
void bindAllPorts(AclTable &acl_table);

// class shared dict: ACL table name -> ACL table
static std::map<std::string, AclTable> acl_table_;
Expand Down

0 comments on commit 797dab4

Please sign in to comment.