From 6d2274ec14ed110b7cb14c4fc7134dd66e544d09 Mon Sep 17 00:00:00 2001 From: Vivek Date: Fri, 16 Dec 2022 14:12:21 -0800 Subject: [PATCH] dereg acl-rule counters during acl-table del (#2574) *Deleting ACL Tables deletes all the associated Rules but it doesn't delete the associated counters. --- orchagent/aclorch.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/orchagent/aclorch.cpp b/orchagent/aclorch.cpp index 955f136393..3be19757d9 100644 --- a/orchagent/aclorch.cpp +++ b/orchagent/aclorch.cpp @@ -2525,6 +2525,12 @@ bool AclTable::clear() for (auto& rulepair: rules) { auto& rule = *rulepair.second; + + if (rule.hasCounter()) + { + m_pAclOrch->deregisterFlexCounter(rule); + } + bool suc = rule.remove(); if (!suc) {