Exemplo n.º 1
0
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);
}
Exemplo n.º 2
0
void
ManyCmdSubmit_r10b::RunCoreTest()
{
    /** \verbatim
     * Assumptions:
     * 1) Test CreateResources_r10b has run prior.
     *  \endverbatim
     */
    uint32_t nCmds;
    uint32_t isrCount;
    uint32_t ceRemain;
    uint32_t numReaped;
    uint32_t numCE;
    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))

    LOG_NRM("Determine the max IOQ entries supported");
    uint64_t ctrlCapReg;
    if (gRegisters->Read(CTLSPC_CAP, ctrlCapReg) == false)
        throw FrmwkEx(HERE, "Unable to determine MQES");
    uint32_t maxIOQEntries = (uint32_t)(ctrlCapReg & CAP_MQES);
    maxIOQEntries += 1;     // convert to 1-based.

    LOG_NRM("Create contig IOQ's");
    SharedIOCQPtr iocq = Queues::CreateIOCQContigToHdw(mGrpName,
        mTestName, CALC_TIMEOUT_ms(1), asq, acq, IOQ_ID, maxIOQEntries,
        false, IOCQ_CONTIG_GROUP_ID, true, 0);

    SharedIOSQPtr iosq = Queues::CreateIOSQContigToHdw(mGrpName,
        mTestName, CALC_TIMEOUT_ms(1), asq, acq, IOQ_ID, maxIOQEntries,
        false, IOSQ_CONTIG_GROUP_ID, IOQ_ID, 0);

    SharedWritePtr writeCmd = SetWriteCmd();

    uint32_t increment = 1;
    for (uint32_t x = 1; x < maxIOQEntries; x += increment) {
        LOG_NRM("Sending #%d simultaneous NVM write cmds to IOSQ", x);
        // Issue x simultaneous NVM write cmds.
        for (nCmds = 1; nCmds <= x; nCmds++)
            iosq->Send(writeCmd, uniqueId);
        iosq->Ring();

        // Variable wait time w.r.t "x" and expect all CE's to arrive in CQ.
        if (iocq->ReapInquiryWaitSpecify(CALC_TIMEOUT_ms(x),
            x, numCE, isrCount) == false) {
            iocq->Dump(FileSystem::PrepDumpFile(mGrpName, mTestName,
                "iocq.reqpinq." + writeCmd->GetName()), "Dump Entire IOCQ");
            LogCEAndCQMetrics(iocq);
            throw FrmwkEx(HERE, "Unable to see CEs for issued cmds #%d", x);
        } else if (numCE != x) {
            iocq->Dump(FileSystem::PrepDumpFile(mGrpName, mTestName,
                "iocq.reqpinq." + writeCmd->GetName()), "Dump Entire IOCQ");
            LogCEAndCQMetrics(iocq);
            throw FrmwkEx(HERE, "The IOCQ should only have #%d CE's as a result "
                "of #%d simultaneous cmds but found #%d", x, x, numCE);
        }

        SharedMemBufferPtr ceMem = SharedMemBufferPtr(new MemBuffer());
        if ((numReaped = iocq->Reap(ceRemain, ceMem, isrCount, x, true)) != x) {
            iocq->Dump(FileSystem::PrepDumpFile(mGrpName, mTestName,
                "iocq.reap." + writeCmd->GetName()), "Dump Entire IOCQ");
            LogCEAndCQMetrics(iocq);
            throw FrmwkEx(HERE, "Unable to reap on IOCQ #%d. Reaped #%d of #%d",
                IOQ_ID, numReaped, x);
        }

        // Testing every cmd takes numerous hrs, so compromise.
        if ((maxIOQEntries - 1000) % x == 0)
            increment = 100;
        else if ((x % 1000) == 0)
            increment = 1000;
        else if ((maxIOQEntries - 100) % x == 0)
            increment = 10;
        else if ((x % 100) == 0)
            increment = 100;
        else if ((maxIOQEntries - 10) % x == 0)
            increment = 1;
        else if ((x % 10) == 0)
            increment = 10;

    }

    // Delete IOSQ before the IOCQ to comply with spec.
    Queues::DeleteIOSQToHdw(mGrpName, mTestName, CALC_TIMEOUT_ms(1),
        iosq, asq, acq);
    Queues::DeleteIOCQToHdw(mGrpName, mTestName, CALC_TIMEOUT_ms(1),
        iocq, asq, acq);
}
Exemplo n.º 3
0
void
SQCQSizeMismatch_r10b::RunCoreTest()
{
    /** \verbatim
     * Assumptions:
     * 1) Test CreateResources_r10b has run prior.
     *  \endverbatim
     */
    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))

    uint64_t maxIOQEntries;
    LOG_NRM("Determine the max IOQ entries supported");
    if (gRegisters->Read(CTLSPC_CAP, maxIOQEntries) == false)
        throw FrmwkEx(HERE, "Unable to determine MQES");
    maxIOQEntries &= CAP_MQES;
    maxIOQEntries += 1;      // convert to 1-based

    SharedWritePtr writeCmd = SetWriteCmd();

    vector<SharedIOSQPtr> IOSQVec;
    vector<SharedIOCQPtr> IOCQVec;

    uint32_t maxIOQSupport = MIN(gInformative->GetFeaturesNumOfIOSQs(),
        gInformative->GetFeaturesNumOfIOCQs());
    uint32_t NumEntriesIOSQ = 2; // IOSQ range: 2 to X + 2
    uint32_t NumEntriesIOCQ = ((maxIOQSupport + 2) > maxIOQEntries) ?
        maxIOQEntries : (maxIOQSupport + 2); // IOCQ range: X + 2 to 2

    // Create all supported  queues.
    for (uint32_t ioqId = 1; ioqId <= maxIOQSupport; ioqId++) {
        LOG_NRM("Creating IOQs with IDs #%d of maximum IDs %d",
            ioqId, maxIOQSupport);
        SharedIOCQPtr iocq = Queues::CreateIOCQContigToHdw(mGrpName,
            mTestName, CALC_TIMEOUT_ms(1), asq, acq, ioqId, NumEntriesIOCQ,
            false, IOCQ_CONTIG_GROUP_ID, false, 0);
        SharedIOSQPtr iosq = Queues::CreateIOSQContigToHdw(mGrpName,
            mTestName, CALC_TIMEOUT_ms(1), asq, acq, ioqId, NumEntriesIOSQ,
            false, IOSQ_CONTIG_GROUP_ID, ioqId, 0);
        IOSQVec.push_back(iosq);
        IOCQVec.push_back(iocq);

        if (NumEntriesIOSQ < maxIOQEntries) {
            NumEntriesIOSQ++;
            NumEntriesIOCQ--;
        }
    }

    vector <SharedIOSQPtr>::iterator iosq;
    vector <SharedIOCQPtr>::iterator iocq;
    LOG_NRM("Send cmds until all SQs fill up.");
    for (iosq = IOSQVec.begin(); iosq != IOSQVec.end(); iosq++) {
        for (uint32_t numCmds = 1; numCmds < ((*iosq)->GetNumEntries());
            numCmds++) {
            (*iosq)->Send(writeCmd, uniqueId);
        }
        (*iosq)->Ring();
    }

    LOG_NRM("Reap and verify all cmds submitted.");
    iosq = IOSQVec.begin();
    for (iocq = IOCQVec.begin(); iocq != IOCQVec.end(); iocq++, iosq++)
        ReapVerifyOnCQ(*iocq, *iosq);

    // Clean up after the test by deleting all the Q's created.
    iocq = IOCQVec.begin();
    for (iosq = IOSQVec.begin(); iosq != IOSQVec.end(); iosq++, iocq++) {
        // Delete IOSQ before the IOCQ to comply with spec.
        Queues::DeleteIOSQToHdw(mGrpName, mTestName, CALC_TIMEOUT_ms(1),
            *iosq, asq, acq);
        Queues::DeleteIOCQToHdw(mGrpName, mTestName, CALC_TIMEOUT_ms(1),
            *iocq, asq, acq);
    }

}