![]() |
![]() |
Qmss_Result Qmss_ackInterrupt | ( | uint8_t | interruptNum, |
uint8_t | value | ||
) |
Description
Calls Qmss_ackInterruptByIntd with intdNum = 0 (for backwards compatibility)
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.
[in] | intdNum | Which QMSS INTD to program. As this is a fast path API it is NOT bounds checked. |
[in] | interruptNum | Interrupt Number that should be acknowledged. |
[in] | value | Value to decrement by or zero to clear. |
**No validation is done to check if the interrupt number is within range to reduce overhead.**
Success | - QMSS_ACC_SOK |
Failure | - QMSS_NOT_INITIALIZED |
Qmss_Result Qmss_cfgAccumulatorCh | ( | Qmss_AccChHandle | handle, |
Qmss_AccCmdCfg * | cfg | ||
) |
Description
This function programs the accumulator channel with values passed in the cfg structure
[in] | handle | Accumulator channel handle to program |
[in] | cfg | Initialization structure that contains accumulator configurable fields |
Value | reported 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.
[in] | handle | Channel handle of channel to close |
Value | reported 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.
[in] | pdspId | Accumulator to program Qmss_PdspId_PDSP1 selects firmware downloaded to PDSP 1 Qmss_PdspId_PDSP2 selects firmware downloaded to PDSP 2 |
[in] | timerConstant | 16 bit wide value calculated as explained above |
Value | reported 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.
[in] | clusterIndex | Index of the cluster to configure - Valid range is 0 to 7 |
[in] | cfg | cluster configuration parameters |
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.
[in] | queIndex | Index of the queue to configure - Valid range is 0 to 31 |
[in] | cfg | Queue configuration parameters |
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
[in] | timerConstant | The 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
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.
[in] | clusterIndex | Index of the cluster to configure - Valid value is 0 |
[in] | cfg | cluster configuration parameters |
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**.
[in] | timerConstant | The 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
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.
[out] | result | Calculated result or 0 on under/over flow |
[in] | ticksPerSecond | QoS timer rate. This is not checked against actual configuration. For example, 20000 means 50us. |
[in] | bitRatePerSecond | Requested bits per second. For example, 50000000 means 50 megabits |
Success | - QMSS_QOS_SCHED_RETCODE_SUCCESS |
Failure | The 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 |
Qmss_Result Qmss_convertQosSchedDropSchedPushStats | ( | Qmss_QosSchedDropSchedPushStats * | stats, |
void * | desc | ||
) |
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.
[out] | stats | Statistics structure to contain returned stats. |
[in] | desc | Pointer to descriptor containing stats. It is assumed that any required cache or fence operations are done on the desc |
Success | - QMSS_QOS_SCHED_RETCODE_SUCCESS |
Failure | The 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.
[out] | result | Calculated result or 0 on under/over flow |
[in] | ticksPerSecond | QoS timer rate. This is not checked against actual configuration. For example, 20000 means 50us. |
[in] | packetRatePerSecond | Requested packets per second. For example, 1000 means 1000 packets per second. |
Success | - QMSS_QOS_SCHED_RETCODE_SUCCESS |
Failure | The 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 ()
[in] | pdspId | Accumulator to program. Qmss_PdspId_PDSP1..8 selects firmware downloaded to PDSP 1 to 8 |
[in] | channel | Channel to disable |
Value | reported 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**.
[in] | clusterIndex | Index of the cluster to disable - Valid range is 0 to 7 |
Success | - QCMD_RETCODE_SUCCESS |
Failure | - Command buffer return status - QMSS_QCMD_INVALID_COMMAND, QMSS_QCMD_INVALID_INDEX, QMSS_QCMD_INVALID_OPTION, |
Qmss_Result Qmss_disableQosSchedDropSched | ( | uint32_t | port | ) |
Description
This function is used to disable the drop scheduler.
[in] | port | Port to disable - must be 0 |
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_disableQosSchedPort | ( | uint32_t | 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.
[in] | port | Port 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) |
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.
[in] | clusterIndex | Index of the cluster to enable - Valid value is 0 |
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.
[in] | pdspId | PDSP number where the firmware should be downloaded |
[in] | image | Pointer to the firmware image |
[in] | size | Size of firmware image in bytes |
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**.
[in] | clusterIndex | Index of the cluster to enable - Valid range is 0 to 7 |
Success | - QCMD_RETCODE_SUCCESS |
Failure | - Command buffer return status - QMSS_QCMD_INVALID_COMMAND, QMSS_QCMD_INVALID_INDEX, QMSS_QCMD_INVALID_OPTION, |
Qmss_Result Qmss_enableQosSchedDropSched | ( | uint32_t | port | ) |
Description
This function is used to enable the drop scheduler.
[in] | port | Port to disable - must be 0 |
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_enableQosSchedPort | ( | uint32_t | port | ) |
Description
This function is used to enable a QoS port.
[in] | port | Port 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) |
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.
[in] | clusterIndex | Index of the cluster to enable - Valid value is 0 |
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.
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 |
Qmss_Result Qmss_getCfgQosSchedDropSchedCfg | ( | uint32_t | port, |
Qmss_QosSchedDropSchedCfg * | pCfg | ||
) |
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.
[in] | port | Drop Scheduler instance (must be 0) |
[out] | pCfg | Drop scheduler top level config |
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.
[in] | port | Drop Scheduler instance (must be 0) |
[out] | profs | config profiles |
[in] | nProfs | Number of profiles in profs[] (for overrun check) |
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.
[in] | port | Drop Scheduler instance (must be 0) |
[out] | profs | output profiles |
[in] | nProfs | Number of profiles in profs[] (for overrun check) |
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.
[in] | port | Drop Scheduler instance (must be 0) |
[out] | cfgs | input queue configurations |
[in] | nCfgs | Number of configurations in cfgs[] (for overrun check) |
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_getCfgQosSchedPort | ( | uint32_t | port, |
Qmss_QosSchedPortCfg * | cfg | ||
) |
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.
[in] | port | Port 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] | cfg | Port configuration parameters |
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.
[in] | QID | 14 or 16 bit QID. |
Queue | handle |
Qmss_Result Qmss_getMemoryRegionCfg | ( | Qmss_MemRegCfg * | memRegInfo | ) |
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.
[out] | memRegInfo | Pointer to the memory region configuration structure allocated by caller. |
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.
[in] | hnd | Queue handle. |
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.
Version | Information. |
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**.
[out] | queueNum | Base queue number |
Success | - QCMD_RETCODE_SUCCESS |
Failure | - Command buffer return status - QMSS_QCMD_INVALID_COMMAND, QMSS_QCMD_INVALID_INDEX, QMSS_QCMD_INVALID_OPTION |
Qmss_Result Qmss_getQosQueueDroppedPktStats | ( | uint32_t | queIndex | ) |
Description
This function is used to get the number of packets dropped due to congestion
[in] | queIndex | Index of the queue whose stats are to be read - Valid range is 0 to 31 |
Success | - Dropped packet count |
Failure | - QMSS_QCMD_INVALID_INDEX |
Qmss_Result Qmss_getQosQueueForwardPktStats | ( | uint32_t | queIndex | ) |
Description
This function is used to get the number of packets forwarded to the ergress queue
[in] | queIndex | Index of the queue whose stats are to be read - Valid range is 0 to 31 |
Success | - Forwarded packet count |
Failure | - QMSS_QCMD_INVALID_INDEX |
Qmss_Result Qmss_getQosSchedDropSchedQueueBase | ( | uint32_t * | queueNum | ) |
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**.
[out] | queueNum | Base queue number |
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.
[out] | stats | Statistics structure to contain returned stats. NULL is valid in order to reset and discard the stats. |
[in] | port | Port to request stats - Must be 0. |
[in] | block | Which stats block to query/reset |
[in] | which_reset | Bitfield 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 |
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_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.
Version | Information. |
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.
Version | Information. |
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**.
[out] | queueNum | Base queue number |
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.
[out] | stats | Statistics structure to contain returned stats. NULL is valid in order to reset and discard the stats. |
[in] | port | Port 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] | group | Group to request stats - Valid range is 0 to 4 |
[in] | queue | Queue in group to request stats - Valid range is 0 to 7 |
[in] | which_reset | Bitfield 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 |
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 |
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.
[in] | hnd | Queue handle. |
Queue | byte 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.
[in] | hnd | Queue handle. |
Queue | entry 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.
[in] | hnd | Queue handle |
Queue | group |
Qmss_QueueHnd Qmss_getQueueHandle | ( | Qmss_Queue | queue | ) |
Description
Given the queue manager and queue number within the queue manager the function returns the corresponding queue handle
[in] | queue | Queue Manager number and Queue Number within the Queue Manager |
Queue | handle 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
[in] | hnd | Queue handle |
Queue | Manager 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.
[in] | hnd | Queue handle. |
Queue | packet 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.
[in] | hnd | Queue handle |
4 | byte memory address. |
static Qmss_QueuePushHnd Qmss_getQueuePushHandleCfg | ( | 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 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.
[in] | hnd | Queue handle |
4 | byte memory address. |
uint32_t Qmss_getQueueThreshold | ( | Qmss_QueueHnd | hnd | ) |
Description
This function returns the threshold at which the queue threshold pin is asserted
[in] | hnd | Queue handle. |
Queue | threshold |
uint16_t Qmss_getQueueThresholdStatus | ( | Qmss_QueueHnd | hnd | ) |
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
[in] | hnd | Queue handle. |
0 | - Configured threshold is not met |
1 | - Configured threshold is met |
uint32_t Qmss_getStarvationCount | ( | Qmss_QueueHnd | hnd | ) |
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.
[in] | hnd | Queue handle. |
8 | bit 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].
[in] | hnd | Queue handle. Number of starvation counts from the group Array of starvation counts. Max 4 |
[in] | numCounts | Maximum number of elements in pStarvationCounts |
[out] | pStarvationCounts | Array of starvation counts (return value) |
None |
uint32_t Qmss_getVersion | ( | void | ) |
Description
The function is used to get the version information of the QMSS LLD.
Version | Information. |
const char* Qmss_getVersionStr | ( | void | ) |
Description
The function is used to get the version string for the QMSS LLD.
Version | String. |
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.
[in] | initCfg | Initialization structure that contains memory region configuration information. Linking RAM memory address should be a global address |
[in] | qmssGblCfgParams | Initialization structure that contains the QMSS device specific information. |
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.
[in] | descCfg | Specifies the number of descriptors, memory region from where it should be allocated and the destination queue to push to. |
[out] | numAllocated | Number of descriptors actually allocated. |
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 |
Qmss_Result Qmss_insertMemoryRegion | ( | Qmss_MemRegInfo * | memRegCfg | ) |
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.
[out] | memRegCfg | Pointer to the memory region configuration structure allocated by caller. Descriptor memory address should be a global address |
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
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
[in] | pdspId | Accumulator to open Qmss_PdspId_PDSP1..8 selects firmware downloaded to PDSP 1 to 8. |
[in] | channel | Channel number within accumulator to open |
Handle | |
Success | >= 0 (handle is returned) |
Failure | - QMSS_NOT_INITIALIZED |
Failure | = QMSS_RESOURCE_ALLOCATE_INIT_DENIED |
Failure | < 0 |
Qmss_Result Qmss_programAccumulator | ( | Qmss_PdspId | pdspId, |
Qmss_AccCmdCfg * | cfg | ||
) |
Description
This function programs the accumulator with values passed in the cfg structure
[in] | pdspId | Accumulator to program Qmss_PdspId_PDSP1 selects firmware downloaded to PDSP 1 Qmss_PdspId_PDSP2 selects firmware downloaded to PDSP 2 |
[in] | cfg | Initialization structure that contains accumulator configurable fields |
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).
Value | reported 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 |
Qmss_Result Qmss_programDiversionQueue | ( | Qmss_PdspId | pdspId, |
Qmss_QueueHnd | divQ, | ||
Qmss_QueueHnd | divCompletionQ | ||
) |
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).
[in] | pdspId | Accumulator to program Qmss_PdspId_PDSP1 selects firmware downloaded to PDSP 1 Qmss_PdspId_PDSP2 selects firmware downloaded to PDSP 2 |
[in] | divQ | Diversion queue handle. This is the queue which is monitored for diversion requests |
[in] | divCompletionQ | Return queue handle. After diversion request is completed, the descriptor is returned in this queue. |
Value | reported by accumulator |
Success | - QMSS_ACC_SOK |
Failure | - QMSS_NOT_INITIALIZED |
Failure | - QMSS_INVALID_PARAM |
Failure | - Accumulator status - QMSS_ACC_IDLE, QMSS_ACC_INVALID_COMMAND |
Qmss_Result Qmss_programReclaimQueue | ( | Qmss_PdspId | pdspId, |
Qmss_QueueHnd | hnd | ||
) |
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
[in] | pdspId | Accumulator to program Qmss_PdspId_PDSP1 selects firmware downloaded to PDSP 1 Qmss_PdspId_PDSP2 selects firmware downloaded to PDSP 2 |
[in] | hnd | Reclamation queue number |
Value | reported by accumulator |
Success | - QMSS_ACC_SOK |
Failure | - QMSS_NOT_INITIALIZED |
Failure | - Accumulator status - QMSS_ACC_IDLE, QMSS_ACC_INVALID_COMMAND |
Qmss_Result Qmss_putCfgQosSchedDropSchedCfg | ( | uint32_t | port, |
Qmss_QosSchedDropSchedCfg * | pCfg | ||
) |
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.
[in] | port | Drop Scheduler instance (must be 0) |
[in] | pCfg | Drop scheduler top level config |
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.
[in] | port | Drop Scheduler instance (must be 0) |
[in] | profs | config profiles |
[in] | nProfs | Number of profiles in profs[] (for overrun check) |
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.
[in] | port | Drop Scheduler instance (must be 0) |
[in] | profs | output profiles |
[in] | nProfs | Number of profiles in profs[] (for overrun check) |
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.
[in] | port | Drop Scheduler instance (must be 0) |
[in] | cfgs | input queue configurations |
[in] | nCfgs | Number of configurations in cfgs[] (for overrun check) |
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 |
Qmss_Result Qmss_putCfgQosSchedPort | ( | uint32_t | port, |
Qmss_QosSchedPortCfg * | cfg | ||
) |
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.
[in] | port | Port 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] | cfg | Port configuration parameters |
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**.
[in] | hnd | Queue handle. |
[in] | descAddr | Memory address of the descriptor. Should be a global address. |
[in] | packetSize | Size of packet pointed to by the descriptor. |
[in] | descSize | Size of the descriptor. Minimum size is 16 bytes. Maximum size is 256 bytes |
[in] | location | 0 - Tail. 1 - Head |
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.
[out] | queueHnds | List of queue handles. This must be pre-allocated to at least numQ entries. |
[in] | queType | Specifies the type of queues that should be opened. |
[in] | numQ | Specifies the number of queues that should be opened |
[in] | align | Queue number of first queue shall be such that queue number % align == 0. |
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.
[out] | queueHnds | List of queue handles. This must be pre-allocated to at least numQ entries. |
[in] | queGroup | Specifies 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] | queType | Specifies the type of queues that should be opened. |
[in] | numQ | Specifies the number of queues that should be opened |
[in] | align | Queue number of first queue shall be such that queue number % align == 0. |
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.
[in] | hnd | Queue handle. |
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.
[in] | srcQnum | Source queue handle. |
[in] | dstQnum | Destination queue handle. |
[in] | location | Head/Tail. |
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.
[in] | hnd | Queue handle. |
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.
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.
[in] | queGroup | Specifies 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] | queType | Specifies the type of queue that should be opened. |
[in] | queNum | Specifies the queue number that should be opened. |
[out] | isAllocated | Indicates 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. |
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.
[in] | startQueNum | Specifies the start of the queue number range. |
[in] | endQueNum | Specifies the end of the queue number range. |
[out] | isAllocated | Indicates 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. |
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".
[in] | QID | Specifies the queue number that should be opened. |
[out] | useCount | Reference count, which must be >= 2. |
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**
[in] | hnd | Queue handle. |
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**
[in] | hnd | Queue handle. |
[out] | descAddr | Descriptor address and size. |
[out] | packetSize | Packet size in bytes. |
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.
[in] | hnd | Queue handle. |
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:
[in] | hnd | Queue handle. |
[in] | descAddr | Memory address of the descriptor. Should be a global address. |
[in] | packetSize | Size of packet pointed to by the descriptor. |
[in] | descSize | Size of the descriptor. Minimum size is 16 bytes. Maximum size is 256 bytes |
[in] | location | 0 - Tail. 1 - Head |
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.
[in] | hnd | Queue handle. |
[in] | descAddr | Memory address of the descriptor. Should be a global address. |
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**.
[in] | hnd | Queue handle. |
[in] | descAddr | Memory address of the descriptor. Should be a global address. |
[in] | descSize | Size of the descriptor. Minimum size is 16 bytes. Maximum size is 256 bytes |
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**.
[in] | hnd | Queue handle. |
[in] | descAddr | Memory address of the descriptor. Should be a global address. |
[in] | descSize | Size of the descriptor. Minimum size is 16 bytes. Maximum size is 256 bytes |
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.
[in] | region | Memory region to clear (return value of Qmss_insertMemoryRegion) |
[in] | qGroup | Queue group to clear region from (only used in split mode) |
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
[in] | queIndex | Index of the queue whose stats are to be reset - Valid range is 0 to 31 |
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)
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.
[in] | intdNum | Which QMSS INTD to program |
[in] | intNum | Interrupt number to program. |
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).
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
[in] | intdNum | Which QMSS INTD to program. As this is a fast path API it is NOT bounds checked. |
[in] | type | Interrupt 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] | accumCh | Accumulator 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.**
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**.
[in] | queueNum | Base queue number |
Success | - QCMD_RETCODE_SUCCESS |
Failure | - Command buffer return status - QMSS_QCMD_INVALID_COMMAND, QMSS_QCMD_INVALID_INDEX, QMSS_QCMD_INVALID_OPTION, |
Qmss_Result Qmss_setQosSchedDropSchedQueueBase | ( | uint32_t | queueNum | ) |
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.
[in] | queueNum | Base queue number |
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:
Port | Group | Assigned Queues |
---|---|---|
0 | 0 | base + 0 - 7 |
0 | 1 | base + 8 -15 |
0 | 2 | base + 16-23 |
0 | 3 | base + 24-31 |
0 | 4 | base + 32-39 |
1 | 0 | base + 40-47 |
1 | 1 | base + 48-55 |
1 | 2 | base + 56-63 |
1 | 3 | base + 64-71 |
1 | 4 | base + 72-79 |
2 | 0 | base + 80-83 |
3 | 0 | base + 84-87 |
4 | 0 | base + 88-91 |
5 | 0 | base + 92-95 |
6 | 0 | base + 96-99 |
7 | 0 | base + 100-103 |
8 | 0 | base + 104-107 |
9 | 0 | base + 108-111 |
10 | 0 | base + 112-115 |
11 | 0 | base + 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**.
[in] | queueNum | Base queue number |
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.
[in] | hnd | Queue handle. |
[in] | hilo | 1 - High 0 - Low. |
[in] | threshold | Threshold value. |
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.
Success | - QMSS_SOK |
Failure | - QMSS_NOT_INITIALIZED |
Qmss_Result Qmss_startCfg | ( | Qmss_StartCfg * | startCfg | ) |
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.
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 ()
[in] | handle | Channel handle of channel to disable |
Value | reported 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 |