Skip to content

Commit 5386d7f

Browse files
JaredLiusprsunny
authored andcommitted
fix bad parameter for gCrmOrch->incCrmAclUsedCounter in qosorch (sonic-net#830)
* fix bad parameter for gCrmOrch->incCrmAclUsedCounter in qosorch * fix VS test failure for test_crm.py::test_CrmAcl FAILED
1 parent 9818b78 commit 5386d7f

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

orchagent/qosorch.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ sai_object_id_t QosOrch::initSystemAclTable()
728728
}
729729
SWSS_LOG_NOTICE("Create a system ACL table for ECN coloring");
730730

731-
gCrmOrch->incCrmAclUsedCounter(CrmResourceType::CRM_ACL_TABLE, (sai_acl_stage_t) attr.value.s32, SAI_ACL_BIND_POINT_TYPE_PORT);
731+
gCrmOrch->incCrmAclUsedCounter(CrmResourceType::CRM_ACL_TABLE, SAI_ACL_STAGE_INGRESS, SAI_ACL_BIND_POINT_TYPE_PORT);
732732

733733
for (auto& pair: gPortsOrch->getAllPorts())
734734
{

tests/test_crm.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,8 @@ def test_CrmAcl(dvs, testlog):
554554

555555
bind_ports = ["Ethernet0", "Ethernet4"]
556556

557+
old_table_used_counter = getCrmCounterValue(dvs, 'ACL_STATS:INGRESS:PORT', 'crm_stats_acl_table_used')
558+
557559
# create ACL table
558560
ttbl = swsscommon.Table(db, "ACL_TABLE")
559561
fvs = swsscommon.FieldValuePairs([("policy_desc", "test"), ("type", "L3"), ("ports", ",".join(bind_ports))])
@@ -565,8 +567,9 @@ def test_CrmAcl(dvs, testlog):
565567
rtbl.set("test|acl_test_rule", fvs)
566568

567569
time.sleep(2)
568-
569-
table_used_counter = getCrmCounterValue(dvs, 'ACL_STATS:INGRESS:PORT', 'crm_stats_acl_table_used')
570+
571+
new_table_used_counter = getCrmCounterValue(dvs, 'ACL_STATS:INGRESS:PORT', 'crm_stats_acl_table_used')
572+
table_used_counter = new_table_used_counter - old_table_used_counter
570573
assert table_used_counter == 1
571574

572575
# get ACL table key
@@ -596,6 +599,7 @@ def test_CrmAcl(dvs, testlog):
596599

597600
time.sleep(2)
598601

599-
table_used_counter = getCrmCounterValue(dvs, 'ACL_STATS:INGRESS:PORT', 'crm_stats_acl_table_used')
602+
new_table_used_counter = getCrmCounterValue(dvs, 'ACL_STATS:INGRESS:PORT', 'crm_stats_acl_table_used')
603+
table_used_counter = new_table_used_counter - old_table_used_counter
600604
assert table_used_counter == 0
601605

0 commit comments

Comments
 (0)