OpenNSL API Guide and Reference Manual
Data Structures | Files | Macros | Typedefs | Enumerations | Functions
Class of Service Queue Configuration

Data Structures

struct  opennsl_cosq_bst_profile_s
 
struct  opennsl_cosq_egress_multicast_config_s
 multicast configuration settings More...
 
struct  opennsl_cosq_gport_discard_s
 For Virtual output queues (system ports) More...
 
struct  opennsl_cosq_gport_info_s
 gport information related to getting a handle More...
 
struct  opennsl_cosq_gport_stat_profile_s
 Statistics Profile. More...
 

Files

file  cosq.h
 
file  cosqX.h
 

Macros

#define OPENNSL_COSQ_ALL   0x00000001
 
#define OPENNSL_COSQ_BW_EAV_MODE   0x00000008
 Prioritize selected queue(s) for bandwidth before non-selected queue(s).
 
#define OPENNSL_COSQ_BW_LLFC   0x00000010
 Link Level Flow Control setting.
 
#define OPENNSL_COSQ_BW_NOT_COMMIT   0x00000040
 Set rate to SW DB only, commit to HW is done when calling the API with the same GPort type and without NOT_COMMIT flag.
 
#define OPENNSL_COSQ_BW_PACKET_MODE   0x00000020
 The bandwidth specified is in packets per second instead of kbits per second.
 
#define OPENNSL_COSQ_DEFICIT_ROUND_ROBIN   0x05
 XGS3 only.
 
#define OPENNSL_COSQ_DISCARD_BYTES   0x2000
 
#define OPENNSL_COSQ_DISCARD_COLOR_ALL   0x0F00
 
#define OPENNSL_COSQ_DISCARD_COLOR_BLACK   0x0800
 
#define OPENNSL_COSQ_DISCARD_COLOR_GREEN   0x0100
 
#define OPENNSL_COSQ_DISCARD_COLOR_RED   0x0400
 
#define OPENNSL_COSQ_DISCARD_COLOR_YELLOW   0x0200
 
#define OPENNSL_COSQ_DISCARD_DEVICE   0x10000
 
#define OPENNSL_COSQ_DISCARD_DROP_FIRST   OPENNSL_COSQ_DISCARD_COLOR_RED
 
#define OPENNSL_COSQ_DISCARD_ENABLE   0x0001
 
#define OPENNSL_COSQ_DISCARD_IFP   0x400000
 
#define OPENNSL_COSQ_DISCARD_MARK_CONGESTION   0x4000
 
#define OPENNSL_COSQ_DISCARD_NONTCP   0x0004
 
#define OPENNSL_COSQ_DISCARD_OUTER_CFI   0x800000
 
#define OPENNSL_COSQ_DISCARD_PACKETS   0x1000
 
#define OPENNSL_COSQ_DISCARD_PORT   0x8000
 
#define OPENNSL_COSQ_DISCARD_PROBABILITY1   0x100000
 
#define OPENNSL_COSQ_DISCARD_PROBABILITY2   0x200000
 
#define OPENNSL_COSQ_DISCARD_SYSTEM   0x80000
 
#define OPENNSL_COSQ_DISCARD_TCP   0x40000
 
#define OPENNSL_COSQ_GPORT_DESTMOD_UCAST_QUEUE_GROUP   0x00000010
 
#define OPENNSL_COSQ_GPORT_DISABLE   0x00000100
 Disable queue, used for OPENNSL_COSQ_GPORT_CALENDAR scheduling discipline.
 
#define OPENNSL_COSQ_GPORT_EGRESS_GROUP   0x00000080
 
#define OPENNSL_COSQ_GPORT_MCAST_QUEUE   0x00000010
 
#define OPENNSL_COSQ_GPORT_MCAST_QUEUE_GROUP   0x00000020
 
#define OPENNSL_COSQ_GPORT_OVERLAY   0x00000004
 
#define OPENNSL_COSQ_GPORT_SCHEDULER   0x00000002
 
#define OPENNSL_COSQ_GPORT_STATS_SHARED   0x00000001
 
#define OPENNSL_COSQ_GPORT_SUBSCRIBER   0x00000040
 
#define OPENNSL_COSQ_GPORT_UCAST_QUEUE_GROUP   0x00000008
 
#define OPENNSL_COSQ_GPORT_WITH_ID   0x00000001
 
#define OPENNSL_COSQ_HIGH_PRIORITY   -4
 
#define OPENNSL_COSQ_LOW_PRIORITY   -5
 
#define OPENNSL_COSQ_MULTICAST_SCHEDULED   0x00000001
 multicast scheduled values are valid
 
#define OPENNSL_COSQ_NONE   0x0
 Pass through.
 
#define OPENNSL_COSQ_PRIO_VALID(prio)   ((prio) >= 0 && (prio < 8))
 
#define OPENNSL_COSQ_QUEUE_VALID(unit, numq)   ((numq) >= 0 && (numq) < NUM_COS(unit))
 
#define OPENNSL_COSQ_ROUND_ROBIN   0x02
 Weights are ignored.
 
#define OPENNSL_COSQ_SP0   0x0C
 Strict priority level 0.
 
#define OPENNSL_COSQ_SP1   0x0D
 Strict priority level.
 
#define OPENNSL_COSQ_STRICT   0x01
 Weights are ignored.
 
#define OPENNSL_COSQ_WEIGHT_MIN   1
 
#define OPENNSL_COSQ_WEIGHT_STRICT   0
 
#define OPENNSL_COSQ_WEIGHT_UNLIMITED   -1
 
#define OPENNSL_COSQ_WEIGHTED_FAIR_QUEUING   0x04
 
#define OPENNSL_COSQ_WEIGHTED_ROUND_ROBIN   0x03
 

Typedefs

typedef enum opennsl_bst_stat_id_e opennsl_bst_stat_id_t
 BST Tracing statistics resources type eumerations.
 
typedef struct
opennsl_cosq_bst_profile_s 
opennsl_cosq_bst_profile_t
 
typedef enum opennsl_cosq_control_e opennsl_cosq_control_t
 Features that can be controlled on a gport/cosq basis.
 
typedef struct
opennsl_cosq_egress_multicast_config_s 
opennsl_cosq_egress_multicast_config_t
 multicast configuration settings
 
typedef struct
opennsl_cosq_gport_discard_s 
opennsl_cosq_gport_discard_t
 For Virtual output queues (system ports)
 
typedef struct
opennsl_cosq_gport_info_s 
opennsl_cosq_gport_info_t
 gport information related to getting a handle
 
typedef struct
opennsl_cosq_gport_stat_profile_s 
opennsl_cosq_gport_stat_profile_t
 Statistics Profile.
 
typedef enum
opennsl_cosq_gport_stats_e 
opennsl_cosq_gport_stats_t
 For Virtual output queues (system ports)
 
typedef int(* opennsl_cosq_gport_traverse_cb )(int unit, opennsl_gport_t port, int numq, uint32 flags, opennsl_gport_t gport, void *user_data)
 
typedef enum
opennsl_cosq_gport_type_e 
opennsl_cosq_gport_type_t
 cosq gport type eumerations
 
typedef enum opennsl_cosq_stat_e opennsl_cosq_stat_t
 XGS3 cosq counters.
 

Enumerations

enum  opennsl_bst_stat_id_e {
  opennslBstStatIdInvalid = -1,
  opennslBstStatIdDevice = 0,
  opennslBstStatIdEgrPool = 1,
  opennslBstStatIdEgrMCastPool = 2,
  opennslBstStatIdIngPool = 3,
  opennslBstStatIdPortPool = 4,
  opennslBstStatIdPriGroupShared = 5,
  opennslBstStatIdPriGroupHeadroom = 6,
  opennslBstStatIdUcast = 7,
  opennslBstStatIdMcast = 8,
  opennslBstStatIdHeadroomPool = 9,
  opennslBstStatIdEgrPortPoolSharedUcast = 10,
  opennslBstStatIdEgrPortPoolSharedMcast = 11,
  opennslBstStatIdMaxCount = 12
}
 BST Tracing statistics resources type eumerations. More...
 
enum  opennsl_cosq_control_e {
  opennslCosqControlEgressUCQueueSharedLimitBytes = 79,
  opennslCosqControlEgressMCQueueMinLimitBytes = 84,
  opennslCosqControlPortQueueUcast = 103,
  opennslCosqControlPortQueueMcast = 104
}
 Features that can be controlled on a gport/cosq basis. More...
 
enum  opennsl_cosq_gport_stats_e {
  opennslCosqGportGreenAcceptedPkts = 0,
  opennslCosqGportGreenAcceptedBytes = 1,
  opennslCosqGportNotGreenAcceptedPkts = 2,
  opennslCosqGportNotGreenAcceptedBytes = 3,
  opennslCosqGportGreenCongestionMarkedPkts = 4,
  opennslCosqGportGreenCongestionMarkedBytes = 5,
  opennslCosqGportGreenDiscardDroppedPkts = 6,
  opennslCosqGportGreenDiscardDroppedBytes = 7,
  opennslCosqGportYellowAcceptedPkts = 8,
  opennslCosqGportYellowAcceptedBytes = 9,
  opennslCosqGportYellowCongestionMarkedPkts = 10,
  opennslCosqGportYellowCongestionMarkedBytes = 11,
  opennslCosqGportYellowDiscardDroppedPkts = 12,
  opennslCosqGportYellowDiscardDroppedBytes = 13,
  opennslCosqGportRedAcceptedPkts = 14,
  opennslCosqGportRedAcceptedBytes = 15,
  opennslCosqGportRedCongestionMarkedPkts = 16,
  opennslCosqGportRedCongestionMarkedBytes = 17,
  opennslCosqGportRedDiscardDroppedPkts = 18,
  opennslCosqGportRedDiscardDroppedBytes = 19,
  opennslCosqGportBlackAcceptedPkts = 20,
  opennslCosqGportBlackAcceptedBytes = 21,
  opennslCosqGportNonWredDroppedPkts = 22,
  opennslCosqGportNonWredDroppedBytes = 23,
  opennslCosqGportDequeuedPkts = 24,
  opennslCosqGportDequeuedBytes = 25,
  opennslCosqGportGreenDroppedPkts = 26,
  opennslCosqGportGreenDroppedBytes = 27,
  opennslCosqGportNotGreenDroppedPkts = 28,
  opennslCosqGportNotGreenDroppedBytes = 29,
  opennslCosqGportYellowDroppedPkts = 30,
  opennslCosqGportYellowDroppedBytes = 31,
  opennslCosqGportRedDroppedPkts = 32,
  opennslCosqGportRedDroppedBytes = 33,
  opennslCosqGportBlackCongestionMarkedPkts = 34,
  opennslCosqGportBlackCongestionMarkedBytes = 35,
  opennslCosqGportBlackDiscardDroppedPkts = 36,
  opennslCosqGportBlackDiscardDroppedBytes = 37,
  opennslCosqGportBlackDroppedPkts = 38,
  opennslCosqGportBlackDroppedBytes = 39,
  opennslCosqGportOverSubscribeTotelDroppedPkts = 40,
  opennslCosqGportOverSubscribeTotalDroppedBytes = 41,
  opennslCosqGportOverSubscribeGuaranteeDroppedPkts = 42,
  opennslCosqGportOverSubscribeGuaranteedDroppedBytes = 43,
  opennslCosqGportDiscardDroppedPkts = 44,
  opennslCosqGportDiscardDroppedBytes = 45,
  opennslCosqGportYellowRedDiscardDroppedPkts = 46,
  opennslCosqGportYellowRedDiscardDroppedBytes = 47,
  opennslCosqGportEnqueuedPkts = 48,
  opennslCosqGportEnqueuedBytes = 49,
  opennslCosqGportOutLimitDroppedPkts = 50,
  opennslCosqGportOutLimitDroppedBytes = 51,
  opennslCosqGportOutLimitDroppedGreenPkts = 52,
  opennslCosqGportOutLimitDroppedGreenBytes = 53,
  opennslCosqGportOutLimitDroppedYellowPkts = 54,
  opennslCosqGportOutLimitDroppedYellowBytes = 55,
  opennslCosqGportOutLimitDroppedRedPkts = 56,
  opennslCosqGportOutLimitDroppedRedBytes = 57,
  opennslCosqGportOutLimitDroppedMulticastPkts = 58,
  opennslCosqGportOutLimitDroppedMulticastBytes = 59,
  opennslCosqGportOutPkts = 60,
  opennslCosqGportOutBytes = 61,
  opennslCosqGportReceivedBytes = 62,
  opennslCosqGportReceivedPkts = 63,
  opennslCosqGportDroppedBytes = 64,
  opennslCosqGportDroppedPkts = 65,
  opennslCosqGportDelayedBytes = 66,
  opennslCosqGportDelayedHundredUs = 67,
  opennslCosqGportGreenPkts = 68,
  opennslCosqGportGreenBytes = 69,
  opennslCosqGportNotGreenPkts = 70,
  opennslCosqGportNotGreenBytes = 71,
  opennslCosqGportOffset0Bytes = 72,
  opennslCosqGportOffset0Packets = 73,
  opennslCosqGportOffset1Bytes = 74,
  opennslCosqGportOffset1Packets = 75,
  opennslCosqGportOffset2Bytes = 76,
  opennslCosqGportOffset2Packets = 77,
  opennslCosqGportOffset3Bytes = 78,
  opennslCosqGportOffset3Packets = 79,
  opennslCosqGportOffset4Bytes = 80,
  opennslCosqGportOffset4Packets = 81,
  opennslCosqGportOffset5Bytes = 82,
  opennslCosqGportOffset5Packets = 83,
  opennslCosqGportOffset6Bytes = 84,
  opennslCosqGportOffset6Packets = 85,
  opennslCosqGportOffset7Bytes = 86,
  opennslCosqGportOffset7Packets = 87,
  opennslCosqGportStatCount = 88
}
 For Virtual output queues (system ports) More...
 
enum  opennsl_cosq_gport_type_e {
  opennslCosqGportTypeUnicastEgress = 1,
  opennslCosqGportTypeMulticastEgress = 2,
  opennslCosqGportTypeLocalPort = 6
}
 cosq gport type eumerations More...
 
enum  opennsl_cosq_stat_e {
  opennslCosqStatDroppedPackets = 0,
  opennslCosqStatDroppedBytes = 1,
  opennslCosqStatYellowCongestionDroppedPackets = 2,
  opennslCosqStatRedCongestionDroppedPackets = 3,
  opennslCosqStatGreenDiscardDroppedPackets = 4,
  opennslCosqStatYellowDiscardDroppedPackets = 5,
  opennslCosqStatRedDiscardDroppedPackets = 6,
  opennslCosqStatOutPackets = 7,
  opennslCosqStatOutBytes = 8
}
 XGS3 cosq counters. More...
 

Functions

int opennsl_cosq_bst_profile_get (int unit, opennsl_gport_t gport, opennsl_cos_queue_t cosq, opennsl_bst_stat_id_t bid, opennsl_cosq_bst_profile_t *profile) LIB_DLL_EXPORTED
 Set/Get the BST profile for CosQ objects.
 
int opennsl_cosq_bst_profile_set (int unit, opennsl_gport_t gport, opennsl_cos_queue_t cosq, opennsl_bst_stat_id_t bid, opennsl_cosq_bst_profile_t *profile) LIB_DLL_EXPORTED
 Set/Get the BST profile for CosQ objects.
 
int opennsl_cosq_bst_stat_clear (int unit, opennsl_gport_t gport, opennsl_cos_queue_t cosq, opennsl_bst_stat_id_t bid) LIB_DLL_EXPORTED
 Clear the current statistic/count of specified BST profile.
 
int opennsl_cosq_bst_stat_get (int unit, opennsl_gport_t gport, opennsl_cos_queue_t cosq, opennsl_bst_stat_id_t bid, uint32 options, uint64 *value) LIB_DLL_EXPORTED
 Get the current statistic/count of specified BST profile.
 
int opennsl_cosq_bst_stat_multi_get (int unit, opennsl_gport_t gport, opennsl_cos_queue_t cosq, uint32 options, int max_values, opennsl_bst_stat_id_t *id_list, uint64 *values) LIB_DLL_EXPORTED
 Get the current statistic/count of multiple specified BST profile.
 
int opennsl_cosq_bst_stat_sync (int unit, opennsl_bst_stat_id_t bid) LIB_DLL_EXPORTED
 Sync the HW stats value to SW copy for all or given BST resource.
 
int opennsl_cosq_config_get (int unit, int *numq) LIB_DLL_EXPORTED
 Configure the number of Class of Service Queues (COSQs).
 
int opennsl_cosq_config_set (int unit, int numq) LIB_DLL_EXPORTED
 Configure the number of Class of Service Queues (COSQs).
 
int opennsl_cosq_control_get (int unit, opennsl_gport_t port, opennsl_cos_queue_t cosq, opennsl_cosq_control_t type, int *arg) LIB_DLL_EXPORTED
 Set various features at the gport/cosq level.
 
int opennsl_cosq_control_set (int unit, opennsl_gport_t port, opennsl_cos_queue_t cosq, opennsl_cosq_control_t type, int arg) LIB_DLL_EXPORTED
 Set various features at the gport/cosq level.
 
int opennsl_cosq_detach (int unit) LIB_DLL_EXPORTED
 De-initialize the CoSQ subsystem.
 
int opennsl_cosq_discard_get (int unit, uint32 *flags) LIB_DLL_EXPORTED
 Configure Weighted Random Early Discard (WRED).
 
