Skip to content

Commit

Permalink
[Aclorch] fix Acl bind point type issue (#516)
Browse files Browse the repository at this point in the history
*  [aclorch] fix acl bind point type issue

* add support for vlan bind point type support

* Revert "add support for vlan bind point type support"

This reverts commit e026cc1c48a3abd6d6fe9b449af7e5b3d37a461d.
  • Loading branch information
keboliu authored and lguohan committed Jul 11, 2018
1 parent 5d31b2d commit 37b1001
Showing 1 changed file with 2 additions and 37 deletions.
39 changes: 2 additions & 37 deletions orchagent/aclorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -952,43 +952,7 @@ bool AclTable::create()

sai_attribute_t attr;
vector<sai_attribute_t> table_attrs;

int32_t range_types_list[] =
{ SAI_ACL_RANGE_TYPE_L4_DST_PORT_RANGE,
SAI_ACL_RANGE_TYPE_L4_SRC_PORT_RANGE
};

set<sai_acl_bind_point_type_t> binds;
for (const auto& portid_pair : ports)
{
Port port;
if (!gPortsOrch->getPort(portid_pair.first, port))
{
continue;
}

switch (port.m_type)
{
case Port::PHY:
binds.insert(SAI_ACL_BIND_POINT_TYPE_PORT);
break;
case Port::VLAN:
binds.insert(SAI_ACL_BIND_POINT_TYPE_VLAN);
break;
case Port::LAG:
binds.insert(SAI_ACL_BIND_POINT_TYPE_LAG);
break;
default:
return SAI_STATUS_FAILURE;
}
}

vector<int32_t> bpoint_list;
for (auto bind : binds)
{
bpoint_list.push_back(bind);
}

vector<int32_t> bpoint_list = { SAI_ACL_BIND_POINT_TYPE_PORT, SAI_ACL_BIND_POINT_TYPE_LAG };
attr.id = SAI_ACL_TABLE_ATTR_ACL_BIND_POINT_TYPE_LIST;
attr.value.s32list.count = static_cast<uint32_t>(bpoint_list.size());
attr.value.s32list.list = bpoint_list.data();
Expand Down Expand Up @@ -1060,6 +1024,7 @@ bool AclTable::create()

if(stage == ACL_STAGE_INGRESS)
{
int32_t range_types_list[] = { SAI_ACL_RANGE_TYPE_L4_DST_PORT_RANGE, SAI_ACL_RANGE_TYPE_L4_SRC_PORT_RANGE };
attr.id = SAI_ACL_TABLE_ATTR_FIELD_ACL_RANGE_TYPE;
attr.value.s32list.count = (uint32_t)(sizeof(range_types_list) / sizeof(range_types_list[0]));
attr.value.s32list.list = range_types_list;
Expand Down

0 comments on commit 37b1001

Please sign in to comment.