Skip to content

Commit

Permalink
Address comment
Browse files Browse the repository at this point in the history
Signed-off-by: bingwang <wang.bing@microsoft.com>
  • Loading branch information
bingwang-ms committed May 27, 2022
1 parent c429c73 commit 17ba13c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 92 deletions.
116 changes: 25 additions & 91 deletions orchagent/aclorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,22 +161,14 @@ static acl_table_action_list_lookup_t defaultAclActionList =
{
{
ACL_STAGE_INGRESS,
AclActionCapabilities
{
{
SAI_ACL_ACTION_TYPE_PACKET_ACTION
},
false
SAI_ACL_ACTION_TYPE_PACKET_ACTION
}
},
{
ACL_STAGE_EGRESS,
AclActionCapabilities
{
{
SAI_ACL_ACTION_TYPE_PACKET_ACTION
},
false
SAI_ACL_ACTION_TYPE_PACKET_ACTION
}
}
}
Expand All @@ -187,22 +179,14 @@ static acl_table_action_list_lookup_t defaultAclActionList =
{
{
ACL_STAGE_INGRESS,
AclActionCapabilities
{
{
SAI_ACL_ACTION_TYPE_PACKET_ACTION
},
false
SAI_ACL_ACTION_TYPE_PACKET_ACTION
}
},
{
ACL_STAGE_EGRESS,
AclActionCapabilities
{
{
SAI_ACL_ACTION_TYPE_PACKET_ACTION
},
false
SAI_ACL_ACTION_TYPE_PACKET_ACTION
}
}
}
Expand All @@ -213,22 +197,16 @@ static acl_table_action_list_lookup_t defaultAclActionList =
{
{
ACL_STAGE_INGRESS,
AclActionCapabilities
{
{
SAI_ACL_ACTION_TYPE_MIRROR_INGRESS
},
false
SAI_ACL_ACTION_TYPE_MIRROR_INGRESS,
SAI_ACL_ACTION_TYPE_REDIRECT
}
},
{
ACL_STAGE_EGRESS,
AclActionCapabilities
{
{
SAI_ACL_ACTION_TYPE_MIRROR_EGRESS
},
false
SAI_ACL_ACTION_TYPE_MIRROR_EGRESS,
SAI_ACL_ACTION_TYPE_REDIRECT
}
}
}
Expand All @@ -239,22 +217,16 @@ static acl_table_action_list_lookup_t defaultAclActionList =
{
{
ACL_STAGE_INGRESS,
AclActionCapabilities
{
{
SAI_ACL_ACTION_TYPE_MIRROR_INGRESS
},
false
SAI_ACL_ACTION_TYPE_MIRROR_INGRESS,
SAI_ACL_ACTION_TYPE_REDIRECT
}
},
{
ACL_STAGE_EGRESS,
AclActionCapabilities
{
{
SAI_ACL_ACTION_TYPE_MIRROR_EGRESS
},
false
SAI_ACL_ACTION_TYPE_MIRROR_EGRESS,
SAI_ACL_ACTION_TYPE_REDIRECT
}
}
}
Expand All @@ -265,22 +237,16 @@ static acl_table_action_list_lookup_t defaultAclActionList =
{
{
ACL_STAGE_INGRESS,
AclActionCapabilities
{
{
SAI_ACL_ACTION_TYPE_MIRROR_INGRESS
},
false
SAI_ACL_ACTION_TYPE_MIRROR_INGRESS,
SAI_ACL_ACTION_TYPE_REDIRECT
}
},
{
ACL_STAGE_EGRESS,
AclActionCapabilities
{
{
SAI_ACL_ACTION_TYPE_MIRROR_EGRESS
},
false
SAI_ACL_ACTION_TYPE_MIRROR_EGRESS,
SAI_ACL_ACTION_TYPE_REDIRECT
}
}
}
Expand All @@ -291,22 +257,14 @@ static acl_table_action_list_lookup_t defaultAclActionList =
{
{
ACL_STAGE_INGRESS,
AclActionCapabilities
{
{
SAI_ACL_ACTION_TYPE_PACKET_ACTION
},
false
SAI_ACL_ACTION_TYPE_PACKET_ACTION
}
},
{
ACL_STAGE_EGRESS,
AclActionCapabilities
{
{
SAI_ACL_ACTION_TYPE_PACKET_ACTION
},
false
SAI_ACL_ACTION_TYPE_PACKET_ACTION
}
}
}
Expand All @@ -317,22 +275,14 @@ static acl_table_action_list_lookup_t defaultAclActionList =
{
{
ACL_STAGE_INGRESS,
AclActionCapabilities
{
{
SAI_ACL_ACTION_TYPE_PACKET_ACTION
},
false
SAI_ACL_ACTION_TYPE_PACKET_ACTION
}
},
{
ACL_STAGE_EGRESS,
AclActionCapabilities
{
{
SAI_ACL_ACTION_TYPE_PACKET_ACTION
},
false
SAI_ACL_ACTION_TYPE_PACKET_ACTION
}
}
}
Expand All @@ -343,22 +293,14 @@ static acl_table_action_list_lookup_t defaultAclActionList =
{
{
ACL_STAGE_INGRESS,
AclActionCapabilities
{
{
SAI_ACL_ACTION_TYPE_PACKET_ACTION
},
false
SAI_ACL_ACTION_TYPE_PACKET_ACTION
}
},
{
ACL_STAGE_EGRESS,
AclActionCapabilities
{
{
SAI_ACL_ACTION_TYPE_PACKET_ACTION
},
false
SAI_ACL_ACTION_TYPE_PACKET_ACTION
}
}
}
Expand All @@ -369,22 +311,14 @@ static acl_table_action_list_lookup_t defaultAclActionList =
{
{
ACL_STAGE_INGRESS,
AclActionCapabilities
{
{
SAI_ACL_ACTION_TYPE_PACKET_ACTION
},
false
SAI_ACL_ACTION_TYPE_PACKET_ACTION
}
},
{
ACL_STAGE_EGRESS,
AclActionCapabilities
{
{
SAI_ACL_ACTION_TYPE_PACKET_ACTION
},
false
SAI_ACL_ACTION_TYPE_PACKET_ACTION
}
}
}
Expand Down Expand Up @@ -2082,7 +2016,7 @@ bool AclTable::addMandatoryActions()
if (defaultAclActionList.count(type.getName()) != 0)
{
// Add the default action list
for (auto action : defaultAclActionList[type.getName()][stage].actionList)
for (auto action : defaultAclActionList[type.getName()][stage])
{
if (m_pAclOrch->isAclActionSupported(stage, acl_action))
{
Expand Down
3 changes: 2 additions & 1 deletion orchagent/aclorch.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ typedef tuple<sai_acl_range_type_t, int, int> acl_range_properties_t;
typedef map<acl_stage_type_t, AclActionCapabilities> acl_capabilities_t;
typedef map<sai_acl_action_type_t, set<int32_t>> acl_action_enum_values_capabilities_t;

typedef map<string, acl_capabilities_t> acl_table_action_list_lookup_t;
typedef map<acl_stage_type_t, set<sai_acl_action_type_t> > acl_stage_action_list_t;
typedef map<string, acl_stage_action_list_t> acl_table_action_list_lookup_t;

class AclRule;

Expand Down

0 comments on commit 17ba13c

Please sign in to comment.