Functions
QMSS Low Level Driver Functions
QMSS

Functions

static void Qmss_queuePush (Qmss_QueueHnd hnd, void *descAddr, uint32_t packetSize, uint32_t descSize, Qmss_Location location)
static void Qmss_queuePushDesc (Qmss_QueueHnd hnd, void *descAddr)
static void Qmss_queuePushDescSizeRaw (Qmss_QueueHnd hnd, void *descAddr, uint32_t descSize)
static void Qmss_queuePushDescSize (Qmss_QueueHnd hnd, void *descAddr, uint32_t descSize)
static void * Qmss_queuePopRaw (Qmss_QueueHnd hnd)
static void * Qmss_queuePop (Qmss_QueueHnd hnd)
static void Qmss_queuePopDescSize (Qmss_QueueHnd hnd, void **descAddr, uint32_t *packetSize)
static Qmss_QueuePushHnd Qmss_getQueuePushHandle (Qmss_QueueHnd hnd)
static Qmss_QueuePushHnd Qmss_getQueuePushHandleCfg (Qmss_QueueHnd hnd)
static Qmss_Result Qmss_queueDivert (Qmss_QueueHnd srcQnum, Qmss_QueueHnd dstQnum, Qmss_Location location)
static void Qmss_queueEmpty (Qmss_QueueHnd hnd)
static uint32_t Qmss_getQueueEntryCount (Qmss_QueueHnd hnd)
static uint32_t Qmss_getQueueByteCount (Qmss_QueueHnd hnd)
static uint32_t Qmss_getQueuePacketSize (Qmss_QueueHnd hnd)
static uint32_t Qmss_getQIDFromHandle (Qmss_QueueHnd hnd)
static Qmss_QueueHnd Qmss_getHandleFromQID (uint32_t QID)
Qmss_AccChHandle Qmss_openAccumulatorCh (Qmss_PdspId pdspId, uint8_t channel)
Qmss_Result Qmss_cfgAccumulatorCh (Qmss_AccChHandle handle, Qmss_AccCmdCfg *cfg)
Qmss_Result Qmss_programAccumulator (Qmss_PdspId pdspId, Qmss_AccCmdCfg *cfg)
Qmss_Result Qmss_closeAccumulatorCh (Qmss_AccChHandle handle)
Qmss_Result Qmss_stopAccumulatorCh (Qmss_AccChHandle handle)
Qmss_Result Qmss_disableAccumulator (Qmss_PdspId pdspId, uint8_t channel)
Qmss_Result Qmss_configureAccTimer (Qmss_PdspId pdspId, uint16_t timerConstant)
Qmss_Result Qmss_programReclaimQueue (Qmss_PdspId pdspId, Qmss_QueueHnd hnd)
Qmss_Result Qmss_programDiversionQueue (Qmss_PdspId pdspId, Qmss_QueueHnd divQ, Qmss_QueueHnd divCompletionQ)
static int32_t Qmss_internalFindQueueType (uint32_t queNum)
static void Qmss_internalUpdateGroupControl (uint32_t qGroup, int sign)
static void Qmss_internalInsertLinkingRAM (uint32_t group, Qmss_LinkingRAM *linkingRAM, uint32_t *actSize)
static Qmss_Result Qmss_internalCheckLinkingRAM (Qmss_LinkingRAM *linkingRAM)
Qmss_Result Qmss_init (Qmss_InitCfg *initCfg, Qmss_GlobalConfigParams *qmssGblCfgParams)
Qmss_Result Qmss_exit (void)
Qmss_Result Qmss_startCfg (Qmss_StartCfg *startCfg)
Qmss_Result Qmss_start (void)
Qmss_Result Qmss_getMemoryRegionCfg (Qmss_MemRegCfg *memRegInfo)
Qmss_Result Qmss_insertMemoryRegion (Qmss_MemRegInfo *memRegCfg)
Qmss_Result Qmss_removeMemoryRegion (int32_t region, uint32_t qGroup)
Qmss_QueueHnd Qmss_initDescriptor (Qmss_DescCfg *descCfg, uint32_t *numAllocated)
Qmss_QueueHnd Qmss_queueOpenInGroup (int32_t queGroup, Qmss_QueueType queType, int32_t queNum, uint8_t *isAllocated)
Qmss_QueueHnd Qmss_queueOpen (Qmss_QueueType queType, int32_t queNum, uint8_t *isAllocated)
Qmss_QueueHnd Qmss_queueOpenInRange (uint32_t startQueNum, uint32_t endQueNum, uint8_t *isAllocated)
Qmss_QueueHnd Qmss_queueBlockOpenInGroup (Qmss_QueueHnd *queueHnds, int32_t queGroup, Qmss_QueueType queType, int32_t numQ, int32_t align)
Qmss_QueueHnd Qmss_queueBlockOpen (Qmss_QueueHnd *queueHnds, Qmss_QueueType queType, int32_t numQ, int32_t align)
Qmss_QueueHnd Qmss_queueOpenUse (uint32_t QID, uint8_t *useCount)
Qmss_Result Qmss_queueClose (Qmss_QueueHnd hnd)
uint32_t Qmss_getQueueThreshold (Qmss_QueueHnd hnd)
Qmss_Result Qmss_setQueueThreshold (Qmss_QueueHnd hnd, uint16_t hilo, uint8_t threshold)
void Qmss_getStarvationCounts (Qmss_QueueHnd hnd, uint32_t numCounts, uint32_t *pStarvationCounts)
uint32_t Qmss_getStarvationCount (Qmss_QueueHnd hnd)
uint16_t Qmss_getQueueThresholdStatus (Qmss_QueueHnd hnd)
Qmss_Queue Qmss_getQueueNumber (Qmss_QueueHnd hnd)
uint32_t Qmss_getQueueGroup (Qmss_QueueHnd hnd)
Qmss_QueueHnd Qmss_getQueueHandle (Qmss_Queue queue)
Qmss_Result Qmss_downloadFirmware (Qmss_PdspId pdspId, void *image, uint32_t size)
Qmss_Result Qmss_setEoiVectorByIntd (uint8_t intdNum, Qmss_IntdInterruptType type, uint8_t accumCh)
Qmss_Result Qmss_setEoiVector (Qmss_IntdInterruptType type, uint8_t accumCh)
Qmss_Result Qmss_setEoiIntNumByIntd (uint8_t intdNum, uint8_t intNum)
Qmss_Result Qmss_setEoiIntNum (uint8_t intNum)
Qmss_Result Qmss_ackInterruptByIntd (uint8_t intdNum, uint8_t interruptNum, uint8_t value)
Qmss_Result Qmss_ackInterrupt (uint8_t interruptNum, uint8_t value)
uint32_t Qmss_getVersion (void)
const char * Qmss_getVersionStr (void)
Qmss_Result Qmss_setQosQueueBase (uint32_t queueNum)
Qmss_Result Qmss_getQosQueueBase (uint32_t *queueNum)
Qmss_Result Qmss_configureQosTimer (uint32_t timerConstant)
Qmss_Result Qmss_enableQosCluster (uint32_t clusterIndex)
Qmss_Result Qmss_disableQosCluster (uint32_t clusterIndex)
Qmss_Result Qmss_configureQosQueue (uint32_t queIndex, Qmss_QosQueueCfg *cfg)
Qmss_Result Qmss_configureQosCluster (uint32_t clusterIndex, Qmss_QosClusterCfg *cfg)
Qmss_Result Qmss_getQosQueueForwardPktStats (uint32_t queIndex)
Qmss_Result Qmss_getQosQueueDroppedPktStats (uint32_t queIndex)
Qmss_Result Qmss_resetQosQueueStats (uint32_t queIndex)
Qmss_Result Qmss_configureQosSrioCluster (uint32_t clusterIndex, Qmss_QosSrioCfg *cfg)
Qmss_Result Qmss_enableQosSrioCluster (uint32_t clusterIndex)
Qmss_Result Qmss_disableQosSrioCluster (uint32_t clusterIndex)
uint32_t Qmss_getQosFwVersion (void)
Qmss_Result Qmss_setQosSchedQueueBase (uint32_t queueNum)
Qmss_Result Qmss_getQosSchedQueueBase (uint32_t *queueNum)
Qmss_Result Qmss_configureQosSchedTimer (uint32_t timerConstant)
Qmss_Result Qmss_enableQosSchedPort (uint32_t port)
Qmss_Result Qmss_disableQosSchedPort (uint32_t port)
Qmss_Result Qmss_putCfgQosSchedPort (uint32_t port, Qmss_QosSchedPortCfg *cfg)
Qmss_Result Qmss_getCfgQosSchedPort (uint32_t port, Qmss_QosSchedPortCfg *cfg)
Qmss_Result Qmss_getQosSchedStats (Qmss_QosSchedStats *stats, uint32_t port, uint32_t group, uint32_t queue, uint32_t which_reset)
uint32_t Qmss_getQosSchedFwVersion (void)
uint32_t Qmss_getQosSchedFwMagic (void)
Qmss_Result Qmss_convertQosSchedBitRate (int32_t *result, uint32_t ticksPerSecond, uint32_t bitRatePerSecond)
Qmss_Result Qmss_convertQosSchedPacketRate (int32_t *result, uint32_t ticksPerSecond, uint32_t packetRatePerSecond)
Qmss_Result Qmss_setQosSchedDropSchedQueueBase (uint32_t queueNum)
Qmss_Result Qmss_getQosSchedDropSchedQueueBase (uint32_t *queueNum)
Qmss_Result Qmss_getCfgQosSchedDropSchedOutProfs (uint32_t port, Qmss_QosSchedDropSchedOutProf *profs, int32_t nProfs)
Qmss_Result Qmss_putCfgQosSchedDropSchedOutProfs (uint32_t port, Qmss_QosSchedDropSchedOutProf *profs, int32_t nProfs)
Qmss_Result Qmss_getCfgQosSchedDropSchedCfgProfs (uint32_t port, Qmss_QosSchedDropSchedCfgProf *profs, int32_t nProfs)
Qmss_Result Qmss_putCfgQosSchedDropSchedCfgProfs (uint32_t port, Qmss_QosSchedDropSchedCfgProf *profs, int32_t nProfs)
Qmss_Result Qmss_getCfgQosSchedDropSchedQueCfgs (uint32_t port, Qmss_QosSchedDropSchedQueCfg *cfgs, int32_t nCfgs)
Qmss_Result Qmss_putCfgQosSchedDropSchedQueCfgs (uint32_t port, Qmss_QosSchedDropSchedQueCfg *cfgs, int32_t nCfgs)
Qmss_Result Qmss_getCfgQosSchedDropSchedCfg (uint32_t port, Qmss_QosSchedDropSchedCfg *pCfg)
Qmss_Result Qmss_putCfgQosSchedDropSchedCfg (uint32_t port, Qmss_QosSchedDropSchedCfg *pCfg)
Qmss_Result Qmss_enableQosSchedDropSched (uint32_t port)
Qmss_Result Qmss_disableQosSchedDropSched (uint32_t port)
Qmss_Result Qmss_getQosSchedDropSchedStats (Qmss_QosSchedDropSchedStats *stats, uint32_t port, uint32_t block, uint32_t which_reset)
Qmss_Result Qmss_convertQosSchedDropSchedPushStats (Qmss_QosSchedDropSchedPushStats *stats, void *desc)
Qmss_Result Qmss_qosSchedDropSchedPushProxy (Qmss_QueueHnd hnd, void *descAddr, uint32_t packetSize, uint32_t descSize, Qmss_Location location)

