From 463a921d6b770cfcffbc0c46e784db34add3190c Mon Sep 17 00:00:00 2001 From: Cybwan Date: Fri, 17 Nov 2023 15:19:44 +0800 Subject: [PATCH 1/2] recycle HwNum counter --- loxinet/qospol.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/loxinet/qospol.go b/loxinet/qospol.go index 0ed6567e0..48262f4a3 100644 --- a/loxinet/qospol.go +++ b/loxinet/qospol.go @@ -19,8 +19,9 @@ package loxinet import ( "errors" - cmn "github.com/loxilb-io/loxilb/common" tk "github.com/loxilb-io/loxilib" + + cmn "github.com/loxilb-io/loxilb/common" ) // error codes @@ -220,6 +221,7 @@ func (P *PolH) PolDelete(pName string) (int, error) { p.DP(DpRemove) delete(P.PolMap, p.Key) + defer P.Mark.PutCounter(p.HwNum) tk.LogIt(tk.LogInfo, "policer deleted - %s\n", pName) From 7bc9f214efba97901855eb1f6c0bef1d931ba1fe Mon Sep 17 00:00:00 2001 From: Cybwan Date: Fri, 17 Nov 2023 15:20:33 +0800 Subject: [PATCH 2/2] recycle HwNum counter --- loxinet/mirror.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/loxinet/mirror.go b/loxinet/mirror.go index 9e6c16df6..34c4d1e55 100644 --- a/loxinet/mirror.go +++ b/loxinet/mirror.go @@ -19,8 +19,9 @@ package loxinet import ( "errors" - cmn "github.com/loxilb-io/loxilb/common" tk "github.com/loxilb-io/loxilib" + + cmn "github.com/loxilb-io/loxilb/common" ) // error codes @@ -221,6 +222,7 @@ func (M *MirrH) MirrDelete(name string) (int, error) { m.DP(DpRemove) delete(M.MirrMap, m.Key) + defer M.Mark.PutCounter(m.HwNum) tk.LogIt(tk.LogInfo, "mirror deleted - %s\n", name)