int opennsl_cosq_discard_port_get (int unit, opennsl_port_t port, opennsl_cos_queue_t cosq, uint32 color, int *drop_start, int *drop_slope, int *average_time) LIB_DLL_EXPORTED
 Configure a port's Weighted Random Early Discard (WRED) parameters.
 
int opennsl_cosq_discard_port_set (int unit, opennsl_port_t port, opennsl_cos_queue_t cosq, uint32 color, int drop_start, int drop_slope, int average_time) LIB_DLL_EXPORTED
 Configure a port's Weighted Random Early Discard (WRED) parameters.
 
int opennsl_cosq_discard_set (int unit, uint32 flags) LIB_DLL_EXPORTED
 Configure Weighted Random Early Discard (WRED).
 
int opennsl_cosq_gport_add (int unit, opennsl_gport_t port, int numq, uint32 flags, opennsl_gport_t *gport) LIB_DLL_EXPORTED
 Allocate/Retrieve unicast queue group and scheduler queue group configuration.
 
int opennsl_cosq_gport_attach (int unit, opennsl_gport_t sched_port, opennsl_gport_t input_port, opennsl_cos_queue_t cosq) LIB_DLL_EXPORTED
 Attach/Detach the output of a GPORT to the input of a scheduler GPORT.
 
int opennsl_cosq_gport_attach_get (int unit, opennsl_gport_t sched_port, opennsl_gport_t *input_port, opennsl_cos_queue_t *cosq) LIB_DLL_EXPORTED
 Attach/Detach the output of a GPORT to the input of a scheduler GPORT.
 
int opennsl_cosq_gport_bandwidth_get (int unit, opennsl_gport_t gport, opennsl_cos_queue_t cosq, uint32 *kbits_sec_min, uint32 *kbits_sec_max, uint32 *flags) LIB_DLL_EXPORTED
 Configure/Retrieve bandwidth setting.
 
int opennsl_cosq_gport_bandwidth_set (int unit, opennsl_gport_t gport, opennsl_cos_queue_t cosq, uint32 kbits_sec_min, uint32 kbits_sec_max, uint32 flags) LIB_DLL_EXPORTED
 Configure/Retrieve bandwidth setting.
 
int opennsl_cosq_gport_child_get (int unit, opennsl_gport_t in_gport, opennsl_cos_queue_t cosq, opennsl_gport_t *out_gport) LIB_DLL_EXPORTED
 Get the child node GPORT atatched to N-th index (cosq) of the scheduler GPORT.
 
int opennsl_cosq_gport_delete (int unit, opennsl_gport_t gport) LIB_DLL_EXPORTED
 Deletes queue group.
 
int opennsl_cosq_gport_detach (int unit, opennsl_gport_t sched_port, opennsl_gport_t input_port, opennsl_cos_queue_t cosq) LIB_DLL_EXPORTED
 Attach/Detach the output of a GPORT to the input of a scheduler GPORT.
 
int opennsl_cosq_gport_discard_get (int unit, opennsl_gport_t gport, opennsl_cos_queue_t cosq, opennsl_cosq_gport_discard_t *discard) LIB_DLL_EXPORTED
 Configure/Retrieve discard setting.
 
int opennsl_cosq_gport_discard_set (int unit, opennsl_gport_t gport, opennsl_cos_queue_t cosq, opennsl_cosq_gport_discard_t *discard) LIB_DLL_EXPORTED
 Configure/Retrieve discard setting.
 
int opennsl_cosq_gport_egress_map_get (int unit, opennsl_gport_t gport, opennsl_cos_t ingress_pri, opennsl_color_t ingress_dp, opennsl_cos_queue_t *offset) LIB_DLL_EXPORTED
 Configure/retrieve {traffic class, dp} mapping to egress queue on a port.
 
int opennsl_cosq_gport_egress_map_set (int unit, opennsl_gport_t gport, opennsl_cos_t ingress_pri, opennsl_color_t ingress_dp, opennsl_cos_queue_t offset) LIB_DLL_EXPORTED
 Configure/retrieve {traffic class, dp} mapping to egress queue on a port.
 
int opennsl_cosq_gport_egress_multicast_config_get (int unit, opennsl_gport_t gport, opennsl_cos_t ingress_pri, opennsl_color_t ingress_dp, uint32 flags, opennsl_cosq_egress_multicast_config_t *config) LIB_DLL_EXPORTED
 Configure/retrieve {traffic class, dp} mapping to multicast egress configuration on a port.
 
int opennsl_cosq_gport_egress_multicast_config_set (int unit, opennsl_gport_t gport, opennsl_cos_t ingress_pri, opennsl_color_t ingress_dp, uint32 flags, opennsl_cosq_egress_multicast_config_t *config) LIB_DLL_EXPORTED
 Configure/retrieve {traffic class, dp} mapping to multicast egress configuration on a port.
 
int opennsl_cosq_gport_enable_get (int unit, opennsl_gport_t gport, opennsl_cos_queue_t cosq, int *enable) LIB_DLL_EXPORTED
 Configure/Retrieve enable/disable state of a cos level in a queue group.
 
int opennsl_cosq_gport_enable_set (int unit, opennsl_gport_t gport, opennsl_cos_queue_t cosq, int enable) LIB_DLL_EXPORTED
 Configure/Retrieve enable/disable state of a cos level in a queue group.
 
int opennsl_cosq_gport_get (int unit, opennsl_gport_t gport, opennsl_gport_t *physical_port, int *num_cos_levels, uint32 *flags) LIB_DLL_EXPORTED
 Allocate/Retrieve unicast queue group and scheduler queue group configuration.
 
int opennsl_cosq_gport_handle_get (int unit, opennsl_cosq_gport_type_t gport_type, opennsl_cosq_gport_info_t *gport_info) LIB_DLL_EXPORTED
 Getting a gport handle.
 
int opennsl_cosq_gport_mapping_get (int unit, opennsl_port_t ing_port, opennsl_cos_t int_pri, uint32 flags, opennsl_gport_t *gport, opennsl_cos_queue_t *cosq) LIB_DLL_EXPORTED
 Get or set the mapping from internal priority to CoS queue.
 
int opennsl_cosq_gport_mapping_set (int unit, opennsl_port_t ing_port, opennsl_cos_t int_pri, uint32 flags, opennsl_gport_t gport, opennsl_cos_queue_t cosq) LIB_DLL_EXPORTED
 Get or set the mapping from internal priority to CoS queue.
 
int opennsl_cosq_gport_sched_config_get (int unit, opennsl_gport_t gport, int sched_mode, int int_pri, uint32 *flags) LIB_DLL_EXPORTED
 Mapping/redirecting scheduling discipline to Egress FIFO.
 
int opennsl_cosq_gport_sched_config_set (int unit, opennsl_gport_t gport, int sched_mode, int int_pri, uint32 flags) LIB_DLL_EXPORTED
 Mapping/redirecting scheduling discipline to Egress FIFO.
 
int opennsl_cosq_gport_sched_get (int unit, opennsl_gport_t gport, opennsl_cos_queue_t cosq, int *mode, int *weight) LIB_DLL_EXPORTED
 Configure/retrieve scheduling policy.
 
int opennsl_cosq_gport_sched_set (int unit, opennsl_gport_t gport, opennsl_cos_queue_t cosq, int mode, int weight) LIB_DLL_EXPORTED
 Configure/retrieve scheduling policy.
 
int opennsl_cosq_gport_stat_config_get (int unit, opennsl_gport_t gport, opennsl_gport_t lgl_gport, opennsl_cos_queue_t cosq, uint32 flags, opennsl_cosq_gport_stat_profile_t *profile) LIB_DLL_EXPORTED
 Get a previously-configured Central Statistic profile that captures WRED packets.
 
int opennsl_cosq_gport_stat_config_set (int unit, opennsl_gport_t gport, opennsl_gport_t lgl_gport, opennsl_cos_queue_t cosq, uint32 flags, opennsl_cosq_gport_stat_profile_t profile) LIB_DLL_EXPORTED
 Set up a Central Statistic profile to capture WRED packets.
 
int opennsl_cosq_gport_stat_enable_get (int unit, opennsl_gport_t gport, int *enable) LIB_DLL_EXPORTED
 Retrieve queue group statistic setting.
 
int opennsl_cosq_gport_stat_enable_set (int unit, opennsl_gport_t gport, int enable) LIB_DLL_EXPORTED
 Enable/Disable statistics for queue group.
 
int opennsl_cosq_gport_stat_get (int unit, opennsl_gport_t gport, opennsl_cos_queue_t cosq, opennsl_cosq_gport_stats_t stat, uint64 *value) LIB_DLL_EXPORTED
 Retrieve/Set Statistics.
 
int opennsl_cosq_gport_stat_set (int unit, opennsl_gport_t gport, opennsl_cos_queue_t cosq, opennsl_cosq_gport_stats_t stat, uint64 value) LIB_DLL_EXPORTED
 Retrieve/Set Statistics.
 
int opennsl_cosq_gport_stat_sync_get (int unit, opennsl_gport_t gport, opennsl_cos_queue_t cosq, opennsl_cosq_gport_stats_t stat, uint64 *value) LIB_DLL_EXPORTED
 Force an immediate counter update and retrieve statistics.
 
int opennsl_cosq_gport_statistic_get (int unit, opennsl_gport_t gport, opennsl_gport_t lgl_gport, opennsl_cos_queue_t cosq, uint32 flags, opennsl_cosq_gport_stats_t stat, uint64 *value) LIB_DLL_EXPORTED
 Get the value associated with a Central Statistics Index.
 
int opennsl_cosq_gport_statistic_set (int unit, opennsl_gport_t gport, opennsl_gport_t lgl_gport, opennsl_cos_queue_t cosq, uint32 flags, opennsl_cosq_gport_stats_t stat, uint64 value) LIB_DLL_EXPORTED
 Reset the value of a Central Statistics stat to zero.
 
int opennsl_cosq_gport_traverse (int unit, opennsl_cosq_gport_traverse_cb cb, void *user_data) LIB_DLL_EXPORTED
 Traverse all added CoS queue GPORTs and call the supplied callback routine for each one.
 
int opennsl_cosq_init (int unit) LIB_DLL_EXPORTED
 Initialize the CoSQ subsystem.
 
int opennsl_cosq_mapping_get (int unit, opennsl_cos_t priority, opennsl_cos_queue_t *cosq) LIB_DLL_EXPORTED
 Get or set the mapping from internal priority to CoS queue.
 
int opennsl_cosq_mapping_set (int unit, opennsl_cos_t priority, opennsl_cos_queue_t cosq) LIB_DLL_EXPORTED
 Get or set the mapping from internal priority to CoS queue.
 
int opennsl_cosq_port_bandwidth_get (int unit, opennsl_port_t port, opennsl_cos_queue_t cosq, uint32 *kbits_sec_min, uint32 *kbits_sec_max, uint32 *flags) LIB_DLL_EXPORTED
 Configure a port's bandwidth distribution among CoS queues.
 
int opennsl_cosq_port_bandwidth_set (int unit, opennsl_port_t port, opennsl_cos_queue_t cosq, uint32 kbits_sec_min, uint32 kbits_sec_max, uint32 flags) LIB_DLL_EXPORTED
 Configure a port's bandwidth distribution among CoS queues.
 
int opennsl_cosq_port_mapping_get (int unit, opennsl_port_t port, opennsl_cos_t priority, opennsl_cos_queue_t *cosq) LIB_DLL_EXPORTED
 Get or set the mapping from internal priority to CoS queue.
 
int opennsl_cosq_port_mapping_multi_get (int unit, opennsl_port_t port, int count, opennsl_cos_t *priority_array, opennsl_cos_queue_t *cosq_array) LIB_DLL_EXPORTED
 Get or set the mapping of multiple internal priorities to their corresponding CoS queues.
 
int opennsl_cosq_port_mapping_multi_set (int unit, opennsl_port_t port, int count, opennsl_cos_t *priority_array, opennsl_cos_queue_t *cosq_array) LIB_DLL_EXPORTED
 Get or set the mapping of multiple internal priorities to their corresponding CoS queues.
 
int opennsl_cosq_port_mapping_set (int unit, opennsl_port_t port, opennsl_cos_t priority, opennsl_cos_queue_t cosq) LIB_DLL_EXPORTED
 Get or set the mapping from internal priority to CoS queue.
 
int opennsl_cosq_port_sched_get (int unit, opennsl_pbmp_t pbm, int *mode, int weights[OPENNSL_COS_COUNT], int *delay) LIB_DLL_EXPORTED
 Get or set Class of Service policy, weights and delay.
 
int opennsl_cosq_port_sched_set (int unit, opennsl_pbmp_t pbm, int mode, const int weights[OPENNSL_COS_COUNT], int delay) LIB_DLL_EXPORTED
 Get or set Class of Service policy, weights and delay.
 
int opennsl_cosq_priority_get (int unit, int start_queue, int end_queue, int *pri_profile_id) LIB_DLL_EXPORTED
 Get the priority profile associated with a queue range.
 
int opennsl_cosq_priority_set (int unit, int start_queue, int end_queue, int pri_profile_id) LIB_DLL_EXPORTED
 Associate a priority profile with a queue range.
 
int opennsl_cosq_sched_get (int unit, int *mode, int weights[OPENNSL_COS_COUNT], int *delay) LIB_DLL_EXPORTED
 Get or set Class of Service policy, weights and delay.
 
int opennsl_cosq_sched_set (int unit, int mode, const int weights[OPENNSL_COS_COUNT], int delay) LIB_DLL_EXPORTED
 Get or set Class of Service policy, weights and delay.
 
int opennsl_cosq_sched_weight_max_get (int unit, int mode, int *weight_max) LIB_DLL_EXPORTED
 Retrieve maximum weights for given CoS policy.
 
int opennsl_cosq_stat_get (int unit, opennsl_gport_t gport, opennsl_cos_queue_t cosq, opennsl_cosq_stat_t stat, uint64 *value) LIB_DLL_EXPORTED
 Retrieve/set various MMU statistics based on stat type.
 
int opennsl_cosq_stat_set (int unit, opennsl_gport_t gport, opennsl_cos_queue_t cosq, opennsl_cosq_stat_t stat, uint64 value) LIB_DLL_EXPORTED
 Retrieve/set various MMU statistics based on stat type.
 
int opennsl_cosq_stat_sync_get (int unit, opennsl_gport_t gport, opennsl_cos_queue_t cosq, opennsl_cosq_stat_t stat, uint64 *value) LIB_DLL_EXPORTED
 Force an immediate counter update and retrieve various MMU statistics.
 

Detailed Description

Macro Definition Documentation

#define OPENNSL_COSQ_ALL   0x00000001

Definition at line 587 of file cosqX.h.

#define OPENNSL_COSQ_BW_EAV_MODE   0x00000008

Prioritize selected queue(s) for bandwidth before non-selected queue(s).

Definition at line 588 of file cosqX.h.

#define OPENNSL_COSQ_BW_LLFC   0x00000010

Link Level Flow Control setting.

Definition at line 591 of file cosqX.h.

#define OPENNSL_COSQ_BW_NOT_COMMIT   0x00000040

Set rate to SW DB only, commit to HW is done when calling the API with the same GPort type and without NOT_COMMIT flag.

Definition at line 596 of file cosqX.h.

#define OPENNSL_COSQ_BW_PACKET_MODE   0x00000020

The bandwidth specified is in packets per second instead of kbits per second.

Definition at line 593 of file cosqX.h.

#define OPENNSL_COSQ_DEFICIT_ROUND_ROBIN   0x05

XGS3 only.

Definition at line 371 of file cosqX.h.

#define OPENNSL_COSQ_DISCARD_BYTES   0x2000

Definition at line 683 of file cosqX.h.

#define OPENNSL_COSQ_DISCARD_COLOR_ALL   0x0F00

Definition at line 680 of file cosqX.h.

#define OPENNSL_COSQ_DISCARD_COLOR_BLACK   0x0800

Definition at line 679 of file cosqX.h.

Referenced by example_create_policy().

#define OPENNSL_COSQ_DISCARD_COLOR_GREEN   0x0100

Definition at line 676 of file cosqX.h.

#define OPENNSL_COSQ_DISCARD_COLOR_RED   0x0400

Definition at line 678 of file cosqX.h.

#define OPENNSL_COSQ_DISCARD_COLOR_YELLOW   0x0200

Definition at line 677 of file cosqX.h.

#define OPENNSL_COSQ_DISCARD_DEVICE   0x10000

Definition at line 686 of file cosqX.h.

#define OPENNSL_COSQ_DISCARD_DROP_FIRST   OPENNSL_COSQ_DISCARD_COLOR_RED

Definition at line 681 of file cosqX.h.

#define OPENNSL_COSQ_DISCARD_ENABLE   0x0001

Definition at line 674 of file cosqX.h.

Referenced by example_create_policy().

#define OPENNSL_COSQ_DISCARD_IFP   0x400000

Definition at line 691 of file cosqX.h.

#define OPENNSL_COSQ_DISCARD_MARK_CONGESTION   0x4000

Definition at line 684 of file cosqX.h.

#define OPENNSL_COSQ_DISCARD_NONTCP   0x0004

Definition at line 675 of file cosqX.h.

#define OPENNSL_COSQ_DISCARD_OUTER_CFI   0x800000

Definition at line 692 of file cosqX.h.

#define OPENNSL_COSQ_DISCARD_PACKETS   0x1000

Definition at line 682 of file cosqX.h.