Function Documentation

Qmss_Result Qmss_ackInterrupt ( uint8_t  interruptNum,
uint8_t  value 
)

Description
Calls Qmss_ackInterruptByIntd with intdNum = 0 (for backwards compatibility)

Return values:
Success- QMSS_SOK
Failure- QMSS_NOT_INITIALIZED
Qmss_Result Qmss_ackInterruptByIntd ( uint8_t  intdNum,
uint8_t  interruptNum,
uint8_t  value 
)

Description
This function decrements the interrupt count. The Interrupt Count Registers contains a count of the interrupts that have triggered and not been processed. Writing a non-zero value to the register subtracts that value from the count. Writing a 0 clears the count. The count saturates at 3.

Note: Clearing the count does not clear the interrupt. The EOI Vector must be set using Qmss_setEoiVector API.

Parameters:
[in]intdNumWhich QMSS INTD to program. As this is a fast path API it is NOT bounds checked.
[in]interruptNumInterrupt Number that should be acknowledged.
[in]valueValue to decrement by or zero to clear.

**No validation is done to check if the interrupt number is within range to reduce overhead.**

Postcondition:
Count is decremented or cleared depending on input parameter.
Return values:
Success- QMSS_ACC_SOK
Failure- QMSS_NOT_INITIALIZED

Description
This function programs the accumulator channel with values passed in the cfg structure

Parameters:
[in]handleAccumulator channel handle to program
[in]cfgInitialization structure that contains accumulator configurable fields
Postcondition:
Accumulator channel is programmed.
Return values:
Valuereported by accumulator
Success- QMSS_ACC_SOK
Failure- QMSS_INVALID_PARAM
Failure- Accumulator status - QMSS_ACC_IDLE, QMSS_ACC_INVALID_COMMAND, QMSS_ACC_INVALID_CHANNEL, QMSS_ACC_CHANNEL_NOT_ACTIVE, QMSS_ACC_CHANNEL_ALREADY_ACTIVE, QMSS_ACC_INVALID_QUEUE_NUMBER

Description
This function releases the channel to the resource manager, if present.

Parameters:
[in]handleChannel handle of channel to close
Postcondition:
Channel is released from resource manager (if present)
Return values:
Valuereported by accumulator
Success- QMSS_ACC_SOK
Failure- Accumulator status - QMSS_ACC_IDLE, QMSS_ACC_INVALID_COMMAND, QMSS_ACC_INVALID_CHANNEL, QMSS_ACC_CHANNEL_NOT_ACTIVE, QMSS_ACC_CHANNEL_ALREADY_ACTIVE, QMSS_ACC_INVALID_QUEUE_NUMBER
Qmss_Result Qmss_configureAccTimer ( Qmss_PdspId  pdspId,
uint16_t  timerConstant 
)

Description
This function programs the timer constant used by the firmware to generate the timer tick.

The Accumulator time "tick" is controlled by a local timer connected to the PDSP core. This timer has a programmable count based on the sub-system clock. When this count expires, a local "tick" is registered in the firmware. The tick is used when timing channel interrupts based on the "Timer Load Count" value supplied in the timer configuration.

The value of "Timer Constant" is the number of QM sub-system clocks divided by 2 that comprise a single "tick" in the accumulator firmware.

For example, if the QM sub-system clock is 350MHz, and the desired firmware "tick" is 20us, the proper Timer Constant for this command is computed as follows:

Timer Constant = (350,000,000 cycles/sec) * (0.000020 sec) / (2 cycles) Timer Constant = 3,500

The firmware initializes with a default constant value of 4375. This corresponds to firmware tick of 25us.

Parameters:
[in]pdspIdAccumulator to program Qmss_PdspId_PDSP1 selects firmware downloaded to PDSP 1 Qmss_PdspId_PDSP2 selects firmware downloaded to PDSP 2
[in]timerConstant16 bit wide value calculated as explained above
Postcondition:
Timer constant is programmed and in use.
Return values:
Valuereported by accumulator
Success- QMSS_ACC_SOK
Failure- QMSS_NOT_INITIALIZED
Failure- Accumulator status - QMSS_ACC_IDLE, QMSS_ACC_INVALID_COMMAND
Qmss_Result Qmss_configureQosCluster ( uint32_t  clusterIndex,
Qmss_QosClusterCfg cfg 
)

Description
This function is used to configure a QoS cluster. Only disabled clusters can be modified by the host. When a cluster is disabled all packet in the QoS queue contained in that cluster are discarded.

Parameters:
[in]clusterIndexIndex of the cluster to configure - Valid range is 0 to 7
[in]cfgcluster configuration parameters
Precondition:
The cluster must be disabled using Qmss_disableQosCluster() API before calling this function.
Return values:
Success- QCMD_RETCODE_SUCCESS
Failure- QMSS_QCMD_INVALID_INDEX QMSS_QCMD_INVALID_MODE QMSS_QCMD_INVALID_RR_HIGH_Q QMSS_QCMD_INVALID_RR_LOW_Q QMSS_QCMD_INVALID_RR_EGRESS_Q
Qmss_Result Qmss_configureQosQueue ( uint32_t  queIndex,
Qmss_QosQueueCfg cfg 
)

Description
This function is used to configure a QoS queue. Only disabled clusters can be modified by the host. When a cluster is disabled all packet in the QoS queue contained in that cluster are discarded.

Parameters:
[in]queIndexIndex of the queue to configure - Valid range is 0 to 31
[in]cfgQueue configuration parameters
Precondition:
The cluster must be disabled using Qmss_disableQosCluster() API before calling this function.
Return values:
Success- QCMD_RETCODE_SUCCESS
Failure- QMSS_QCMD_INVALID_INDEX
Qmss_Result Qmss_configureQosSchedTimer ( uint32_t  timerConstant)

Description
This function is used to configure the QoS packet scheduler's credit interval timer

Parameters:
[in]timerConstantThe PDSP timer determines when credit is passed out. The timer is configured by supplying a timer constant. The constant is computed as follows:

timerConstant = (QMSS_Clock_Frequency * Desired_Interval) / 2

Return values:
Success- QMSS_QOS_SCHED_RETCODE_SUCCESS
Failure- The following errors are detected by the firmware: QMSS_QOS_SCHED_INVALID_COMMAND QMSS_QOS_SCHED_INVALID_INDEX QMSS_QOS_SCHED_INVALID_OPTION
The following errors are detected by the LLD: QMSS_QOS_SCHED_INVALID_PORT
Qmss_Result Qmss_configureQosSrioCluster ( uint32_t  clusterIndex,
Qmss_QosSrioCfg cfg 
)

Description
This function is used to configure the SRIO tracking cluster. The cluster must be disabled before calling this function.

Parameters:
[in]clusterIndexIndex of the cluster to configure - Valid value is 0
[in]cfgcluster configuration parameters
Return values:
Success- QCMD_RETCODE_SUCCESS
Failure- QMSS_QCMD_INVALID_INDEX, QMSS_QCMD_INVALID_SRIO_NUM_Q
Qmss_Result Qmss_configureQosTimer ( uint32_t  timerConstant)

Description
This function is used to configure the QoS credit interval timer

**No validation is done on the input parameters**.

Parameters:
[in]timerConstantThe PDSP timer determines when credit is passed out. The timer is configured by supplying a timer constant. The constant is computed as follows:

timerConstant = (QMSS_Clock_Frequency * Desired_Interval) / 2

Return values:
Success- QCMD_RETCODE_SUCCESS
Failure- Command buffer return status - QMSS_QCMD_INVALID_COMMAND, QMSS_QCMD_INVALID_INDEX, QMSS_QCMD_INVALID_OPTION,
Qmss_Result Qmss_convertQosSchedBitRate ( int32_t *  result,
uint32_t  ticksPerSecond,
uint32_t  bitRatePerSecond 
)

Description
This function performs unit conversion from bits per second rate to a cir/pir/wrr rate given the configured ticks per second. The result is rounded to nearest.

Parameters:
[out]resultCalculated result or 0 on under/over flow
[in]ticksPerSecondQoS timer rate. This is not checked against actual configuration. For example, 20000 means 50us.
[in]bitRatePerSecondRequested bits per second. For example, 50000000 means 50 megabits
Return values:
Success- QMSS_QOS_SCHED_RETCODE_SUCCESS
FailureThe following errors are detected by the LLD: QMSS_QOS_SCHED_OVERFLOW -- result overflows QMSS_QOS_SCHED_UNDERFLOW -- result is 0, but bitRatePerSecond was not 0 QMSS_QOS_SCHED_INVALID_PARAM -- result was NULL

Description
This function converts a push stats descriptor handling the cache and endian as necessary. As soon as this function returns, the descriptor can be returned.

The drop scheduler statistics are 32 bit internally. If one of the stats' MSBs gets set, and the queue's Qmss_QosSchedDropSchedQueCfg::statBlockIdx is nonzero, then a descriptor is popped from Qmss_QosSchedDropSchedCfg.statsQueues[statBlockIdx-1].src, stats are copied in, then it is returned to sw via Qmss_QosSchedDropSchedCfg.statsQueues[statBlockIdx-1].dst. This function converts those descriptors.

