Skip to content

Commit

Permalink
Changed FID system to allow for iterating through FID values. Now nee…
Browse files Browse the repository at this point in the history
…d to reference the actual values through an array instead of assigning the enum values to the FID values.
  • Loading branch information
JeffHensel committed Oct 30, 2015
1 parent d2f2155 commit a2e7584
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 33 deletions.
8 changes: 8 additions & 0 deletions Cmds/baseFeatures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
*/

#include "baseFeatures.h"
#include "featureDefs.h"

#define ZZ(a,b) b,
const uint8_t FID[] = {
FEATURE_TABLE
FID_FENCE // always must be the last element
};
#undef ZZ


BaseFeatures::BaseFeatures() : Cmd(Trackable::OBJTYPE_FENCE)
Expand Down
4 changes: 3 additions & 1 deletion Cmds/featureDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@
ZZ(FID_RESV_NOTIF_MASK, 0x82) \
ZZ(FID_RESV_PERSIST, 0x83)

#define ZZ(a, b) a=b,
#define ZZ(a, b) a,
typedef enum FeatureID {
FEATURE_TABLE
FID_FENCE // always must be the last element
} FeatureID;
#undef ZZ

extern const uint8_t FID[];

struct HostIDStruct {
uint8_t HOSTID;
} __attribute__((__packed__));
Expand Down
1 change: 0 additions & 1 deletion Cmds/formatNVM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,3 @@ FormatNVM::GetLBAF() const
return ((work & BYTE_BITMASK_LBAF) >> 0);
}


6 changes: 3 additions & 3 deletions GrpAdminSetGetFeatCombo/fidArbitration_r10b.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ FIDArbitration_r10b::RunCoreTest()
SharedSetFeaturesPtr setFeaturesCmd =
SharedSetFeaturesPtr(new SetFeatures());

LOG_NRM("Set and Get features arbitration (FID = 0x%x)", FID_ARBITRATION);
getFeaturesCmd->SetFID(FID_ARBITRATION);
setFeaturesCmd->SetFID(FID_ARBITRATION);
LOG_NRM("Set and Get features arbitration (FID = 0x%x)", FID[FID_ARBITRATION]);
getFeaturesCmd->SetFID(FID[FID_ARBITRATION]);
setFeaturesCmd->SetFID(FID[FID_ARBITRATION]);

uint8_t arbBurst[] = {
0, 1, 2, 3, 4, 5, 6, NO_LIMIT
Expand Down
6 changes: 3 additions & 3 deletions GrpAdminSetGetFeatCombo/fidAsyncEventCfg_r10b.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ FIDAsyncEventCfg_r10b::RunCoreTest()
SharedSetFeaturesPtr(new SetFeatures());

LOG_NRM("Set and Get features for async event config (FID = 0x%x)",
FID_ASYNC_EVENT_CONFIG);
getFeaturesCmd->SetFID(FID_ASYNC_EVENT_CONFIG);
setFeaturesCmd->SetFID(FID_ASYNC_EVENT_CONFIG);
FID[FID_ASYNC_EVENT_CONFIG]);
getFeaturesCmd->SetFID(FID[FID_ASYNC_EVENT_CONFIG]);
setFeaturesCmd->SetFID(FID[FID_ASYNC_EVENT_CONFIG]);

uint8_t asyncEventMismatch = 0;

Expand Down
6 changes: 3 additions & 3 deletions GrpAdminSetGetFeatCombo/fidErrRecovery_r10b.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ FIDErrRecovery_r10b::RunCoreTest()
SharedSetFeaturesPtr(new SetFeatures());

LOG_NRM("Set and Get features for error recovery (FID = 0x%x)",
FID_ERR_RECOVERY);
getFeaturesCmd->SetFID(FID_ERR_RECOVERY);
setFeaturesCmd->SetFID(FID_ERR_RECOVERY);
FID[FID_ERR_RECOVERY]);
getFeaturesCmd->SetFID(FID[FID_ERR_RECOVERY]);
setFeaturesCmd->SetFID(FID[FID_ERR_RECOVERY]);

uint8_t tlerMismatch = 0;

Expand Down
6 changes: 3 additions & 3 deletions GrpAdminSetGetFeatCombo/fidErrRecovery_r12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ FIDErrRecovery_r12::RunCoreTest()
SharedSetFeaturesPtr(new SetFeatures());

LOG_NRM("Set and Get features for error recovery (FID = 0x%x)",
FID_ERR_RECOVERY);
getFeaturesCmd->SetFID(FID_ERR_RECOVERY);
setFeaturesCmd->SetFID(FID_ERR_RECOVERY);
FID[FID_ERR_RECOVERY]);
getFeaturesCmd->SetFID(FID[FID_ERR_RECOVERY]);
setFeaturesCmd->SetFID(FID[FID_ERR_RECOVERY]);

ConstSharedIdentifyPtr idCtrlr = gInformative->GetIdentifyCmdCtrlr();
for (uint64_t i = 1; i <= idCtrlr->GetValue(IDCTRLRCAP_NN); i++) {
Expand Down
6 changes: 3 additions & 3 deletions GrpAdminSetGetFeatCombo/fidIRQCoalescing_r10b.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ FIDIRQCoalescing_r10b::RunCoreTest()
SharedSetFeaturesPtr(new SetFeatures());

LOG_NRM("Set and Get features for IRQ coalescing (FID = 0x%x)",
FID_IRQ_COALESCING);
getFeaturesCmd->SetFID(FID_IRQ_COALESCING);
setFeaturesCmd->SetFID(FID_IRQ_COALESCING);
FID[FID_IRQ_COALESCING]);
getFeaturesCmd->SetFID(FID[FID_IRQ_COALESCING]);
setFeaturesCmd->SetFID(FID[FID_IRQ_COALESCING]);