#define OPENNSL_COSQ_DISCARD_PORT   0x8000

Definition at line 685 of file cosqX.h.

#define OPENNSL_COSQ_DISCARD_PROBABILITY1   0x100000

Definition at line 689 of file cosqX.h.

#define OPENNSL_COSQ_DISCARD_PROBABILITY2   0x200000

Definition at line 690 of file cosqX.h.

#define OPENNSL_COSQ_DISCARD_SYSTEM   0x80000

Definition at line 688 of file cosqX.h.

#define OPENNSL_COSQ_DISCARD_TCP   0x40000

Definition at line 687 of file cosqX.h.

#define OPENNSL_COSQ_GPORT_DESTMOD_UCAST_QUEUE_GROUP   0x00000010

Definition at line 1551 of file cosqX.h.

#define OPENNSL_COSQ_GPORT_DISABLE   0x00000100

Disable queue, used for OPENNSL_COSQ_GPORT_CALENDAR scheduling discipline.

Definition at line 1556 of file cosqX.h.

#define OPENNSL_COSQ_GPORT_EGRESS_GROUP   0x00000080

Definition at line 1555 of file cosqX.h.

#define OPENNSL_COSQ_GPORT_MCAST_QUEUE   0x00000010

Definition at line 1552 of file cosqX.h.

#define OPENNSL_COSQ_GPORT_MCAST_QUEUE_GROUP   0x00000020

Definition at line 1553 of file cosqX.h.

#define OPENNSL_COSQ_GPORT_OVERLAY   0x00000004

Definition at line 1549 of file cosqX.h.

#define OPENNSL_COSQ_GPORT_SCHEDULER   0x00000002

Definition at line 1548 of file cosqX.h.

#define OPENNSL_COSQ_GPORT_STATS_SHARED   0x00000001

Definition at line 1030 of file cosqX.h.

#define OPENNSL_COSQ_GPORT_SUBSCRIBER   0x00000040

Definition at line 1554 of file cosqX.h.

#define OPENNSL_COSQ_GPORT_UCAST_QUEUE_GROUP   0x00000008

Definition at line 1550 of file cosqX.h.

#define OPENNSL_COSQ_GPORT_WITH_ID   0x00000001

Definition at line 1547 of file cosqX.h.

#define OPENNSL_COSQ_HIGH_PRIORITY   -4
#define OPENNSL_COSQ_LOW_PRIORITY   -5
#define OPENNSL_COSQ_MULTICAST_SCHEDULED   0x00000001

multicast scheduled values are valid

Definition at line 2168 of file cosqX.h.

Referenced by example_set_mc_queue_mapping().

#define OPENNSL_COSQ_NONE   0x0

Pass through.

Definition at line 366 of file cosqX.h.

#define OPENNSL_COSQ_PRIO_VALID (   prio)    ((prio) >= 0 && (prio < 8))

Definition at line 379 of file cosqX.h.

#define OPENNSL_COSQ_QUEUE_VALID (   unit,
  numq 
)    ((numq) >= 0 && (numq) < NUM_COS(unit))

Definition at line 380 of file cosqX.h.

#define OPENNSL_COSQ_ROUND_ROBIN   0x02

Weights are ignored.

Definition at line 368 of file cosqX.h.

#define OPENNSL_COSQ_SP0   0x0C

Strict priority level 0.

Definition at line 372 of file cosqX.h.

Referenced by example_set_sp().

#define OPENNSL_COSQ_SP1   0x0D

Strict priority level.

Definition at line 374 of file cosqX.h.

Referenced by example_set_sp().

#define OPENNSL_COSQ_STRICT   0x01

Weights are ignored.

Definition at line 367 of file cosqX.h.

#define OPENNSL_COSQ_WEIGHT_MIN   1

Definition at line 378 of file cosqX.h.

#define OPENNSL_COSQ_WEIGHT_STRICT   0

Definition at line 377 of file cosqX.h.

#define OPENNSL_COSQ_WEIGHT_UNLIMITED   -1

Definition at line 376 of file cosqX.h.

#define OPENNSL_COSQ_WEIGHTED_FAIR_QUEUING   0x04

Definition at line 370 of file cosqX.h.

#define OPENNSL_COSQ_WEIGHTED_ROUND_ROBIN   0x03

Definition at line 369 of file cosqX.h.

Typedef Documentation

BST Tracing statistics resources type eumerations.

Features that can be controlled on a gport/cosq basis.

multicast configuration settings

For Virtual output queues (system ports)

gport information related to getting a handle

Statistics Profile.

For Virtual output queues (system ports)

typedef int(* opennsl_cosq_gport_traverse_cb)(int unit, opennsl_gport_t port, int numq, uint32 flags, opennsl_gport_t gport, void *user_data)

Definition at line 1188 of file cosqX.h.

cosq gport type eumerations

XGS3 cosq counters.

Enumeration Type Documentation

BST Tracing statistics resources type eumerations.

Enumerator:
opennslBstStatIdInvalid 

Invalid BST Id and used for sync all the Hardware stats to the Software copy.

opennslBstStatIdDevice 

Per device BST tracing resource.

opennslBstStatIdEgrPool 

Per Egress Pool BST tracing resource.

opennslBstStatIdEgrMCastPool 

Per Egress Pool BST tracing resource(Multicast)

opennslBstStatIdIngPool 

Per Ingress Pool BST tracing resource.

opennslBstStatIdPortPool 

Per Port Pool BST tracing resource.

opennslBstStatIdPriGroupShared 

Per Shared Priority Group Pool BST tracing resource.

opennslBstStatIdPriGroupHeadroom 

Per Priority Group Headroom BST tracing resource.

opennslBstStatIdUcast 

BST Tracing resource for unicast.

opennslBstStatIdMcast 

BST Tracing resource for multicast.

opennslBstStatIdHeadroomPool 

BST Tracing the Headroom Pool Usage Count.

opennslBstStatIdEgrPortPoolSharedUcast 

Per Port Pool unicast BST Tracing resource.

opennslBstStatIdEgrPortPoolSharedMcast 

Per Port Pool multicast BST Tracing resource.

opennslBstStatIdMaxCount 

Must be the last.

Not a usable value.

Definition at line 108 of file cosq.h.

Features that can be controlled on a gport/cosq basis.

Enumerator:
opennslCosqControlEgressUCQueueSharedLimitBytes 

Egress UC Shared Queue limit setting.

opennslCosqControlEgressMCQueueMinLimitBytes 

MC Min Queue limit setting.

opennslCosqControlPortQueueUcast 

retrieve port, cosq queue number of PBSMH UC packet headers

opennslCosqControlPortQueueMcast 

retrieve port, cosq queue number of PBSMH MC packet headers

Definition at line 858 of file cosqX.h.

For Virtual output queues (system ports)

Enumerator:
opennslCosqGportGreenAcceptedPkts 

Green/DP0, accepted packet count.

opennslCosqGportGreenAcceptedBytes 

Green/DP0, accepted byte count.

opennslCosqGportNotGreenAcceptedPkts 

Not Green/DP1-3, accepted packet count.

opennslCosqGportNotGreenAcceptedBytes 

Not Green/DP1-3, accepted byte count.

opennslCosqGportGreenCongestionMarkedPkts 

Green/DP0, ECN Marked packets.

opennslCosqGportGreenCongestionMarkedBytes 

Green/DP0, ECN Marked bytes.

opennslCosqGportGreenDiscardDroppedPkts 

Green/DP0, WRED dropped packets.

opennslCosqGportGreenDiscardDroppedBytes 

Green/DP0, WRED dropped bytes.

opennslCosqGportYellowAcceptedPkts 

Yellow/DP1, accepted packet count.

opennslCosqGportYellowAcceptedBytes 

Yellow/DP1, accepted byte count.

opennslCosqGportYellowCongestionMarkedPkts 

Yellow/DP1, ECN Marked packets.

opennslCosqGportYellowCongestionMarkedBytes 

Yellow/DP1, ECN nMarked bytes.

opennslCosqGportYellowDiscardDroppedPkts 

Yellow/DP1, WRED dropped packets.

opennslCosqGportYellowDiscardDroppedBytes 

Yellow/DP1, WRED dropped bytes.

opennslCosqGportRedAcceptedPkts 

Red/DP2, accepted packet count.

opennslCosqGportRedAcceptedBytes 

Red/DP2, accepted byte count.

opennslCosqGportRedCongestionMarkedPkts 

Red/DP2, ECN Marked packets.

opennslCosqGportRedCongestionMarkedBytes 

Red/DP2, ECN Marked bytes.

opennslCosqGportRedDiscardDroppedPkts 

Red/DP2, WRED dropped packets.

opennslCosqGportRedDiscardDroppedBytes 

Red/DP2, WRED dropped bytes.

opennslCosqGportBlackAcceptedPkts 

Black/DP3, accepted packet count.

opennslCosqGportBlackAcceptedBytes 

Black/DP3, accepted byte count.

opennslCosqGportNonWredDroppedPkts 

NON-WRED dropped packet count.

opennslCosqGportNonWredDroppedBytes 

NON-WRED dropped byte count.

opennslCosqGportDequeuedPkts 

dequeued packets.

opennslCosqGportDequeuedBytes 

dequeued bytes.

opennslCosqGportGreenDroppedPkts 

Green/DP0, non-WRED dropped pkts.

opennslCosqGportGreenDroppedBytes 

Green/DP0, non-WRED dropped bytes.

opennslCosqGportNotGreenDroppedPkts 

Not Green/DP1-3 dropped pkts.

opennslCosqGportNotGreenDroppedBytes 

Not Green/DP1-3 dropped bytes.

opennslCosqGportYellowDroppedPkts 

Yellow/DP1, non-WRED dropped pkts.

opennslCosqGportYellowDroppedBytes 

Yellow/DP1, non-WRED dropped bytes.

opennslCosqGportRedDroppedPkts 

Red/DP2, non-WRED dropped pkts.

opennslCosqGportRedDroppedBytes 

Red/DP2, non-WRED dropped bytes.

opennslCosqGportBlackCongestionMarkedPkts 

Black/DP3, ECN Marked packets.

opennslCosqGportBlackCongestionMarkedBytes 

Black/DP3, ECN Marked bytes.

opennslCosqGportBlackDiscardDroppedPkts 

Black/DP3, WRED dropped at packets.

opennslCosqGportBlackDiscardDroppedBytes 

Black/DP3, WRED dropped bytes.

opennslCosqGportBlackDroppedPkts 

Black/DP3, non-WRED dropped at packets.

opennslCosqGportBlackDroppedBytes 

Black/DP3, non-WRED dropped bytes.

opennslCosqGportOverSubscribeTotelDroppedPkts 

Free list underflow, pkts dropped.

opennslCosqGportOverSubscribeTotalDroppedBytes 

Free list underflow, bytes dropped.

opennslCosqGportOverSubscribeGuaranteeDroppedPkts 

Gbl buf thres guarantee, pkts dropped.

opennslCosqGportOverSubscribeGuaranteedDroppedBytes 

Gbl buf thres guarantee, bytes dropped.

opennslCosqGportDiscardDroppedPkts 

discarded packets

opennslCosqGportDiscardDroppedBytes 

discarded bytes

opennslCosqGportYellowRedDiscardDroppedPkts 

Yellow and Red dropped packets.

opennslCosqGportYellowRedDiscardDroppedBytes 

Yellow and Red dropped bytes.

opennslCosqGportEnqueuedPkts 

enqueued packets

opennslCosqGportEnqueuedBytes 

enqueued bytes

opennslCosqGportOutLimitDroppedPkts 

Egress Admission Control (EAC) dropped pkts.

opennslCosqGportOutLimitDroppedBytes 

EAC dropped bytes.

opennslCosqGportOutLimitDroppedGreenPkts 

EAC dropped green pkts.

opennslCosqGportOutLimitDroppedGreenBytes 

EAC dropped green bytes.

opennslCosqGportOutLimitDroppedYellowPkts 

EAC dropped yellow pkts.

opennslCosqGportOutLimitDroppedYellowBytes 

EAC dropped yellow bytes.

opennslCosqGportOutLimitDroppedRedPkts 

EAC dropped red pkts.

opennslCosqGportOutLimitDroppedRedBytes 

EAC dropped red bytes.

opennslCosqGportOutLimitDroppedMulticastPkts 

EAC dropped multicast pkts.

opennslCosqGportOutLimitDroppedMulticastBytes 

EAC dropped multicast bytes.

opennslCosqGportOutPkts 

Egress Interface.

opennslCosqGportOutBytes 

Egress Interface.

opennslCosqGportReceivedBytes 

Bytes received into queue.

opennslCosqGportReceivedPkts 

Pkts received into queue.

opennslCosqGportDroppedBytes 

Bytes dropped in queue.

opennslCosqGportDroppedPkts 

Pkts dropped in queue.

opennslCosqGportDelayedBytes 

Delayed bytes.

opennslCosqGportDelayedHundredUs 

Maximum Pkts delay.

opennslCosqGportGreenPkts 

Green/DP0 packet count.

opennslCosqGportGreenBytes 

Green/DP0 byte count.

opennslCosqGportNotGreenPkts 

Not-Green/DP0 packet count.

opennslCosqGportNotGreenBytes 

Not-Green/DP0 byte count.

opennslCosqGportOffset0Bytes 

Byte count at configurable offset 0.

opennslCosqGportOffset0Packets 

Packet count at configurable offset 0.

opennslCosqGportOffset1Bytes 

Byte count at configurable offset 1.

opennslCosqGportOffset1Packets 

Packet count at configurable offset.

opennslCosqGportOffset2Bytes 

Byte count at configurable offset 2.

opennslCosqGportOffset2Packets 

Packet count at configurable offset.

opennslCosqGportOffset3Bytes 

Byte count at configurable offset 3.

opennslCosqGportOffset3Packets 

Packet count at configurable offset.

opennslCosqGportOffset4Bytes 

Byte count at configurable offset 4.

opennslCosqGportOffset4Packets 

Packet count at configurable offset.

opennslCosqGportOffset5Bytes 

Byte count at configurable offset 5.

opennslCosqGportOffset5Packets 

Packet count at configurable offset.

opennslCosqGportOffset6Bytes 

Byte count at configurable offset 6.

opennslCosqGportOffset6Packets 

Packet count at configurable offset.

opennslCosqGportOffset7Bytes 

Byte count at configurable offset 7.

opennslCosqGportOffset7Packets 

Packet count at configurable offset.

opennslCosqGportStatCount 

Must be the last entry !

Definition at line 924 of file cosqX.h.

cosq gport type eumerations

Enumerator:
opennslCosqGportTypeUnicastEgress 

Unicast Egress Queues - Port hierarchy.

opennslCosqGportTypeMulticastEgress 

Multicast Egress Queues - Port Hierarchy.

opennslCosqGportTypeLocalPort 

Ports in Egress transmit hierarchy.

Definition at line 2252 of file cosqX.h.

XGS3 cosq counters.

Enumerator:
opennslCosqStatDroppedPackets 

Dropped packet count.

opennslCosqStatDroppedBytes 

Dropped byte count.

opennslCosqStatYellowCongestionDroppedPackets 

Dropped yellow packets due to congestion.

opennslCosqStatRedCongestionDroppedPackets 

Dropped red packets due to congestion.

opennslCosqStatGreenDiscardDroppedPackets 

WRED green packets.

opennslCosqStatYellowDiscardDroppedPackets 

WRED yellow packets.

opennslCosqStatRedDiscardDroppedPackets 

WRED red packets.

opennslCosqStatOutPackets 

Transmit packet count.

opennslCosqStatOutBytes 

Transmit byte count.

Definition at line 2291 of file cosqX.h.

Function Documentation

int opennsl_cosq_bst_profile_get ( int  unit,
opennsl_gport_t  gport,
opennsl_cos_queue_t  cosq,
opennsl_bst_stat_id_t  bid,
opennsl_cosq_bst_profile_t profile 
)

Set/Get the BST profile for CosQ objects.

Description
Configure or retrieve the BST (buffer statistics tracking) configuration for the specified MMU resource. MMU resource is identified by the combination of port, cosq and bid parameters. port parameter can be port gport, queue gport. bid parameter identifies the MMU resource, for instance the bid opennslBstStatIdEgrPool identifies the egress service pool resource. cosq parameter identifies the object within the various instances of resources within the identified resource. Note: For bid=opennslBstStatIdHeadroomPool, returns OPENNSL_E_PARAM as there is no BST configuration required for Headroom Pool The bid parameter can be one of the following from the table.
Parameters
unit[IN] Unit number.
gport[IN]
cosq[IN] Cosq object offset identifier
bid[IN] BST stat ID to identify the COSQ resource/object
profile[OUT] BST profile configuration
Return values
OPENNSL_E_NONE
OPENNSL_E_XXX
int opennsl_cosq_bst_profile_set ( int  unit,
opennsl_gport_t  gport,
opennsl_cos_queue_t  cosq,
opennsl_bst_stat_id_t  bid,
opennsl_cosq_bst_profile_t profile 
)

Set/Get the BST profile for CosQ objects.