Parameters:
[out]statsStatistics structure to contain returned stats.
[in]descPointer to descriptor containing stats. It is assumed that any required cache or fence operations are done on the desc
Return values:
Success- QMSS_QOS_SCHED_RETCODE_SUCCESS
FailureThe following errors are detected by the LLD: QMSS_QOS_SCHED_REQ_DROP_SCHED, QMSS_QOS_SCHED_INVALID_PORT, QMSS_QOS_SCHED_INVALID_PARAM
Qmss_Result Qmss_convertQosSchedPacketRate ( int32_t *  result,
uint32_t  ticksPerSecond,
uint32_t  packetRatePerSecond 
)

Description
This function performs unit conversion from packets per second rate to a cir/pir/wrr rate given the configured ticks per second. The result is rounded to nearest.

Parameters:
[out]resultCalculated result or 0 on under/over flow
[in]ticksPerSecondQoS timer rate. This is not checked against actual configuration. For example, 20000 means 50us.
[in]packetRatePerSecondRequested packets per second. For example, 1000 means 1000 packets per second.
Return values:
Success- QMSS_QOS_SCHED_RETCODE_SUCCESS
FailureThe following errors are detected by the LLD: QMSS_QOS_SCHED_OVERFLOW -- result overflows QMSS_QOS_SCHED_UNDERFLOW -- result is 0, but packetRatePerSecond was not 0 QMSS_QOS_SCHED_INVALID_PARAM -- result was NULL
Qmss_Result Qmss_disableAccumulator ( Qmss_PdspId  pdspId,
uint8_t  channel 
)

Description
This function disables the accumulator functionality for the specified channel

This function combines the behavior of Qmss_stopAccumulatorCh() and Qmss_closeAccumulatorCh ()

Parameters:
[in]pdspIdAccumulator to program. Qmss_PdspId_PDSP1..8 selects firmware downloaded to PDSP 1 to 8
[in]channelChannel to disable
Postcondition:
Channel is disabled and released from resource manager (if present)
Return values:
Valuereported by accumulator
Success- QMSS_ACC_SOK
Failure- QMSS_NOT_INITIALIZED
Failure- QMSS_INVALID_PARAM
Failure- QMSS_RESOURCE_FREE_DENIED
Failure- Accumulator status - QMSS_ACC_IDLE, QMSS_ACC_INVALID_COMMAND, QMSS_ACC_INVALID_CHANNEL, QMSS_ACC_CHANNEL_NOT_ACTIVE, QMSS_ACC_CHANNEL_ALREADY_ACTIVE, QMSS_ACC_INVALID_QUEUE_NUMBER
Qmss_Result Qmss_disableQosCluster ( uint32_t  clusterIndex)

Description
This function is used to disable a QoS cluster. Only disabled clusters can be modified by the host. When a cluster is disabled all packet in the QoS queue contained in that cluster are discarded.

**No validation is done on the input parameters**.

Parameters:
[in]clusterIndexIndex of the cluster to disable - Valid range is 0 to 7
Return values:
Success- QCMD_RETCODE_SUCCESS
Failure- Command buffer return status - QMSS_QCMD_INVALID_COMMAND, QMSS_QCMD_INVALID_INDEX, QMSS_QCMD_INVALID_OPTION,

Description
This function is used to disable the drop scheduler.

Parameters:
[in]portPort to disable - must be 0
Return values:
Success- QMSS_QOS_SCHED_RETCODE_SUCCESS
Failure- The following errors are detected by the firmware: QMSS_QOS_SCHED_INVALID_COMMAND QMSS_QOS_SCHED_INVALID_INDEX QMSS_QOS_SCHED_INVALID_OPTION
The following errors are detected by the LLD: QMSS_QOS_SCHED_INVALID_PORT

Description
This function is used to disable a QoS scheduler port. Only disabled ports can be modified by the host. When a port is disabled all packet in the QoS queue contained in that port are discarded.

Parameters:
[in]portPort to disable - Valid range is 0 to QMSS_QOS_SCHED_MAX_PHYS_PORTS (if build is qos scheduler) or 0 to QMSS_QOS_SCHED_DROP_SCHED_MAX_PHYS_PORTS (if build is with drop scheduler)
Return values:
Success- QMSS_QOS_SCHED_RETCODE_SUCCESS
Failure- The following errors are detected by the firmware: QMSS_QOS_SCHED_INVALID_COMMAND QMSS_QOS_SCHED_INVALID_INDEX QMSS_QOS_SCHED_INVALID_OPTION
The following errors are detected by the LLD: QMSS_QOS_SCHED_INVALID_PORT
Qmss_Result Qmss_disableQosSrioCluster ( uint32_t  clusterIndex)

Description
This function is used to disable a QoS SRIO cluster.

Parameters:
[in]clusterIndexIndex of the cluster to enable - Valid value is 0
Precondition:
The cluster and queue configuration must be performed by the host before calling this function.
Return values:
Success- QCMD_RETCODE_SUCCESS
Failure- Command buffer return status - QMSS_QCMD_INVALID_COMMAND, QMSS_QCMD_INVALID_INDEX, QMSS_QCMD_INVALID_OPTION
Qmss_Result Qmss_downloadFirmware ( Qmss_PdspId  pdspId,
void *  image,
uint32_t  size 
)

Description
Downloads the PDSP firmware to PDSP.

Parameters:
[in]pdspIdPDSP number where the firmware should be downloaded
[in]imagePointer to the firmware image
[in]sizeSize of firmware image in bytes
Return values:
Success- Firmware is downloaded to PDSP
Failure- QMSS_NOT_INITIALIZED
Failure- QMSS_INVALID_PARAM
Failure- QMSS_RESOURCE_ALLOCATE_USE_DENIED
Qmss_Result Qmss_enableQosCluster ( uint32_t  clusterIndex)

Description
This function is used to enable a QoS cluster.

**No validation is done on the input parameters**.

Parameters:
[in]clusterIndexIndex of the cluster to enable - Valid range is 0 to 7
Precondition:
The cluster and queue configuration must be performed by the host before calling this function.
Return values:
Success- QCMD_RETCODE_SUCCESS
Failure- Command buffer return status - QMSS_QCMD_INVALID_COMMAND, QMSS_QCMD_INVALID_INDEX, QMSS_QCMD_INVALID_OPTION,

Description
This function is used to enable the drop scheduler.

Parameters:
[in]portPort to disable - must be 0
Return values:
Success- QMSS_QOS_SCHED_RETCODE_SUCCESS
Failure- The following errors are detected by the firmware: QMSS_QOS_SCHED_INVALID_COMMAND QMSS_QOS_SCHED_INVALID_INDEX QMSS_QOS_SCHED_INVALID_OPTION
The following errors are detected by the LLD: QMSS_QOS_SCHED_INVALID_PORT

Description
This function is used to enable a QoS port.

Parameters:
[in]portPort to enable - Valid range is 0 to QMSS_QOS_SCHED_MAX_PHYS_PORTS (if build is qos scheduler) or 0 to QMSS_QOS_SCHED_DROP_SCHED_MAX_PHYS_PORTS (if build is with drop scheduler)
Precondition:
The port's configuration must be performed by the host before calling this function.
Return values:
Success- QMSS_QOS_SCHED_RETCODE_SUCCESS
Failure- The following errors are detected by the firmware: QMSS_QOS_SCHED_INVALID_COMMAND QMSS_QOS_SCHED_INVALID_INDEX QMSS_QOS_SCHED_INVALID_OPTION
The following errors are detected by the LLD: QMSS_QOS_SCHED_INVALID_PORT
Qmss_Result Qmss_enableQosSrioCluster ( uint32_t  clusterIndex)

Description
This function is used to enable a QoS SRIO cluster.

Parameters:
[in]clusterIndexIndex of the cluster to enable - Valid value is 0
Precondition:
The cluster and queue configuration must be performed by the host before calling this function.
Return values:
Success- QCMD_RETCODE_SUCCESS
Failure- Command buffer return status - QMSS_QCMD_INVALID_COMMAND, QMSS_QCMD_INVALID_INDEX, QMSS_QCMD_INVALID_OPTION
Qmss_Result Qmss_exit ( void  )

Description
This function deinitializes the CPPI low level driver. The LLD is deinitialized only if all the queues (opened via this instance) are closed and regions inserted through this instance are removed. It is user responsibility to dispose of all descriptors added via this instance.

Precondition:
Qmss_init function should be called before calling this function. All descriptors added by this instance should be removed with Qmss_queueEmpty(). All regions added by this instance shoudl be removed with Qmss_removeMemoryRegion().
Return values:
Success- QMSS_SOK
Failure- QMSS_NOT_INITIALIZED QMSS_EXIT_QUEUES_OPEN QMSS_EXIT_REGIONS_PRESENT QMSS_QM_CONTROL_DENIED QMSS_RESOURCE_LINKING_RAM_INIT_DENIED

Description
This function is used to retrieve the current configuration the drop scheduler top level config. It sends a command to the firmware which copies the configuration from the active area to the shadow area (the active area continues to run!)

This function can be used either for diagnostic purposes to verify the configuration, or to query the current configuration, modify it, and put it back using Qmss_putCfgQosSchedDropSchedCfg.

Parameters:
[in]portDrop Scheduler instance (must be 0)
[out]pCfgDrop scheduler top level config
Return values:
Success- QMSS_QOS_SCHED_RETCODE_SUCCESS
Failure- The following errors are detected by the firmware: QMSS_QOS_SCHED_INVALID_INDEX
The following errors are detected by the LLD: QMSS_QOS_SCHED_INVALID_PORT QMSS_QOS_SCHED_REQ_DROP_SCHED QMSS_QOS_SCHED_INVALID_PARAM
Qmss_Result Qmss_getCfgQosSchedDropSchedCfgProfs ( uint32_t  port,
Qmss_QosSchedDropSchedCfgProf profs,
int32_t  nProfs 
)

Description
This function is used to retrieve the current configuration the drop scheduler config profiles. It sends a command to the firmware which copies the configuration from the active area to the shadow area (the active area continues to run!)

This function can be used either for diagnostic purposes to verify the configuration, or to query the current configuration, modify it, and put it back using Qmss_putCfgQosSchedDropSchedCfgProfs.

Parameters:
[in]portDrop Scheduler instance (must be 0)
[out]profsconfig profiles
[in]nProfsNumber of profiles in profs[] (for overrun check)
Return values:
Success- QMSS_QOS_SCHED_RETCODE_SUCCESS
Failure- The following errors are detected by the firmware: QMSS_QOS_SCHED_INVALID_INDEX
The following errors are detected by the LLD: QMSS_QOS_SCHED_INVALID_PORT QMSS_QOS_SCHED_INVALID_PARAM QMSS_QOS_SCHED_REQ_DROP_SCHED
Qmss_Result Qmss_getCfgQosSchedDropSchedOutProfs ( uint32_t  port,
Qmss_QosSchedDropSchedOutProf profs,
int32_t  nProfs 
)

