Documentation ¶
Overview ¶
- Copyright 2020-2024 Open Networking Foundation (ONF) and the ONF Contributors *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
* Copyright 2019-2024 Open Networking Foundation (ONF) and the ONF Contributors
* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Index ¶
- Constants
- type AdditionalBW
- type DiscardPolicy
- type SchedulingPolicy
- type TechProfileFlags
- type TechProfileIf
- type TechProfileMgr
- func (t *TechProfileMgr) CloseKVClient(ctx context.Context)
- func (t *TechProfileMgr) CreateTechProfileInstance(ctx context.Context, tpID uint32, uniPortName string, intfID uint32) (interface{}, error)
- func (t *TechProfileMgr) DeleteTechProfileInstance(ctx context.Context, tpID uint32, uniPortName string) error
- func (t *TechProfileMgr) FindAllTpInstances(ctx context.Context, oltDeviceID string, tpID uint32, intfID uint32, ...) interface{}
- func (t *TechProfileMgr) FreeResourceID(ctx context.Context, intfID uint32, resourceType string, ...) error
- func (t *TechProfileMgr) GetDsScheduler(tpInstance *tp_pb.TechProfileInstance) *tp_pb.SchedulerConfig
- func (t *TechProfileMgr) GetGemportForPbit(ctx context.Context, tp interface{}, dir tp_pb.Direction, pbit uint32) interface{}
- func (t *TechProfileMgr) GetMulticastTrafficQueues(ctx context.Context, tp *tp_pb.TechProfileInstance) []*tp_pb.TrafficQueue
- func (t *TechProfileMgr) GetResourceID(ctx context.Context, intfID uint32, resourceType string, numIDs uint32) ([]uint32, error)
- func (t *TechProfileMgr) GetTPInstance(ctx context.Context, path string) (interface{}, error)
- func (t *TechProfileMgr) GetTechProfileInstanceKey(ctx context.Context, tpID uint32, uniPortName string) string
- func (t *TechProfileMgr) GetTrafficQueues(ctx context.Context, tp *tp_pb.TechProfileInstance, direction tp_pb.Direction) ([]*tp_pb.TrafficQueue, error)
- func (t *TechProfileMgr) GetTrafficScheduler(tpInstance *tp_pb.TechProfileInstance, SchedCfg *tp_pb.SchedulerConfig, ...) *tp_pb.TrafficScheduler
- func (t *TechProfileMgr) GetUsScheduler(tpInstance *tp_pb.TechProfileInstance) *tp_pb.SchedulerConfig
- func (t *TechProfileMgr) SetKVClient(ctx context.Context, pathPrefix string) *db.Backend
Constants ¶
const ( NAME = "name" PROFILE_TYPE = "profile_type" VERSION = "version" NUM_GEM_PORTS = "num_gem_ports" INSTANCE_CONTROL = "instance_control" US_SCHEDULER = "us_scheduler" DS_SCHEDULER = "ds_scheduler" UPSTREAM_GEM_PORT_ATTRIBUTE_LIST = "upstream_gem_port_attribute_list" DOWNSTREAM_GEM_PORT_ATTRIBUTE_LIST = "downstream_gem_port_attribute_list" ONU = "onu" UNI = "uni" MAX_GEM_PAYLOAD_SIZE = "max_gem_payload_size" DIRECTION = "direction" ADDITIONAL_BW = "additional_bw" PRIORITY = "priority" Q_SCHED_POLICY = "q_sched_policy" WEIGHT = "weight" PBIT_MAP = "pbit_map" DISCARD_CONFIG = "discard_config" MAX_THRESHOLD = "max_threshold" MIN_THRESHOLD = "min_threshold" MAX_PROBABILITY = "max_probability" DISCARD_POLICY = "discard_policy" PRIORITY_Q = "priority_q" SCHEDULING_POLICY = "scheduling_policy" MAX_Q_SIZE = "max_q_size" AES_ENCRYPTION = "aes_encryption" // String Keys for EPON EPON_ATTRIBUTE = "epon_attribute" PACKAGE_TYPE = "package_type" TRAFFIC_TYPE = "traffic type" UNSOLICITED_GRANT_SIZE = "unsolicited_grant_size" NOMINAL_INTERVAL = "nominal_interval" TOLERATED_POLL_JITTER = "tolerated_poll_jitter" REQUEST_TRANSMISSION_POLICY = "request_transmission_policy" NUM_Q_SETS = "num_q_sets" Q_THRESHOLDS = "q_thresholds" Q_THRESHOLD1 = "q_threshold1" Q_THRESHOLD2 = "q_threshold2" Q_THRESHOLD3 = "q_threshold3" Q_THRESHOLD4 = "q_threshold4" Q_THRESHOLD5 = "q_threshold5" Q_THRESHOLD6 = "q_threshold6" Q_THRESHOLD7 = "q_threshold7" )
Tech-Profile JSON String Keys NOTE: Tech profile templeate JSON file should comply with below keys
const (
DEFAULT_TECH_PROFILE_TABLE_ID = 64
)
tech profile default constants
const (
MaxUniPortPerOnu = 16 // TODO: Adapter uses its own constant for MaxUniPort. How to synchronize this and have a single source of truth?
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdditionalBW ¶
type AdditionalBW int32
const ( AdditionalBW_AdditionalBW_None AdditionalBW = 0 AdditionalBW_AdditionalBW_NA AdditionalBW = 1 AdditionalBW_AdditionalBW_BestEffort AdditionalBW = 2 AdditionalBW_AdditionalBW_Auto AdditionalBW = 3 )
type DiscardPolicy ¶
type DiscardPolicy int32
const ( DiscardPolicy_TailDrop DiscardPolicy = 0 DiscardPolicy_WTailDrop DiscardPolicy = 1 DiscardPolicy_Red DiscardPolicy = 2 DiscardPolicy_WRed DiscardPolicy = 3 )
type SchedulingPolicy ¶
type SchedulingPolicy int32
const ( SchedulingPolicy_WRR SchedulingPolicy = 0 SchedulingPolicy_StrictPriority SchedulingPolicy = 1 SchedulingPolicy_Hybrid SchedulingPolicy = 2 )
type TechProfileFlags ¶
type TechProfileFlags struct { KVStoreAddress string KVStoreType string KVStoreTimeout time.Duration KVBackend *db.Backend // this is the backend used to store TP instances DefaultTpKVBackend *db.Backend // this is the backend used to read the TP profile ResourceInstanceKVBacked *db.Backend // this is the backed used to read/write Resource Instances TPKVPathPrefix string TPFileKVPath string ResourceInstanceKVPathPrefix string DefaultTPName string TPVersion uint32 NumGemPorts uint32 DefaultPbits []string LogLevel int DefaultTechProfileID uint32 DefaultNumGemPorts uint32 // contains filtered or unexported fields }
TechprofileFlags represents the set of configurations used
func NewTechProfileFlags ¶
func NewTechProfileFlags(KVStoreType string, KVStoreAddress string, basePathKvStore string) *TechProfileFlags
type TechProfileIf ¶
type TechProfileIf interface { SetKVClient(ctx context.Context, pathPrefix string) *db.Backend CloseKVClient(ctx context.Context) GetTechProfileInstanceKey(ctx context.Context, tpID uint32, uniPortName string) string GetTPInstance(ctx context.Context, path string) (interface{}, error) CreateTechProfileInstance(ctx context.Context, tpID uint32, uniPortName string, intfID uint32) (interface{}, error) DeleteTechProfileInstance(ctx context.Context, tpID uint32, uniPortName string) error GetUsScheduler(tpInstance *tp_pb.TechProfileInstance) *tp_pb.SchedulerConfig GetDsScheduler(tpInstance *tp_pb.TechProfileInstance) *tp_pb.SchedulerConfig GetTrafficScheduler(tpInstance *tp_pb.TechProfileInstance, SchedCfg *tp_pb.SchedulerConfig, ShapingCfg *tp_pb.TrafficShapingInfo) *tp_pb.TrafficScheduler GetTrafficQueues(ctx context.Context, tp *tp_pb.TechProfileInstance, Dir tp_pb.Direction) ([]*tp_pb.TrafficQueue, error) GetMulticastTrafficQueues(ctx context.Context, tp *tp_pb.TechProfileInstance) []*tp_pb.TrafficQueue GetGemportForPbit(ctx context.Context, tp interface{}, Dir tp_pb.Direction, pbit uint32) interface{} FindAllTpInstances(ctx context.Context, oltDeviceID string, tpID uint32, ponIntf uint32, onuID uint32) interface{} GetResourceID(ctx context.Context, IntfID uint32, ResourceType string, NumIDs uint32) ([]uint32, error) FreeResourceID(ctx context.Context, IntfID uint32, ResourceType string, ReleaseContent []uint32) error }
type TechProfileMgr ¶
type TechProfileMgr struct { OnuIDMgmtLock sync.RWMutex GemPortIDMgmtLock sync.RWMutex AllocIDMgmtLock sync.RWMutex // contains filtered or unexported fields }
func NewTechProfile ¶
func (*TechProfileMgr) CloseKVClient ¶
func (t *TechProfileMgr) CloseKVClient(ctx context.Context)
func (*TechProfileMgr) CreateTechProfileInstance ¶
func (t *TechProfileMgr) CreateTechProfileInstance(ctx context.Context, tpID uint32, uniPortName string, intfID uint32) (interface{}, error)
CreateTechProfileInstance creates a new TP instance.
func (*TechProfileMgr) DeleteTechProfileInstance ¶
func (t *TechProfileMgr) DeleteTechProfileInstance(ctx context.Context, tpID uint32, uniPortName string) error
DeleteTechProfileInstance deletes the TP instance from the local cache as well as deletes the corresponding resource instance from the KV store.
func (*TechProfileMgr) FindAllTpInstances ¶
func (t *TechProfileMgr) FindAllTpInstances(ctx context.Context, oltDeviceID string, tpID uint32, intfID uint32, onuID uint32) interface{}
FindAllTpInstances returns all TechProfile instances for a given TechProfile table-id, pon interface ID and onu ID.
func (*TechProfileMgr) FreeResourceID ¶
func (*TechProfileMgr) GetDsScheduler ¶
func (t *TechProfileMgr) GetDsScheduler(tpInstance *tp_pb.TechProfileInstance) *tp_pb.SchedulerConfig
func (*TechProfileMgr) GetGemportForPbit ¶
func (*TechProfileMgr) GetMulticastTrafficQueues ¶
func (t *TechProfileMgr) GetMulticastTrafficQueues(ctx context.Context, tp *tp_pb.TechProfileInstance) []*tp_pb.TrafficQueue
func (*TechProfileMgr) GetResourceID ¶
func (*TechProfileMgr) GetTPInstance ¶
func (t *TechProfileMgr) GetTPInstance(ctx context.Context, path string) (interface{}, error)
GetTPInstance gets TP instance from cache if found
func (*TechProfileMgr) GetTechProfileInstanceKey ¶
func (t *TechProfileMgr) GetTechProfileInstanceKey(ctx context.Context, tpID uint32, uniPortName string) string
GetTechProfileInstanceKey returns the tp instance key that is used to reference TP Instance Map
func (*TechProfileMgr) GetTrafficQueues ¶
func (t *TechProfileMgr) GetTrafficQueues(ctx context.Context, tp *tp_pb.TechProfileInstance, direction tp_pb.Direction) ([]*tp_pb.TrafficQueue, error)
func (*TechProfileMgr) GetTrafficScheduler ¶
func (t *TechProfileMgr) GetTrafficScheduler(tpInstance *tp_pb.TechProfileInstance, SchedCfg *tp_pb.SchedulerConfig, ShapingCfg *tp_pb.TrafficShapingInfo) *tp_pb.TrafficScheduler
func (*TechProfileMgr) GetUsScheduler ¶
func (t *TechProfileMgr) GetUsScheduler(tpInstance *tp_pb.TechProfileInstance) *tp_pb.SchedulerConfig