Description
Configure or retrieve the BST (buffer statistics tracking) configuration for the specified MMU resource. MMU resource is identified by the combination of port, cosq and bid parameters. port parameter can be port gport, queue gport. bid parameter identifies the MMU resource, for instance the bid opennslBstStatIdEgrPool identifies the egress service pool resource. cosq parameter identifies the object within the various instances of resources within the identified resource. Note: For bid=opennslBstStatIdHeadroomPool, returns OPENNSL_E_PARAM as there is no BST configuration required for Headroom Pool The bid parameter can be one of the following from the table.
Parameters
unit[IN] Unit number.
gport[IN]
cosq[IN] Cosq object offset identifier
bid[IN] BST stat ID to identify the COSQ resource/object
profile[IN] BST profile configuration
Return values
OPENNSL_E_NONE
OPENNSL_E_XXX
int opennsl_cosq_bst_stat_clear ( int  unit,
opennsl_gport_t  gport,
opennsl_cos_queue_t  cosq,
opennsl_bst_stat_id_t  bid 
)

Clear the current statistic/count of specified BST profile.

Description
Clear the BST (buffer statistics tracking) statistic for the specified MMU resource. MMU resource is identified by the combination of port, cosq and bid parameters. port parameter can be port gport, queue gport. bid parameter identifies the MMU resource, for instance the bid opennslBstStatIdEgrPool identifies the egress service pool resource. cosq parameter identifies the object within the various instances of resources within the identified resource. gport value of -1 will clear stats on all ports.
Parameters
unit[IN] Unit number.
gport[IN] Device or logical port or GPORT ID
cosq[IN] Cosq object offset identifier
bid[IN] BST stat ID to identify the COSQ resource/object
Return values
OPENNSL_E_NONE
OPENNSL_E_XXX
int opennsl_cosq_bst_stat_get ( int  unit,
opennsl_gport_t  gport,
opennsl_cos_queue_t  cosq,
opennsl_bst_stat_id_t  bid,
uint32  options,
uint64 value 
)

Get the current statistic/count of specified BST profile.

Description
Retrieve the BST (buffer statistics tracking) statistic for the specified MMU resource. MMU resource is identified by the combination of port, cosq and bid parameters. port parameter can be port gport, queue gport. bid parameter identifies the MMU resource, for instance the flag opennslBstStatIdEgrPool identifies the egress service pool resource. cosq parameter identifies the object within the various instances of resources within the identified resource. if option OPENNSL_COSQ_STAT_CLEAR is present, a memory/register clear will be performed after stat reading. .
Parameters
unit[IN] Unit number.
gport[IN]
cosq[IN] Cosq object offset identifier
bid[IN] BST stat ID to identify the COSQ resource/object
options[IN] options to perform clear-on-read
value[OUT]
Return values
OPENNSL_E_NONE
OPENNSL_E_XXX
int opennsl_cosq_bst_stat_multi_get ( int  unit,
opennsl_gport_t  gport,
opennsl_cos_queue_t  cosq,
uint32  options,
int  max_values,
opennsl_bst_stat_id_t id_list,
uint64 values 
)

Get the current statistic/count of multiple specified BST profile.

Description
Retrieve the BST (buffer statistics tracking) statistic for multiple specified MMU resource. MMU resource is identified by the combination of port, cosq and bid parameters. port parameter can be port gport, queue gport. bid parameter identifies the MMU resource, for instance the flag opennslBstStatIdEgrPool identifies the egress service pool resource. cosq parameter identifies the object within the various instances of resources within the identified resource. if option OPENNSL_COSQ_STAT_CLEAR is present, a memory/register clear will be performed after stat reading. .
Parameters
unit[IN] Unit number.
gport[IN] Device or logical port or GPORT ID
cosq[IN] Cosq object offset identifier
options[IN] options to perform clear-on-read
max_values[IN] Number of elements in id_list and pvalue
id_list[IN] Array of BST stat ID list to identify the COSQ resource/object
values[OUT]
Return values
OPENNSL_E_NONE
OPENNSL_E_XXX
int opennsl_cosq_bst_stat_sync ( int  unit,
opennsl_bst_stat_id_t  bid 
)

Sync the HW stats value to SW copy for all or given BST resource.

Description
API to sync the Hardware stats for all or given BST resources to the Software copy. During this sync, BST status will be disabled, in order to maintain consistency of the stats to a defined time and Post sync, the BST status will be restored. This is required to be used before calling bst_stat_get() to get latest or updated stats value.
Parameters
unit[IN] Unit number.
bid[IN] BST stat ID to identify the COSQ resource/object
Return values
OPENNSL_E_NONE
OPENNSL_E_XXX
int opennsl_cosq_config_get ( int  unit,
int *  numq 
)

Configure the number of Class of Service Queues (COSQs).

Description
Configure or retrieve the number of CoS queues. Different devices support different numbers of queues. 1, 2, 4 or 8 class CoS queues may be configured depending on the underlying device. Configuring the number of CoS queues affects the configuration and utilization of several internal resources in the device. opennsl_cosq_config_set configures the device to operate properly for the number of CoS Queues. The CPU CoS queue mapping is also reconfigured to adjust for the numq. For more information regarding user defined CPU CoS queue mappings see =opennsl_rx_cosq_mapping_set . After configuration of the number of CoS Queues, the application must call =opennsl_cosq_mapping_set to map the packet priorities into the desired CoS queues. opennsl_cosq_config_set configures the mapping to be functional but the priority to CoS Queue mapping is not defined. The number of CoS queues must be configured during system initialization. It is invalid to configure the CoS queues on a system with traffic flowing. The API does not check for this condition and the results are undefined if it occurs. On the chip network switch the default number of CoS queues is 8.
Parameters
unit[IN] Unit number.
numq[OUT] Number of Class of Service Queues
Return values
OPENNSL_E_NONE
OPENNSL_E_UNAVAILRequested number of CoS queues not supported on this device.
OPENNSL_E_XXX
int opennsl_cosq_config_set ( int  unit,
int  numq 
)

Configure the number of Class of Service Queues (COSQs).

Description
Configure or retrieve the number of CoS queues. Different devices support different numbers of queues. 1, 2, 4 or 8 class CoS queues may be configured depending on the underlying device. Configuring the number of CoS queues affects the configuration and utilization of several internal resources in the device. opennsl_cosq_config_set configures the device to operate properly for the number of CoS Queues. The CPU CoS queue mapping is also reconfigured to adjust for the numq. For more information regarding user defined CPU CoS queue mappings see =opennsl_rx_cosq_mapping_set . After configuration of the number of CoS Queues, the application must call =opennsl_cosq_mapping_set to map the packet priorities into the desired CoS queues. opennsl_cosq_config_set configures the mapping to be functional but the priority to CoS Queue mapping is not defined. The number of CoS queues must be configured during system initialization. It is invalid to configure the CoS queues on a system with traffic flowing. The API does not check for this condition and the results are undefined if it occurs. On the chip network switch the default number of CoS queues is 8.
Parameters
unit[IN] Unit number.
numq[IN] Number of Class of Service Queues
Return values
OPENNSL_E_NONE
OPENNSL_E_UNAVAILRequested number of CoS queues not supported on this device.
OPENNSL_E_XXX
int opennsl_cosq_control_get ( int  unit,
opennsl_gport_t  port,
opennsl_cos_queue_t  cosq,
opennsl_cosq_control_t  type,
int *  arg 
)

Set various features at the gport/cosq level.

Description
Features that can be controlled on a gport/cosq basis. On some devices and for some cosq control types, a port value of -1 or gport type for system configuration will configure system based cosq control.
Parameters
unit[IN] Unit number.
port[IN] GPORT ID for a queue group
cosq[IN] CoS Queue
type[IN] type of operation (see =OPENNSL_COSQ_CONTROL_table)
arg[OUT] (for _set) Argument whose meaning is dependent on type
Return values
OPENNSL_E_XXX
int opennsl_cosq_control_set ( int  unit,
opennsl_gport_t  port,
opennsl_cos_queue_t  cosq,
opennsl_cosq_control_t  type,
int  arg 
)

Set various features at the gport/cosq level.

Description
Features that can be controlled on a gport/cosq basis. On some devices and for some cosq control types, a port value of -1 or gport type for system configuration will configure system based cosq control.
Parameters
unit[IN] Unit number.
port[IN] GPORT ID for a queue group
cosq[IN] CoS Queue
type[IN] type of operation (see =OPENNSL_COSQ_CONTROL_table)
arg[IN] (for _set) Argument whose meaning is dependent on type
Return values
OPENNSL_E_XXX
int opennsl_cosq_detach ( int  unit)

De-initialize the CoSQ subsystem.

Description
De-initialize the CoSQ and scheduling for the specified unit. Any held resources associated with the module are released.
Parameters
unit[IN] Unit number.
Return values
OPENNSL_E_NONE
OPENNSL_E_XXX
int opennsl_cosq_discard_get ( int  unit,
uint32 flags 
)

Configure Weighted Random Early Discard (WRED).

Description
Configure the Weighted Random Early Discard (WRED) features. The available flags for discard are =OPENNSL_COSQ_DISCARD_f.
Parameters
unit[IN] Unit number.
flags[OUT] Enable parameters
Return values
OPENNSL_E_xxx
int opennsl_cosq_discard_port_get ( int  unit,
opennsl_port_t  port,
opennsl_cos_queue_t  cosq,
uint32  color,
int *  drop_start,
int *  drop_slope,
int *  average_time 
)

Configure a port's Weighted Random Early Discard (WRED) parameters.

Description
Configure the port's Weighted Random Early Discard (WRED) parameters. Some vendors do WRED (Weighted Random Early Detection) based on IP precedence per cos, with non-IP packets treated as precedence 0. This implementation does WRED (Weighted Random Early Discard) based on cosq and treats all packets in a queue equally. The parameters are specified for a given port, cosq, and color (green, yellow, or red). A port value of -1 will configure all ports, and a cosq value of -1 will configure all cosq's. The drop start specifies the queue size where drops will begin in terms of percent of max queue size. The drop slope specifies the angle in degrees describing the drop probability slope. The average_time specifies the time in microseconds used in the calculation of average queue depth. This set of APIs is also used for configuring the Simple Random Early Discard (RED) parameters for network switch. For a given port, cosq and color, the user can configure the drop_start (percentage of queue size) and the drop probability in increments of one-tenths of a percentage. The drop_slope parameter is overloaded to encode the percentage and must be negative. The average_time parameter is ignored. This set of APIs is also used for configuring the System-RED parameters. System-wide RED control scheme to ensure that on a system level (with multiple devices) color priority will remain. In that case, user should set OPENNSL_COSQ_DISCARD_SYSTEM flag in order to indicate System-RED configuration. In case RED test support more than one slot test. User should set each slot by using flags OPENNSL_COSQ_DISCARD_PROBABILITY. Where each flag indicate slot number (first from above). In case RED test support more than one slot test by user set without OPENNSL_COSQ_DISCARD_PROBABILITY flags HW configuration assume as there only one slot test. network switch introduces an additional Weighted Curve Set (WCS) profile for ECN Capable transport (ECT). For network switch, the packet classifications are for ECT and non-ECT traffic. Non-ECT traffic gets further classified based on congestion control algorithm which reacts to packet drops, into Responsive & Non-Responsive dropping. To support the new WCS profiles, three new packet classification flags have been introduced:.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port
cosq[IN] Cos Queue to configure
color[IN] OPENNSL_COSQ_DISCARD_COLOR_*
drop_start[OUT] Percentage of queue size to start dropping
drop_slope[OUT] Degrees 0..90 describing the drop probability slope for WRED. For network switch and network switch, this parameter must be negative and each unit describes one-tenths of a percentage of the simple RED drop probability.
average_time[OUT] Time in microseconds used in avg queue depth calculation for WRED. For simple RED (network switch) this is ignored.
Return values
OPENNSL_E_xxx
int opennsl_cosq_discard_port_set ( int  unit,
opennsl_port_t  port,
opennsl_cos_queue_t  cosq,
uint32  color,
int  drop_start,
int  drop_slope,
int  average_time 
)

Configure a port's Weighted Random Early Discard (WRED) parameters.

Description
Configure the port's Weighted Random Early Discard (WRED) parameters. Some vendors do WRED (Weighted Random Early Detection) based on IP precedence per cos, with non-IP packets treated as precedence 0. This implementation does WRED (Weighted Random Early Discard) based on cosq and treats all packets in a queue equally. The parameters are specified for a given port, cosq, and color (green, yellow, or red). A port value of -1 will configure all ports, and a cosq value of -1 will configure all cosq's. The drop start specifies the queue size where drops will begin in terms of percent of max queue size. The drop slope specifies the angle in degrees describing the drop probability slope. The average_time specifies the time in microseconds used in the calculation of average queue depth. This set of APIs is also used for configuring the Simple Random Early Discard (RED) parameters for network switch. For a given port, cosq and color, the user can configure the drop_start (percentage of queue size) and the drop probability in increments of one-tenths of a percentage. The drop_slope parameter is overloaded to encode the percentage and must be negative. The average_time parameter is ignored. This set of APIs is also used for configuring the System-RED parameters. System-wide RED control scheme to ensure that on a system level (with multiple devices) color priority will remain. In that case, user should set OPENNSL_COSQ_DISCARD_SYSTEM flag in order to indicate System-RED configuration. In case RED test support more than one slot test. User should set each slot by using flags OPENNSL_COSQ_DISCARD_PROBABILITY. Where each flag indicate slot number (first from above). In case RED test support more than one slot test by user set without OPENNSL_COSQ_DISCARD_PROBABILITY flags HW configuration assume as there only one slot test. network switch introduces an additional Weighted Curve Set (WCS) profile for ECN Capable transport (ECT). For network switch, the packet classifications are for ECT and non-ECT traffic. Non-ECT traffic gets further classified based on congestion control algorithm which reacts to packet drops, into Responsive & Non-Responsive dropping. To support the new WCS profiles, three new packet classification flags have been introduced:.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port
cosq[IN] Cos Queue to configure
color[IN] OPENNSL_COSQ_DISCARD_COLOR_*
drop_start[IN] Percentage of queue size to start dropping
drop_slope[IN] Degrees 0..90 describing the drop probability slope for WRED. For network switch and network switch, this parameter must be negative and each unit describes one-tenths of a percentage of the simple RED drop probability.
average_time[IN] Time in microseconds used in avg queue depth calculation for WRED. For simple RED (network switch) this is ignored.
Return values
OPENNSL_E_xxx
int opennsl_cosq_discard_set ( int  unit,
uint32  flags 
)

Configure Weighted Random Early Discard (WRED).

Description
Configure the Weighted Random Early Discard (WRED) features. The available flags for discard are =OPENNSL_COSQ_DISCARD_f.
Parameters
unit[IN] Unit number.
flags[IN] Enable parameters
Return values
OPENNSL_E_xxx

Referenced by example_create_policy().

int opennsl_cosq_gport_add ( int  unit,
opennsl_gport_t  port,
int  numq,
uint32  flags,
opennsl_gport_t gport 
)

Allocate/Retrieve unicast queue group and scheduler queue group configuration.

Description
These APIs are used to allocate/retrieve unicast or multicast queue group or a scheduler queue group configuration. Scheduler queue groups are used to implement H-QoS. The set of CoS queues are uniquely identified with a GPORT ID, which represents the base CoS queue in the set. The GPORT ID is allocated from the next available queue in group of queues for the port or specified by the input when the OPENNSL_COSQ_GPORT_WITH_ID flag is set. But the flag OPENNSL_COSQ_GPORT_WITH_ID is only supported for a few devices. OPENNSL_GPORT_TYPE_UCAST_QUEUE_GROUP, OPENNSL_GPORT_TYPE_MCAST_QUEUE_GROUP, or OPENNSL_GPORT_TYPE_SCHEDULER type of GPORT can be added for hierarchical queuing (see also, =opennsl_cosq_gport_attach API). Depending on the functionality physical_port parameter can have one of the following values unicast queue group => OPENNSL_GPORT_MODPORT_SET() multicast queue group => OPENNSL_GPORT_MODPORT_SET() scheduler queue group => OPENNSL_GPORT_NULL When allocating a queue group the req_gport parameter direction depends on the flags. If OPENNSL_COSQ_GPORT_WITH_ID is specified the input direction is valid. Depending on the functionality the following macros can be used to create the req_gport. unicast queue group => OPENNSL_GPORT_UCAST_QUEUE_GROUP_SET() multicast queue group => OPENNSL_GPORT_MCAST_QUEUE_GROUP_SET() scheduler queue group => OPENNSL_GPORT_SCHEDULER_SET() req_gport parameter is always updated and should be subsequently used by the user. When the OPENNSL_COSQ_GPORT_WITH_ID flag is set, the value provided in the gport parameter is used as the GPORT ID, otherwise a unique GPORT ID will be allocated and returned. The feature using OPENNSL_COSQ_GPORT_WITH_ID to allocate a queue group is only supported for a few devices. For some devices that may not have the ability to shape every port or queue, the application can control whether the gport must be allocated from a shapeable or non-shapeable area. This can be done by specifying the flags OPENNSL_COSQ_GPORT_WITH_SHAPING or OPENNSL_COSQ_GPORT_WITHOUT_SHAPING, respectively. If neither flag is specified, the API will allocate a gport without paying any attention to whether it would be possible to configure a shaper on such port later. When the OPENNSL_COSQ_GPORT_OVERLAY flag is set, it allows overlay of queues that were previously allocated. When the OPENNSL_COSQ_GPORT_SUBSCRIBER flag is set, scheduling for the queue group will be done locally and will not involve the central arbiter. A local gport should be added only for ports which are local to that device. When the OPENNSL_COSQ_GPORT_MULTIPATH flag is set, a multipath shaper gport is created. Scheduler nodes on the same level could be added to the multipath shaper gport. The aggregated traffic from all nodes is shaped by the multipath shaper. The shaping rate of multipath shaper is controlled by calling =opennsl_cosq_gport_bandwidth_set API with the multipath shaper gport When the config.opennsl variable fabric_egress_setup=0 is set, FIFO-level egress support becomes available. The OPENNSL_COSQ_GPORT_EGRESS_GROUP flag is used to enable egress group support. Egress Group gports are similar to egress child gports in all other aspects. The egress group gport connects a number of fifos to a subport and allows access at the FIFO-level. Multiple egress groups can be connected to the same subport up to sixteen fifos. In the case of egress gports, the num_cos_levels field is used to indicate the number of fifos to be associated with that egress gport. When the OPENNSL_COSQ_GPORT_DESTMOD_UCAST_QUEUE_GROUP flag is set, a set of virtual queue group (DMVOQ) is allocated. On network switch chips, When the OPENNSL_COSQ_GPORT_DESTMOD_UCAST_QUEUE_GROUP flag is used with the combination of OPENNSL_COSQ_GPORT_WITH_ID, the value provided in gport parameters is used as the GPORT_ID. But scheduling mode need to programmed again as per the scheduling hierarchy. API opennsl_cosq_port_sched_set() can be used to set the scheduling mode to be Strict/WRR. When the OPENNSL_COSQ_GPORT_VLAN_UCAST_QUEUE_GROUP flag is set, a queue to support service based queuing is allocated When a parent node is created by using opennsl_cosq_gport_add API call by passing num_cos_levels = -1 then that node can have any number of child nodes. On the chips network switch, default schedule hierarchies are set up at SDK initialization. Default schedule hierarchy elements cannot be managed except using non-gport APIs to configure COSQs at port level. The first call to the API opennsl_cosq_gport_add will destroy the default schedule hierarchies for all of ports and traffic will not flow on those ports until new schedule hierarchies for those ports are built. On the chips network switch and network switch API opennsl_cosq_gport_add return OPENNSL_E_PARAM because of fixed hierarchy. Gport tree is created during init. On the chips network switch and network switch because of fixed hierarchy scheduler the scope of COSQ GPORT is not global but it is local to per unit. So we should not modify the MODID dynamically. Some device configuration support multiple queue groups on a physical port.
Parameters
unit[IN] Unit number.
port[IN] (for _add) GPORT ID physical port (For DNX, this should be local port)
numq[IN]
flags[IN] (for _add) Specifies configuration. Valid flags listed at =OPENNSL_COSQ_GPORT_FLAGS_table
gport[IN,OUT] (for _get) GPORT ID for a queue group
Return values
OPENNSL_E_XXX
int opennsl_cosq_gport_attach ( int  unit,
opennsl_gport_t  sched_port,
opennsl_gport_t  input_port,
opennsl_cos_queue_t  cosq 
)