Description
This function is used to retrieve the current configuration the drop scheduler output profiles. It sends a command to the firmware which copies the configuration from the active area to the shadow area (the active area continues to run!)

This function can be used either for diagnostic purposes to verify the configuration, or to query the current configuration, modify it, and put it back using Qmss_putCfgQosSchedDropSchedOutProfs.

Parameters:
[in]portDrop Scheduler instance (must be 0)
[out]profsoutput profiles
[in]nProfsNumber of profiles in profs[] (for overrun check)
Return values:
Success- QMSS_QOS_SCHED_RETCODE_SUCCESS
Failure- The following errors are detected by the firmware: QMSS_QOS_SCHED_INVALID_INDEX
The following errors are detected by the LLD: QMSS_QOS_SCHED_INVALID_PORT QMSS_QOS_SCHED_INVALID_PARAM QMSS_QOS_SCHED_REQ_DROP_SCHED
Qmss_Result Qmss_getCfgQosSchedDropSchedQueCfgs ( uint32_t  port,
Qmss_QosSchedDropSchedQueCfg cfgs,
int32_t  nCfgs 
)

Description
This function is used to retrieve the current configuration the drop scheduler input queue configs. It sends a command to the firmware which copies the configuration from the active area to the shadow area (the active area continues to run!)

This function can be used either for diagnostic purposes to verify the configuration, or to query the current configuration, modify it, and put it back using Qmss_putCfgQosSchedDropSchedQueCfgs.

Parameters:
[in]portDrop Scheduler instance (must be 0)
[out]cfgsinput queue configurations
[in]nCfgsNumber of configurations in cfgs[] (for overrun check)
Return values:
Success- QMSS_QOS_SCHED_RETCODE_SUCCESS
Failure- The following errors are detected by the firmware: QMSS_QOS_SCHED_INVALID_INDEX
The following errors are detected by the LLD: QMSS_QOS_SCHED_INVALID_PORT QMSS_QOS_SCHED_INVALID_PARAM QMSS_QOS_SCHED_REQ_DROP_SCHED

Description
This function is used to retrieve the current configuration of a QoS scheduler port. It sends a command to the firmware which copies the configuration from the active area to the shadow area (the active area continues to run!)

This function can be used either for diagnostic purposes to verify the configuration, or to query the current configuration, modify it, and put it back using Qmss_putCfgQosSchedPort.

Parameters:
[in]portPort to query - Valid range is 0 to QMSS_QOS_SCHED_MAX_PHYS_PORTS (if build is qos scheduler) or 0 to QMSS_QOS_SCHED_DROP_SCHED_MAX_PHYS_PORTS (if build is with drop scheduler)
[out]cfgPort configuration parameters
Return values:
Success- QMSS_QOS_SCHED_RETCODE_SUCCESS
Failure- The following errors are detected by the firmware: QMSS_QOS_SCHED_INVALID_INDEX
The following errors are detected by the LLD: QMSS_QOS_SCHED_INVALID_PORT QMSS_QOS_SCHED_INVALID_PARAM
static Qmss_QueueHnd Qmss_getHandleFromQID ( uint32_t  QID) [inline, static]

Description
This function returns Queue Handle associated with a QID. A QID is a 14 or 16 bit number used by other hardware.

No checking is performed on whether this context is allowed to use the generated handle resource.

Parameters:
[in]QID14 or 16 bit QID.
Return values:
Queuehandle

Description
This function is used to obtain the QMSS memory region configuration. The function returns the descriptor base address, descriptor size and the number of descriptors for each configured memory region.

Parameters:
[out]memRegInfoPointer to the memory region configuration structure allocated by caller.
Precondition:
Qmss_init function should be called before calling this function.
Return values:
Success- QMSS_SOK
Failure- QMSS_INVALID_PARAM
Failure- QMSS_NOT_INITIALIZED
static uint32_t Qmss_getQIDFromHandle ( Qmss_QueueHnd  hnd) [inline, static]

Description
This function returns Queue ID that can be used with other hardware that request a 14 or 16 bit QID.

Parameters:
[in]hndQueue handle.
Return values:
QID
uint32_t Qmss_getQosFwVersion ( void  )

Description
The function is used to get the version information of the current QoS scheduler firmware running on the PDSP.

Return values:
VersionInformation.
Qmss_Result Qmss_getQosQueueBase ( uint32_t *  queueNum)

Description
This function is used to get the QoS ingress base queue number. The QoS ingress queue are restricted to a set of 32 starting at a fixed base which must be a multiple of 32.

**No validation is done on the input parameters**.

Parameters:
[out]queueNumBase queue number
Return values:
Success- QCMD_RETCODE_SUCCESS
Failure- Command buffer return status - QMSS_QCMD_INVALID_COMMAND, QMSS_QCMD_INVALID_INDEX, QMSS_QCMD_INVALID_OPTION

Description
This function is used to get the number of packets dropped due to congestion

Parameters:
[in]queIndexIndex of the queue whose stats are to be read - Valid range is 0 to 31
Return values:
Success- Dropped packet count
Failure- QMSS_QCMD_INVALID_INDEX

Description
This function is used to get the number of packets forwarded to the ergress queue

Parameters:
[in]queIndexIndex of the queue whose stats are to be read - Valid range is 0 to 31
Return values:
Success- Forwarded packet count
Failure- QMSS_QCMD_INVALID_INDEX

Description
This function is used to get the drop scheduler ingress base queue number. The drop scheduler ingress queue are restricted to a set of 32 starting at a fixed base which must be a multiple of 32.

**No validation is done on the input parameters**.

Parameters:
[out]queueNumBase queue number
Return values:
Success- QMSS_QOS_SCHED_RETCODE_SUCCESS
Failure- Command buffer return status - QMSS_QOS_SCHED_INVALID_COMMAND, QMSS_QOS_SCHED_INVALID_INDEX, QMSS_QOS_SCHED_INVALID_OPTION
Qmss_Result Qmss_getQosSchedDropSchedStats ( Qmss_QosSchedDropSchedStats stats,
uint32_t  port,
uint32_t  block,
uint32_t  which_reset 
)

Description
This function returns the bytes and packets forwarded and discarded by the drop scheduler. The statistics are synchronously and atomically collected and reset.

Parameters:
[out]statsStatistics structure to contain returned stats. NULL is valid in order to reset and discard the stats.
[in]portPort to request stats - Must be 0.
[in]blockWhich stats block to query/reset
[in]which_resetBitfield listing the stats to reset. Can be one or more of QMSS_QOS_SCHED_STATS_FORWARDED_BYTES | QMSS_QOS_SCHED_STATS_FORWARDED_PACKETS | QMSS_QOS_SCHED_STATS_DISCARDED_BYTES | QMSS_QOS_SCHED_STATS_DISCARDED_PACKETS
Return values:
Success- QMSS_QOS_SCHED_RETCODE_SUCCESS
FailureThe following errors are detected by the firmware: QMSS_QOS_SCHED_INVALID_INDEX
The following errors are detected by the LLD: QMSS_QOS_SCHED_REQ_DROP_SCHED, QMSS_QOS_SCHED_INVALID_PORT, QMSS_QOS_SCHED_INVALID_PARAM
uint32_t Qmss_getQosSchedFwMagic ( void  )

Description
The function is used to get the version information of the current QoS scheduler firmware running on the PDSP.

Return values:
VersionInformation.
uint32_t Qmss_getQosSchedFwVersion ( void  )

Description
The function is used to get the version information of the current QoS scheduler firmware running on the PDSP.

Return values:
VersionInformation.
Qmss_Result Qmss_getQosSchedQueueBase ( uint32_t *  queueNum)

Description
This function is used to get the QoS ingress base queue number. The QoS ingress queue are restricted to a set of 32 starting at a fixed base which must be a multiple of 32.

**No validation is done on the input parameters**.

Parameters:
[out]queueNumBase queue number
Return values:
Success- QMSS_QOS_SCHED_RETCODE_SUCCESS
Failure- Command buffer return status - QMSS_QOS_SCHED_INVALID_COMMAND, QMSS_QOS_SCHED_INVALID_INDEX, QMSS_QOS_SCHED_INVALID_OPTION
Qmss_Result Qmss_getQosSchedStats ( Qmss_QosSchedStats stats,
uint32_t  port,
uint32_t  group,
uint32_t  queue,
uint32_t  which_reset 
)

Description
This function returns the bytes and packets forwarded and discarded by the port. The statistics are synchronously and atomically collected and reset.

Parameters:
[out]statsStatistics structure to contain returned stats. NULL is valid in order to reset and discard the stats.
[in]portPort to request stats - Valid range is 0 to QMSS_QOS_SCHED_MAX_PHYS_PORTS (if build is qos scheduler) or 0 to QMSS_QOS_SCHED_DROP_SCHED_MAX_PHYS_PORTS (if build is with drop scheduler)
[in]groupGroup to request stats - Valid range is 0 to 4
[in]queueQueue in group to request stats - Valid range is 0 to 7
[in]which_resetBitfield listing the stats to reset. Can be one or more of QMSS_QOS_SCHED_STATS_FORWARDED_BYTES | QMSS_QOS_SCHED_STATS_FORWARDED_PACKETS | QMSS_QOS_SCHED_STATS_DISCARDED_BYTES | QMSS_QOS_SCHED_STATS_DISCARDED_PACKETS
Return values:
Success- QMSS_QOS_SCHED_RETCODE_SUCCESS
FailureThe following errors are detected by the firmware: QMSS_QOS_SCHED_INVALID_INDEX
The following errors are detected by the LLD: QMSS_QOS_SCHED_INVALID_PORT QMSS_QOS_SCHED_INVALID_GROUP QMSS_QOS_SCHED_INVALID_QUEUE
static uint32_t Qmss_getQueueByteCount ( Qmss_QueueHnd  hnd) [inline, static]

Description
This function returns the total number of bytes that are contained in all of the packets that are currently queued on the queue.

Parameters:
[in]hndQueue handle.
Precondition:
Qmss_queueOpen function should be called before calling this function.
Return values:
Queuebyte count
static uint32_t Qmss_getQueueEntryCount ( Qmss_QueueHnd  hnd) [inline, static]

