VOL-5367: Optimize the memory and cpu utilization of openonu adapter
Change-Id: I5b90f83387cbb6896e28ae95dc176e584cd836da
Signed-off-by: Praneeth Kumar Nalmas <praneeth.nalmas@radisys.com>
diff --git a/internal/pkg/core/device_handler.go b/internal/pkg/core/device_handler.go
index 460d794..319012c 100755
--- a/internal/pkg/core/device_handler.go
+++ b/internal/pkg/core/device_handler.go
@@ -2937,7 +2937,7 @@
// createUniLockFsm initializes and runs the UniLock FSM to transfer the OMCI related commands for port lock/unlock
func (dh *deviceHandler) createUniLockFsm(ctx context.Context, aAdminState bool, devEvent cmn.OnuDeviceEvent) {
- chLSFsm := make(chan cmn.Message, 2048)
+ chLSFsm := make(chan cmn.Message, 2)
var sFsmName string
if aAdminState {
logger.Debugw(ctx, "createLockStateFSM", log.Fields{"device-id": dh.DeviceID})
@@ -3010,7 +3010,7 @@
// createOnuUpgradeFsm initializes and runs the Onu Software upgrade FSM
// precondition: lockUpgradeFsm is already locked from caller of this function
func (dh *deviceHandler) createOnuUpgradeFsm(ctx context.Context, apDevEntry *mib.OnuDeviceEntry, aDevEvent cmn.OnuDeviceEvent) error {
- chUpgradeFsm := make(chan cmn.Message, 2048)
+ chUpgradeFsm := make(chan cmn.Message, 2)
var sFsmName = "OnuSwUpgradeFSM"
logger.Debugw(ctx, "create OnuSwUpgradeFSM", log.Fields{"device-id": dh.DeviceID})
if apDevEntry.PDevOmciCC == nil {
@@ -3461,7 +3461,7 @@
// precondition: dh.lockVlanConfig is locked by the caller!
func (dh *deviceHandler) createVlanFilterFsm(ctx context.Context, apUniPort *cmn.OnuUniPort, aTpID uint8, aCookieSlice []uint64,
aMatchVlan uint16, aMatchPcp uint8, aSetVlan uint16, aSetPcp uint8, innerCvlan uint16, aDevEvent cmn.OnuDeviceEvent, lastFlowToReconcile bool, aMeter *of.OfpMeterConfig, respChan *chan error) error {
- chVlanFilterFsm := make(chan cmn.Message, 2048)
+ chVlanFilterFsm := make(chan cmn.Message, 2)
pDevEntry := dh.GetOnuDeviceEntry(ctx, true)
if pDevEntry == nil {