Skip to content

Commit 8aca780

Browse files
authored
[ssw][ha] add ACTION_COUNTER to acl table type (#4068)
What I did Add action counter to acl table type when creating initializing tunnel termination acl table. sign-off: Jing Zhang zhangjing@microsoft.com Why I did it It's added for the acl rules but not for the table today. How I verified it This change was there for our HA development (on a custom branch) but missed on the master branch. It's verified in many demo sessions.
1 parent 8e0a0e7 commit 8aca780

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

orchagent/vnetorch.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3518,6 +3518,12 @@ void VNetTunnelTermAcl::lazyInit()
35183518
};
35193519
string matches = std::accumulate(std::next(match_list.begin()), match_list.end(), match_list[0], concat);
35203520

3521+
vector<string> action_list = {
3522+
ACTION_REDIRECT_ACTION,
3523+
ACTION_COUNTER
3524+
};
3525+
string actions = std::accumulate(std::next(action_list.begin()), action_list.end(), action_list[0], concat);
3526+
35213527
vector<string> bpoint_list = {
35223528
BIND_POINT_TYPE_PORT,
35233529
BIND_POINT_TYPE_PORTCHANNEL
@@ -3526,7 +3532,7 @@ void VNetTunnelTermAcl::lazyInit()
35263532

35273533
vector<FieldValueTuple> fvs = {
35283534
{ACL_TABLE_TYPE_MATCHES, matches},
3529-
{ACL_TABLE_TYPE_ACTIONS, ACTION_REDIRECT_ACTION},
3535+
{ACL_TABLE_TYPE_ACTIONS, actions},
35303536
{ACL_TABLE_TYPE_BPOINT_TYPES, bpoints}
35313537
};
35323538

tests/test_vnet.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2687,6 +2687,14 @@ def test_vnet_orch_28(self, dvs, dvs_acl, testlog):
26872687
vnet_obj.fetch_exist_entries(dvs)
26882688
create_vnet_routes(dvs, "100.100.1.1/32", vnet_name, '9.1.0.1,9.1.0.2', ep_monitor='9.1.0.3,9.1.0.4', primary ='9.1.0.1', profile="Test_profile", monitoring='custom', adv_prefix='100.100.1.0/24', check_directly_connected=True)
26892689

2690+
# verify acl table action list
2691+
expected_action_list = [
2692+
"SAI_ACL_ACTION_TYPE_COUNTER",
2693+
"SAI_ACL_ACTION_TYPE_REDIRECT"
2694+
]
2695+
acl_table_id = dvs_acl.get_acl_table_ids(1)[0]
2696+
dvs_acl.verify_acl_table_action_list(acl_table_id, expected_action_list)
2697+
26902698
# verify tunnel term acl
26912699
expected_sai_qualifiers = {
26922700
"SAI_ACL_ENTRY_ATTR_FIELD_DST_IP": dvs_acl.get_simple_qualifier_comparator("100.100.1.1&mask:255.255.255.255")

0 commit comments

Comments
 (0)