Description
This function returns the number of packets that are currently queued on the queue.

Parameters:
[in]hndQueue handle.
Precondition:
Qmss_queueOpen function should be called before calling this function.
Return values:
Queueentry count
uint32_t Qmss_getQueueGroup ( Qmss_QueueHnd  hnd)

Description
Given the queue handle the function returns the queue manager group containing the queue. This can be used to allocate other queues in the same group as a particular handle. This is required if it is necessary to use Qmss_queueDivert on the pair of queues.

Parameters:
[in]hndQueue handle
Return values:
Queuegroup

Description
Given the queue manager and queue number within the queue manager the function returns the corresponding queue handle

Parameters:
[in]queueQueue Manager number and Queue Number within the Queue Manager
Return values:
Queuehandle corresponding to the queue manager and queue number

Description
Given the queue handle the function returns the queue manager and queue number within the queue manager corresponding to the handle

Parameters:
[in]hndQueue handle
Return values:
QueueManager and Queue Number within the Queue Manager
static uint32_t Qmss_getQueuePacketSize ( Qmss_QueueHnd  hnd) [inline, static]

Description
This function returns the packet size of the packet queued at the head of the queue.

Parameters:
[in]hndQueue handle.
Precondition:
Qmss_queueOpen function should be called before calling this function.
Return values:
Queuepacket size
static Qmss_QueuePushHnd Qmss_getQueuePushHandle ( Qmss_QueueHnd  hnd) [inline, static]

Description
Given the queue handle the function returns the address of queue management register D. register D is used to write the descriptor address during a queue push operation.

The D register is available through "data" space and is retrievable using this API. It is also available through config address space, which is available through Qmss_getQueuePushHandleCfg. Please check device errata document for usage advisories for each address.

Parameters:
[in]hndQueue handle
Return values:
4byte memory address.

Description
Given the queue handle the function returns the address of queue management register D. register D is used to write the descriptor address during a queue push operation.

The D register is available through "data" space and is retrievable using Qmss_getQueuePushHandle. It is also available through config address space, which is available with this API. Please check device errata document for usage advisories for each address.

Parameters:
[in]hndQueue handle
Return values:
4byte memory address.

Description
This function returns the threshold at which the queue threshold pin is asserted

Parameters:
[in]hndQueue handle.
Precondition:
Qmss_queueOpen function should be called before calling this function.
Return values:
Queuethreshold

Description
This function returns the threshold status of the queue. There are 2 conditions under which the threshold bit is set

The threshold bit is set for a queue if the number of element in a queue is above or below a certain threshold number of items configured using Qmss_setQueueThreshold() API.

The threshold bit is set for a queue if there is atleast 1 element on the queue when the threshold is not set Qmss_setQueueThreshold() API

Parameters:
[in]hndQueue handle.
Precondition:
Qmss_queueOpen function should be called before calling this function.
Return values:
0- Configured threshold is not met
1- Configured threshold is met

Description
The starvation count is incremented every time the Free Descriptor/Buffer queue is read when empty. This function returns the starvation count of queue.

Parameters:
[in]hndQueue handle.
Precondition:
Qmss_queueOpen function should be called before calling this function.
Return values:
8bit Starvation count
void Qmss_getStarvationCounts ( Qmss_QueueHnd  hnd,
uint32_t  numCounts,
uint32_t *  pStarvationCounts 
)

Description
API to return a group of 4 starvation count available in the group

Note: if handle is unaligned to 4 queues, it will be aligned. Thus if hnd%4 = 2, the requested result will be in pStarvationCounts[2], not pStarvationCounts[0].

Parameters:
[in]hndQueue handle. Number of starvation counts from the group Array of starvation counts. Max 4
[in]numCountsMaximum number of elements in pStarvationCounts
[out]pStarvationCountsArray of starvation counts (return value)
Precondition:
Qmss_queueOpen function should be called before calling this function.
Return values:
None
uint32_t Qmss_getVersion ( void  )

Description
The function is used to get the version information of the QMSS LLD.

Return values:
VersionInformation.
const char* Qmss_getVersionStr ( void  )

Description
The function is used to get the version string for the QMSS LLD.

Return values:
VersionString.
Qmss_Result Qmss_init ( Qmss_InitCfg initCfg,
Qmss_GlobalConfigParams qmssGblCfgParams 
)

Description
This function initializes the Queue Manager subsystem low level driver This function is called once in the system to setup the queue manager low level driver with information pertaining to linking RAM and descriptor memory region.

Parameters:
[in]initCfgInitialization structure that contains memory region configuration information. Linking RAM memory address should be a global address
[in]qmssGblCfgParamsInitialization structure that contains the QMSS device specific information.
Postcondition:
QMSS instance is created.
Return values:
Success- QMSS_SOK
Failure- QMSS_INVALID_PARAM
Failure- QMSS_RESOURCE_LINKING_RAM_INIT_DENIED
Failure- QMSS_QM_CONTROL_DENIED
Qmss_QueueHnd Qmss_initDescriptor ( Qmss_DescCfg descCfg,
uint32_t *  numAllocated 
)

Description
This function is used to obtain previously allocated descriptors. The function opens a destination queue as specified in the input parameters and pushes the requested number of descriptors if available onto it.

Parameters:
[in]descCfgSpecifies the number of descriptors, memory region from where it should be allocated and the destination queue to push to.
[out]numAllocatedNumber of descriptors actually allocated.
Precondition:
Qmss_init function should be called before calling this function.
Return values:
Success- Destination queue handle on which the allocated descriptors are stored. The queue must be closed by the caller using Qmss_queueClose() when done.
Failure- QMSS_NOT_INITIALIZED
Failure- QMSS_INVALID_PARAM
Failure- QMSS_MEMREGION_NOT_INITIALIZED
Failure- QMSS_QUEUE_OPEN_ERROR
Failure- QMSS_RESOURCE_MEM_REGION_USE_DENIED

Description
This function is used to configure memory region at runtime. The function configures specified memory region with descriptor base address, descriptor size and the number of descriptors.

Parameters:
[out]memRegCfgPointer to the memory region configuration structure allocated by caller. Descriptor memory address should be a global address
Precondition:
Qmss_init function should be called before calling this function. Memory Region specified should not have been configured before.
Return values:
Success- Inserted Memory region index. Range is 0 to 63.
Failure- QMSS_INVALID_PARAM
Failure- QMSS_NOT_INITIALIZED
Failure- QMSS_MEMREGION_ALREADY_INITIALIZED
Failure- QMSS_MEMREGION_INVALID_PARAM
Failure- QMSS_MAX_DESCRIPTORS_CONFIGURED
Failure- QMSS_MEMREGION_INVALID_INDEX
Failure- QMSS_MEMREGION_OVERLAP
Failure- QMSS_QUEUE_OPEN_ERROR
Failure- QMSS_RESOURCE_MEMORY_REGION_INIT_DENIED
Failure- QMSS_RESOURCE_LINKING_RAM_INIT_DENIED
static Qmss_Result Qmss_internalCheckLinkingRAM ( Qmss_LinkingRAM linkingRAM) [static]

Description
Internal function to validate linking RAM configuration for each queue manager group

Return values:
Success- QMSS_SOK
Failure- QMSS_INVALID_PARAM
static int32_t Qmss_internalFindQueueType ( uint32_t  queNum) [static]

Description
Internal function get the queue type of a specified queue

static void Qmss_internalInsertLinkingRAM ( uint32_t  group,
Qmss_LinkingRAM linkingRAM,
uint32_t *  actSize 
) [static]

Description
Internal function to program linking RAM configuration for each queue manager group

static void Qmss_internalUpdateGroupControl ( uint32_t  qGroup,
int  sign 
) [static]

Description
Internal function to increment or decrement the number of queues open in each group.

Qmss_AccChHandle Qmss_openAccumulatorCh ( Qmss_PdspId  pdspId,
uint8_t  channel 
)

Description
This function programs the accumulator with values passed in the cfg structure

Parameters:
[in]pdspIdAccumulator to open Qmss_PdspId_PDSP1..8 selects firmware downloaded to PDSP 1 to 8.
[in]channelChannel number within accumulator to open
Postcondition:
Handle is returned, and channel is allocated to current context if a resource manager is in use.
Return values:
Handle
Success>= 0 (handle is returned)
Failure- QMSS_NOT_INITIALIZED
Failure= QMSS_RESOURCE_ALLOCATE_INIT_DENIED
Failure< 0

Description
This function programs the accumulator with values passed in the cfg structure

Parameters:
[in]pdspIdAccumulator to program Qmss_PdspId_PDSP1 selects firmware downloaded to PDSP 1 Qmss_PdspId_PDSP2 selects firmware downloaded to PDSP 2
[in]cfgInitialization structure that contains accumulator configurable fields
Postcondition:
Accumulator channel is programmed and channel is alocated from resource managere (if present)

This combines the operation of allocating the channel from the resource manager (if any), and configuring it. These features can be accessed separately by using Qmss_openAccumulatorCh and Qmss_cfgAccumulatorCh. In applications where the accumulator is reconfigured "on the fly", separateing open/close (and calling from outside realtime code) will reduce the latency of config/stop (when called in realtime code).

Return values:
Valuereported by accumulator
Success- QMSS_ACC_SOK
Failure- QMSS_NOT_INITIALIZED
Failure- QMSS_INVALID_PARAM
Failure= QMSS_RESOURCE_ALLOCATE_INIT_DENIED
Failure- Accumulator status - QMSS_ACC_IDLE, QMSS_ACC_INVALID_COMMAND, QMSS_ACC_INVALID_CHANNEL, QMSS_ACC_CHANNEL_NOT_ACTIVE, QMSS_ACC_CHANNEL_ALREADY_ACTIVE, QMSS_ACC_INVALID_QUEUE_NUMBER

Description
The Accumulator firmware supports an optional diversion queue which can be used remotely cause a queue diversion. When enabled, any descriptor placed on the diversion queue will be loaded, and its Timestamp field will be written to the QM diversion register. The descriptor pointer will then be pushed onto the diversion completion queue.

Setting the diversion queue to ‘0’ disables diversion queue monitoring. The firmware initializes with a default diversion queue of ‘0’ (disabled).

