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

Create egress ACL table group during the PFCWD stats list installment #787

Merged
merged 4 commits into from
Feb 15, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions orchagent/pfcwdorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,10 @@ void PfcWdSwOrch<DropHandler, ForwardHandler>::registerInWdDb(const Port& port,
PfcWdOrch<DropHandler, ForwardHandler>::getCountersTable(),
sai_serialize_object_id(queueId));
}

// Create egress table group for each port of pfcwd's interest
sai_object_id_t group_member_oid;
gPortsOrch->bindAclTable(port.m_port_id, SAI_NULL_OBJECT_ID, group_member_oid, ACL_STAGE_EGRESS);
Copy link
Contributor

Choose a reason for hiding this comment

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

this is not correct. you want to reuse bindAclTable function, but you return false if table_oid == NULL.
You want to create an empty table group, the return should be success, not false.

I suggest you to define a new function createAclTableGroup(), and call gPortsOrch->createAclTableGroup(port.m_port_id, ACL_STAGE_EGRESS)

Then, you rewrite bindAclTable to use createAclTableGroup.

}

template <typename DropHandler, typename ForwardHandler>
Expand Down
10 changes: 8 additions & 2 deletions orchagent/portsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,12 @@ bool PortsOrch::bindAclTable(sai_object_id_t id, sai_object_id_t table_oid, sai_
SWSS_LOG_NOTICE("Create ACL table group and bind port %s to it", port.m_alias.c_str());
}

if (table_oid == SAI_NULL_OBJECT_ID)
{
SWSS_LOG_NOTICE("Invalid ACL table %lx; Drop member creation in ACL table group %lx", table_oid, groupOid);
return false;
}

// Create an ACL group member with table_oid and groupOid
vector<sai_attribute_t> member_attrs;

Expand All @@ -874,8 +880,8 @@ bool PortsOrch::bindAclTable(sai_object_id_t id, sai_object_id_t table_oid, sai_
status = sai_acl_api->create_acl_table_group_member(&group_member_oid, gSwitchId, (uint32_t)member_attrs.size(), member_attrs.data());
if (status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("Failed to create member in ACL table group %lx for ACL table group %lx, rv:%d",
table_oid, groupOid, status);
SWSS_LOG_ERROR("Failed to create member in ACL table group %lx for ACL table %lx, rv:%d",
groupOid, table_oid, status);
return false;
}

Expand Down