Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[muxorch] Bind all ports to drop ACL table #2027

Merged
merged 1 commit into from
Nov 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion orchagent/muxorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -790,9 +790,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);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you can see from line 783, the same table shall be used if pfcwd has already created this table. You may want to apply the same fix here as well -

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I can update the PR with requested changes. But cisco platform does not use drop ACL for PFC wd so I won't be able to verify it. Is it fine to change?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, then leave it for now and revisit later

}

void MuxAclHandler::createMuxAclRule(shared_ptr<AclRuleMux> rule, string strTable)
Expand All @@ -817,6 +817,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