Parameters:
[in]pdspIdAccumulator to program Qmss_PdspId_PDSP1 selects firmware downloaded to PDSP 1 Qmss_PdspId_PDSP2 selects firmware downloaded to PDSP 2
[in]divQDiversion queue handle. This is the queue which is monitored for diversion requests
[in]divCompletionQReturn queue handle. After diversion request is completed, the descriptor is returned in this queue.
Postcondition:
Diversion queue is configured.
Return values:
Valuereported by accumulator
Success- QMSS_ACC_SOK
Failure- QMSS_NOT_INITIALIZED
Failure- QMSS_INVALID_PARAM
Failure- Accumulator status - QMSS_ACC_IDLE, QMSS_ACC_INVALID_COMMAND

Description

The Accumulator firmware also supports an optional reclamation queue which can be used for packet discards. Any descriptor placed on the reclamation queue will be recycled in the same manner as if it had been submitted to CDMA.

The descriptor packet information field is used to determine the return queue and the return handling, including options to unlink host descriptors and push to either the front or the back of the return queue. Setting queue to zero disables the reclamation feature

Parameters:
[in]pdspIdAccumulator to program Qmss_PdspId_PDSP1 selects firmware downloaded to PDSP 1 Qmss_PdspId_PDSP2 selects firmware downloaded to PDSP 2
[in]hndReclamation queue number
Postcondition:
Reclamation queue is configured.
Return values:
Valuereported by accumulator
Success- QMSS_ACC_SOK
Failure- QMSS_NOT_INITIALIZED
Failure- Accumulator status - QMSS_ACC_IDLE, QMSS_ACC_INVALID_COMMAND

Description
This function is used to configure the drop scheduler top level config. The configuration operates on a shadow configuration such that the configuration can occur whether or not the drop scheduler is enabled.

The entire configuration must be specified. If unknown the previous config can be retrieved with Qmss_getCfgQosSchedDropSchedCfg then modified.

This function copies the new configuration to the shadow area, then sends a command to the firmware to accept the change. This minimizes network downtime during reconfiguration.

Parameters:
[in]portDrop Scheduler instance (must be 0)
[in]pCfgDrop scheduler top level config
Return values:
Success- QMSS_QOS_SCHED_RETCODE_SUCCESS
Failure- The following errors are detected by the firmware: QMSS_QOS_SCHED_INVALID_INDEX
The following errors are detected by the LLD: QMSS_QOS_SCHED_INVALID_PORT QMSS_QOS_SCHED_REQ_DROP_SCHED QMSS_QOS_SCHED_INVALID_VALID_FLAG QMSS_QOS_SCHED_INVALID_QOS_TICKS QMSS_QOS_SCHED_INVALID_DROP_TICKS QMSS_QOS_SCHED_INVALID_INTNUM QMSS_QOS_SCHED_INVALID_PARAM
Qmss_Result Qmss_putCfgQosSchedDropSchedCfgProfs ( uint32_t  port,
Qmss_QosSchedDropSchedCfgProf profs,
int32_t  nProfs 
)

Description
This function is used to configure the drop scheduler config profiles. The configuration operates on a shadow configuration such that the configuration can occur whether or not the drop scheduler is enabled.

The entire configuration must be specified. If unknown the previous config can be retrieved with Qmss_getCfgQosSchedDropSchedCfgProfs then modified.

This function copies the new configuration to the shadow area, then sends a command to the firmware to accept the change. This minimizes network downtime during reconfiguration.

Parameters:
[in]portDrop Scheduler instance (must be 0)
[in]profsconfig profiles
[in]nProfsNumber of profiles in profs[] (for overrun check)
Return values:
Success- QMSS_QOS_SCHED_RETCODE_SUCCESS
Failure- The following errors are detected by the firmware: QMSS_QOS_SCHED_INVALID_INDEX
The following errors are detected by the LLD: QMSS_QOS_SCHED_INVALID_PORT QMSS_QOS_SCHED_INVALID_PARAM QMSS_QOS_SCHED_REQ_DROP_SCHED QMSS_QOS_SCHED_INVALID_DROP_MODE QMSS_QOS_SCHED_INVALID_RED_TC QMSS_QOS_SCHED_INVALID_RED_THRESH QMSS_QOS_SCHED_INVALID_RED_THRESH_RECIP
Qmss_Result Qmss_putCfgQosSchedDropSchedOutProfs ( uint32_t  port,
Qmss_QosSchedDropSchedOutProf profs,
int32_t  nProfs 
)

Description
This function is used to configure the drop scheduler output profiles. The configuration operates on a shadow configuration such that the configuration can occur whether or not the drop scheduler is enabled.

The entire configuration must be specified. If unknown the previous config can be retrieved with Qmss_getCfgQosSchedDropSchedOutProfs then modified.

This function copies the new configuration to the shadow area, then sends a command to the firmware to accept the change. This minimizes network downtime during reconfiguration.

Parameters:
[in]portDrop Scheduler instance (must be 0)
[in]profsoutput profiles
[in]nProfsNumber of profiles in profs[] (for overrun check)
Return values:
Success- QMSS_QOS_SCHED_RETCODE_SUCCESS
Failure- The following errors are detected by the firmware: QMSS_QOS_SCHED_INVALID_INDEX
The following errors are detected by the LLD: QMSS_QOS_SCHED_INVALID_PORT QMSS_QOS_SCHED_INVALID_PARAM QMSS_QOS_SCHED_REQ_DROP_SCHED QMSS_QOS_SCHED_INVALID_VALID_FLAG QMSS_QOS_SCHED_INVALID_CFG_PROF_IDX
Qmss_Result Qmss_putCfgQosSchedDropSchedQueCfgs ( uint32_t  port,
Qmss_QosSchedDropSchedQueCfg cfgs,
int32_t  nCfgs 
)

Description
This function is used to configure the drop scheduler input queue configs. The configuration operates on a shadow configuration such that the configuration can occur whether or not the drop scheduler is enabled.

The entire configuration must be specified. If unknown the previous config can be retrieved with Qmss_getCfgQosSchedDropSchedQueCfgs then modified.

This function copies the new configuration to the shadow area, then sends a command to the firmware to accept the change. This minimizes network downtime during reconfiguration.

Parameters:
[in]portDrop Scheduler instance (must be 0)
[in]cfgsinput queue configurations
[in]nCfgsNumber of configurations in cfgs[] (for overrun check)
Return values:
Success- QMSS_QOS_SCHED_RETCODE_SUCCESS
Failure- The following errors are detected by the firmware: QMSS_QOS_SCHED_INVALID_INDEX
The following errors are detected by the LLD: QMSS_QOS_SCHED_INVALID_PORT QMSS_QOS_SCHED_INVALID_PARAM QMSS_QOS_SCHED_REQ_DROP_SCHED QMSS_QOS_SCHED_INVALID_VALID_FLAG QMSS_QOS_SCHED_INVALID_STATS_BLOCK_IDX QMSS_QOS_SCHED_INVALID_OUT_PROF_IDX

Description
This function is used to configure a QoS scheduler port. The configuration operates on a shadow configuration such that the configuration can occur whether or not the port is enabled.

The entire configuration must be specified. If unknown the previous config can be retrieved with Qmss_getCfgQosSchedPort then modified.

This function copies the new configuration to the shadow area, then sends a command to the firmware to accept the change. This minimizes network downtime during reconfiguration.

If the queues or groups are renumbered by changing counts, the descriptors are left in the original queues. Thus if renumbering is needed, it is suggested to disable the port before reconfiguring. If only the credits are changed, the reconfiguration should be done with the port enabled.

Parameters:
[in]portPort to configure - Valid range is 0 to QMSS_QOS_SCHED_MAX_PHYS_PORTS (if build is qos scheduler) or 0 to QMSS_QOS_SCHED_DROP_SCHED_MAX_PHYS_PORTS (if build is with drop scheduler)
[in]cfgPort configuration parameters
Return values:
Success- QMSS_QOS_SCHED_RETCODE_SUCCESS
Failure- The following errors are detected by the firmware: QMSS_QOS_SCHED_INVALID_INDEX
The following errors are detected by the LLD: QMSS_QOS_SCHED_INVALID_PORT QMSS_QOS_SCHED_INVALID_GROUP QMSS_QOS_SCHED_INVALID_QUEUE QMSS_QOS_SCHED_INVALID_WRRTYPE QMSS_QOS_SCHED_INVALID_CIRTYPE QMSS_QOS_SCHED_INVALID_CONGTYPE QMSS_QOS_SCHED_INVALID_QUEUE_NUM QMSS_QOS_SCHED_INVALID_PARAM
Qmss_Result Qmss_qosSchedDropSchedPushProxy ( Qmss_QueueHnd  hnd,
void *  descAddr,
uint32_t  packetSize,
uint32_t  descSize,
Qmss_Location  location 
)

Description

This function pushes a descriptor onto a queue specified by the queue handle using a proxy function that is part of qos scheduler with drop scheduler. This can be used on architectures which cannot do atomic 64 bit writes AND whose hardware queue proxy isn't working. Most code need not use this functions such as those running on c66x which can do atomic 64 bit write (and instead shouls use Qmss_queuePush()).

The "descSize" is used to specify the size of the descriptor being pushed. The optional parameter "packetSize" is used specify the size of packet during pop operation. The optional parameter "location" is used to override the default(tail) and push the packet to the head of the queue.

**No validation is done on the input parameters**.

Parameters:
[in]hndQueue handle.
[in]descAddrMemory address of the descriptor. Should be a global address.
[in]packetSizeSize of packet pointed to by the descriptor.
[in]descSizeSize of the descriptor. Minimum size is 16 bytes. Maximum size is 256 bytes
[in]location0 - Tail. 1 - Head
Precondition:
Qmss_queueOpen function should be called before calling this function.
Return values:
None
Qmss_QueueHnd Qmss_queueBlockOpen ( Qmss_QueueHnd queueHnds,
Qmss_QueueType  queType,
int32_t  numQ,
int32_t  align 
)

Description
This function opens a contiguous block of queues of type queType aligned to align in queue group 0. This API may fail even if sufficient queues are available due to fragmentation; thus it should be called soon after boot.

Parameters:
[out]queueHndsList of queue handles. This must be pre-allocated to at least numQ entries.
[in]queTypeSpecifies the type of queues that should be opened.
[in]numQSpecifies the number of queues that should be opened
[in]alignQueue number of first queue shall be such that queue number % align == 0.
Return values:
Success- Queue Handle of first queue
Failure- QMSS_RESOURCE_ALLOCATE_USE_DENIED
Failure- <0
Qmss_QueueHnd Qmss_queueBlockOpenInGroup ( Qmss_QueueHnd queueHnds,
int32_t  queGroup,
Qmss_QueueType  queType,
int32_t  numQ,
int32_t  align 
)

