[VOL-1800] Implement Performance configuration in Voltha Core.
This is a port of the exisiting voltha 1.x funtionality into
the Voltha 2.0 Core.
Change-Id: I87bf8836fd392c1c7f4a2c45e85323d1cbe0079f
diff --git a/rw_core/core/adapter_request_handler.go b/rw_core/core/adapter_request_handler.go
index 0d37255..1a00db8 100644
--- a/rw_core/core/adapter_request_handler.go
+++ b/rw_core/core/adapter_request_handler.go
@@ -984,13 +984,12 @@
}
func (rhp *AdapterRequestHandlerProxy) DevicePMConfigUpdate(args []*ic.Argument) (*empty.Empty, error) {
- if len(args) < 3 {
+ if len(args) < 2 {
log.Warn("invalid-number-of-args", log.Fields{"args": args})
err := errors.New("invalid-number-of-args")
return nil, err
}
pmConfigs := &voltha.PmConfigs{}
- init := &ic.BoolType{}
transactionID := &ic.StrType{}
for _, arg := range args {
switch arg.Key {
@@ -999,11 +998,6 @@
log.Warnw("cannot-unmarshal-pm-config", log.Fields{"error": err})
return nil, err
}
- case "init":
- if err := ptypes.UnmarshalAny(arg.Value, init); err != nil {
- log.Warnw("cannot-unmarshal-boolean", log.Fields{"error": err})
- return nil, err
- }
case kafka.TransactionKey:
if err := ptypes.UnmarshalAny(arg.Value, transactionID); err != nil {
log.Warnw("cannot-unmarshal-transaction-ID", log.Fields{"error": err})
@@ -1012,7 +1006,7 @@
}
}
log.Debugw("DevicePMConfigUpdate", log.Fields{"deviceId": pmConfigs.Id, "configs": pmConfigs,
- "init": init, "transactionID": transactionID.Val})
+ "transactionID": transactionID.Val})
// Try to grab the transaction as this core may be competing with another Core
if rhp.competeForTransaction() {
@@ -1029,10 +1023,7 @@
return nil, nil
}
- go rhp.deviceMgr.updatePmConfigs(pmConfigs.Id, pmConfigs)
- //if err := rhp.deviceMgr.updatePmConfigs(pmConfigs.Id, pmConfigs); err != nil {
- // return nil, err
- //}
+ go rhp.deviceMgr.initPmConfigs(pmConfigs.Id, pmConfigs)
return new(empty.Empty), nil
}