本文整理汇总了C++中SharedMemBufferPtr::Dump方法的典型用法代码示例。如果您正苦于以下问题:C++ SharedMemBufferPtr::Dump方法的具体用法?C++ SharedMemBufferPtr::Dump怎么用?C++ SharedMemBufferPtr::Dump使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SharedMemBufferPtr
的用法示例。
在下文中一共展示了SharedMemBufferPtr::Dump方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FrmwkEx
void
FunctionalityMeta_r10b::VerifyDataPat(SharedReadPtr readCmd,
SharedWritePtr writeCmd, uint64_t metaBuffSz)
{
LOG_NRM("Compare read vs written data to verify");
SharedMemBufferPtr rdPayload = readCmd->GetRWPrpBuffer();
SharedMemBufferPtr wrPayload = writeCmd->GetRWPrpBuffer();
if (rdPayload->Compare(wrPayload) == false) {
readCmd->Dump(
FileSystem::PrepDumpFile(mGrpName, mTestName, "ReadCmd"),
"Read command");
rdPayload->Dump(
FileSystem::PrepDumpFile(mGrpName, mTestName, "ReadPayload"),
"Data read from media miscompared from written");
wrPayload->Dump(
FileSystem::PrepDumpFile(mGrpName, mTestName, "WrittenPayload"),
"Data read from media miscompared from written");
throw FrmwkEx(HERE, "Data miscompare");
}
// If meta data is allocated then compare meta data.
if (writeCmd->GetMetaBuffer() != NULL) {
const uint8_t *metaRdBuff = readCmd->GetMetaBuffer();
const uint8_t *metaWrBuff = writeCmd->GetMetaBuffer();
if (memcmp(metaRdBuff, metaWrBuff, metaBuffSz)) {
readCmd->Dump(
FileSystem::PrepDumpFile(mGrpName, mTestName, "ReadCmdMeta"),
"Read command with meta data");
writeCmd->Dump(
FileSystem::PrepDumpFile(mGrpName, mTestName, "WriteCmdMeta"),
"Write command with meta data");
throw FrmwkEx(HERE, "Meta data miscompare, Meta Sz %d", metaBuffSz);
}
}
}
示例2: exception
void
WriteDataPat_r10b::WriteDataPattern()
{
uint64_t regVal;
LOG_NRM("Calc buffer size to write %d logical blks to media",
WRITE_DATA_PAT_NUM_BLKS);
ConstSharedIdentifyPtr namSpcPtr = gInformative->GetIdentifyCmdNamspc(1);
if (namSpcPtr == Identify::NullIdentifyPtr) {
LOG_ERR("Namespace #1 must exist");
throw exception();
}
uint64_t lbaDataSize = namSpcPtr->GetLBADataSize();
LOG_NRM("Create data pattern to write to media");
SharedMemBufferPtr dataPat = SharedMemBufferPtr(new MemBuffer());
dataPat->Init(WRITE_DATA_PAT_NUM_BLKS * lbaDataSize);
dataPat->SetDataPattern(MemBuffer::DATAPAT_INC_16BIT);
dataPat->Dump(FileSystem::PrepLogFile(mGrpName, mTestName, "DataPat"),
"Write buffer's data pattern");
LOG_NRM("Create a generic write cmd to send data pattern to namspc 1");
SharedWritePtr writeCmd = SharedWritePtr(new Write(mFd));
send_64b_bitmask prpBitmask = (send_64b_bitmask)
(MASK_PRP1_PAGE | MASK_PRP2_PAGE | MASK_PRP2_LIST);
writeCmd->SetPrpBuffer(prpBitmask, dataPat);
writeCmd->SetNSID(1);
writeCmd->SetNLB(WRITE_DATA_PAT_NUM_BLKS-1); // convert to 0-based value
// Lookup objs which were created in a prior test within group
SharedIOSQPtr iosqContig = CAST_TO_IOSQ(
gRsrcMngr->GetObj(IOSQ_CONTIG_GROUP_ID))
SharedIOCQPtr iocqContig = CAST_TO_IOCQ(
gRsrcMngr->GetObj(IOCQ_CONTIG_GROUP_ID))
SharedIOSQPtr iosqDiscontig = CAST_TO_IOSQ(
gRsrcMngr->GetObj(IOSQ_DISCONTIG_GROUP_ID))
SharedIOCQPtr iocqDiscontig = CAST_TO_IOCQ(
gRsrcMngr->GetObj(IOCQ_DISCONTIG_GROUP_ID))
LOG_NRM("Send the cmd to hdw via the contiguous IOQ's");
SendToIOSQ(iosqContig, iocqContig, writeCmd, "contig");
// To run the discontig part of this test, the hdw must support that feature
if (gRegisters->Read(CTLSPC_CAP, regVal) == false) {
LOG_ERR("Unable to determine Q memory requirements");
throw exception();
} else if (regVal & CAP_CQR) {
LOG_NRM("Unable to utilize discontig Q's, DUT requires contig");
return;
}
LOG_NRM("Send the cmd to hdw via the discontiguous IOQ's");
SendToIOSQ(iosqDiscontig, iocqDiscontig, writeCmd, "discontig");
}
示例3:
void
VerifyDataPat_r10b::SendToIOSQ(SharedIOSQPtr iosq, SharedIOCQPtr iocq,
SharedReadPtr readCmd, string qualifier, SharedMemBufferPtr writtenPayload,
SharedMemBufferPtr readPayload)
{
IO::SendCmdToHdw(mGrpName, mTestName, DEFAULT_CMD_WAIT_ms, iosq, iocq,
readCmd, qualifier, true);
LOG_NRM("Compare read vs written data to verify");
if (readPayload->Compare(writtenPayload) == false) {
readPayload->Dump(
FileSystem::PrepLogFile(mGrpName, mTestName, "ReadPayload"),
"Data read from media miscompared from written");
writtenPayload->Dump(
FileSystem::PrepLogFile(mGrpName, mTestName, "WrittenPayload"),
"Data read from media miscompared from written");
}
}
示例4: FrmwkEx
void
StartingLBABare_r10b::VerifyDataPat(SharedReadPtr readCmd,
SharedMemBufferPtr wrPayload)
{
LOG_NRM("Compare read vs written data to verify");
SharedMemBufferPtr rdPayload = readCmd->GetRWPrpBuffer();
if (rdPayload->Compare(wrPayload) == false) {
readCmd->Dump(
FileSystem::PrepDumpFile(mGrpName, mTestName, "ReadCmd"),
"Read command");
rdPayload->Dump(
FileSystem::PrepDumpFile(mGrpName, mTestName, "ReadPayload"),
"Data read from media miscompared from written");
wrPayload->Dump(
FileSystem::PrepDumpFile(mGrpName, mTestName, "WrittenPayload"),
"Data read from media miscompared from written");
throw FrmwkEx(HERE, "Data miscompare");
}
}
示例5: FrmwkEx
void
PRPOffsetDualPgMultiBlk_r10b::VerifyDataPat(SharedReadPtr readCmd,
DataPattern dataPat, uint64_t wrVal, uint64_t metabufSz)
{
LOG_NRM("Compare read vs written data to verify");
SharedMemBufferPtr wrPayload = SharedMemBufferPtr(new MemBuffer());
wrPayload->Init(readCmd->GetPrpBufferSize());
wrPayload->SetDataPattern(dataPat, wrVal);
SharedMemBufferPtr rdPayload = readCmd->GetRWPrpBuffer();
if (rdPayload->Compare(wrPayload) == false) {
rdPayload->Dump(
FileSystem::PrepDumpFile(mGrpName, mTestName, "ReadPayload"),
"Data read from media miscompared from written");
wrPayload->Dump(
FileSystem::PrepDumpFile(mGrpName, mTestName, "WrittenPayload"),
"Data read from media miscompared from written");
throw FrmwkEx(HERE, "Data miscompare");
}
if (readCmd->GetMetaBuffer() != NULL) {
SharedMemBufferPtr metaWrPayload = SharedMemBufferPtr(new MemBuffer());
metaWrPayload->Init(metabufSz);
metaWrPayload->SetDataPattern(dataPat, wrVal);
if (readCmd->CompareMetaBuffer(metaWrPayload) == false) {
readCmd->Dump(
FileSystem::PrepDumpFile(mGrpName, mTestName, "MetaRdPayload"),
"Meta Data read from media miscompared from written");
metaWrPayload->Dump(
FileSystem::PrepDumpFile(mGrpName, mTestName, "MetaWrPayload"),
"Meta Data read from media miscompared from written");
throw FrmwkEx(HERE, "Meta Data miscompare");
}
}
}
示例6: FrmwkEx
bool
CompareGolden(Golden &golden)
{
string work;
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);
SharedIdentifyPtr idCmd = SharedIdentifyPtr(new Identify());
SharedMemBufferPtr idMem = SharedMemBufferPtr(new MemBuffer());
idMem->InitAlignment(Identify::IDEAL_DATA_SIZE, sizeof(uint64_t), true, 0);
send_64b_bitmask prpReq =
(send_64b_bitmask)(MASK_PRP1_PAGE | MASK_PRP2_PAGE);
idCmd->SetPrpBuffer(prpReq, idMem);
for (size_t i = 0; i < golden.cmds.size(); i++) {
LOG_NRM("Identify cmd #%ld", i);
LOG_NRM(" Identify:DW1.nsid = 0x%02x", golden.cmds[i].nsid);
LOG_NRM(" Identify.DW10.cns = %c", golden.cmds[i].cns ? 'T' : 'F');
LOG_NRM(" sizeof(Identify.raw) = %ld", golden.cmds[i].raw.size());
LOG_NRM("Formulate an identical idenitfy cmd to issue");
idCmd->SetCNS(golden.cmds[i].cns);
idCmd->SetNSID(golden.cmds[i].nsid);
idMem->InitAlignment(Identify::IDEAL_DATA_SIZE, sizeof(uint64_t),
true, 0);
work = str(boost::format("IdCmd%d") % i);
IO::SendAndReapCmd("tnvme", "golden", SYSTEMWIDE_CMD_WAIT_ms, asq,
acq, idCmd, work, false);
if (idMem->Compare(golden.cmds[i].raw) == false) {
idMem->Dump(FileSystem::PrepDumpFile("tnvme", "golden",
"identify", "dut.miscompare"), "DUT data miscompare");
SharedMemBufferPtr userMem = SharedMemBufferPtr(
new MemBuffer(golden.cmds[i].raw));
userMem->Dump(FileSystem::PrepDumpFile("tnvme", "golden",
"identify", "cmdline.miscompare"),
"Golden user data miscompare");
throw FrmwkEx(HERE, "Golden identify data miscompare");
}
}
LOG_NRM("The operation succeeded to compare golden data");
} catch (...) {
LOG_ERR("Operation failed to compare golden data");
gCtrlrConfig->SetState(ST_DISABLE_COMPLETELY);
return false;
}
gCtrlrConfig->SetState(ST_DISABLE_COMPLETELY);
return true;
}
示例7: FrmwkEx
void
AcquireReservation::RunCoreTest()
{
/** \verbatim
* Assumptions:
* None.
* \endverbatim
*/
LOG_NRM("Start AcquireReservation::RunCoreTest")
SharedIOSQPtr iosq = CAST_TO_IOSQ(gRsrcMngr->GetObj(IOSQ_GROUP_ID));
SharedIOCQPtr iocq = CAST_TO_IOCQ(gRsrcMngr->GetObj(IOCQ_GROUP_ID));
SharedASQPtr asq = CAST_TO_ASQ(gRsrcMngr->GetObj(ASQ_GROUP_ID));
SharedACQPtr acq = CAST_TO_ACQ(gRsrcMngr->GetObj(ACQ_GROUP_ID));
SharedWritePtr writeCmd = SharedWritePtr(new Write());
SharedReadPtr readCmd = SharedReadPtr(new Read());
SharedMemBufferPtr writeRegKey = SharedMemBufferPtr(new MemBuffer());
SharedMemBufferPtr lbaWriteBuffer = SharedMemBufferPtr(new MemBuffer());
SharedMemBufferPtr lbaReadBuffer = SharedMemBufferPtr(new MemBuffer());
uint8_t keyToRegister[16];
uint32_t memAlignment = sysconf(_SC_PAGESIZE);
LOG_NRM("Create ReservationAcquire Cmd and attempt to acquire NSID using wrong key (0xFA versus current 0xAD");
SharedReservationAcquirePtr reservationAcquireCmd = SharedReservationAcquirePtr(new ReservationAcquire());
reservationAcquireCmd->SetNSID(1);
reservationAcquireCmd->SetRTYPE(2);
reservationAcquireCmd->SetIEKEY(0);
reservationAcquireCmd->SetRACQA(0);
for(uint8_t keyIndex = 0; keyIndex < 8; keyIndex++) keyToRegister[keyIndex] = 0xFA;
writeRegKey->InitAlignment(8, memAlignment, false, 0x0, keyToRegister); // 0xAD should be current key...
reservationAcquireCmd->SetPrpBuffer( (send_64b_bitmask)MASK_PRP1_PAGE, writeRegKey);
IO::SendAndReapCmd(mGrpName, mTestName, CALC_TIMEOUT_ms(1), iosq, iocq, reservationAcquireCmd, "Acquire NSID using wrong key", true, CESTAT_RSRV_CONFLICT);
LOG_NRM("Create ReservationAcquire Cmd and attempt to acquire NSID using right key (0xAD");
for(uint8_t keyIndex = 0; keyIndex < 8; keyIndex++) keyToRegister[keyIndex] = 0xAD;
writeRegKey->InitAlignment(8, memAlignment, false, 0x0, keyToRegister); // 0xAD should be current key...
reservationAcquireCmd->SetPrpBuffer( (send_64b_bitmask)MASK_PRP1_PAGE, writeRegKey);
IO::SendAndReapCmd(mGrpName, mTestName, CALC_TIMEOUT_ms(1), iosq, iocq, reservationAcquireCmd, "Acquire NSID using right key", true, CESTAT_SUCCESS);
LOG_NRM("Create nvmeWrite Cmd and write 1 block of data to LBA 5, expecting a pass for HostA");
lbaWriteBuffer->Init(512, true, 0xCC);
writeCmd->SetPrpBuffer( (send_64b_bitmask)( MASK_PRP1_PAGE | MASK_PRP2_PAGE), lbaWriteBuffer);
writeCmd->SetNSID(1);
writeCmd->SetSLBA(5);
writeCmd->SetNLB(0); // 0's based!
IO::SendAndReapCmd(mGrpName, mTestName, CALC_TIMEOUT_ms(1), iosq, iocq, writeCmd, "write 0xCC's to LBA5", true, CESTAT_SUCCESS);
LOG_NRM("Create nvmeRead Cmd and read back 1 block of data to LBA 5, expecting a pass for HostA");
lbaReadBuffer->Init(512, true, 0x00);
readCmd->SetPrpBuffer( (send_64b_bitmask) (MASK_PRP1_PAGE | MASK_PRP2_PAGE), lbaReadBuffer);
readCmd->SetNSID(1);
readCmd->SetSLBA(5);
readCmd->SetNLB(0); // 0's based!
IO::SendAndReapCmd(mGrpName, mTestName, CALC_TIMEOUT_ms(1), iosq, iocq, readCmd, "read from LBA5", true, CESTAT_SUCCESS);
LOG_NRM("Ensure the data read back matches the expected data written (0xCC's)")
if (lbaWriteBuffer->Compare(lbaReadBuffer) == false) {
LOG_NRM("Data MISMATCH!!!")
lbaWriteBuffer->Dump(
FileSystem::PrepDumpFile(mGrpName, mTestName, "Write Data"),
"write after acquire");
lbaReadBuffer->Dump(
FileSystem::PrepDumpFile(mGrpName, mTestName, "Read Data"),
"read after acquire");
throw FrmwkEx(HERE, "Data miscompare");
}
LOG_NRM("Completed AcquireReservation::RunCoreTest")
}
示例8: FrmwkEx
void
RegisterReservation::RunCoreTest()
{
/** \verbatim
* Assumptions:
* None.
* \endverbatim
*/
LOG_NRM("Start RegisterReservationHostB::RunCoreTest");
SharedIOSQPtr iosq = CAST_TO_IOSQ(gRsrcMngr->GetObj(IOSQ_GROUP_ID));
SharedIOCQPtr iocq = CAST_TO_IOCQ(gRsrcMngr->GetObj(IOCQ_GROUP_ID));
SharedASQPtr asq = CAST_TO_ASQ(gRsrcMngr->GetObj(ASQ_GROUP_ID));
SharedACQPtr acq = CAST_TO_ACQ(gRsrcMngr->GetObj(ACQ_GROUP_ID));
//uint8_t keyToRegister[16];
//uint32_t memAlignment = sysconf(_SC_PAGESIZE);
CEStat retStat;
LOG_NRM("Create Set features cmd to set HostID");
SharedSetFeaturesPtr setFeaturesCmd = SharedSetFeaturesPtr(new SetFeatures());
setFeaturesCmd->SetFID(0x81); // Host Identifier
LOG_NRM("Create memory to contain HostID payload");
SharedMemBufferPtr writeHostIDmem = SharedMemBufferPtr(new MemBuffer());
// Init(uint32_t bufSize, bool initMem = false, uint8_t initVal = 0)
writeHostIDmem->Init(8, true, 0xBB);
//writeHostIDmem->InitAlignment(8, true, true, 0xAA); // HostID = 0xAAAAAAAAAAAAAAAA
send_64b_bitmask prpBitmask = (send_64b_bitmask) MASK_PRP1_PAGE;
setFeaturesCmd->SetPrpBuffer(prpBitmask, writeHostIDmem);
IO::SendAndReapCmd(mGrpName, mTestName, CALC_TIMEOUT_ms(1), asq, acq, setFeaturesCmd, "Set 0xBBs hostID", true, CESTAT_SUCCESS);
LOG_NRM("Create Get features cmd to read back HostID");
SharedGetFeaturesPtr getFeaturesCmd = SharedGetFeaturesPtr(new GetFeatures());
getFeaturesCmd->SetFID(0x81); // Host Identifier
SharedMemBufferPtr readHostIDmem = SharedMemBufferPtr(new MemBuffer());
readHostIDmem->Init(8, true, 0x00); // HostID = 0xAAAAAAAAAAAAAAAA
getFeaturesCmd->SetPrpBuffer(prpBitmask, readHostIDmem);
std::vector<CEStat> acceptableReturnStatuses = {CESTAT_SUCCESS, CESTAT_IGNORE};
retStat = IO::SendAndReapCmd(mGrpName, mTestName, CALC_TIMEOUT_ms(1), asq, acq, getFeaturesCmd, "Read back hostID", true, acceptableReturnStatuses);
if(retStat != CESTAT_SUCCESS) {
LOG_NRM("Was unable to get back HostId after setting...");
} else {
LOG_NRM("Compare returned HostID to what was just previously set...");
if (writeHostIDmem->Compare(readHostIDmem) == false) {
LOG_NRM("HostID MISMATCH!!!");
writeHostIDmem->Dump(
FileSystem::PrepDumpFile(mGrpName, mTestName, "WriteHostID"),
"setFeatures HostID");
readHostIDmem->Dump(
FileSystem::PrepDumpFile(mGrpName, mTestName, "ReadHostId"),
"getFeatures HostID");
throw FrmwkEx(HERE, "Data miscompare");
}
}
// HostID should be set... now we can register a key, first we will try to release
SharedMemBufferPtr writeRegKey = SharedMemBufferPtr(new MemBuffer());
SharedReservationRegisterPtr reservationRegisterCmd = SharedReservationRegisterPtr(new ReservationRegister());
LOG_NRM("Release any current key with IKEY=1. If pass we cleared a key, else was already clear.");
reservationRegisterCmd->SetNSID(1);
reservationRegisterCmd->SetCPTPL(0); // No PTPL change
reservationRegisterCmd->SetIEKEY(1);
reservationRegisterCmd->SetRREGA(1); // Unregister Key
writeRegKey->Init(16, true, 0); // 0's in buffer, IKEY will ignore CKEY/NKEY
reservationRegisterCmd->SetPrpBuffer(prpBitmask, writeRegKey);
std::vector<CEStat> possibleReturnStatuses = {CESTAT_SUCCESS, CESTAT_RSRV_CONFLICT, CESTAT_IGNORE};
retStat = IO::SendAndReapCmd(mGrpName, mTestName, CALC_TIMEOUT_ms(1), iosq, iocq, reservationRegisterCmd, "Release Any Key HostB", true, possibleReturnStatuses);
switch(retStat) {
case CESTAT_SUCCESS:
LOG_NRM("Success status returned, a key was assumed to have been present and is now cleared.");
break;
case CESTAT_RSRV_CONFLICT:
LOG_NRM("Rsrv Conflict status returned, a key was assumed have not been present to be able to be cleared.");
break;
default:
LOG_NRM("Unknown stat returned back while attempting to unregister a potential exhisting key... continuing.");
}
LOG_NRM("Register our key (0xBD's), expecting pass");
reservationRegisterCmd->SetNSID(1);
reservationRegisterCmd->SetCPTPL(0); // No PTPL change
reservationRegisterCmd->SetIEKEY(1);
reservationRegisterCmd->SetRREGA(0); // Register Key
writeRegKey->Init(16, true, 0xBD); // 0xAF's as arbitrary new key
reservationRegisterCmd->SetPrpBuffer(prpBitmask, writeRegKey);
retStat = IO::SendAndReapCmd(mGrpName, mTestName, CALC_TIMEOUT_ms(1), iosq, iocq, reservationRegisterCmd, "Register Key 0xBD HostB", true, CESTAT_SUCCESS);
//LOG_NRM("Try to register (not replace) a new key. Should always fail even with IEKEY=1 and same key as before... Expecting Rsvr Conflict.");
// Same command as before...
/*
reservationRegisterCmd->SetNSID(1);
reservationRegisterCmd->SetCPTPL(0); // No PTPL change
reservationRegisterCmd->SetIEKEY(1);
reservationRegisterCmd->SetRREGA(0); // Register Key
writeRegKey->InitAlignment(16, true, 0xAE); // 0xAF's as arbitrary new key
reservationRegisterCmd->SetPrpBuffer(prpBitmask, writeRegKey);
*/
//retStat = IO::SendAndReapCmd(mGrpName, mTestName, CALC_TIMEOUT_ms(1), iosq, iocq, reservationRegisterCmd, "Register Key 0xBD HostB", true, CESTAT_RSRV_CONFLICT);
//.........这里部分代码省略.........
示例9: FrmwkEx
void
WriteDataPat_r10b::WriteDataPattern()
{
uint64_t regVal;
LOG_NRM("Calc buffer size to write %d logical blks to media",
WRITE_DATA_PAT_NUM_BLKS);
Informative::Namspc namspcData = gInformative->Get1stBareMetaE2E();
ConstSharedIdentifyPtr namSpcPtr = namspcData.idCmdNamspc;
if (namSpcPtr == Identify::NullIdentifyPtr)
throw FrmwkEx(HERE, "Namespace #%d must exist", namspcData.id);
LBAFormat lbaFormat = namspcData.idCmdNamspc->GetLBAFormat();
if (namspcData.type == Informative::NS_METAS) {
if (gRsrcMngr->SetMetaAllocSize(lbaFormat.MS * WRITE_DATA_PAT_NUM_BLKS)
== false) {
throw FrmwkEx(HERE);
}
}
uint64_t lbaDataSize = namSpcPtr->GetLBADataSize();
LOG_NRM("Create a generic write cmd to send data pattern to namspc #%d",
namspcData.id);
SharedWritePtr writeCmd = SharedWritePtr(new Write());
send_64b_bitmask prpBitmask = (send_64b_bitmask)
(MASK_PRP1_PAGE | MASK_PRP2_PAGE | MASK_PRP2_LIST);
LOG_NRM("Create data pattern to write to media");
SharedMemBufferPtr dataPat = SharedMemBufferPtr(new MemBuffer());
switch (namspcData.type) {
case Informative::NS_BARE:
dataPat->Init(WRITE_DATA_PAT_NUM_BLKS * lbaDataSize);
break;
case Informative::NS_METAS:
dataPat->Init(WRITE_DATA_PAT_NUM_BLKS * lbaDataSize);
writeCmd->AllocMetaBuffer();
writeCmd->SetMetaDataPattern(DATAPAT_INC_16BIT);
break;
case Informative::NS_METAI:
dataPat->Init(WRITE_DATA_PAT_NUM_BLKS * (lbaDataSize + lbaFormat.MS));
break;
case Informative::NS_E2ES:
case Informative::NS_E2EI:
throw FrmwkEx(HERE, "Deferring work to handle this case in future");
break;
}
dataPat->SetDataPattern(DATAPAT_INC_16BIT);
dataPat->Dump(FileSystem::PrepDumpFile(mGrpName, mTestName, "DataPat"),
"Write buffer's data pattern");
writeCmd->SetPrpBuffer(prpBitmask, dataPat);
writeCmd->SetNSID(namspcData.id);
writeCmd->SetNLB(WRITE_DATA_PAT_NUM_BLKS - 1); // convert to 0-based value
// Lookup objs which were created in a prior test within group
SharedIOSQPtr iosqContig = CAST_TO_IOSQ(
gRsrcMngr->GetObj(IOSQ_CONTIG_GROUP_ID))
SharedIOCQPtr iocqContig = CAST_TO_IOCQ(
gRsrcMngr->GetObj(IOCQ_CONTIG_GROUP_ID))
SharedIOSQPtr iosqDiscontig = CAST_TO_IOSQ(
gRsrcMngr->GetObj(IOSQ_DISCONTIG_GROUP_ID))
SharedIOCQPtr iocqDiscontig = CAST_TO_IOCQ(
gRsrcMngr->GetObj(IOCQ_DISCONTIG_GROUP_ID))
LOG_NRM("Send the cmd to hdw via the contiguous IOQ's");
SendToIOSQ(iosqContig, iocqContig, writeCmd, "contig");
// To run the discontig part of this test, the hdw must support that feature
if (gRegisters->Read(CTLSPC_CAP, regVal) == false) {
throw FrmwkEx(HERE, "Unable to determine Q memory requirements");
} else if (regVal & CAP_CQR) {
LOG_NRM("Unable to utilize discontig Q's, DUT requires contig");
return;
}
LOG_NRM("Send the cmd to hdw via the discontiguous IOQ's");
SendToIOSQ(iosqDiscontig, iocqDiscontig, writeCmd, "discontig");
}