Description
This function opens a contiguous block of queues of type queType aligned to align. This API may fail even if sufficient queues are available due to fragmentation; thus it should be called soon after boot.

Parameters:
[out]queueHndsList of queue handles. This must be pre-allocated to at least numQ entries.
[in]queGroupSpecifies the queue manager group to find a queue. This must be specified in SPLIT mode. It may be specified (not QMSS_PARAM_NOT_SPECIFIED) in JOINT mode to allocate a queue in the same group as another queue.
[in]queTypeSpecifies the type of queues that should be opened.
[in]numQSpecifies the number of queues that should be opened
[in]alignQueue number of first queue shall be such that queue number % align == 0.
Return values:
Success- Queue Handle of first queue
Failure- QMSS_RESOURCE_ALLOCATE_USE_DENIED
Failure- <0

Description
This function closes a queue. The queue reference count is decremented. The queue is freed only if the reference count is zero.

Parameters:
[in]hndQueue handle.
Precondition:
Qmss_queueOpen function should be called before calling this function.
Postcondition:
Queue is freed if the reference count is zero and available for reallocation.
Return values:
Success- Current reference count.
Failure- QMSS_INVALID_PARAM
static Qmss_Result Qmss_queueDivert ( Qmss_QueueHnd  srcQnum,
Qmss_QueueHnd  dstQnum,
Qmss_Location  location 
) [inline, static]

Description
This function diverts the entire content of source queue to the destination queue. "location" indicates whether the contents should be merged on to the head or tail of the destination queue.

Parameters:
[in]srcQnumSource queue handle.
[in]dstQnumDestination queue handle.
[in]locationHead/Tail.
Precondition:
Qmss_queueOpen function for source queue and destination queue should be called before calling this function.
Postcondition:
Contents of source queue is moved to the destination queue. Source queue is empty.
Return values:
Failure- QMSS_INVALID_PARAM - queues are in different groups
Success- QMSS_SOK
static void Qmss_queueEmpty ( Qmss_QueueHnd  hnd) [inline, static]

Description
This function deletes all the contents of the queue.

Parameters:
[in]hndQueue handle.
Precondition:
Qmss_queueOpen function should be called before calling this function.
Postcondition:
Queue is empty
Return values:
None
Qmss_QueueHnd Qmss_queueOpen ( Qmss_QueueType  queType,
int32_t  queNum,
uint8_t *  isAllocated 
)

Description
This function opens the requested queue from queue group 0. For additional details, see Qmss_queueOpenInGroup.

When operating in SPLIT mode, this function will allocate the queue from group 0. To use other groups, must use Qmss_queueOpenInGroup.

When operating in JOINT mode, this function provides load balancing using the configured load balancing mode.

Return values:
Success- Queue Handle. Used as an input parameter for operation on this queue.
Failure- <0
Qmss_QueueHnd Qmss_queueOpenInGroup ( int32_t  queGroup,
Qmss_QueueType  queType,
int32_t  queNum,
uint8_t *  isAllocated 
)

Description
This function opens the requested queue. A queue can be opened in two ways: 1) If "queNum" is set to QMSS_PARAM_NOT_SPECIFIED, then a new available queue of type "queType" is allocated. 2) If "queNum" is a valid queue number i.e., >= 0, then a queue is allocated if free else a handle to a previously opened queue is returned. In this case "queType" parameter is not used.

Parameters:
[in]queGroupSpecifies the queue manager group to find a queue. This must be specified in SPLIT mode. It may be specified (not QMSS_PARAM_NOT_SPECIFIED) in JOINT mode to allocate a queue in the same group as another queue.
[in]queTypeSpecifies the type of queue that should be opened.
[in]queNumSpecifies the queue number that should be opened.
[out]isAllocatedIndicates whether the requested queue is a new queue allocation(1). or was already allocated. If the queue was previously allocated this parameter returns the reference count.
Return values:
Success- Queue Handle. Used as an input parameter for operation on this queue.
Failure- QMSS_RESOURCE_ALLOCATE_USE_DENIED
Failure- <0
Qmss_QueueHnd Qmss_queueOpenInRange ( uint32_t  startQueNum,
uint32_t  endQueNum,
uint8_t *  isAllocated 
)

Description
This function opens the requested queue if a free queue is avialable within the given start and end range.

Parameters:
[in]startQueNumSpecifies the start of the queue number range.
[in]endQueNumSpecifies the end of the queue number range.
[out]isAllocatedIndicates whether the requested queue is a new queue allocation(1). or was already allocated. If the queue was previously allocated this parameter returns the reference count.
Return values:
Success- Queue Handle. Used as an input parameter for operation on this queue.
Failure- <0
Qmss_QueueHnd Qmss_queueOpenUse ( uint32_t  QID,
uint8_t *  useCount 
)

Description
This function opens the specified queue if and only if it is already open elsewhere. OpenUse means "open to use queue already allocated by someone else".

Parameters:
[in]QIDSpecifies the queue number that should be opened.
[out]useCountReference count, which must be >= 2.
Return values:
Success- Queue Handle
Failure- QMSS_RESOURCE_ALLOCATE_USE_DENIED Failure - QMSS_QUEUE_NOT_ALREADY_OPEN
Failure- <0
static void* Qmss_queuePop ( Qmss_QueueHnd  hnd) [inline, static]

Description
This function pop's a descriptor off the queue specified by the queue handle.

The lower 4 bits of the descriptor address contain the size of the descriptor that was specified during the queue push operation. Caller should mask the lower order 4 bits before using the descriptor.

**No validation is done on the input parameters**

Parameters:
[in]hndQueue handle.
Precondition:
Qmss_queueOpen function should be called before calling this function.
Return values:
Success- Descriptor address and size
0- If queue is empty
static void Qmss_queuePopDescSize ( Qmss_QueueHnd  hnd,
void **  descAddr,
uint32_t *  packetSize 
) [inline, static]

Description
This function pop's a descriptor off the queue specified by the queue handle. It also returns the packet size of the popped decriptor. The packet size is available only if it was specified during the push operation.

If the processor supports atomic 64 bit reads, then this can pop via proxy or via non proxy without critical section or other issues.

If processor doesn't support 64 bit reads, then a critical section is required if multiple readers can pop the same queue.

Special protection is also needed to make sure reg C isn't read on an empty queue, and reg D read once a descriptor comes in. This can be done externally by checking Qmss_getQueueEntryCount before popping.

The packet size field is part of the descriptor and should be used to ensure correctness.

The lower 4 bits of the descriptor address contain the size of the descriptor that was specified during the queue push operation. Caller should mask the lower order 4 bits before using the descriptor.

**No validation is done on the input parameters**

Parameters:
[in]hndQueue handle.
[out]descAddrDescriptor address and size.
[out]packetSizePacket size in bytes.
Precondition:
Qmss_queueOpen function should be called before calling this function.
Return values:
None
static void* Qmss_queuePopRaw ( Qmss_QueueHnd  hnd) [inline, static]

Description
This function pop's a descriptor off the queue specified by the queue handle.

The lower 4 bits of the descriptor address contain the size of the descriptor that was specified during the queue push operation. Caller should mask the lower order 4 bits before using the descriptor.

Address translation is not performed on the descriptor before the return. In order to have address translation done, use Qmss_queuePop

The primary reason for use of this API is for highly optimized applications that manage their own address translation (virtual memory). Normal SW should use Qmss_queuePop instead.

Parameters:
[in]hndQueue handle.
Precondition:
Qmss_queueOpen function should be called before calling this function.
Return values:
Success- Descriptor address and size
0- If queue is empty
static void Qmss_queuePush ( Qmss_QueueHnd  hnd,
void *  descAddr,
uint32_t  packetSize,
uint32_t  descSize,
Qmss_Location  location 
) [inline, static]

Description
This function pushes a descriptor onto a queue specified by the queue handle. The "descSize" is used to specify the size of the descriptor being pushed. The optional parameter "packetSize" is used specify the size of packet during pop operation. The optional parameter "location" is used to override the default(tail) and push the packet to the head of the queue.

**No validation is done on the input parameters**.

This function has some special considerations regarding critical section/mutex:

  1. On c66x no mutex is ever needed, since it supports 64-bit stores. This is true whether or not a proxy is used. Thus "#ifdef _TMS320C6600" is used to save cycles that would be spent calling an empty critical section.
  2. On other processors such as ARM, it may not support 64-bit stores. Thus
    1. A proxy must be used to merge together the 32-bit stores
    2. a critical section/mutex is needed to protect from both threads and other cores who are trying to push to the same queue. If QoS scheduler with drop scheduler is in use, it has a push proxy that can be used if errata prevent the use of the HW proxy. Please see Qmss_qosSchedDropSchedPushProxy.
Parameters:
[in]hndQueue handle.
[in]descAddrMemory address of the descriptor. Should be a global address.
[in]packetSizeSize of packet pointed to by the descriptor.
[in]descSizeSize of the descriptor. Minimum size is 16 bytes. Maximum size is 256 bytes
[in]location0 - Tail. 1 - Head
Precondition:
Qmss_queueOpen function should be called before calling this function.
Return values:
None
static void Qmss_queuePushDesc ( Qmss_QueueHnd  hnd,
void *  descAddr 
) [inline, static]

Description
It pushes a descriptor onto a queue specified by the queue handle. Does not allow specifying optional parameters. The descriptor size is not written to the queue. This function should be used to push descriptors that will not be prefetched by the CPDMA.

Parameters:
[in]hndQueue handle.
[in]descAddrMemory address of the descriptor. Should be a global address.
Precondition:
Qmss_queueOpen function should be called before calling this function.
Return values:
None
static void Qmss_queuePushDescSize ( Qmss_QueueHnd  hnd,
void *  descAddr,
uint32_t  descSize 
) [inline, static]

Description
It pushes a descriptor onto a queue specified by the queue handle. Does not allow specifying optional parameters.

The "descSize" is used to specify the size of the descriptor being pushed. This function should be used to push descriptors that will be prefetched by the CPDMA.

**No validation is done on the input parameters**.

Parameters:
[in]hndQueue handle.
[in]descAddrMemory address of the descriptor. Should be a global address.
[in]descSizeSize of the descriptor. Minimum size is 16 bytes. Maximum size is 256 bytes
Precondition:
Qmss_queueOpen function should be called before calling this function.
Return values:
None
static void Qmss_queuePushDescSizeRaw ( Qmss_QueueHnd  hnd,
void *  descAddr,
uint32_t  descSize 
) [inline, static]

