Skip to content

Commit 37b1001

Browse files
keboliulguohan
authored andcommitted
[Aclorch] fix Acl bind point type issue (sonic-net#516)
* [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.
1 parent 5d31b2d commit 37b1001

File tree

1 file changed

+2
-37
lines changed

1 file changed

+2
-37
lines changed

orchagent/aclorch.cpp

+2-37
Original file line numberDiff line numberDiff line change
@@ -952,43 +952,7 @@ bool AclTable::create()
952952

953953
sai_attribute_t attr;
954954
vector<sai_attribute_t> table_attrs;
955-
956-
int32_t range_types_list[] =
957-
{ SAI_ACL_RANGE_TYPE_L4_DST_PORT_RANGE,
958-
SAI_ACL_RANGE_TYPE_L4_SRC_PORT_RANGE
959-
};
960-
961-
set<sai_acl_bind_point_type_t> binds;
962-
for (const auto& portid_pair : ports)
963-
{
964-
Port port;
965-
if (!gPortsOrch->getPort(portid_pair.first, port))
966-
{
967-
continue;
968-
}
969-
970-
switch (port.m_type)
971-
{
972-
case Port::PHY:
973-
binds.insert(SAI_ACL_BIND_POINT_TYPE_PORT);
974-
break;
975-
case Port::VLAN:
976-
binds.insert(SAI_ACL_BIND_POINT_TYPE_VLAN);
977-
break;
978-
case Port::LAG:
979-
binds.insert(SAI_ACL_BIND_POINT_TYPE_LAG);
980-
break;
981-
default:
982-
return SAI_STATUS_FAILURE;
983-
}
984-
}
985-
986-
vector<int32_t> bpoint_list;
987-
for (auto bind : binds)
988-
{
989-
bpoint_list.push_back(bind);
990-
}
991-
955+
vector<int32_t> bpoint_list = { SAI_ACL_BIND_POINT_TYPE_PORT, SAI_ACL_BIND_POINT_TYPE_LAG };
992956
attr.id = SAI_ACL_TABLE_ATTR_ACL_BIND_POINT_TYPE_LIST;
993957
attr.value.s32list.count = static_cast<uint32_t>(bpoint_list.size());
994958
attr.value.s32list.list = bpoint_list.data();
@@ -1060,6 +1024,7 @@ bool AclTable::create()
10601024

10611025
if(stage == ACL_STAGE_INGRESS)
10621026
{
1027+
int32_t range_types_list[] = { SAI_ACL_RANGE_TYPE_L4_DST_PORT_RANGE, SAI_ACL_RANGE_TYPE_L4_SRC_PORT_RANGE };
10631028
attr.id = SAI_ACL_TABLE_ATTR_FIELD_ACL_RANGE_TYPE;
10641029
attr.value.s32list.count = (uint32_t)(sizeof(range_types_list) / sizeof(range_types_list[0]));
10651030
attr.value.s32list.list = range_types_list;

0 commit comments

Comments
 (0)