Attach/Detach the output of a GPORT to the input of a scheduler GPORT.

Description
These APIs can be used to attach/detach a sched GPORT (sched_port) to the parent GPORT (input_port) to form a queuing hierarchy. The connect is done at the specified CoS queue of the parent GPORT. A cosq value of -1 will attach the sched GPORT to the first unused CoS queue of the parent GPORT (going from higher to lower CoS queue priority). On the chip network switch: opennsl_cosq_gport_attach_get can be used to get the parent node gport and cosq value will represent the CoS queue value of the parent node i.e. the index at which parent is attached. opennsl_cosq_gport_attach and opennsl_cosq_gport_detach APIs are only supported for CPU port. CPU Queues needed to be mapped to CMC0 Channel 0 should be attached to 3rd index of L0 level scheduler node of CPU port. CPU Queues needed to be mapped to CMC0 Channel 1 should be attached to 0th index of L0 level scheduler node of CPU port. CPU Queues needed to be mapped to CMC0 Channel 2 should be attached to 1st index of L0 level scheduler node of CPU port. CPU Queues needed to be mapped to CMC0 Channel 3 should be attached to 2nd index of L0 level scheduler node of CPU port. CPU Queues needed to be mapped to CMC1 Channel 1 should be attached to 7th index of L0 level scheduler node of CPU port. CPU Queues needed to be mapped to CMC2 Channel 1 should be attached to 8th index of L0 level scheduler node of CPU port. And CPU Queues after detach using opennsl_cosq_gport_detach API will get attached to 9th index of L0 level scheduler node CPU port.
Parameters
unit[IN] Unit number.
sched_port[IN] GPORT ID that gets attached to input_port
input_port[IN] GPORT ID to which sched_port gets attached
cosq[IN] CoS queue to attach to
Return values
OPENNSL_E_xxx
int opennsl_cosq_gport_attach_get ( int  unit,
opennsl_gport_t  sched_port,
opennsl_gport_t input_port,
opennsl_cos_queue_t cosq 
)

Attach/Detach the output of a GPORT to the input of a scheduler GPORT.

Description
These APIs can be used to attach/detach a sched GPORT (sched_port) to the parent GPORT (input_port) to form a queuing hierarchy. The connect is done at the specified CoS queue of the parent GPORT. A cosq value of -1 will attach the sched GPORT to the first unused CoS queue of the parent GPORT (going from higher to lower CoS queue priority). On the chip network switch: opennsl_cosq_gport_attach_get can be used to get the parent node gport and cosq value will represent the CoS queue value of the parent node i.e. the index at which parent is attached. opennsl_cosq_gport_attach and opennsl_cosq_gport_detach APIs are only supported for CPU port. CPU Queues needed to be mapped to CMC0 Channel 0 should be attached to 3rd index of L0 level scheduler node of CPU port. CPU Queues needed to be mapped to CMC0 Channel 1 should be attached to 0th index of L0 level scheduler node of CPU port. CPU Queues needed to be mapped to CMC0 Channel 2 should be attached to 1st index of L0 level scheduler node of CPU port. CPU Queues needed to be mapped to CMC0 Channel 3 should be attached to 2nd index of L0 level scheduler node of CPU port. CPU Queues needed to be mapped to CMC1 Channel 1 should be attached to 7th index of L0 level scheduler node of CPU port. CPU Queues needed to be mapped to CMC2 Channel 1 should be attached to 8th index of L0 level scheduler node of CPU port. And CPU Queues after detach using opennsl_cosq_gport_detach API will get attached to 9th index of L0 level scheduler node CPU port.
Parameters
unit[IN] Unit number.
sched_port[IN] GPORT ID that gets attached to input_port
input_port[OUT] GPORT ID to which sched_port gets attached
cosq[OUT] CoS queue to attach to
Return values
OPENNSL_E_xxx
int opennsl_cosq_gport_bandwidth_get ( int  unit,
opennsl_gport_t  gport,
opennsl_cos_queue_t  cosq,
uint32 kbits_sec_min,
uint32 kbits_sec_max,
uint32 flags 
)

Configure/Retrieve bandwidth setting.

Description
Configure/retrieve bandwidth setting. If OPENNSL_COSQ_ALL is specified the configuration applies to the entire queue group. On some devices, the bandwidth allocated to each CoS queue may be configured. The gport parameter can be a physical port, in which case the CoS queue specified by the cosq parameter is one of the default CoS queues assigned to the port during initialization. Alternatively, the gport parameter can be a GPORT that was dynamically added with =opennsl_cosq_gport_add or.
Parameters
unit[IN] Unit number.
gport[IN] GPORT ID for a queue group
cosq[IN] CoS Queue
kbits_sec_min[OUT] (for _set) CIR (Bandwidth guarantee)
kbits_sec_max[OUT] (for _set) PIR (Traffic shaping)
flags[OUT] (for _set) Specifies bandwidth configuration. Can be logical OR of of values defined in table =OPENNSL_COSQ_BW_f
Return values
OPENNSL_E_XXX
int opennsl_cosq_gport_bandwidth_set ( int  unit,
opennsl_gport_t  gport,
opennsl_cos_queue_t  cosq,
uint32  kbits_sec_min,
uint32  kbits_sec_max,
uint32  flags 
)

Configure/Retrieve bandwidth setting.

Description
Configure/retrieve bandwidth setting. If OPENNSL_COSQ_ALL is specified the configuration applies to the entire queue group. On some devices, the bandwidth allocated to each CoS queue may be configured. The gport parameter can be a physical port, in which case the CoS queue specified by the cosq parameter is one of the default CoS queues assigned to the port during initialization. Alternatively, the gport parameter can be a GPORT that was dynamically added with =opennsl_cosq_gport_add or.
Parameters
unit[IN] Unit number.
gport[IN] GPORT ID for a queue group
cosq[IN] CoS Queue
kbits_sec_min[IN] (for _set) CIR (Bandwidth guarantee)
kbits_sec_max[IN] (for _set) PIR (Traffic shaping)
flags[IN] (for _set) Specifies bandwidth configuration. Can be logical OR of of values defined in table =OPENNSL_COSQ_BW_f
Return values
OPENNSL_E_XXX

Referenced by example_set_ofp_bandwidth().

int opennsl_cosq_gport_child_get ( int  unit,
opennsl_gport_t  in_gport,
opennsl_cos_queue_t  cosq,
opennsl_gport_t out_gport 
)

Get the child node GPORT atatched to N-th index (cosq) of the scheduler GPORT.

Description
This API can be used to get child node GPORT atatched to N-th index (cosq) of the scheduler GPORT.
Parameters
unit[IN] Unit number.
in_gport[IN] Scheduler GPORT ID
cosq[IN] COS queue attached to.
out_gport[OUT] Child GPORT ID.
Return values
OPENNSL_E_XXX
int opennsl_cosq_gport_delete ( int  unit,
opennsl_gport_t  gport 
)

Deletes queue group.

Description
Deletes queue group. It could be a unicast, scheduler or a multicast queue group. On the chips network switch and network switch API opennsl_cosq_gport_delete return OPENNSL_E_PARAM because of fixed hierarchy. Gport tree is created during init.
Parameters
unit[IN] Unit number.
gport[IN] GPORT ID of the queue group that has to be deleted
Return values
OPENNSL_E_XXX
int opennsl_cosq_gport_detach ( int  unit,
opennsl_gport_t  sched_port,
opennsl_gport_t  input_port,
opennsl_cos_queue_t  cosq 
)

Attach/Detach the output of a GPORT to the input of a scheduler GPORT.

Description
These APIs can be used to attach/detach a sched GPORT (sched_port) to the parent GPORT (input_port) to form a queuing hierarchy. The connect is done at the specified CoS queue of the parent GPORT. A cosq value of -1 will attach the sched GPORT to the first unused CoS queue of the parent GPORT (going from higher to lower CoS queue priority). On the chip network switch: opennsl_cosq_gport_attach_get can be used to get the parent node gport and cosq value will represent the CoS queue value of the parent node i.e. the index at which parent is attached. opennsl_cosq_gport_attach and opennsl_cosq_gport_detach APIs are only supported for CPU port. CPU Queues needed to be mapped to CMC0 Channel 0 should be attached to 3rd index of L0 level scheduler node of CPU port. CPU Queues needed to be mapped to CMC0 Channel 1 should be attached to 0th index of L0 level scheduler node of CPU port. CPU Queues needed to be mapped to CMC0 Channel 2 should be attached to 1st index of L0 level scheduler node of CPU port. CPU Queues needed to be mapped to CMC0 Channel 3 should be attached to 2nd index of L0 level scheduler node of CPU port. CPU Queues needed to be mapped to CMC1 Channel 1 should be attached to 7th index of L0 level scheduler node of CPU port. CPU Queues needed to be mapped to CMC2 Channel 1 should be attached to 8th index of L0 level scheduler node of CPU port. And CPU Queues after detach using opennsl_cosq_gport_detach API will get attached to 9th index of L0 level scheduler node CPU port.
Parameters
unit[IN] Unit number.
sched_port[IN] GPORT ID that gets attached to input_port
input_port[IN] GPORT ID to which sched_port gets attached
cosq[IN] CoS queue to attach to
Return values
OPENNSL_E_xxx
int opennsl_cosq_gport_discard_get ( int  unit,
opennsl_gport_t  gport,
opennsl_cos_queue_t  cosq,
opennsl_cosq_gport_discard_t discard 
)

Configure/Retrieve discard setting.

Description
Configures discard/WRED setting. The port parameter can be a physical port, in which case the CoS queue specified by the cosq parameter is one of the default Cos queues assigned to the port during initialization. Alternatively, the port parameter can be a GPORT that was dynamically added with =opennsl_cosq_gport_add or.
Parameters
unit[IN] Unit number.
gport[IN] GPORT ID for a queue group
cosq[IN] CoS Queue
discard[IN,OUT] (for _set) discard configuration
Return values
OPENNSL_E_XXX
int opennsl_cosq_gport_discard_set ( int  unit,
opennsl_gport_t  gport,
opennsl_cos_queue_t  cosq,
opennsl_cosq_gport_discard_t discard 
)

Configure/Retrieve discard setting.

Description
Configures discard/WRED setting. The port parameter can be a physical port, in which case the CoS queue specified by the cosq parameter is one of the default Cos queues assigned to the port during initialization. Alternatively, the port parameter can be a GPORT that was dynamically added with =opennsl_cosq_gport_add or.
Parameters
unit[IN] Unit number.
gport[IN] GPORT ID for a queue group
cosq[IN] CoS Queue
discard[IN] (for _set) discard configuration
Return values
OPENNSL_E_XXX
int opennsl_cosq_gport_egress_map_get ( int  unit,
opennsl_gport_t  gport,
opennsl_cos_t  ingress_pri,
opennsl_color_t  ingress_dp,
opennsl_cos_queue_t offset 
)

Configure/retrieve {traffic class, dp} mapping to egress queue on a port.

Description
Configure/retrieve {traffic class, dp} mapping to egress queue on a port. The gport identifies the underlying resource. The resource will be either Unicast or Multicast egress queues for a port.
Parameters
unit[IN] Unit number.
gport[IN] gport referencing unicast or multicast egress queues on a port
ingress_pri[IN] packet priority/traffic class
ingress_dp[IN] packet drop precedence
offset[OUT] (for _set) queue offset from base
Return values
OPENNSL_E_XXX
int opennsl_cosq_gport_egress_map_set ( int  unit,
opennsl_gport_t  gport,
opennsl_cos_t  ingress_pri,
opennsl_color_t  ingress_dp,
opennsl_cos_queue_t  offset 
)

Configure/retrieve {traffic class, dp} mapping to egress queue on a port.

Description
Configure/retrieve {traffic class, dp} mapping to egress queue on a port. The gport identifies the underlying resource. The resource will be either Unicast or Multicast egress queues for a port.
Parameters
unit[IN] Unit number.
gport[IN] gport referencing unicast or multicast egress queues on a port
ingress_pri[IN] packet priority/traffic class
ingress_dp[IN] packet drop precedence
offset[IN] (for _set) queue offset from base
Return values
OPENNSL_E_XXX

Referenced by example_set_uc_queue_mapping().

int opennsl_cosq_gport_egress_multicast_config_get ( int  unit,
opennsl_gport_t  gport,
opennsl_cos_t  ingress_pri,
opennsl_color_t  ingress_dp,
uint32  flags,
opennsl_cosq_egress_multicast_config_t config 
)

Configure/retrieve {traffic class, dp} mapping to multicast egress configuration on a port.

Description
Configure/retrieve {traffic class, dp} mapping to multicast egress configuration on a port. The gport identifies the underlying resource. The resource will be local gport. When gport is local port, flags should be OPENNSL_COSQ_MULTICAST_SCHEDULED, and only scheduled fields of opennsl_cosq_egress_multicast_config_t structure are valid. When gport is null, flags should be OPENNSL_COSQ_MULTICAST_UNSCHEDULED, and only unscheduled fields of opennsl_cosq_egress_multicast_config_t structure are valid. Gport parameter identifies the mapping to be for scheduled multicast or unscheduled multicast. The flags parameter is redundant. However the flag value identifies what fields of opennsl_cosq_egress_multicast_config_t structure are valid.
Parameters
unit[IN] Unit number.
gport[IN] gport referencing unicast or multicast egress queues on a port
ingress_pri[IN] packet priority/traffic class
ingress_dp[IN] packet drop precedence
flags[IN] Specifies configuration. Valid flags: OPENNSL_COSQ_MULTICAST_SCHEDULED, OPENNSL_COSQ_MULTICAST_UNSCHEDULED
config[OUT] (for _set) multicast egress configuration
Return values
OPENNSL_E_XXX
int opennsl_cosq_gport_egress_multicast_config_set ( int  unit,
opennsl_gport_t  gport,
opennsl_cos_t  ingress_pri,
opennsl_color_t  ingress_dp,
uint32  flags,
opennsl_cosq_egress_multicast_config_t config 
)

Configure/retrieve {traffic class, dp} mapping to multicast egress configuration on a port.

Description
Configure/retrieve {traffic class, dp} mapping to multicast egress configuration on a port. The gport identifies the underlying resource. The resource will be local gport. When gport is local port, flags should be OPENNSL_COSQ_MULTICAST_SCHEDULED, and only scheduled fields of opennsl_cosq_egress_multicast_config_t structure are valid. When gport is null, flags should be OPENNSL_COSQ_MULTICAST_UNSCHEDULED, and only unscheduled fields of opennsl_cosq_egress_multicast_config_t structure are valid. Gport parameter identifies the mapping to be for scheduled multicast or unscheduled multicast. The flags parameter is redundant. However the flag value identifies what fields of opennsl_cosq_egress_multicast_config_t structure are valid.
Parameters
unit[IN] Unit number.
gport[IN] gport referencing unicast or multicast egress queues on a port
ingress_pri[IN] packet priority/traffic class
ingress_dp[IN] packet drop precedence
flags[IN] Specifies configuration. Valid flags: OPENNSL_COSQ_MULTICAST_SCHEDULED, OPENNSL_COSQ_MULTICAST_UNSCHEDULED
config[IN] (for _set) multicast egress configuration
Return values
OPENNSL_E_XXX