Description
It pushes a descriptor onto a queue specified by the queue handle. Does not allow specifying optional parameters.

The "descSize" is used to specify the size of the descriptor being pushed. This function should be used to push descriptors that will be prefetched by the CPDMA.

The raw version of the API doesn't perform any checks or address translation. The regular version, Qmss_queuePushDescSize, performs address translation on the descriptor before the push.

The primary reason for use of this API is for highly optimized applications that manage their own address translation (virtual memory). Normal SW should use Qmss_queuePushDescSize instead.

**No validation is done on the input parameters**.

Parameters:
[in]hndQueue handle.
[in]descAddrMemory address of the descriptor. Should be a global address.
[in]descSizeSize of the descriptor. Minimum size is 16 bytes. Maximum size is 256 bytes
Precondition:
Qmss_queueOpen function should be called before calling this function.
Return values:
None
Qmss_Result Qmss_removeMemoryRegion ( int32_t  region,
uint32_t  qGroup 
)

Description
This function is used to deconfigure memory region at runtime. The hardware region is set to NULL, and any associated queue is empted and closed.

Parameters:
[in]regionMemory region to clear (return value of Qmss_insertMemoryRegion)
[in]qGroupQueue group to clear region from (only used in split mode)
Precondition:
All descriptors must be discarded by application from all queues before using this function, or it will leave hw in unknown state.
Return values:
Success- QMSS_SOK
Failure- QMSS_INVALID_PARAM, QMSS_NOT_INITIALIZED
Qmss_Result Qmss_resetQosQueueStats ( uint32_t  queIndex)

Description
This function is used to reset the statistics(Forwarded and Dropped packet count) of a queue

Parameters:
[in]queIndexIndex of the queue whose stats are to be reset - Valid range is 0 to 31
Return values:
Success- QCMD_RETCODE_SUCCESS
Failure- QMSS_QCMD_INVALID_INDEX
Qmss_Result Qmss_setEoiIntNum ( uint8_t  intNum)

Description
Calls Qmss_setEoiIntNumByIntd with intdNum = 0 (for backwards compatibility)

Return values:
Success- QMSS_SOK
Failure- QMSS_NOT_INITIALIZED
Qmss_Result Qmss_setEoiIntNumByIntd ( uint8_t  intdNum,
uint8_t  intNum 
)

Description
This function sets the end of interrupt vector value for the specified interrupt. This API is used by the host to indicate host is done processing interrupt number intNum. This API is normally not used. See Qmss_setEoiVectorByIntd.

Parameters:
[in]intdNumWhich QMSS INTD to program
[in]intNumInterrupt number to program.
Postcondition:
EOI vector value is set indicating end of host interrupt processing.
Return values:
Success- QMSS_SOK
Failure- QMSS_NOT_INITIALIZED
Qmss_Result Qmss_setEoiVector ( Qmss_IntdInterruptType  type,
uint8_t  accumCh 
)

Description
Calls Qmss_setEoiVectorByIntd for the first intd in QMSS (for backwards compatibility).

Return values:
Success- QMSS_ACC_SOK
Failure- QMSS_NOT_INITIALIZED
Qmss_Result Qmss_setEoiVectorByIntd ( uint8_t  intdNum,
Qmss_IntdInterruptType  type,
uint8_t  accumCh 
)

Description
This function sets the end of interrupt vector value for the specified interrupt. This API is used by the host to indicate

  • The end of interrupt processing to the accumulator. The accumulator is then free to write to the accumulator ping/pong page released by the host.
  • The end of interrupt processing for buffer descriptor starvation event on receive SOP and MOP for any of the RX DMA units in the CDMA.
Parameters:
[in]intdNumWhich QMSS INTD to program. As this is a fast path API it is NOT bounds checked.
[in]typeInterrupt to program. Qmss_IntdInterruptType_HIGH selects the interrupts corresponding to the high priority accumulator Qmss_IntdInterruptType_LOW selects the interrupts corresponding to the low priority accumulator Qmss_IntdInterruptType_CDMA selects the interrupts corresponding to the low priority accumulator
[in]accumChAccumulator channel which is mapped to interrupt number via Qmss_xxxEoiVector mapping table. The resulting interrupt number is set.

**No validation is done to check if the interrupt number is within range to reduce overhead.**

Postcondition:
EOI vector value is set indicating end of host interrupt processing.
Return values:
Success- QMSS_ACC_SOK
Failure- QMSS_NOT_INITIALIZED
Qmss_Result Qmss_setQosQueueBase ( uint32_t  queueNum)

Description
This function is used to set the QoS ingress base queue number. The QoS ingress queue are restricted to a set of 64 starting at a fixed base which must be a multiple of 32.

Each device has a block of queues reserved for this purpose. It is defined in CSL as QMSS_TRAFFIC_SHAPING_QUEUE_BASE and QMSS_MAX_TRAFFIC_SHAPING_QUEUE.

On some devices, the QMSS_MAX_TRAFFIC_SHAPING_QUEUE may be limited to something less than 64. If more queues are needed, then the traffic shaping/QoS subsystem allows any range of general purpose queues used. In other words, QMSS_TRAFFIC_SHAPING_QUEUE_BASE is just a suggestion.

If general queues are used, they should be reserved through Qmss_queueOpen, similar to example code in test_descAlloc.c inside QOS_TEST.

**No validation is done on the input parameters**.

Parameters:
[in]queueNumBase queue number
Return values:
Success- QCMD_RETCODE_SUCCESS
Failure- Command buffer return status - QMSS_QCMD_INVALID_COMMAND, QMSS_QCMD_INVALID_INDEX, QMSS_QCMD_INVALID_OPTION,

Description
This function is used to set the drop scheduler ingress base queue number. The drop scheduler ingress queue are restricted to a set of 80 starting at a fixed base which must be a multiple of 32.

Parameters:
[in]queueNumBase queue number
Return values:
Success- QCMD_RETCODE_SUCCESS
Failure- Command buffer return status - QMSS_QOS_SCHED_INVALID_COMMAND, QMSS_QOS_SCHED_INVALID_INDEX, QMSS_QOS_SCHED_INVALID_OPTION
Qmss_Result Qmss_setQosSchedQueueBase ( uint32_t  queueNum)

Description
This function is used to set the QoS ingress base queue number. The QoS ingress queue are restricted to a set of 80 or 120 starting at a fixed base which must be a multiple of 32.

If the drop scheduler is present, then there are 80 queues arranged into 20 ports each of which has 1 group of 4 queues.

Otherwise, 120 queues are mapped into ports and groups. Assuming there are 8 queues per group and 5 groups per port the assignment is:

PortGroupAssigned Queues
00base + 0 - 7
01base + 8 -15
02base + 16-23
03base + 24-31
04base + 32-39
10base + 40-47
11base + 48-55
12base + 56-63
13base + 64-71
14base + 72-79
20base + 80-83
30base + 84-87
40base + 88-91
50base + 92-95
60base + 96-99
70base + 100-103
80base + 104-107
90base + 108-111
100base + 112-115
110base + 116-119

Each device has a block of queues reserved for this purpose. It is defined in CSL as QMSS_TRAFFIC_SHAPING_QUEUE_BASE and QMSS_MAX_TRAFFIC_SHAPING_QUEUE.

On some devices, the QMSS_MAX_TRAFFIC_SHAPING_QUEUE may be limited to something less than 80. If more queues are needed, then the traffic shaping/QoS subsystem allows any range of general purpose queues used. In other words, QMSS_TRAFFIC_SHAPING_QUEUE_BASE is just a suggestion.

If general queues are used, they should be reserved through Qmss_queueOpen, similar to example code in test_descAlloc.c inside QOS_TEST.

**No validation is done on the input parameters**.

Parameters:
[in]queueNumBase queue number
Return values:
Success- QCMD_RETCODE_SUCCESS
Failure- Command buffer return status - QMSS_QOS_SCHED_INVALID_COMMAND, QMSS_QOS_SCHED_INVALID_INDEX, QMSS_QOS_SCHED_INVALID_OPTION
Qmss_Result Qmss_setQueueThreshold ( Qmss_QueueHnd  hnd,
uint16_t  hilo,
uint8_t  threshold 
)

Description
This function sets the threshold at which the queue threshold pin is asserted and threshold bit in threshold status register is set. "hilo" indicates whether the number of items in the queue should be greater than/equal to OR less than the confgiured threshold value before the queue ecnt status bit is asserted and threshold bit in threshold status register is set. The threshold value is 10'h3ff when it is ten or higher. It is (2^threshold-1) for other values.

Parameters:
[in]hndQueue handle.
[in]hilo1 - High 0 - Low.
[in]thresholdThreshold value.
Precondition:
Qmss_queueOpen function should be called before calling this function.
Return values:
Qmss_Result
Qmss_Result Qmss_start ( void  )

Description
This function initializes the Queue Manager SubsSystem local object blocks in memory local to each core.

This function must be called atleast once for every core.

Precondition:
Qmss_init function should be called before calling this function.
Return values:
Success- QMSS_SOK
Failure- QMSS_NOT_INITIALIZED

Description
This function initializes the Queue Manager SubsSystem local object blocks in memory local to each core and initializes any start parameters like the RM instance.

This function must be called at least once for every core. It can either be called directly through the application if RM is to be used or it will be called via Qmss_start if RM is not to be used.

Precondition:
Qmss_init function should be called before calling this function.
Return values:
Success- QMSS_SOK
Failure- QMSS_NOT_INITIALIZED

Description
This function disables the accumulator functionality for the specified channel

This function combines the behavior of Qmss_stopAccumulatorCh() and Qmss_closeAccumulatorCh ()

Parameters:
[in]handleChannel handle of channel to disable
Postcondition:
Channel is disabled
Return values:
Valuereported by accumulator
Success- QMSS_ACC_SOK
Failure- QMSS_INVALID_PARAM
Failure- Accumulator status - QMSS_ACC_IDLE, QMSS_ACC_INVALID_COMMAND, QMSS_ACC_INVALID_CHANNEL, QMSS_ACC_CHANNEL_NOT_ACTIVE, QMSS_ACC_CHANNEL_ALREADY_ACTIVE, QMSS_ACC_INVALID_QUEUE_NUMBER

Copyright 2014, Texas Instruments Incorporated