Skip to content

Commit

Permalink
[aclorch]: Allow DTEL drop actions in DTEL flow watchlist (sonic-net#915
Browse files Browse the repository at this point in the history
)

In order to simplify operations, it may be desirable to combine the
DTEL flow and drop watchlists into one single watchlist that contains
both flow and drop actions. This change adds the drop actions to the
flow watchlist, allowing the combination of flow and drop actions in
a single ACL table.

This change also allows ACTION_DTEL_REPORT_ALL_PACKETS in drop
watchlists.

Signed-off-by: Mickey Spiegel <mspiegel@barefootnetworks.com>
  • Loading branch information
mickeyspiegel authored and lguohan committed Jun 19, 2019
1 parent 9778374 commit 52fdf1c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions orchagent/aclorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1586,7 +1586,9 @@ bool AclRuleDTelFlowWatchListEntry::validateAddAction(string attr_name, string a
(attr_name != ACTION_DTEL_FLOW_OP &&
attr_name != ACTION_DTEL_INT_SESSION &&
attr_name != ACTION_DTEL_FLOW_SAMPLE_PERCENT &&
attr_name != ACTION_DTEL_REPORT_ALL_PACKETS))
attr_name != ACTION_DTEL_REPORT_ALL_PACKETS &&
attr_name != ACTION_DTEL_DROP_REPORT_ENABLE &&
attr_name != ACTION_DTEL_TAIL_DROP_REPORT_ENABLE))
{
return false;
}
Expand Down Expand Up @@ -1643,7 +1645,9 @@ bool AclRuleDTelFlowWatchListEntry::validateAddAction(string attr_name, string a

value.aclaction.enable = true;

if (attr_name == ACTION_DTEL_REPORT_ALL_PACKETS)
if (attr_name == ACTION_DTEL_REPORT_ALL_PACKETS ||
attr_name == ACTION_DTEL_DROP_REPORT_ENABLE ||
attr_name == ACTION_DTEL_TAIL_DROP_REPORT_ENABLE)
{
value.aclaction.parameter.booldata = (attr_value == DTEL_ENABLED) ? true : false;
value.aclaction.enable = (attr_value == DTEL_ENABLED) ? true : false;
Expand Down Expand Up @@ -1798,7 +1802,8 @@ bool AclRuleDTelDropWatchListEntry::validateAddAction(string attr_name, string a
string attr_value = to_upper(attr_val);

if (attr_name != ACTION_DTEL_DROP_REPORT_ENABLE &&
attr_name != ACTION_DTEL_TAIL_DROP_REPORT_ENABLE)
attr_name != ACTION_DTEL_TAIL_DROP_REPORT_ENABLE &&
attr_name != ACTION_DTEL_REPORT_ALL_PACKETS)
{
return false;
}
Expand Down

0 comments on commit 52fdf1c

Please sign in to comment.