uint8_t irqclscMismatch = 0;

Expand Down
6 changes: 3 additions & 3 deletions GrpAdminSetGetFeatCombo/fidIRQVec_r10b.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ FIDIRQVec_r10b::RunCoreTest()
SharedSetFeaturesPtr(new SetFeatures());

LOG_NRM("Set and Get features for IRQ vec config (FID = 0x%x)",
FID_IRQ_VEC_CONFIG);
getFeaturesCmd->SetFID(FID_IRQ_VEC_CONFIG);
setFeaturesCmd->SetFID(FID_IRQ_VEC_CONFIG);
FID[FID_IRQ_VEC_CONFIG]);
getFeaturesCmd->SetFID(FID[FID_IRQ_VEC_CONFIG]);
setFeaturesCmd->SetFID(FID[FID_IRQ_VEC_CONFIG]);

uint16_t max_ivec = IRQ::GetMaxIRQsSupportedAnyScheme();

Expand Down
6 changes: 3 additions & 3 deletions GrpAdminSetGetFeatCombo/fidPwrMgmt_r10b.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ FIDPwrMgmt_r10b::RunCoreTest()
SharedSetFeaturesPtr setFeaturesCmd =
SharedSetFeaturesPtr(new SetFeatures());

LOG_NRM("Set and Get features PSD (FID = 0x%x)", FID_PWR_MGMT);
getFeaturesCmd->SetFID(FID_PWR_MGMT);
setFeaturesCmd->SetFID(FID_PWR_MGMT);
LOG_NRM("Set and Get features PSD (FID = 0x%x)", FID[FID_PWR_MGMT]);
getFeaturesCmd->SetFID(FID[FID_PWR_MGMT]);
setFeaturesCmd->SetFID(FID[FID_PWR_MGMT]);

uint8_t npss = gInformative->GetIdentifyCmdCtrlr()->
GetValue(IDCTRLRCAP_NPSS); // 0-based
Expand Down
6 changes: 3 additions & 3 deletions GrpAdminSetGetFeatCombo/fidTempThres_r10b.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ FIDTempThres_r10b::RunCoreTest()
SharedSetFeaturesPtr(new SetFeatures());

LOG_NRM("Set and Get features for temperature thrshold (FID = 0x%x)",
FID_TEMP_THRESHOLD);
getFeaturesCmd->SetFID(FID_TEMP_THRESHOLD);
setFeaturesCmd->SetFID(FID_TEMP_THRESHOLD);
FID[FID_TEMP_THRESHOLD]);
getFeaturesCmd->SetFID(FID[FID_TEMP_THRESHOLD]);
setFeaturesCmd->SetFID(FID[FID_TEMP_THRESHOLD]);

uint8_t tmpthMismatch = 0;

Expand Down
6 changes: 3 additions & 3 deletions GrpAdminSetGetFeatCombo/fidVolatileCash_r10b.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ FIDVolatileCash_r10b::RunCoreTest()
SharedSetFeaturesPtr(new SetFeatures());

LOG_NRM("Set and Get features for volatile write cache (FID = 0x%x)",
FID_VOL_WR_CACHE);
getFeaturesCmd->SetFID(FID_VOL_WR_CACHE);
setFeaturesCmd->SetFID(FID_VOL_WR_CACHE);
FID[FID_VOL_WR_CACHE]);
getFeaturesCmd->SetFID(FID[FID_VOL_WR_CACHE]);
setFeaturesCmd->SetFID(FID[FID_VOL_WR_CACHE]);

uint8_t wce = 0x0; // Disable volatile write cache
LOG_NRM("Disable volatile wr cache # %d ", wce);
Expand Down
6 changes: 3 additions & 3 deletions GrpAdminSetGetFeatCombo/fidWriteAtomicity_r10b.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ FIDWriteAtomicity_r10b::RunCoreTest()
SharedSetFeaturesPtr(new SetFeatures());

LOG_NRM("Set and Get features for Write Atomicity (FID = 0x%x)",
FID_WRITE_ATOMICITY);
getFeaturesCmd->SetFID(FID_WRITE_ATOMICITY);
setFeaturesCmd->SetFID(FID_WRITE_ATOMICITY);
FID[FID_WRITE_ATOMICITY]);
getFeaturesCmd->SetFID(FID[FID_WRITE_ATOMICITY]);
setFeaturesCmd->SetFID(FID[FID_WRITE_ATOMICITY]);

uint8_t wrAtomMismatch = 0;

Expand Down
2 changes: 1 addition & 1 deletion tnvmeHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ SetFeaturesNumberOfQueues(NumQueues &numQueues)
LOG_NRM("Create the cmd to carry this data to the DUT");
SharedSetFeaturesPtr sfNumOfQ =
SharedSetFeaturesPtr(new SetFeatures());
sfNumOfQ->SetFID(FID_NUM_QUEUES);
sfNumOfQ->SetFID(FID[FID_NUM_QUEUES]);
sfNumOfQ->SetNumberOfQueues(numQueues.ncqr, numQueues.nsqr);

IO::SendAndReapCmd("tnvme", "queues", CALC_TIMEOUT_ms(1),
Expand Down

0 comments on commit a2e7584

Please sign in to comment.