IxQMgrQCfgStats* ixQMgrQCfgQStatsGet (IxQMgrQId qId) { unsigned int ne; unsigned int nf; UINT32 baseAddress; UINT32 readPtr; UINT32 writePtr; stats.qStats[qId].qSizeInWords = cfgQueueInfo[qId].qSizeInWords; stats.qStats[qId].qEntrySizeInWords = cfgQueueInfo[qId].qEntrySizeInWords; if (IX_SUCCESS != ixQMgrQNumEntriesGet (qId, &stats.qStats[qId].numEntries)) { if (IX_QMGR_WARNING != ixQMgrQNumEntriesGet (qId, &stats.qStats[qId].numEntries)) { IX_QMGR_LOG_WARNING1("Failed to get the number of entries in queue.... %d\n", qId); } } ixQMgrAqmIfQueCfgRead (qId, stats.qStats[qId].numEntries, &baseAddress, &ne, &nf, &readPtr, &writePtr); stats.qStats[qId].baseAddress = baseAddress; stats.qStats[qId].ne = ne; stats.qStats[qId].nf = nf; stats.qStats[qId].readPtr = readPtr; stats.qStats[qId].writePtr = writePtr; return &stats; }
/* --------------------------------------------------------- * Get the number of entries from a queue and handle the case * where queues are moving during the operation */ PRIVATE INLINE IX_STATUS ixAtmdAccTxQueueEntriesGet(IxQMgrQId qMgrQueueId, unsigned int *numberOfEntriesPtr, unsigned int defaultNumberOfEntries) { /* read the number from the queue manager */ IX_STATUS returnStatus = ixQMgrQNumEntriesGet (qMgrQueueId, numberOfEntriesPtr); /* check read success */ if (returnStatus == IX_QMGR_WARNING) { /* read again the number from the queue manager */ returnStatus = ixQMgrQNumEntriesGet (qMgrQueueId, numberOfEntriesPtr); /* cannot get the number of entries : this is because the queue is full */ if (returnStatus == IX_QMGR_WARNING) { /* get the number of entries */ returnStatus = IX_SUCCESS; *numberOfEntriesPtr = defaultNumberOfEntries; } else if (returnStatus != IX_SUCCESS) { /* map the return status */ returnStatus = IX_FAIL; } } /* end of if(returnStatus) */ else if (returnStatus != IX_SUCCESS) { /* map the return status */ returnStatus = IX_FAIL; } return returnStatus; }
/** * @fn ixEthAccQMgrRxQEntryGet(UINT32 *rxQueueEntries) * * @brief Add and return the total number of entries in all Rx queues * * @param UINT32 rxQueueEntries[in] number of entries in all queues * * @return void * * @note Rx queues configuration is driven by Qos Setup. There is a * variable number of rx queues which are set at initialisation. * * @internal */ IX_ETH_ACC_PUBLIC void ixEthAccQMgrRxQEntryGet(UINT32 *numRxQueueEntries) { UINT32 rxQueueLevel; IxEthAccQregInfo *qInfoDes;; *numRxQueueEntries = 0; /* iterate thru rx queues */ for (qInfoDes = ixEthAccQmgrRxQueuesInfo; qInfoDes->qCallback != (IxQMgrCallback)NULL; ++qInfoDes) { /* retrieve the rx queue level */ rxQueueLevel = 0; ixQMgrQNumEntriesGet(qInfoDes->qId, &rxQueueLevel); (*numRxQueueEntries) += rxQueueLevel; } }