Skip to content

Commit 797dab4

Browse files
authored
[muxorch] Bind all ports to drop ACL table (sonic-net#2027)
*BInd all physical ports to drop ACL table
1 parent 99929cd commit 797dab4

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

orchagent/muxorch.cpp

+19-1
Original file line numberDiff line numberDiff line change
@@ -793,9 +793,9 @@ void MuxAclHandler::createMuxAclTable(sai_object_id_t port, string strTable)
793793

794794
acl_table.type = ACL_TABLE_DROP;
795795
acl_table.id = strTable;
796-
acl_table.link(port);
797796
acl_table.stage = ACL_STAGE_INGRESS;
798797
gAclOrch->addAclTable(acl_table);
798+
bindAllPorts(acl_table);
799799
}
800800

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

823+
void MuxAclHandler::bindAllPorts(AclTable &acl_table)
824+
{
825+
SWSS_LOG_ENTER();
826+
827+
auto allPorts = gPortsOrch->getAllPorts();
828+
for (auto &it: allPorts)
829+
{
830+
Port port = it.second;
831+
if (port.m_type == Port::PHY)
832+
{
833+
SWSS_LOG_INFO("Binding port %" PRIx64 " to ACL table %s", port.m_port_id, acl_table.id.c_str());
834+
835+
acl_table.link(port.m_port_id);
836+
acl_table.bind(port.m_port_id);
837+
}
838+
}
839+
}
840+
823841
sai_object_id_t MuxOrch::createNextHopTunnel(std::string tunnelKey, swss::IpAddress& ipAddr)
824842
{
825843
auto it = mux_tunnel_nh_.find(ipAddr);

orchagent/muxorch.h

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class MuxAclHandler
4444
private:
4545
void createMuxAclTable(sai_object_id_t port, string strTable);
4646
void createMuxAclRule(shared_ptr<AclRuleMux> rule, string strTable);
47+
void bindAllPorts(AclTable &acl_table);
4748

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

0 commit comments

Comments
 (0)