本文整理汇总了C++中SharedACQPtr类的典型用法代码示例。如果您正苦于以下问题:C++ SharedACQPtr类的具体用法?C++ SharedACQPtr怎么用?C++ SharedACQPtr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SharedACQPtr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: exception
bool
CreateResources_r10b::RunCoreTest()
{
/** \verbatim
* Assumptions:
* 1) none
* \endverbatim
*/
if (gCtrlrConfig->SetState(ST_DISABLE_COMPLETELY) == false)
throw exception();
SharedACQPtr acq = CAST_TO_ACQ(
gRsrcMngr->AllocObj(Trackable::OBJ_ACQ, ACQ_GROUP_ID))
acq->Init(5);
SharedASQPtr asq = CAST_TO_ASQ(
gRsrcMngr->AllocObj(Trackable::OBJ_ASQ, ASQ_GROUP_ID))
asq->Init(5);
gCtrlrConfig->SetCSS(CtrlrConfig::CSS_NVM_CMDSET);
if (gCtrlrConfig->SetState(ST_ENABLE) == false)
throw exception();
return true;
}
示例2: SharedGetFeaturesPtr
bool
GrpAdminSetGetFeatCombo::RestoreTLER(SharedASQPtr asq, SharedACQPtr acq)
{
SharedGetFeaturesPtr getFeaturesCmd =
SharedGetFeaturesPtr(new GetFeatures());
SharedSetFeaturesPtr setFeaturesCmd =
SharedSetFeaturesPtr(new SetFeatures());
LOG_NRM("Restoring state with TLER = 0x%04X", mTimeLimErrRec);
setFeaturesCmd->SetFID(FID[FID_ERR_RECOVERY]);
getFeaturesCmd->SetFID(FID[FID_ERR_RECOVERY]);
setFeaturesCmd->SetDword(mTimeLimErrRec, 11);
IO::SendAndReapCmd(mGrpName, mGrpName, CALC_TIMEOUT_ms(1), asq, acq,
setFeaturesCmd, "RestoreTLER", true);
struct nvme_gen_cq acqMetrics = acq->GetQMetrics();
IO::SendAndReapCmd(mGrpName, mGrpName, CALC_TIMEOUT_ms(1), asq, acq,
getFeaturesCmd, "RestoreTLER", true);
union CE ce = acq->PeekCE(acqMetrics.head_ptr);
if (mTimeLimErrRec != ce.t.dw0) {
LOG_ERR("TLER restore to original state failed. "
"(Actual: Expected) = (0x%04X:0x%04X)", ce.t.dw0, mTimeLimErrRec);
return false;
}
return true;
}
示例3: exception
bool
CreateACQASQ_r10b::RunCoreTest()
{
/** \verbatim
* Assumptions:
* 1) This is the 1st within GrpBasicInit.
* 2) The NVME device is disabled
* 3) All interrupts are disabled.
* \endverbatim
*/
KernelAPI::DumpKernelMetrics(mFd,
FileSystem::PrepLogFile(mGrpName, mTestName, "kmetrics", "before"));
// After disabling the defaults for AMS & CSS are fine, no need to modify
if (gCtrlrConfig->SetMPS() == false)
throw exception();
SharedACQPtr acq = CAST_TO_ACQ(
gRsrcMngr->AllocObj(Trackable::OBJ_ACQ, ACQ_GROUP_ID))
acq->Init(5);
SharedASQPtr asq = CAST_TO_ASQ(
gRsrcMngr->AllocObj(Trackable::OBJ_ASQ, ASQ_GROUP_ID))
asq->Init(5);
if (gCtrlrConfig->SetState(ST_ENABLE) == false)
throw exception();
KernelAPI::DumpKernelMetrics(mFd,
FileSystem::PrepLogFile(mGrpName, mTestName, "kmetrics", "after"));
return true;
}
示例4: FrmwkEx
void
CreateResources_r10b::RunCoreTest()
{
/** \verbatim
* Assumptions:
* 1) none
* \endverbatim
*/
if (gCtrlrConfig->SetState(ST_DISABLE_COMPLETELY) == false)
throw FrmwkEx(HERE);
SharedACQPtr acq = CAST_TO_ACQ(
gRsrcMngr->AllocObj(Trackable::OBJ_ACQ, ACQ_GROUP_ID))
acq->Init(5);
SharedASQPtr asq = CAST_TO_ASQ(
gRsrcMngr->AllocObj(Trackable::OBJ_ASQ, ASQ_GROUP_ID))
asq->Init(5);
// All queues will use identical IRQ vector
IRQ::SetAnySchemeSpecifyNum(1); // throws upon error
gCtrlrConfig->SetCSS(CtrlrConfig::CSS_NVM_CMDSET);
if (gCtrlrConfig->SetState(ST_ENABLE) == false)
throw FrmwkEx(HERE);
gCtrlrConfig->SetIOCQES(gInformative->GetIdentifyCmdCtrlr()->
GetValue(IDCTRLRCAP_CQES) & 0xf);
gCtrlrConfig->SetIOSQES(gInformative->GetIdentifyCmdCtrlr()->
GetValue(IDCTRLRCAP_SQES) & 0xf);
}
示例5: FrmwkEx
void
CIDAcceptedASQ_r10b::ReapVerifyCID(SharedASQPtr asq, SharedACQPtr acq,
uint16_t currCID)
{
uint32_t isrCount;
uint32_t ceRemain;
uint32_t numReaped;
uint32_t numCE;
if (acq->ReapInquiryWaitSpecify(CALC_TIMEOUT_ms(1), 1, numCE, isrCount)
== false) {
acq->Dump(FileSystem::PrepDumpFile(mGrpName, mTestName, "acq.fail"),
"Dump Entire ACQ");
throw FrmwkEx(HERE, "Unable to see CEs for issued cmd");
}
SharedMemBufferPtr ceMem = SharedMemBufferPtr(new MemBuffer());
if ((numReaped = acq->Reap(ceRemain, ceMem, isrCount, numCE, true)) != 1) {
acq->Dump(FileSystem::PrepDumpFile(mGrpName, mTestName, "acq.fail"),
"Dump Entire ACQ");
throw FrmwkEx(HERE, "Unable to reap on ACQ");
}
union CE *ce = (union CE *)ceMem->GetBuffer();
ProcessCE::Validate(*ce); // throws upon error
if (ce->n.CID != currCID) {
asq->Dump(FileSystem::PrepDumpFile(mGrpName, mTestName, "asq.fail"),
"Dump Entire ASQ");
acq->Dump(FileSystem::PrepDumpFile(mGrpName, mTestName, "acq.fail"),
"Dump Entire ACQ");
throw FrmwkEx(HERE, "Received CID %d but expected %d", ce->n.CID,
currCID);
}
}
示例6: FrmwkEx
void
InvalidQID_r10b::RunCoreTest()
{
/** \verbatim
* Assumptions:
* None.
* \endverbatim
*/
string work;
bool enableLog;
uint64_t maxIOQEntries = 2;
if (gCtrlrConfig->SetState(ST_DISABLE_COMPLETELY) == false)
throw FrmwkEx(HERE);
LOG_NRM("Create admin queues ACQ and ASQ");
SharedACQPtr acq = SharedACQPtr(new ACQ(gDutFd));
acq->Init(5);
SharedASQPtr asq = SharedASQPtr(new ASQ(gDutFd));
asq->Init(5);
// All queues will use identical IRQ vector
IRQ::SetAnySchemeSpecifyNum(1);
gCtrlrConfig->SetCSS(CtrlrConfig::CSS_NVM_CMDSET);
if (gCtrlrConfig->SetState(ST_ENABLE) == false)
throw FrmwkEx(HERE);
// Calc X, max no. of IOCQ's DUT supports.
uint32_t X = gInformative->GetFeaturesNumOfIOCQs();
LOG_NRM("Maximum num of IOCQ's DUT will support = %d", X);
LOG_NRM("Setup element size for the IOCQ");
gCtrlrConfig->SetIOCQES(gInformative->GetIdentifyCmdCtrlr()->
GetValue(IDCTRLRCAP_CQES) & 0xf);
LOG_NRM("Issue CreateIOCQ cmds with QID's ranging from %d to %d",
(X + 1), MAX_IOQ_ID);
list<uint32_t> illegalQIDs = GetIllegalQIDs(X + 1);
for (list<uint32_t>::iterator qId = illegalQIDs.begin();
qId != illegalQIDs.end(); qId++) {
LOG_NRM("Process each CreateIOCQCmd with iocq id #%d", *qId);
SharedIOCQPtr iocq = SharedIOCQPtr(new IOCQ(gDutFd));
iocq->Init(*qId, maxIOQEntries, true, 0);
SharedCreateIOCQPtr createIOCQCmd =
SharedCreateIOCQPtr(new CreateIOCQ());
createIOCQCmd->Init(iocq);
work = str(boost::format("iocqId.%d") % *qId);
enableLog = false;
if ((*qId <= (X + 8)) || (*qId >= (MAX_IOQ_ID - 8)))
enableLog = true;
LOG_NRM("Send and reap cmd with CQ ID #%d", *qId);
IO::SendAndReapCmd(mGrpName, mTestName, CALC_TIMEOUT_ms(1), asq, acq,
createIOCQCmd, work, enableLog, CESTAT_INVALID_QID);
}
}
示例7: FrmwkEx
void
UnsupportRsvdFields_r11b::RunCoreTest()
{
/** \verbatim
* Assumptions:
* 1) none
* \endverbatim
*/
if (gCtrlrConfig->SetState(ST_DISABLE_COMPLETELY) == false)
throw FrmwkEx(HERE);
LOG_NRM("Create admin queues ACQ and ASQ for test lifetime");
SharedACQPtr acq = SharedACQPtr(new ACQ(gDutFd));
acq->Init(5);
SharedASQPtr asq = SharedASQPtr(new ASQ(gDutFd));
asq->Init(5);
// All queues will use identical IRQ vector
IRQ::SetAnySchemeSpecifyNum(1);
gCtrlrConfig->SetCSS(CtrlrConfig::CSS_NVM_CMDSET);
if (gCtrlrConfig->SetState(ST_ENABLE) == false)
throw FrmwkEx(HERE);
// Test async events without setting the rsvd bits in the cmd.
TestAsyncEvents(acq, asq, false);
// Test async events by setting the rsvd bits in the cmd.
TestAsyncEvents(acq, asq, true);
}
示例8: SharedGetFeaturesPtr
bool
GrpAdminSetGetFeatCombo::RestoreTMPTH(SharedASQPtr asq, SharedACQPtr acq)
{
SharedGetFeaturesPtr getFeaturesCmd =
SharedGetFeaturesPtr(new GetFeatures());
SharedSetFeaturesPtr setFeaturesCmd =
SharedSetFeaturesPtr(new SetFeatures());
LOG_NRM("Restoring state with TMPTH = 0x%04X", mTmpThreshold);
setFeaturesCmd->SetFID(BaseFeatures::FID_TEMP_THRESHOLD);
getFeaturesCmd->SetFID(BaseFeatures::FID_TEMP_THRESHOLD);
setFeaturesCmd->SetDword(mTmpThreshold, 11);
IO::SendAndReapCmd(mGrpName, mGrpName, CALC_TIMEOUT_ms(1), asq, acq,
setFeaturesCmd, "RestoreTMPTH", true);
struct nvme_gen_cq acqMetrics = acq->GetQMetrics();
IO::SendAndReapCmd(mGrpName, mGrpName, CALC_TIMEOUT_ms(1), asq, acq,
getFeaturesCmd, "RestoreTMPTH", true);
union CE ce = acq->PeekCE(acqMetrics.head_ptr);
if (mTmpThreshold != ce.t.dw0) {
LOG_ERR("TMPTH restore to original state failed. "
"(Actual: Expected) = (0x%04X:0x%04X)", ce.t.dw0, mTmpThreshold);
return false;
}
return true;
}
示例9: FrmwkEx
void
CreateResources_r10b::RunCoreTest()
{
/** \verbatim
* Assumptions:
* 1) This is the 1st within GrpBasicInit.
* \endverbatim
*/
static uint32_t NumEntriesIOQ = 2;
if (gCtrlrConfig->SetState(ST_DISABLE_COMPLETELY) == false)
throw FrmwkEx(HERE);
SharedACQPtr acq = CAST_TO_ACQ(
gRsrcMngr->AllocObj(Trackable::OBJ_ACQ, ACQ_GROUP_ID))
acq->Init(5);
SharedASQPtr asq = CAST_TO_ASQ(
gRsrcMngr->AllocObj(Trackable::OBJ_ASQ, ASQ_GROUP_ID))
asq->Init(5);
// All queues will use identical IRQ vector
IRQ::SetAnySchemeSpecifyNum(1); // throws upon error
gCtrlrConfig->SetCSS(CtrlrConfig::CSS_NVM_CMDSET);
if (gCtrlrConfig->SetState(ST_ENABLE) == false)
throw FrmwkEx(HERE);
{
uint64_t maxIOQEntries;
// 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
if (maxIOQEntries < (uint64_t)NumEntriesIOQ) {
LOG_NRM("Changing number of Q elements from %d to %lld",
NumEntriesIOQ, (unsigned long long)maxIOQEntries);
NumEntriesIOQ = maxIOQEntries;
}
gCtrlrConfig->SetIOCQES(gInformative->GetIdentifyCmdCtrlr()->
GetValue(IDCTRLRCAP_CQES) & 0xf);
Queues::CreateIOCQContigToHdw(mGrpName, mTestName,
DEFAULT_CMD_WAIT_ms, asq, acq, IOQ_ID, NumEntriesIOQ, true,
IOCQ_GROUP_ID, true, 0);
gCtrlrConfig->SetIOSQES(gInformative->GetIdentifyCmdCtrlr()->
GetValue(IDCTRLRCAP_SQES) & 0xf);
Queues::CreateIOSQContigToHdw(mGrpName, mTestName,
DEFAULT_CMD_WAIT_ms, asq, acq, IOQ_ID, NumEntriesIOQ, true,
IOSQ_GROUP_ID, IOQ_ID, 0);
}
}
示例10: FrmwkEx
void
CIDAcceptedIOSQ_r10b::RunCoreTest()
{
/** \verbatim
* Assumptions:
* None.
* \endverbatim
*/
if (gCtrlrConfig->SetState(ST_DISABLE_COMPLETELY) == false)
throw FrmwkEx(HERE);
LOG_NRM("Create ACQ and ASQ objects which have test life time");
SharedACQPtr acq = CAST_TO_ACQ(SharedACQPtr(new ACQ(gDutFd)))
acq->Init(5);
SharedASQPtr asq = CAST_TO_ASQ(SharedASQPtr(new ASQ(gDutFd)))
asq->Init(5);
IRQ::SetAnySchemeSpecifyNum(2); // throws upon error
gCtrlrConfig->SetCSS(CtrlrConfig::CSS_NVM_CMDSET);
if (gCtrlrConfig->SetState(ST_ENABLE) == false)
throw FrmwkEx(HERE);
vector<SharedIOSQPtr> iosqs;
SharedIOCQPtr iocq;
InitTstRsrcs(asq, acq, iosqs, iocq);
SharedWritePtr writeCmd = CreateWriteCmd();
LOG_NRM("Learn initial unique command id assigned by dnvme");
uint16_t curCID;
vector <SharedIOSQPtr>::iterator iosq;
for (iosq = iosqs.begin(); iosq != iosqs.end(); iosq++)
(*iosq)->Send(writeCmd, curCID);
uint16_t prevCID = curCID;
for (uint32_t nCmds = 0; nCmds < MAX_CMDS; nCmds++) {
for (iosq = iosqs.begin(); iosq != iosqs.end(); iosq++) {
LOG_NRM("(nCmds, curCID, prevCID, SQ ID) = (%d, %d, %d, %d)",
nCmds, curCID, prevCID, (*iosq)->GetQId());
(*iosq)->Ring();
ReapVerifyCID(*iosq, iocq, prevCID);
(*iosq)->Send(writeCmd, curCID);
if (curCID != (uint16_t)(prevCID + 1)) {
(*iosq)->Dump(FileSystem::PrepDumpFile(mGrpName, mTestName,
"iosq.fail." + (*iosq)->GetQId()), "Dump Entire IOSQ");
iocq->Dump(FileSystem::PrepDumpFile(mGrpName, mTestName,
"iocq.fail." + iocq->GetQId()), "Dump Entire IOCQ");
throw FrmwkEx(HERE, "curCID(%d) != (prevCID + 1)(%d)", curCID,
(prevCID + 1));
}
}
prevCID = curCID;
}
}
示例11: exception
void
DeleteIOQDiscontigPoll_r10b::DeleteIOSQDiscontigPoll(SharedASQPtr asq,
SharedACQPtr acq)
{
uint16_t numCE;
LOG_NRM("Lookup IOSQ which was created in a prior test within group");
SharedIOSQPtr iosq = CAST_TO_IOSQ(
gRsrcMngr->GetObj(IOSQ_DISCONTIG_POLL_GROUP_ID))
LOG_NRM("Create a Delete IOSQ cmd to perform the IOSQ deletion");
SharedDeleteIOSQPtr deleteIOSQCmd =
SharedDeleteIOSQPtr(new DeleteIOSQ(mFd));
deleteIOSQCmd->Init(iosq);
LOG_NRM("Send the Delete IOSQ cmd to hdw");
asq->Send(deleteIOSQCmd);
asq->Dump(FileSystem::PrepLogFile(mGrpName, mTestName, "asq",
"deleteIOSQCmd"),
"Just B4 ringing SQ0 doorbell, dump entire SQ contents");
asq->Ring();
LOG_NRM("Wait for the CE to arrive in ACQ");
if (acq->ReapInquiryWaitSpecify(DEFAULT_CMD_WAIT_ms, 1, numCE) == false) {
LOG_ERR("Unable to see completion of Delete IOSQ cmd");
acq->Dump(
FileSystem::PrepLogFile(mGrpName, mTestName, "acq","deleteIOSQCmd"),
"Unable to see any CE's in CQ0, dump entire CQ contents");
throw exception();
}
acq->Dump(FileSystem::PrepLogFile(mGrpName, mTestName, "acq",
"deleteIOSQCmd"), "Just B4 reaping CQ0, dump entire CQ contents");
{
uint16_t ceRemain;
uint16_t numReaped;
LOG_NRM("Reaping CE from ACQ, requires memory to hold reaped CE");
SharedMemBufferPtr ceMemIOSQ = SharedMemBufferPtr(new MemBuffer());
if ((numReaped = acq->Reap(ceRemain, ceMemIOSQ, numCE, true)) != 1) {
LOG_ERR("Verified there was 1 CE, but reaping produced %d",
numReaped);
throw exception();
}
LOG_NRM("The reaped identify CE is...");
ceMemIOSQ->Log();
}
// Not explicitly necessary, but is more clean to free what is not needed
gRsrcMngr->FreeObj(IOSQ_DISCONTIG_POLL_GROUP_ID);
}
示例12: FrmwkEx
bool
GrpAdminSetGetFeatCombo::RestoreState()
{
// For the majority of test groups this feature most likely won't be needed
if (gCtrlrConfig->SetState(ST_DISABLE_COMPLETELY) == false)
throw FrmwkEx(HERE);
SharedACQPtr acq = SharedACQPtr(new ACQ(gDutFd));
acq->Init(5);
SharedASQPtr asq = SharedASQPtr(new ASQ(gDutFd));
asq->Init(5);
// All queues will use identical IRQ vector
IRQ::SetAnySchemeSpecifyNum(1);
gCtrlrConfig->SetCSS(CtrlrConfig::CSS_NVM_CMDSET);
if (gCtrlrConfig->SetState(ST_ENABLE) == false)
throw FrmwkEx(HERE);
if (RestoreArbitration(asq, acq) == false) {
LOG_ERR("Arbitration restore failed");
return false;
}
if (RestorePowerState(asq, acq) == false) {
LOG_ERR("Power state restore failed");
return false;
}
if (RestoreTMPTH(asq, acq) == false) {
LOG_ERR("Temperature threshold restore failed");
return false;
}
if (RestoreTLER(asq, acq) == false) {
LOG_ERR("Time limited error recovery restore failed");
return false;
}
if ((gInformative->GetIdentifyCmdCtrlr()->GetValue(IDCTRLRCAP_VWC)
& BITMASK_VWC) == 0x1) {
if (RestoreVolWrCache(asq, acq) == false) {
LOG_ERR("Volatile write cache restore failed");
return false;
}
}
LOG_NRM("System restore successful.");
return true;
}
示例13: FrmwkEx
void
AcceptQPriority_r10b::RunCoreTest()
{
/** \verbatim
* Assumptions:
* None.
* \endverbatim
*/
uint64_t maxIOQEntries = 2;
if (gCtrlrConfig->SetState(ST_DISABLE_COMPLETELY) == false)
throw FrmwkEx(HERE);
LOG_NRM("Create admin queues ACQ and ASQ");
SharedACQPtr acq = SharedACQPtr(new ACQ(gDutFd));
acq->Init(5);
SharedASQPtr asq = SharedASQPtr(new ASQ(gDutFd));
asq->Init(5);
// All queues will use identical IRQ vector
IRQ::SetAnySchemeSpecifyNum(1);
gCtrlrConfig->SetCSS(CtrlrConfig::CSS_NVM_CMDSET);
if (gCtrlrConfig->SetState(ST_ENABLE) == false)
throw FrmwkEx(HERE);
LOG_NRM("Setup element sizes for the IOQ's");
gCtrlrConfig->SetIOCQES(gInformative->GetIdentifyCmdCtrlr()->
GetValue(IDCTRLRCAP_CQES) & 0xf);
gCtrlrConfig->SetIOSQES(gInformative->GetIdentifyCmdCtrlr()->
GetValue(IDCTRLRCAP_SQES) & 0xf);
LOG_NRM("Create IOCQ with QID = %d", IOQ_ID);
SharedIOCQPtr iocq = Queues::CreateIOCQContigToHdw(mGrpName, mTestName,
CALC_TIMEOUT_ms(1), asq, acq, IOQ_ID, maxIOQEntries, false,
IOCQ_GROUP_ID, true, 0);
for (uint8_t priority = 0; priority < PRIORITY_RANGE; priority++) {
LOG_NRM("Create IOSQ with QID = %d and priority #%d", IOQ_ID, priority);
SharedIOSQPtr iosq = Queues::CreateIOSQContigToHdw(mGrpName,
mTestName, CALC_TIMEOUT_ms(1), asq, acq, IOQ_ID, maxIOQEntries,
false, IOSQ_GROUP_ID, IOQ_ID, priority);
LOG_NRM("Delete IOSQ with QID = %d and priority #%d", IOQ_ID, priority);
Queues::DeleteIOSQToHdw(mGrpName, mTestName, CALC_TIMEOUT_ms(1), iosq,
asq, acq, "", false);
}
}
示例14: FormatDevice
/**
* A function to issue consecutive admin cmd set format NVM cmds to a DUT.
* @param format Pass formating instructions
* @return true upon successful parsing, otherwise false.
*/
bool
FormatDevice(Format &format)
{
try { // The objects to perform this work throw exceptions
FileSystem::SetBaseDumpDir(false); // Log into GrpPending
if (gCtrlrConfig->SetState(ST_DISABLE_COMPLETELY) == false)
throw FrmwkEx(HERE);
LOG_NRM("Prepare the admin Q's to setup this request");
SharedACQPtr acq = SharedACQPtr(new ACQ(gDutFd));
acq->Init(2);
SharedASQPtr asq = SharedASQPtr(new ASQ(gDutFd));
asq->Init(2);
gCtrlrConfig->SetCSS(CtrlrConfig::CSS_NVM_CMDSET);
if (gCtrlrConfig->SetState(ST_ENABLE) == false)
throw FrmwkEx(HERE);
for (size_t i = 0; i < format.cmds.size(); i++) {
LOG_NRM("Formatting namespace: %d", format.cmds[i].nsid);
LOG_NRM(" FormatNVM:DW10.ses = 0x%02x", format.cmds[i].ses);
LOG_NRM(" FormatNVM:DW10.pil = %c", format.cmds[i].pil ? 'T' :'F');
LOG_NRM(" FormatNVM:DW10.pi = 0x%02x", format.cmds[i].pi);
LOG_NRM(" FormatNVM:DW10.ms = %c", format.cmds[i].ms ? 'T' : 'F');
LOG_NRM(" FormatNVM:DW10.lbaf = 0x%02x", format.cmds[i].lbaf);
LOG_NRM("Create the cmd to carry this data to the DUT");
SharedFormatNVMPtr formatNVM =
SharedFormatNVMPtr(new FormatNVM());
formatNVM->SetNSID(format.cmds[i].nsid);
formatNVM->SetSES(format.cmds[i].ses);
formatNVM->SetPIL(format.cmds[i].pil);
formatNVM->SetPI(format.cmds[i].pi);
formatNVM->SetMS(format.cmds[i].ms);
formatNVM->SetLBAF(format.cmds[i].lbaf);
IO::SendAndReapCmd("tnvme", "format", SYSTEMWIDE_CMD_WAIT_ms,
asq, acq, formatNVM, "", true);
}
LOG_NRM("The operation succeeded to format device");
} catch (...) {
LOG_ERR("Operation failed to format device");
gCtrlrConfig->SetState(ST_DISABLE_COMPLETELY);
return false;
}
gCtrlrConfig->SetState(ST_DISABLE_COMPLETELY);
return true;
}
示例15: LOG_NRM
bool
GrpAdminSetGetFeatCombo::SaveState()
{
LOG_NRM("Saving system state using getfeatures before group starts");
// Reset saved value to account for regression
mArbitration = 0;
mPowerState = 0;
mTmpThreshold = 0;
mTimeLimErrRec = 0;
mVolWrCache = 0;
mIrqCoalescing = 0;
mWrAtomicity = 0;
memset(mIvecConf, 0, sizeof(mIvecConf));
mAsyncEvent = 0;
if (gCtrlrConfig->SetState(ST_DISABLE_COMPLETELY) == false)
throw FrmwkEx(HERE);
SharedACQPtr acq = SharedACQPtr(new ACQ(gDutFd));
acq->Init(5);
SharedASQPtr asq = SharedASQPtr(new ASQ(gDutFd));
asq->Init(5);
// All queues will use identical IRQ vector
IRQ::SetAnySchemeSpecifyNum(1);
gCtrlrConfig->SetCSS(CtrlrConfig::CSS_NVM_CMDSET);
if (gCtrlrConfig->SetState(ST_ENABLE) == false)
throw FrmwkEx(HERE);
SaveArbitration(asq, acq);
SavePowerState(asq, acq);
SaveTMPTH(asq, acq);
SaveTLER(asq, acq);
if ((gInformative->GetIdentifyCmdCtrlr()->GetValue(IDCTRLRCAP_VWC)
& BITMASK_VWC) == 0x1) {
SaveVolWrCache(asq, acq);
}
SaveIRQCoalescing(asq, acq);
SaveIvecConf(asq, acq);
SaveWrAtomicity(asq, acq);
SaveAsyncEvent(asq, acq);
return true;
}