Referenced by example_set_mc_queue_mapping().

int opennsl_cosq_gport_enable_get ( int  unit,
opennsl_gport_t  gport,
opennsl_cos_queue_t  cosq,
int *  enable 
)

Configure/Retrieve enable/disable state of a cos level in a queue group.

   OPENNSL88230 only: Also configure/Retrieve enable/disable state of a
   FIFO in an egress group.
Description
Configure/Retrieve enable/disable state of a cos level in a queue group. To enable/disable entire queue group, set cosq to -1. For OPENNSL88230, this API also supports enable and disable of an Egress Fifo. .
Parameters
unit[IN] Unit number.
gport[IN] GPORT ID for a queue group
cosq[IN] CoS Queue, -1 for Queue Group (set only)
enable[OUT] (for _set) TRUE to enable, FALSE to disable
Return values
OPENNSL_E_XXX
int opennsl_cosq_gport_enable_set ( int  unit,
opennsl_gport_t  gport,
opennsl_cos_queue_t  cosq,
int  enable 
)

Configure/Retrieve enable/disable state of a cos level in a queue group.

   OPENNSL88230 only: Also configure/Retrieve enable/disable state of a
   FIFO in an egress group.
Description
Configure/Retrieve enable/disable state of a cos level in a queue group. To enable/disable entire queue group, set cosq to -1. For OPENNSL88230, this API also supports enable and disable of an Egress Fifo. .
Parameters
unit[IN] Unit number.
gport[IN] GPORT ID for a queue group
cosq[IN] CoS Queue, -1 for Queue Group (set only)
enable[IN] (for _set) TRUE to enable, FALSE to disable
Return values
OPENNSL_E_XXX
int opennsl_cosq_gport_get ( int  unit,
opennsl_gport_t  gport,
opennsl_gport_t physical_port,
int *  num_cos_levels,
uint32 flags 
)

Allocate/Retrieve unicast queue group and scheduler queue group configuration.

Description
These APIs are used to allocate/retrieve unicast or multicast queue group or a scheduler queue group configuration. Scheduler queue groups are used to implement H-QoS. The set of CoS queues are uniquely identified with a GPORT ID, which represents the base CoS queue in the set. The GPORT ID is allocated from the next available queue in group of queues for the port or specified by the input when the OPENNSL_COSQ_GPORT_WITH_ID flag is set. But the flag OPENNSL_COSQ_GPORT_WITH_ID is only supported for a few devices. OPENNSL_GPORT_TYPE_UCAST_QUEUE_GROUP, OPENNSL_GPORT_TYPE_MCAST_QUEUE_GROUP, or OPENNSL_GPORT_TYPE_SCHEDULER type of GPORT can be added for hierarchical queuing (see also, =opennsl_cosq_gport_attach API). Depending on the functionality physical_port parameter can have one of the following values unicast queue group => OPENNSL_GPORT_MODPORT_SET() multicast queue group => OPENNSL_GPORT_MODPORT_SET() scheduler queue group => OPENNSL_GPORT_NULL When allocating a queue group the req_gport parameter direction depends on the flags. If OPENNSL_COSQ_GPORT_WITH_ID is specified the input direction is valid. Depending on the functionality the following macros can be used to create the req_gport. unicast queue group => OPENNSL_GPORT_UCAST_QUEUE_GROUP_SET() multicast queue group => OPENNSL_GPORT_MCAST_QUEUE_GROUP_SET() scheduler queue group => OPENNSL_GPORT_SCHEDULER_SET() req_gport parameter is always updated and should be subsequently used by the user. When the OPENNSL_COSQ_GPORT_WITH_ID flag is set, the value provided in the gport parameter is used as the GPORT ID, otherwise a unique GPORT ID will be allocated and returned. The feature using OPENNSL_COSQ_GPORT_WITH_ID to allocate a queue group is only supported for a few devices. For some devices that may not have the ability to shape every port or queue, the application can control whether the gport must be allocated from a shapeable or non-shapeable area. This can be done by specifying the flags OPENNSL_COSQ_GPORT_WITH_SHAPING or OPENNSL_COSQ_GPORT_WITHOUT_SHAPING, respectively. If neither flag is specified, the API will allocate a gport without paying any attention to whether it would be possible to configure a shaper on such port later. When the OPENNSL_COSQ_GPORT_OVERLAY flag is set, it allows overlay of queues that were previously allocated. When the OPENNSL_COSQ_GPORT_SUBSCRIBER flag is set, scheduling for the queue group will be done locally and will not involve the central arbiter. A local gport should be added only for ports which are local to that device. When the OPENNSL_COSQ_GPORT_MULTIPATH flag is set, a multipath shaper gport is created. Scheduler nodes on the same level could be added to the multipath shaper gport. The aggregated traffic from all nodes is shaped by the multipath shaper. The shaping rate of multipath shaper is controlled by calling =opennsl_cosq_gport_bandwidth_set API with the multipath shaper gport When the config.opennsl variable fabric_egress_setup=0 is set, FIFO-level egress support becomes available. The OPENNSL_COSQ_GPORT_EGRESS_GROUP flag is used to enable egress group support. Egress Group gports are similar to egress child gports in all other aspects. The egress group gport connects a number of fifos to a subport and allows access at the FIFO-level. Multiple egress groups can be connected to the same subport up to sixteen fifos. In the case of egress gports, the num_cos_levels field is used to indicate the number of fifos to be associated with that egress gport. When the OPENNSL_COSQ_GPORT_DESTMOD_UCAST_QUEUE_GROUP flag is set, a set of virtual queue group (DMVOQ) is allocated. On network switch chips, When the OPENNSL_COSQ_GPORT_DESTMOD_UCAST_QUEUE_GROUP flag is used with the combination of OPENNSL_COSQ_GPORT_WITH_ID, the value provided in gport parameters is used as the GPORT_ID. But scheduling mode need to programmed again as per the scheduling hierarchy. API opennsl_cosq_port_sched_set() can be used to set the scheduling mode to be Strict/WRR. When the OPENNSL_COSQ_GPORT_VLAN_UCAST_QUEUE_GROUP flag is set, a queue to support service based queuing is allocated When a parent node is created by using opennsl_cosq_gport_add API call by passing num_cos_levels = -1 then that node can have any number of child nodes. On the chips network switch, default schedule hierarchies are set up at SDK initialization. Default schedule hierarchy elements cannot be managed except using non-gport APIs to configure COSQs at port level. The first call to the API opennsl_cosq_gport_add will destroy the default schedule hierarchies for all of ports and traffic will not flow on those ports until new schedule hierarchies for those ports are built. On the chips network switch and network switch API opennsl_cosq_gport_add return OPENNSL_E_PARAM because of fixed hierarchy. Gport tree is created during init. On the chips network switch and network switch because of fixed hierarchy scheduler the scope of COSQ GPORT is not global but it is local to per unit. So we should not modify the MODID dynamically. Some device configuration support multiple queue groups on a physical port.
Parameters
unit[IN] Unit number.
gport[IN] (for _get) GPORT ID for a queue group
physical_port[OUT] (for _get) GPORT ID for physical port
num_cos_levels[OUT] (for _add) number of cos levels
flags[OUT] (for _add) Specifies configuration. Valid flags listed at =OPENNSL_COSQ_GPORT_FLAGS_table
Return values
OPENNSL_E_XXX
int opennsl_cosq_gport_handle_get ( int  unit,
opennsl_cosq_gport_type_t  gport_type,
opennsl_cosq_gport_info_t gport_info 
)

Getting a gport handle.

Description
Getting a gport handle. This could be either a global gport (single instance on a device) or converting a gport to the desired type .
Parameters
unit[IN] Unit number.
gport_type[IN] gport type. see table =OPENNSL_COSQ_GPORT_type
gport_info[IN,OUT] gport info. see table =OPENNSL_COSQ_GPORT_INFO_table in_gport parameter is an input parameter
Return values
OPENNSL_E_XXX

Referenced by example_set_mc_queue_mapping(), example_set_ofp_bandwidth(), example_set_sp(), example_set_uc_queue_mapping(), example_set_weight(), and multicast__open_egress_mc_group_with_local_ports().

int opennsl_cosq_gport_mapping_get ( int  unit,
opennsl_port_t  ing_port,
opennsl_cos_t  int_pri,
uint32  flags,
opennsl_gport_t gport,
opennsl_cos_queue_t cosq 
)

Get or set the mapping from internal priority to CoS queue.

Description
Configure or retrieve the mapping from the internal priority value to Cos Queue. The internal priority is usually initialized from the packet priority. For tagged packets the priority is extracted from the PRI field of the tag. For untagged packets, the priority is specified using the API =opennsl_port_untagged_priority_set . On some devices, the mapping tables may be shared among several ports, so setting one port's mappings may affect other ports'. On some devices, packets directed to the CPU interface port may have their priority assigned independent of this setting. For more information see =opennsl_switch_control_set . They can be used only on chips which support ETS(Enhanced Transmission Selection) feature regardless of that the ETS mode is enabled.
Parameters
unit[IN] Unit number.
ing_port[IN] Ingress device or logical port or GPORT ID
int_pri[IN]
flags[IN] Can be one of following OPENNSL_COSQ_GPORT_UCAST_QUEUE_GROUP, OPENNSL_COSQ_GPORT_DESTMOD_UCAST_QUEUE_GROUP, OPENNSL_COSQ_GPORT_MCAST_QUEUE_GROUP
gport[OUT] GPORT ID for a queue group
cosq[OUT] CoS queue to which to map the chosen priority
Return values
OPENNSL_E_NONE
OPENNSL_E_PARAM
OPENNSL_E_XXX
int opennsl_cosq_gport_mapping_set ( int  unit,
opennsl_port_t  ing_port,
opennsl_cos_t  int_pri,
uint32  flags,
opennsl_gport_t  gport,
opennsl_cos_queue_t  cosq 
)

Get or set the mapping from internal priority to CoS queue.

Description
Configure or retrieve the mapping from the internal priority value to Cos Queue. The internal priority is usually initialized from the packet priority. For tagged packets the priority is extracted from the PRI field of the tag. For untagged packets, the priority is specified using the API =opennsl_port_untagged_priority_set . On some devices, the mapping tables may be shared among several ports, so setting one port's mappings may affect other ports'. On some devices, packets directed to the CPU interface port may have their priority assigned independent of this setting. For more information see =opennsl_switch_control_set . They can be used only on chips which support ETS(Enhanced Transmission Selection) feature regardless of that the ETS mode is enabled.
Parameters
unit[IN] Unit number.
ing_port[IN] Ingress device or logical port or GPORT ID
int_pri[IN]
flags[IN] Can be one of following OPENNSL_COSQ_GPORT_UCAST_QUEUE_GROUP, OPENNSL_COSQ_GPORT_DESTMOD_UCAST_QUEUE_GROUP, OPENNSL_COSQ_GPORT_MCAST_QUEUE_GROUP
gport[IN] GPORT ID for a queue group
cosq[IN] CoS queue to which to map the chosen priority
Return values
OPENNSL_E_NONE
OPENNSL_E_PARAM
OPENNSL_E_XXX
int opennsl_cosq_gport_sched_config_get ( int  unit,
opennsl_gport_t  gport,
int  sched_mode,
int  int_pri,
uint32 flags 
)

Mapping/redirecting scheduling discipline to Egress FIFO.

Description
This API maps scheduling discipline to Egress FIFO. This is valid on XCore fabric devices. gport parameter value of OPENNSL_GPORT_INVALID configures a device wide setting.
Parameters
unit[IN] Unit number.
gport[IN] fabric gport
sched_mode[IN] scheduling discipline
int_pri[IN] internal priority on fabric device
flags[OUT] (for _set) flags =SCHED_CONFIG_FLAGS_table
Return values
OPENNSL_E_XXX
int opennsl_cosq_gport_sched_config_set ( int  unit,
opennsl_gport_t  gport,
int  sched_mode,
int  int_pri,
uint32  flags 
)

Mapping/redirecting scheduling discipline to Egress FIFO.

Description
This API maps scheduling discipline to Egress FIFO. This is valid on XCore fabric devices. gport parameter value of OPENNSL_GPORT_INVALID configures a device wide setting.
Parameters
unit[IN] Unit number.
gport[IN] fabric gport
sched_mode[IN] scheduling discipline
int_pri[IN] internal priority on fabric device
flags[IN] (for _set) flags =SCHED_CONFIG_FLAGS_table
Return values
OPENNSL_E_XXX
int opennsl_cosq_gport_sched_get ( int  unit,
opennsl_gport_t  gport,
opennsl_cos_queue_t  cosq,
int *  mode,
int *  weight 
)

Configure/retrieve scheduling policy.

Description
Configure/Retrieve scheduling modes. Set or Get the Class of Service policy and weight for the specified GPORT. The gport parameter can be a physical port, in which case the CoS queue specified by the cosq parameter is one of the default CoS queues assigned to the port during initialization. Alternatively, the gport parameter can be a scheduler GPORT that was dynamically added with =opennsl_cosq_gport_add or.
Parameters
unit[IN] Unit number.
gport[IN] GPORT ID for a queue group
cosq[IN] CoS Queue
mode[OUT] (for _set) scheduling mode
weight[OUT] (for _set) weight. This is applicable for some scheduling modes
Return values
OPENNSL_E_XXX
int opennsl_cosq_gport_sched_set ( int  unit,
opennsl_gport_t  gport,
opennsl_cos_queue_t  cosq,
int  mode,
int  weight 
)

Configure/retrieve scheduling policy.

Description
Configure/Retrieve scheduling modes. Set or Get the Class of Service policy and weight for the specified GPORT. The gport parameter can be a physical port, in which case the CoS queue specified by the cosq parameter is one of the default CoS queues assigned to the port during initialization. Alternatively, the gport parameter can be a scheduler GPORT that was dynamically added with =opennsl_cosq_gport_add or.
Parameters
unit[IN] Unit number.
gport[IN] GPORT ID for a queue group
cosq[IN] CoS Queue
mode[IN] (for _set) scheduling mode
weight[IN] (for _set) weight. This is applicable for some scheduling modes
Return values
OPENNSL_E_XXX

Referenced by example_set_sp(), and example_set_weight().

int opennsl_cosq_gport_stat_config_get ( int  unit,
opennsl_gport_t  gport,
opennsl_gport_t  lgl_gport,
opennsl_cos_queue_t  cosq,
uint32  flags,
opennsl_cosq_gport_stat_profile_t profile 
)

Get a previously-configured Central Statistic profile that captures WRED packets.

Description
Get a configured WRED profile for the specific physical gport or ingress queue group. To retrieve Ingress physical profiles, the ingress gport must be set to a specific interface gport of type OPENNSL_GPORT_TYPE_MODPORT and the Ingress queue group gport must be OPENNSL_GPORT_TYPE_NONE. For all egress statistics profiles, the Ingress queue group gport must be set to OPENNSL_GPORT_TYPE_NONE.
Parameters
unit[IN] Unit number.
gport[IN] GPORT ID for Ingress interface. Valid types: OPENNSL_GPORT_TYPE_MODPORT, OPENNSL_GPORT_TYPE_EGRESS_MODPORT, OPENNSL_GPORT_TYPE_EGRESS_CHILD, OPENNSL_GPORT_TYPE_EGRESS_GROUP
lgl_gport[IN] GPORT ID for Ingress queue group. Valid types: OPENNSL_GPORT_TYPE_UCAST_QUEUE_GROUP, OPENNSL_GPORT_TYPE_MAST_QUEUE_GROUP, OPENNSL_GPORT_TYPE_NONE
cosq[IN] CoS Queue
flags[IN] Specifies configuration. Valid flags: OPENNSL_COSQ_GPORT_STATS_SHARED
profile[OUT] opennsl_cosq_gport_stats bitmap. see table =OPENNSL_COSQ_GPORT_STATISTICS_table .
Return values
OPENNSL_E_NONE
OPENNSL_E_UNAVAIL
OPENNSL_E_PARAM
OPENNSL_E_PORT
int opennsl_cosq_gport_stat_config_set ( int  unit,
opennsl_gport_t  gport,
opennsl_gport_t  lgl_gport,
opennsl_cos_queue_t  cosq,
uint32  flags,
opennsl_cosq_gport_stat_profile_t  profile 
)

Set up a Central Statistic profile to capture WRED packets.

