void IOQRollChkDiff_r10b::IOQRollChkDiff(uint32_t numEntriesIOSQ, uint32_t numEntriesIOCQ) { uint16_t uniqueId; // Lookup objs which were created in a prior test within group SharedASQPtr asq = CAST_TO_ASQ(gRsrcMngr->GetObj(ASQ_GROUP_ID)) SharedACQPtr acq = CAST_TO_ACQ(gRsrcMngr->GetObj(ACQ_GROUP_ID)) SharedIOCQPtr iocq = Queues::CreateIOCQContigToHdw(mGrpName, mTestName, DEFAULT_CMD_WAIT_ms, asq, acq, IOQ_ID, numEntriesIOCQ, false, IOCQ_CONTIG_GROUP_ID, false, 1); SharedIOSQPtr iosq = Queues::CreateIOSQContigToHdw(mGrpName, mTestName, DEFAULT_CMD_WAIT_ms, asq, acq, IOQ_ID, numEntriesIOSQ, false, IOSQ_CONTIG_GROUP_ID, IOQ_ID, 0); LOG_NRM("(IOCQ Size, IOSQ Size)=(%d,%d)", iocq->GetNumEntries(), iosq->GetNumEntries()); SharedWritePtr writeCmd = SetWriteCmd(); LOG_NRM("Send #%d cmds to hdw via the contiguous IOSQ #%d", MAX(iosq->GetNumEntries(), iocq->GetNumEntries()) + 2, iosq->GetQId()); for (uint32_t numEntries = 0; numEntries < (uint32_t)(MAX (iosq->GetNumEntries(), iocq->GetNumEntries()) + 2); numEntries++) { LOG_NRM("Processing #%d entries", numEntries); iosq->Send(writeCmd, uniqueId); iosq->Ring(); ReapAndVerifyCE(iocq, (numEntries + 1) % iosq->GetNumEntries()); } VerifyQPointers(iosq, iocq); LOG_NRM("Delete IOSQ before the IOCQ to comply with spec."); Queues::DeleteIOSQToHdw(mGrpName, mTestName, DEFAULT_CMD_WAIT_ms, iosq, asq, acq); Queues::DeleteIOCQToHdw(mGrpName, mTestName, DEFAULT_CMD_WAIT_ms, iocq, asq, acq); }
void AdminQRollChkDiff_r10b::RunCoreTest() { /** \verbatim * Assumptions: * 1) none. * \endverbatim */ uint16_t mACQSize = MIN_ADMIN_Q_SIZE; // Start ACQ with min size. uint16_t mASQSize = MAX_ADMIN_Q_SIZE; uint16_t loopCnt = 0; if (gCtrlrConfig->SetState(ST_DISABLE_COMPLETELY) == false) throw FrmwkEx(HERE); while (1) { LOG_NRM("(ASQSize, ACQSize, Loop Cnt) = (%d, %d, %d)", mASQSize, mACQSize, loopCnt++); // Issue cntl'r disable completely for every iteration. if (gCtrlrConfig->SetState(ST_DISABLE_COMPLETELY) == false) throw FrmwkEx(HERE); // Create ACQ and ASQ objects which have test life time SharedACQPtr acq = CAST_TO_ACQ(SharedACQPtr(new ACQ(gDutFd))) acq->Init(mACQSize); SharedASQPtr asq = CAST_TO_ASQ(SharedASQPtr(new ASQ(gDutFd))) asq->Init(mASQSize); gCtrlrConfig->SetCSS(CtrlrConfig::CSS_NVM_CMDSET); if (gCtrlrConfig->SetState(ST_ENABLE) == false) throw FrmwkEx(HERE); LOG_NRM("Create identify cmd and assoc some buffer memory"); SharedIdentifyPtr idCmdCap = SharedIdentifyPtr(new Identify()); LOG_NRM("Force identify to request ctrlr capabilities struct"); idCmdCap->SetCNS(true); SharedMemBufferPtr idMemCap = SharedMemBufferPtr(new MemBuffer()); idMemCap->InitAlignment(Identify::IDEAL_DATA_SIZE, PRP_BUFFER_ALIGNMENT, false, 0); send_64b_bitmask idPrpCap = (send_64b_bitmask)(MASK_PRP1_PAGE | MASK_PRP2_PAGE); idCmdCap->SetPrpBuffer(idPrpCap, idMemCap); LOG_NRM("Submit Idtfy cmds to fill & roll over the Q (Q_SIZE plus 2)."); for (uint16_t nsubmitTimes = 0; nsubmitTimes < MAX(asq->GetNumEntries(), acq->GetNumEntries()) + 2; nsubmitTimes++) { LOG_NRM("Sending #%d times of %d", (nsubmitTimes + 1), (acq->GetNumEntries() + 2)); IO::SendAndReapCmd(mGrpName, mTestName, CALC_TIMEOUT_ms(1), asq, acq, idCmdCap, "AdminQRollChkDiff", false); VerifyCESQValues(acq, (nsubmitTimes + 1) % asq->GetNumEntries()); } // Verify final Q pointers after all the cmds are submitted and reaped VerifyQPointers(acq, asq); if (mACQSize >= MAX_ADMIN_Q_SIZE) { break; } // If the test requires incremental sizes then edit here. mACQSize = MAX_ADMIN_Q_SIZE; // Assign MAX Q Size of ACQ. mASQSize = MIN_ADMIN_Q_SIZE; } }