void GrpAdminSetGetFeatCombo::SaveIvecConf(SharedASQPtr asq, SharedACQPtr acq) { LOG_NRM("Create Get features cmd"); SharedGetFeaturesPtr getFeaturesCmd = SharedGetFeaturesPtr(new GetFeatures()); getFeaturesCmd->SetFID(FID[FID_IRQ_VEC_CONFIG]); uint16_t max_ivec = IRQ::GetMaxIRQsSupportedAnyScheme(); for (uint16_t ivec = 0; ivec < max_ivec; ivec++) { getFeaturesCmd->SetIntVecConfigIV(ivec); struct nvme_gen_cq acqMetrics = acq->GetQMetrics(); IO::SendAndReapCmd(mGrpName, mGrpName, CALC_TIMEOUT_ms(1), asq, acq, getFeaturesCmd, "SaveFeatIvecCOnf", true); union CE ce = acq->PeekCE(acqMetrics.head_ptr); mIvecConf[ivec] = ce.t.dw0; LOG_NRM("Default conf = 0x%04X using Get Features for ivec = 0x%02X", mIvecConf[ivec], ivec); } }
bool GrpAdminSetGetFeatCombo::RestoreSaveIvecConf(SharedASQPtr asq, SharedACQPtr acq) { SharedGetFeaturesPtr getFeaturesCmd = SharedGetFeaturesPtr(new GetFeatures()); SharedSetFeaturesPtr setFeaturesCmd = SharedSetFeaturesPtr(new SetFeatures()); uint16_t max_ivec = IRQ::GetMaxIRQsSupportedAnyScheme(); for (uint16_t ivec = 0; ivec < max_ivec; ivec++) { LOG_NRM("Restoring state for ivec = 0x%02X with IvecConf = 0x%04X", ivec, mIvecConf[ivec]); setFeaturesCmd->SetFID(FID[FID_IRQ_VEC_CONFIG]); getFeaturesCmd->SetFID(FID[FID_IRQ_VEC_CONFIG]); setFeaturesCmd->SetDword(mIvecConf[ivec], 11); IO::SendAndReapCmd(mGrpName, mGrpName, CALC_TIMEOUT_ms(1), asq, acq, setFeaturesCmd, "RestoreIvecConf", true); getFeaturesCmd->SetIntVecConfigIV(ivec); struct nvme_gen_cq acqMetrics = acq->GetQMetrics(); IO::SendAndReapCmd(mGrpName, mGrpName, CALC_TIMEOUT_ms(1), asq, acq, getFeaturesCmd, "RestoreIvecConf", true); union CE ce = acq->PeekCE(acqMetrics.head_ptr); if (mIvecConf[ivec] != ce.t.dw0) { LOG_ERR("mIvecConf restore to original state failed. " "(Actual: Expected) = (0x%04X:0x%04X)", ce.t.dw0, mIvecConf[ivec]); return false; } } return true; }