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

[Aclorch]: add match TC support for acl rule #302

Merged
merged 2 commits into from
Sep 5, 2017
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
11 changes: 11 additions & 0 deletions orchagent/aclorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ acl_rule_attr_lookup_t aclMatchLookup =
{ MATCH_TCP_FLAGS, SAI_ACL_ENTRY_ATTR_FIELD_TCP_FLAGS },
{ MATCH_IP_TYPE, SAI_ACL_ENTRY_ATTR_FIELD_ACL_IP_TYPE },
{ MATCH_DSCP, SAI_ACL_ENTRY_ATTR_FIELD_DSCP },
{ MATCH_TC, SAI_ACL_ENTRY_ATTR_FIELD_TC },
{ MATCH_L4_SRC_PORT_RANGE, (sai_acl_entry_attr_t)SAI_ACL_RANGE_TYPE_L4_SRC_PORT_RANGE },
{ MATCH_L4_DST_PORT_RANGE, (sai_acl_entry_attr_t)SAI_ACL_RANGE_TYPE_L4_DST_PORT_RANGE },
};
Expand Down Expand Up @@ -226,6 +227,12 @@ bool AclRule::validateAddMatch(string attr_name, string attr_value)
return false;
}
}
else if(attr_name == MATCH_TC)
{
value.aclfield.data.u8 = to_uint<uint8_t>(attr_value);
value.aclfield.mask.u8 = 0xFF;
}

}
catch (exception &e)
{
Expand Down Expand Up @@ -1441,6 +1448,10 @@ sai_status_t AclOrch::createBindAclTable(AclTable &aclTable, sai_object_id_t &ta
attr.value.booldata = true;
table_attrs.push_back(attr);

attr.id = SAI_ACL_TABLE_ATTR_FIELD_TC;
attr.value.booldata = true;
table_attrs.push_back(attr);

if (aclTable.type == ACL_TABLE_MIRROR)
{
attr.id = SAI_ACL_TABLE_ATTR_FIELD_DSCP;
Expand Down
1 change: 1 addition & 0 deletions orchagent/aclorch.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#define MATCH_DSCP "DSCP"
#define MATCH_L4_SRC_PORT_RANGE "L4_SRC_PORT_RANGE"
#define MATCH_L4_DST_PORT_RANGE "L4_DST_PORT_RANGE"
#define MATCH_TC "TC"

#define ACTION_PACKET_ACTION "PACKET_ACTION"
#define ACTION_MIRROR_ACTION "MIRROR_ACTION"
Expand Down