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

[ACL] Add default action_list for default ACL table type #2298

Merged
merged 6 commits into from
May 27, 2022
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
114 changes: 23 additions & 91 deletions orchagent/aclorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,22 +161,16 @@ 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,
SAI_ACL_ACTION_TYPE_REDIRECT
}
},
{
ACL_STAGE_EGRESS,
AclActionCapabilities
{
{
SAI_ACL_ACTION_TYPE_PACKET_ACTION
},
false
SAI_ACL_ACTION_TYPE_PACKET_ACTION,
SAI_ACL_ACTION_TYPE_REDIRECT
}
}
}
Expand All @@ -187,22 +181,16 @@ 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,
SAI_ACL_ACTION_TYPE_REDIRECT
}
},
{
ACL_STAGE_EGRESS,
AclActionCapabilities
{
{
SAI_ACL_ACTION_TYPE_PACKET_ACTION
},
false
SAI_ACL_ACTION_TYPE_PACKET_ACTION,
SAI_ACL_ACTION_TYPE_REDIRECT
Copy link
Contributor

Choose a reason for hiding this comment

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

redirect action should be only for the ingress and not egress.

}
}
}
Expand All @@ -213,22 +201,14 @@ 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
}
},
{
ACL_STAGE_EGRESS,
AclActionCapabilities
{
{
SAI_ACL_ACTION_TYPE_MIRROR_EGRESS
},
false
SAI_ACL_ACTION_TYPE_MIRROR_EGRESS
}
}
}
Expand All @@ -239,22 +219,14 @@ 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
}
},
{
ACL_STAGE_EGRESS,
AclActionCapabilities
{
{
SAI_ACL_ACTION_TYPE_MIRROR_EGRESS
},
false
SAI_ACL_ACTION_TYPE_MIRROR_EGRESS
}
}
}
Expand All @@ -265,22 +237,14 @@ 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
}
},
{
ACL_STAGE_EGRESS,
AclActionCapabilities
{
{
SAI_ACL_ACTION_TYPE_MIRROR_EGRESS
},
false
SAI_ACL_ACTION_TYPE_MIRROR_EGRESS
}
}
}
Expand All @@ -291,22 +255,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 +273,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 +291,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 +309,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 +2014,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