예제 #1
0
void
IO::SendAndReapCmdFail(string grpName, string testName, uint32_t ms,
    SharedSQPtr sq, SharedCQPtr cq, SharedCmdPtr cmd, string qualify,
    bool verbose)
{
    uint32_t numCE;
    uint32_t isrCount;
    string work;
    uint16_t uniqueId;

    if ((numCE = cq->ReapInquiry(isrCount, true)) != 0) {
        cq->Dump(
            FileSystem::PrepDumpFile(grpName, testName, "cq",
            "notEmpty"), "Test assumption have not been met");
        throw FrmwkEx(HERE, "Require 0 CE's within CQ %d, not upheld, found %d",
            cq->GetQId(), numCE);
    }

    LOG_NRM("Send the cmd to hdw via SQ %d", sq->GetQId());
    sq->Send(cmd, uniqueId);
    if (verbose) {
        work = str(boost::format(
            "Just B4 ringing SQ %d doorbell, dump entire SQ") % sq->GetQId());
        sq->Dump(FileSystem::PrepDumpFile(grpName, testName,
            "sq." + cmd->GetName(), qualify), work);
    }
    sq->Ring();

    LOG_NRM("Wait for the CE to arrive in CQ %d", cq->GetQId());
    if (cq->ReapInquiryWaitSpecifyQ(ms, 1, numCE, isrCount) == true) {
        /* Found a CE...reap it then throw so that it gets cleared from CQ */
        if (verbose) {
            work = str(boost::format("Just B4 reaping CQ %d, dump entire CQ") %
                cq->GetQId());
            cq->Dump(FileSystem::PrepDumpFile(grpName, testName,
                "cq." + cmd->GetName(), qualify), work);
        }

        // throws if an error occurs
        ReapCEIgnore(cq, numCE, isrCount, grpName, testName, qualify);
        if (verbose) {
            cmd->Dump(FileSystem::PrepDumpFile(grpName, testName,
                cmd->GetName(), qualify), "A cmd's contents dumped");
        }

        throw FrmwkEx(HERE, "Command was successfully processed and its "
            "completion was reaped from the CQ");
    }
}
예제 #2
0
union CE
IO::SendAndReapCmdWhole(string grpName, string testName, uint32_t ms,
    SharedSQPtr sq, SharedCQPtr cq, SharedCmdPtr cmd, string qualify,
    bool verbose)
{
    uint32_t numCE;
    uint32_t isrCount;
    string work;

    SendCmd(grpName, testName, sq, cq, cmd, numCE, isrCount, qualify, verbose);
    WaitForReap(grpName, testName, ms, cq, cmd, numCE, isrCount, qualify,
        verbose);

    // throws if an error occurs
    union CE retCE = ReapCEWhole(cq, numCE, isrCount, grpName,
        testName, qualify);
    if (verbose) {
        cmd->Dump(FileSystem::PrepDumpFile(grpName, testName,
            cmd->GetName(), qualify), "A cmd's contents dumped");
    }
    return retCE;
}
예제 #3
0
CEStat
IO::SendAndReapCmd(string grpName, string testName, uint32_t ms,
    SharedSQPtr sq, SharedCQPtr cq, SharedCmdPtr cmd, string qualify,
    bool verbose, std::vector<CEStat> &status,
    CEStat (*Reap)(SharedCQPtr, uint32_t, uint32_t &, string, string,
            string, std::vector<CEStat> &, bool))
{
    uint32_t numCE;
    uint32_t isrCount;
    string work;

    SendCmd(grpName, testName, sq, cq, cmd, numCE, isrCount, qualify, verbose);
    WaitForReap(grpName, testName, ms, cq, cmd, numCE, isrCount, qualify,
        verbose);

    // throws if an error occurs
    CEStat retStat =
        Reap(cq, numCE, isrCount, grpName, testName, qualify, status, true);
    if (verbose) {
        cmd->Dump(FileSystem::PrepDumpFile(grpName, testName,
            cmd->GetName(), qualify), "A cmd's contents dumped");
    }
    return retStat;
}