Description
Configure a profile of WRED statistics to capture on Ingress or Egress. To configure Ingress physical statistics, the ingress gport must be set to a specific interface gport of type OPENNSL_GPORT_TYPE_MODPORT and the Ingress queue group gport must be OPENNSL_GPORT_TYPE_NONE. For all egress statistics, the Ingress queue group gport must be set to OPENNSL_GPORT_TYPE_NONE. To set up a profile to generate Egress physical statistics, set gport type to OPENNSL_GPORT_TYPE_EGRESS_MODPORT. For Egress subport statistics, use OPENNSL_GPORT_TYPE_EGRESS_CHILD. For specific FIFO-based statistics, use OPENNSL_GPORT_TYPE_EGRESS_GROUP. When creating a profile for FIFO-based statistics, the CoSQ field represents the specific FIFO number. The OPENNSL_COSQ_GPORT_STATS_SHARED flag is used to save resources by sharing common profiles over different queue ranges. This is the most common scenario. For example, a profile that captures all green, yellow, and red accepted packets over a specific queue range can share the same resources. However, should a user wish to simultaneously capture red dropped packets over the same queue range, then the SHARED flag would not be used and a separate buffer will be allocated to store the dropped red packets over the queue range. The minimum granularity for a data collection is 1024 counters. When allocating counters for ingress queue groups, for example, creating a profile for base queue 16 will enable statistics gathering on all queues between 0 and 1023, because of the minimum granularity. The next queue group begins at 1024. To allocate a profile to collect statistics for 16K queues, the user only need execute this command 16 times. .
Parameters
unit[IN] Unit number.
gport[IN] GPORT ID for Ingress interface. Valid types: OPENNSL_GPORT_TYPE_MODPORT, OPENNSL_GPORT_TYPE_EGRESS_MODPORT, OPENNSL_GPORT_TYPE_EGRESS_CHILD, OPENNSL_GPORT_TYPE_EGRESS_GROUP
lgl_gport[IN] GPORT ID for Ingress queue group. Valid types: OPENNSL_GPORT_TYPE_UCAST_QUEUE_GROUP, OPENNSL_GPORT_TYPE_MAST_QUEUE_GROUP, OPENNSL_GPORT_TYPE_NONE
cosq[IN] CoS Queue
flags[IN] Specifies configuration. Valid flags: OPENNSL_COSQ_GPORT_STATS_SHARED
profile[IN] opennsl_cosq_gport_stats bitmap. see table =OPENNSL_COSQ_GPORT_STATISTICS_table .
Return values
OPENNSL_E_NONE
OPENNSL_E_UNAVAIL
OPENNSL_E_PARAM
OPENNSL_E_PORT
OPENNSL_E_NOT_FOUND
OPENNSL_E_RESOURCE
OPENNSL_E_MEMORY
int opennsl_cosq_gport_stat_enable_get ( int  unit,
opennsl_gport_t  gport,
int *  enable 
)

Retrieve queue group statistic setting.

Description
Retrieve queue group statistic setting.
Parameters
unit[IN] Unit number.
gport[IN] GPORT ID for a queue group
enable[OUT] TRUE for enable, FALSE for disable
Return values
OPENNSL_E_XXX
int opennsl_cosq_gport_stat_enable_set ( int  unit,
opennsl_gport_t  gport,
int  enable 
)

Enable/Disable statistics for queue group.

Description
Enables or disables statistics for a queue group.
Parameters
unit[IN] Unit number.
gport[IN] GPORT ID for a queue group
enable[IN] TRUE to enable, FALSE to disable
Return values
OPENNSL_E_XXX
int opennsl_cosq_gport_stat_get ( int  unit,
opennsl_gport_t  gport,
opennsl_cos_queue_t  cosq,
opennsl_cosq_gport_stats_t  stat,
uint64 value 
)

Retrieve/Set Statistics.

Description
Retrieve/Set statistics. If a statistic is not valid for a particular device a value of zero will be returned. The type opennsl_cosq_gport_stats_t is an enumeration of the available statistics. The set functionality only allows clearing of statistics.
Parameters
unit[IN] Unit number.
gport[IN] GPORT ID for a queue group
cosq[IN] CoS Queue
stat[IN] statistic to be retrieved. see table =OPENNSL_COSQ_GPORT_STATISTICS_table .
value[OUT] (for _get) statistic value
Return values
OPENNSL_E_XXX
int opennsl_cosq_gport_stat_set ( int  unit,
opennsl_gport_t  gport,
opennsl_cos_queue_t  cosq,
opennsl_cosq_gport_stats_t  stat,
uint64  value 
)

Retrieve/Set Statistics.

Description
Retrieve/Set statistics. If a statistic is not valid for a particular device a value of zero will be returned. The type opennsl_cosq_gport_stats_t is an enumeration of the available statistics. The set functionality only allows clearing of statistics.
Parameters
unit[IN] Unit number.
gport[IN] GPORT ID for a queue group
cosq[IN] CoS Queue
stat[IN] statistic to be retrieved. see table =OPENNSL_COSQ_GPORT_STATISTICS_table .
value[IN] (for _get) statistic value
Return values
OPENNSL_E_XXX
int opennsl_cosq_gport_stat_sync_get ( int  unit,
opennsl_gport_t  gport,
opennsl_cos_queue_t  cosq,
opennsl_cosq_gport_stats_t  stat,
uint64 value 
)

Force an immediate counter update and retrieve statistics.

Description
Similar to opennsl_cosq_gport_stat_get(), value returned is software accumulated counter synced with the hardware counter.
Parameters
unit[IN] Unit number.
gport[IN] GPORT ID for a queue group
cosq[IN] CoS Queue
stat[IN] statistic to be retrieved. see table =OPENNSL_COSQ_GPORT_STATISTICS_table .
value[OUT] (for _get) statistic value
Return values
OPENNSL_E_XXX
int opennsl_cosq_gport_statistic_get ( int  unit,
opennsl_gport_t  gport,
opennsl_gport_t  lgl_gport,
opennsl_cos_queue_t  cosq,
uint32  flags,
opennsl_cosq_gport_stats_t  stat,
uint64 value 
)

Get the value associated with a Central Statistics Index.

Description
Get a specific statistic value. For Ingress physical statistics, gport must be set to a specific physical interface using OPENNSL_GPORT_TYPE_MODPORT and Ingress queue group must be OPENNSL_GPORT_TYPE_NONE. For a specific Egress statistic, Ingress queue group must always be OPENNSL_GPORT_TYPE_NONE. Physical egress statistics are associated with OPENNSL_GPORT_TYPE_EGRESS_MODPORT. Egress subport statistics are associated with OPENNSL_GPORT_TYPE_EGRESS_CHILD. Egress FIFO statistics are associated with OPENNSL_GPORT_TYPE_EGRESS_GROUP. The specific FIFO is indexed using cosq parameter such that 0 and 1 indicate unicast EF and non-EF packets, respectively, while 2 and 3 correspond to multicast EF and non-EF packets, respectively. .
Parameters
unit[IN] Unit number.
gport[IN] GPORT ID for Ingress interface. Valid types: OPENNSL_GPORT_TYPE_MODPORT, OPENNSL_GPORT_TYPE_EGRESS_MODPORT, OPENNSL_GPORT_TYPE_EGRESS_CHILD, OPENNSL_GPORT_TYPE_EGRESS_GROUP
lgl_gport[IN] GPORT ID for Ingress queue group. Valid types: OPENNSL_GPORT_TYPE_UCAST_QUEUE_GROUP, OPENNSL_GPORT_TYPE_MAST_QUEUE_GROUP, OPENNSL_GPORT_TYPE_NONE
cosq[IN] CoS Queue
flags[IN] Specifies configuration. Valid flags: OPENNSL_COSQ_GPORT_STATS_SHARED
stat[IN] See table =OPENNSL_COSQ_GPORT_STATISTICS_table .
value[OUT] statistic value
Return values
OPENNSL_E_NONE
OPENNSL_E_UNAVAIL
OPENNSL_E_PARAM
OPENNSL_E_PORT
int opennsl_cosq_gport_statistic_set ( int  unit,
opennsl_gport_t  gport,
opennsl_gport_t  lgl_gport,
opennsl_cos_queue_t  cosq,
uint32  flags,
opennsl_cosq_gport_stats_t  stat,
uint64  value 
)

Reset the value of a Central Statistics stat to zero.

Description
Reset a specific statistic value to zero. For Ingress physical statistics, gport must be set to a specific physical interface using OPENNSL_GPORT_TYPE_MODPORT and Ingress queue group must be OPENNSL_GPORT_TYPE_NONE. For a specific Egress statistic, Ingress queue group must always be OPENNSL_GPORT_TYPE_NONE. Physical egress statistics are associated with OPENNSL_GPORT_TYPE_EGRESS_MODPORT. Egress subport statistics are associated with OPENNSL_GPORT_TYPE_EGRESS_CHILD. Egress FIFO statistics are associated with OPENNSL_GPORT_TYPE_EGRESS_GROUP.
Parameters
unit[IN] Unit number.
gport[IN] GPORT ID for Ingress interface. Valid types: OPENNSL_GPORT_TYPE_MODPORT, OPENNSL_GPORT_TYPE_EGRESS_MODPORT, OPENNSL_GPORT_TYPE_EGRESS_CHILD, OPENNSL_GPORT_TYPE_EGRESS_GROUP
lgl_gport[IN] GPORT ID for Ingress queue group. Valid types: OPENNSL_GPORT_TYPE_UCAST_QUEUE_GROUP, OPENNSL_GPORT_TYPE_MAST_QUEUE_GROUP, OPENNSL_GPORT_TYPE_NONE
cosq[IN] CoS Queue
flags[IN] Specifies configuration. Valid flags: OPENNSL_COSQ_GPORT_STATS_SHARED
stat[IN] See table =OPENNSL_COSQ_GPORT_STATISTICS_table .
value[IN]
Return values
OPENNSL_E_NONE
OPENNSL_E_UNAVAIL
OPENNSL_E_PARAM
OPENNSL_E_PORT
int opennsl_cosq_gport_traverse ( int  unit,
opennsl_cosq_gport_traverse_cb  cb,
void *  user_data 
)

Traverse all added CoS queue GPORTs and call the supplied callback routine for each one.

Description
Traverse all added CoS queue GPORTs and call the supplied callback routine for each one.
Parameters
unit[IN] Unit number.
cb[IN] User-supplied callback function
user_data[IN] User-supplied data passed back in callback function
Return values
OPENNSL_E_xxx
int opennsl_cosq_init ( int  unit)

Initialize the CoSQ subsystem.

Description
Initialize the CoSQ configuration and scheduling module.
Parameters
unit[IN] Unit number.
Return values
OPENNSL_E_NONE
OPENNSL_E_XXX
int opennsl_cosq_mapping_get ( int  unit,
opennsl_cos_t  priority,
opennsl_cos_queue_t cosq 
)

Get or set the mapping from internal priority to CoS queue.

Description
Configure or retrieve the mapping from the internal priority value to Cos Queue. The internal priority is usually initialized from the packet priority. For tagged packets the priority is extracted from the PRI field of the tag. For untagged packets, the priority is specified using the API =opennsl_port_untagged_priority_set . On some devices, the mapping tables may be shared among several ports, so setting one port's mappings may affect other ports'. On some devices, packets directed to the CPU interface port may have their priority assigned independent of this setting. For more information see =opennsl_switch_control_set . On some devices, a port value of -1 or gport type for system configuration will configure all ports. Some devices support Enhanced Transmission Selection (ETS) which requires to use GPORT ID for the port argument. When the ETS mode is enabled, they configure and retrive the mapping from the internal priority to the offset (which is equal to the value of cosq) of the unicast queues and multicast queues attached to the egress port. Most devices have 8 internal priorities (0 to 7).
Parameters
unit[IN] Unit number.
priority[IN] internal priority to map
cosq[OUT] Cos queue to which to map the chosen priority
Return values
OPENNSL_E_NONE
OPENNSL_E_PARAMInvalid priority, or device not configured for the number of CoS queues specified.
OPENNSL_E_XXX
int opennsl_cosq_mapping_set ( int  unit,
opennsl_cos_t  priority,
opennsl_cos_queue_t  cosq 
)

Get or set the mapping from internal priority to CoS queue.

Description
Configure or retrieve the mapping from the internal priority value to Cos Queue. The internal priority is usually initialized from the packet priority. For tagged packets the priority is extracted from the PRI field of the tag. For untagged packets, the priority is specified using the API =opennsl_port_untagged_priority_set . On some devices, the mapping tables may be shared among several ports, so setting one port's mappings may affect other ports'. On some devices, packets directed to the CPU interface port may have their priority assigned independent of this setting. For more information see =opennsl_switch_control_set . On some devices, a port value of -1 or gport type for system configuration will configure all ports. Some devices support Enhanced Transmission Selection (ETS) which requires to use GPORT ID for the port argument. When the ETS mode is enabled, they configure and retrive the mapping from the internal priority to the offset (which is equal to the value of cosq) of the unicast queues and multicast queues attached to the egress port. Most devices have 8 internal priorities (0 to 7).
Parameters
unit[IN] Unit number.
priority[IN] internal priority to map
cosq[IN] Cos queue to which to map the chosen priority
Return values
OPENNSL_E_NONE
OPENNSL_E_PARAMInvalid priority, or device not configured for the number of CoS queues specified.
OPENNSL_E_XXX
int opennsl_cosq_port_bandwidth_get ( int  unit,
opennsl_port_t  port,
opennsl_cos_queue_t  cosq,
uint32 kbits_sec_min,
uint32 kbits_sec_max,
uint32 flags 
)

Configure a port's bandwidth distribution among CoS queues.

Description
On some devices, the bandwidth allocated to each CoS queue may be configured. The maximum bandwidth setting is applicable to any mode on these devices. However, for non-XCore (tm) and non-XGS devices, the minimum bandwidth settings and the preference flags are only valid when the WEIGHTED_FAIR_QUEUING mode is selected. The order of the calls opennsl_cosq_port_bandwidth_set and opennsl_cosq_port_sched_set is not important. A port value of -1 or gport type for system configuration will configure all ports, and a cosq value of -1 will configure all cosq's. The supplied bandwidth values may be rounded up to the nearest value supported by the HW. On network switch devices, while using this API kbits_sec_min should be used for specifying rate and kbits_sec_max for specifying the burst. The available flags for bandwidth response tuning are =OPENNSL_COSQ_BW_f.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port
cosq[IN] Cos Queue to configure
kbits_sec_min[OUT] Minimum bandwidth in kbits/sec.
kbits_sec_max[OUT] Maximum bandwidth in kbits/sec.
flags[OUT] Bandwidth tuning parameters.
Return values
OPENNSL_E_xxx
int opennsl_cosq_port_bandwidth_set ( int  unit,
opennsl_port_t  port,
opennsl_cos_queue_t  cosq,
uint32  kbits_sec_min,
uint32  kbits_sec_max,
uint32  flags 
)

Configure a port's bandwidth distribution among CoS queues.

Description
On some devices, the bandwidth allocated to each CoS queue may be configured. The maximum bandwidth setting is applicable to any mode on these devices. However, for non-XCore (tm) and non-XGS devices, the minimum bandwidth settings and the preference flags are only valid when the WEIGHTED_FAIR_QUEUING mode is selected. The order of the calls opennsl_cosq_port_bandwidth_set and opennsl_cosq_port_sched_set is not important. A port value of -1 or gport type for system configuration will configure all ports, and a cosq value of -1 will configure all cosq's. The supplied bandwidth values may be rounded up to the nearest value supported by the HW. On network switch devices, while using this API kbits_sec_min should be used for specifying rate and kbits_sec_max for specifying the burst. The available flags for bandwidth response tuning are =OPENNSL_COSQ_BW_f.
Parameters
unit[IN] Unit number.
port[IN] Device or logical port
cosq[IN] Cos Queue to configure
kbits_sec_min[IN] Minimum bandwidth in kbits/sec.
kbits_sec_max[IN] Maximum bandwidth in kbits/sec.
flags[IN] Bandwidth tuning parameters.
Return values
OPENNSL_E_xxx
int opennsl_cosq_port_mapping_get ( int  unit,
opennsl_port_t  port,
opennsl_cos_t  priority,
opennsl_cos_queue_t cosq 
)

Get or set the mapping from internal priority to CoS queue.

Description
Configure or retrieve the mapping from the internal priority value to Cos Queue. The internal priority is usually initialized from the packet priority. For tagged packets the priority is extracted from the PRI field of the tag. For untagged packets, the priority is specified using the API =opennsl_port_untagged_priority_set . On some devices, the mapping tables may be shared among several ports, so setting one port's mappings may affect other ports'. On some devices, packets directed to the CPU interface port may have their priority assigned independent of this setting. For more information see =opennsl_switch_control_set . On some devices, a port value of -1 or gport type for system configuration will configure all ports. Some devices support Enhanced Transmission Selection (ETS) which requires to use GPORT ID for the port argument. When the ETS mode is enabled, they configure and retrive the mapping from the internal priority to the offset (which is equal to the value of cosq) of the unicast queues and multicast queues attached to the egress port. Most devices have 8 internal priorities (0 to 7).
Parameters
unit[IN] Unit number.
port[IN] Device or logical port or GPORT ID
priority[IN] internal priority to map
cosq[OUT] Cos queue to which to map the chosen priority
Return values
OPENNSL_E_NONE
OPENNSL_E_PARAMInvalid priority, or device not configured for the number of CoS queues specified.
OPENNSL_E_XXX
int opennsl_cosq_port_mapping_multi_get ( int  unit,
opennsl_port_t  port,
int  count,
opennsl_cos_t priority_array,
opennsl_cos_queue_t cosq_array 
)

Get or set the mapping of multiple internal priorities to their corresponding CoS queues.

Description
Configure or retrieve the mapping of multiple internal priority value to their corresponding Cos Queue. The internal priority is usually initialized from the packet priority. For tagged packets the priority is extracted from the PRI field of the tag. For untagged packets, the priority is specified using the API =opennsl_port_untagged_priority_set . On some devices, the mapping tables may be shared among several ports, so setting one port's mappings may affect other ports'. On some devices, packets directed to the CPU interface port may have their priority assigned independent of this setting. For more information see =opennsl_switch_control_set . On some devices, a port value of -1 or gport type for system configuration will configure all ports. Some devices support Enhanced Transmission Selection (ETS) which requires to use GPORT ID for the port argument. When the ETS mode is enabled, they configure and retrive the mapping from the internal priority to the offset (which is equal to the value of cosq) of the unicast queues and multicast queues attached to the egress port. Most devices have 8 internal priorities (0 to 7).
Parameters
unit[IN] Unit number.
port[IN] Device or logical port or GPORT ID
count[IN] number of elements in priority array and cosq array in case of multi get or set
priority_array[IN] array of internal priority to map
cosq_array[OUT] array of Cos queue where each element of cosq_array (cos) corresponds to the respective element of priority_array (internal priority)
Return values
OPENNSL_E_NONE
OPENNSL_E_PARAMInvalid priority, or device not configured for the number of CoS queues specified.
OPENNSL_E_XXX
int opennsl_cosq_port_mapping_multi_set ( int  unit,
opennsl_port_t  port,
int  count,
opennsl_cos_t priority_array,
opennsl_cos_queue_t cosq_array 
)

Get or set the mapping of multiple internal priorities to their corresponding CoS queues.

Description
Configure or retrieve the mapping of multiple internal priority value to their corresponding Cos Queue. The internal priority is usually initialized from the packet priority. For tagged packets the priority is extracted from the PRI field of the tag. For untagged packets, the priority is specified using the API =opennsl_port_untagged_priority_set . On some devices, the mapping tables may be shared among several ports, so setting one port's mappings may affect other ports'. On some devices, packets directed to the CPU interface port may have their priority assigned independent of this setting. For more information see =opennsl_switch_control_set . On some devices, a port value of -1 or gport type for system configuration will configure all ports. Some devices support Enhanced Transmission Selection (ETS) which requires to use GPORT ID for the port argument. When the ETS mode is enabled, they configure and retrive the mapping from the internal priority to the offset (which is equal to the value of cosq) of the unicast queues and multicast queues attached to the egress port. Most devices have 8 internal priorities (0 to 7).
Parameters
unit[IN] Unit number.
port[IN] Device or logical port or GPORT ID
count[IN] number of elements in priority array and cosq array in case of multi get or set
priority_array[IN] array of internal priority to map
cosq_array[IN] array of Cos queue where each element of cosq_array (cos) corresponds to the respective element of priority_array (internal priority)
Return values
OPENNSL_E_NONE
OPENNSL_E_PARAMInvalid priority, or device not configured for the number of CoS queues specified.
OPENNSL_E_XXX
int opennsl_cosq_port_mapping_set ( int  unit,
opennsl_port_t  port,
opennsl_cos_t  priority,
opennsl_cos_queue_t  cosq 
)

Get or set the mapping from internal priority to CoS queue.

Description
Configure or retrieve the mapping from the internal priority value to Cos Queue. The internal priority is usually initialized from the packet priority. For tagged packets the priority is extracted from the PRI field of the tag. For untagged packets, the priority is specified using the API =opennsl_port_untagged_priority_set . On some devices, the mapping tables may be shared among several ports, so setting one port's mappings may affect other ports'. On some devices, packets directed to the CPU interface port may have their priority assigned independent of this setting. For more information see =opennsl_switch_control_set . On some devices, a port value of -1 or gport type for system configuration will configure all ports. Some devices support Enhanced Transmission Selection (ETS) which requires to use GPORT ID for the port argument. When the ETS mode is enabled, they configure and retrive the mapping from the internal priority to the offset (which is equal to the value of cosq) of the unicast queues and multicast queues attached to the egress port. Most devices have 8 internal priorities (0 to 7).
Parameters
unit[IN] Unit number.
port[IN] Device or logical port or GPORT ID
priority[IN] internal priority to map
cosq[IN] Cos queue to which to map the chosen priority
Return values
OPENNSL_E_NONE
OPENNSL_E_PARAMInvalid priority, or device not configured for the number of CoS queues specified.
OPENNSL_E_XXX
int opennsl_cosq_port_sched_get ( int  unit,
opennsl_pbmp_t  pbm,
int *  mode,
int  weights[OPENNSL_COS_COUNT],
int *  delay 
)

Get or set Class of Service policy, weights and delay.

Description
Configure or retrieve the Class of Service policy, weights, and delay for a device or port. The mode options are listed in the table below. For modes which use weights, the weights may range between OPENNSL_COSQ_WEIGHT_MIN and the value of weight_max returned by =opennsl_cosq_sched_weight_max_get for the mode. If weight_max = OPENNSL_COSQ_WEIGHT_UNLIMITED, then any positive weight is acceptable. In OPENNSL_COSQ_BOUNDED_DELAY mode, a negative value for an element of the weight array indicates that the weight and delay value for that Class of Service should remain unchanged, while the non-negative elements of the weight array are updated and assigned the given delay value. For modes which use weights, OPENNSL_COSQ_WEIGHT_STRICT may be supplied for some of the weights, indicating these queues should behave as in strict priority mode. On the chips network switch, the queues in strict priority mode must be in consecutive order. The chips network switch does not support the scheduling modes OPENNSL_COSQ_WEIGHTED_FAIR_QUEUING and OPENNSL_COSQ_BOUNDED_DELAY. Note: In all devices supporting Enhanced Transmission Selection (ETS) hierarchical scheduling, opennsl_cosq_sched_set and opennsl_cosq_sched_get API is used to configure and retrieve the Class of Service policy, weights, and delay for CPU(CMIC) port only.
Parameters
unit[IN] Unit number.
pbm[IN] Port bit map of ports to configure
mode[OUT] Scheduling mode, see table =OPENNSL_COSQ_table
weights[OUT] Array of relative weights indexed by CoS queue. Use depends on the selected mode. See =OPENNSL_COSQ_COMBO . Note: Be aware that despite of OPENNSL_COS_COUNT is 8, it supports up to 10 weights arrays in network switch devices if and only if opennsl_num_cos=10 is configured.
delay[OUT] Used only if scheduling algorithm is OPENNSL_COSQ_BOUNDED_DELAY to indicate the maximum amount of time before returning to the highest priority CoS queue. This value is only used for non-negative elements of the weights array.
Return values
OPENNSL_E_xxx
int opennsl_cosq_port_sched_set ( int  unit,
opennsl_pbmp_t  pbm,
int  mode,
const int  weights[OPENNSL_COS_COUNT],
int  delay 
)

Get or set Class of Service policy, weights and delay.

Description
Configure or retrieve the Class of Service policy, weights, and delay for a device or port. The mode options are listed in the table below. For modes which use weights, the weights may range between OPENNSL_COSQ_WEIGHT_MIN and the value of weight_max returned by =opennsl_cosq_sched_weight_max_get for the mode. If weight_max = OPENNSL_COSQ_WEIGHT_UNLIMITED, then any positive weight is acceptable. In OPENNSL_COSQ_BOUNDED_DELAY mode, a negative value for an element of the weight array indicates that the weight and delay value for that Class of Service should remain unchanged, while the non-negative elements of the weight array are updated and assigned the given delay value. For modes which use weights, OPENNSL_COSQ_WEIGHT_STRICT may be supplied for some of the weights, indicating these queues should behave as in strict priority mode. On the chips network switch, the queues in strict priority mode must be in consecutive order. The chips network switch does not support the scheduling modes OPENNSL_COSQ_WEIGHTED_FAIR_QUEUING and OPENNSL_COSQ_BOUNDED_DELAY. Note: In all devices supporting Enhanced Transmission Selection (ETS) hierarchical scheduling, opennsl_cosq_sched_set and opennsl_cosq_sched_get API is used to configure and retrieve the Class of Service policy, weights, and delay for CPU(CMIC) port only.
Parameters
unit[IN] Unit number.
pbm[IN] Port bit map of ports to configure
mode[IN] Scheduling mode, see table =OPENNSL_COSQ_table
weights[IN] Array of relative weights indexed by CoS queue. Use depends on the selected mode. See =OPENNSL_COSQ_COMBO . Note: Be aware that despite of OPENNSL_COS_COUNT is 8, it supports up to 10 weights arrays in network switch devices if and only if opennsl_num_cos=10 is configured.
delay[IN] Used only if scheduling algorithm is OPENNSL_COSQ_BOUNDED_DELAY to indicate the maximum amount of time before returning to the highest priority CoS queue. This value is only used for non-negative elements of the weights array.
Return values
OPENNSL_E_xxx
int opennsl_cosq_priority_get ( int  unit,
int  start_queue,
int  end_queue,
int *  pri_profile_id 
)

Get the priority profile associated with a queue range.

Description
Return one of 4 priority profiles associated with the given queue range.
Parameters
unit[IN] Unit number.
start_queue[IN] starting queue (must be multiple of 64)
end_queue[IN] ending queue (must be multiple of 64 then -1)
pri_profile_id[OUT] priority profile id (0-3)
Return values
OPENNSL_E_NONE
OPENNSL_E_XXX
int opennsl_cosq_priority_set ( int  unit,
int  start_queue,
int  end_queue,
int  pri_profile_id 
)

Associate a priority profile with a queue range.

Description
Associate one of 4 priority profiles with a queue range.
Parameters
unit[IN] Unit number.
start_queue[IN] starting queue (must be multiple of 64)
end_queue[IN] ending queue (must be multiple of 64 then -1)
pri_profile_id[IN] priority profile id (0-3)
Return values
OPENNSL_E_NONE
OPENNSL_E_XXX
int opennsl_cosq_sched_get ( int  unit,
int *  mode,
int  weights[OPENNSL_COS_COUNT],
int *  delay 
)

Get or set Class of Service policy, weights and delay.

Description
Configure or retrieve the Class of Service policy, weights, and delay for a device or port. The mode options are listed in the table below. For modes which use weights, the weights may range between OPENNSL_COSQ_WEIGHT_MIN and the value of weight_max returned by =opennsl_cosq_sched_weight_max_get for the mode. If weight_max = OPENNSL_COSQ_WEIGHT_UNLIMITED, then any positive weight is acceptable. In OPENNSL_COSQ_BOUNDED_DELAY mode, a negative value for an element of the weight array indicates that the weight and delay value for that Class of Service should remain unchanged, while the non-negative elements of the weight array are updated and assigned the given delay value. For modes which use weights, OPENNSL_COSQ_WEIGHT_STRICT may be supplied for some of the weights, indicating these queues should behave as in strict priority mode. On the chips network switch, the queues in strict priority mode must be in consecutive order. The chips network switch does not support the scheduling modes OPENNSL_COSQ_WEIGHTED_FAIR_QUEUING and OPENNSL_COSQ_BOUNDED_DELAY. Note: In all devices supporting Enhanced Transmission Selection (ETS) hierarchical scheduling, opennsl_cosq_sched_set and opennsl_cosq_sched_get API is used to configure and retrieve the Class of Service policy, weights, and delay for CPU(CMIC) port only.
Parameters
unit[IN] Unit number.
mode[OUT] Scheduling mode, see table =OPENNSL_COSQ_table
weights[OUT] Array of relative weights indexed by CoS queue. Use depends on the selected mode. See =OPENNSL_COSQ_COMBO . Note: Be aware that despite of OPENNSL_COS_COUNT is 8, it supports up to 10 weights arrays in network switch devices if and only if opennsl_num_cos=10 is configured.
delay[OUT] Used only if scheduling algorithm is OPENNSL_COSQ_BOUNDED_DELAY to indicate the maximum amount of time before returning to the highest priority CoS queue. This value is only used for non-negative elements of the weights array.
Return values
OPENNSL_E_xxx
int opennsl_cosq_sched_set ( int  unit,
int  mode,
const int  weights[OPENNSL_COS_COUNT],
int  delay 
)

Get or set Class of Service policy, weights and delay.

Description
Configure or retrieve the Class of Service policy, weights, and delay for a device or port. The mode options are listed in the table below. For modes which use weights, the weights may range between OPENNSL_COSQ_WEIGHT_MIN and the value of weight_max returned by =opennsl_cosq_sched_weight_max_get for the mode. If weight_max = OPENNSL_COSQ_WEIGHT_UNLIMITED, then any positive weight is acceptable. In OPENNSL_COSQ_BOUNDED_DELAY mode, a negative value for an element of the weight array indicates that the weight and delay value for that Class of Service should remain unchanged, while the non-negative elements of the weight array are updated and assigned the given delay value. For modes which use weights, OPENNSL_COSQ_WEIGHT_STRICT may be supplied for some of the weights, indicating these queues should behave as in strict priority mode. On the chips network switch, the queues in strict priority mode must be in consecutive order. The chips network switch does not support the scheduling modes OPENNSL_COSQ_WEIGHTED_FAIR_QUEUING and OPENNSL_COSQ_BOUNDED_DELAY. Note: In all devices supporting Enhanced Transmission Selection (ETS) hierarchical scheduling, opennsl_cosq_sched_set and opennsl_cosq_sched_get API is used to configure and retrieve the Class of Service policy, weights, and delay for CPU(CMIC) port only.
Parameters
unit[IN] Unit number.
mode[IN] Scheduling mode, see table =OPENNSL_COSQ_table
weights[IN] Array of relative weights indexed by CoS queue. Use depends on the selected mode. See =OPENNSL_COSQ_COMBO . Note: Be aware that despite of OPENNSL_COS_COUNT is 8, it supports up to 10 weights arrays in network switch devices if and only if opennsl_num_cos=10 is configured.
delay[IN] Used only if scheduling algorithm is OPENNSL_COSQ_BOUNDED_DELAY to indicate the maximum amount of time before returning to the highest priority CoS queue. This value is only used for non-negative elements of the weights array.
Return values
OPENNSL_E_xxx
int opennsl_cosq_sched_weight_max_get ( int  unit,
int  mode,
int *  weight_max 
)

Retrieve maximum weights for given CoS policy.

Description
Retrieve the maximum allowed weight value for the weights array in.
Parameters
unit[IN] Unit number.
mode[IN] Scheduling mode, see table =OPENNSL_COSQ_table
weight_max[OUT] Maximum weight value for opennsl_cosq_sched_set.
Return values
OPENNSL_E_xxx
int opennsl_cosq_stat_get ( int  unit,
opennsl_gport_t  gport,
opennsl_cos_queue_t  cosq,
opennsl_cosq_stat_t  stat,
uint64 value 
)

Retrieve/set various MMU statistics based on stat type.

Description
Retrieve/set various MMU statistics. The type opennsl_cosq_stat_t is an enumeration of the available statistics. For _get functions, if the given cosq is -1, then the sum of the values of all the given port's CoS queues will be returned. For _set functions, if the given cosq is -1, the value of the port's first CoS queue will be set to the given value; the value of the port's all other CoS queues will be kept as untouched except for device network switch, on which the value of the port's all other CoS queues will be set to zero. When setting the non-zero value, if the device supports separate unicast and multicast queues, the value being set is evenly distributed between unicast and multicast counter. This is applicable to switch family-III devices only.
Parameters
unit[IN] Unit number.
gport[IN] GPORT ID.
cosq[IN] CoS Queue.
stat[IN] Statistic to be retrieved. See table =OPENNSL_COSQ_STAT_table .
value[OUT] (for _get) statistic value.
Return values
OPENNSL_E_NONE
OPENNSL_E_XXX
int opennsl_cosq_stat_set ( int  unit,
opennsl_gport_t  gport,
opennsl_cos_queue_t  cosq,
opennsl_cosq_stat_t  stat,
uint64  value 
)

Retrieve/set various MMU statistics based on stat type.

Description
Retrieve/set various MMU statistics. The type opennsl_cosq_stat_t is an enumeration of the available statistics. For _get functions, if the given cosq is -1, then the sum of the values of all the given port's CoS queues will be returned. For _set functions, if the given cosq is -1, the value of the port's first CoS queue will be set to the given value; the value of the port's all other CoS queues will be kept as untouched except for device network switch, on which the value of the port's all other CoS queues will be set to zero. When setting the non-zero value, if the device supports separate unicast and multicast queues, the value being set is evenly distributed between unicast and multicast counter. This is applicable to switch family-III devices only.
Parameters
unit[IN] Unit number.
gport[IN] GPORT ID.
cosq[IN] CoS Queue.
stat[IN] Statistic to be retrieved. See table =OPENNSL_COSQ_STAT_table .
value[IN] (for _get) statistic value.
Return values
OPENNSL_E_NONE
OPENNSL_E_XXX
int opennsl_cosq_stat_sync_get ( int  unit,
opennsl_gport_t  gport,
opennsl_cos_queue_t  cosq,
opennsl_cosq_stat_t  stat,
uint64 value 
)

Force an immediate counter update and retrieve various MMU statistics.

Description
Similar to opennsl_cosq_stat_get(), value returned is software accumulated counter synced with the hardware counter. On the chip network switch, for stat opennslCosqStatOutPackets/opennslCosqStatOutBytes because of clear on read implementation in hardware, opennsl_cosq_stat_sync_get on OutPackets will have impact on OutBytes counters and vice-versa. Hence recommendation is to use opennsl_stat_sync(unit) api before the opennsl_cosq_stat_get API instead of using opennsl_cosq_stat_sync_get API.
Parameters
unit[IN] Unit number.
gport[IN] GPORT ID.
cosq[IN] CoS Queue.
stat[IN] Statistic to be retrieved. See table =OPENNSL_COSQ_STAT_table .
value[OUT] (for _get) statistic value.
Return values
OPENNSL_E_NONE
OPENNSL_E_XXX