nvme: remove dump_command and dump_completion
nvme_dump_command is totally unused aside from the unit test. nvme_dump_completion was used in qpair, but it can be replaced with the equivalent nvme_qpair_print_completion. Also added the missing nvme_completion fields to nvme_qpair_print_completion that had been printed by nvme_dump_command. Change-Id: Ia5ee66f3553df06febe8f465d42e49a84c555dd2 Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
a6cf458c9d
commit
8217814218
@ -46,28 +46,6 @@ int32_t nvme_retry_count;
|
|||||||
int __thread nvme_thread_ioq_index = -1;
|
int __thread nvme_thread_ioq_index = -1;
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
nvme_dump_command(struct nvme_command *cmd)
|
|
||||||
{
|
|
||||||
printf(
|
|
||||||
"opc:%x f:%x r1:%x cid:%x nsid:%x r2:%x r3:%x mptr:%jx prp1:%jx prp2:%jx cdw:%x %x %x %x %x %x\n",
|
|
||||||
cmd->opc, cmd->fuse, cmd->rsvd1, cmd->cid, cmd->nsid,
|
|
||||||
cmd->rsvd2, cmd->rsvd3,
|
|
||||||
(uintmax_t)cmd->mptr, (uintmax_t)cmd->dptr.prp.prp1, (uintmax_t)cmd->dptr.prp.prp2,
|
|
||||||
cmd->cdw10, cmd->cdw11, cmd->cdw12, cmd->cdw13, cmd->cdw14,
|
|
||||||
cmd->cdw15);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
nvme_dump_completion(struct nvme_completion *cpl)
|
|
||||||
{
|
|
||||||
printf("cdw0:%08x sqhd:%04x sqid:%04x "
|
|
||||||
"cid:%04x p:%x sc:%02x sct:%x m:%x dnr:%x\n",
|
|
||||||
cpl->cdw0, cpl->sqhd, cpl->sqid,
|
|
||||||
cpl->cid, cpl->status.p, cpl->status.sc, cpl->status.sct,
|
|
||||||
cpl->status.m, cpl->status.dnr);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \page nvme_initialization NVMe Initialization
|
* \page nvme_initialization NVMe Initialization
|
||||||
|
|
||||||
|
@ -429,9 +429,6 @@ int nvme_ns_construct(struct nvme_namespace *ns, uint16_t id,
|
|||||||
struct nvme_controller *ctrlr);
|
struct nvme_controller *ctrlr);
|
||||||
void nvme_ns_destruct(struct nvme_namespace *ns);
|
void nvme_ns_destruct(struct nvme_namespace *ns);
|
||||||
|
|
||||||
void nvme_dump_command(struct nvme_command *cmd);
|
|
||||||
void nvme_dump_completion(struct nvme_completion *cpl);
|
|
||||||
|
|
||||||
struct nvme_request *
|
struct nvme_request *
|
||||||
nvme_allocate_request(void *payload, uint32_t payload_size,
|
nvme_allocate_request(void *payload, uint32_t payload_size,
|
||||||
nvme_cb_fn_t cb_fn, void *cb_arg);
|
nvme_cb_fn_t cb_fn, void *cb_arg);
|
||||||
|
@ -234,9 +234,10 @@ static void
|
|||||||
nvme_qpair_print_completion(struct nvme_qpair *qpair,
|
nvme_qpair_print_completion(struct nvme_qpair *qpair,
|
||||||
struct nvme_completion *cpl)
|
struct nvme_completion *cpl)
|
||||||
{
|
{
|
||||||
nvme_printf(qpair->ctrlr, "%s (%02x/%02x) sqid:%d cid:%d cdw0:%x\n",
|
nvme_printf(qpair->ctrlr, "%s (%02x/%02x) sqid:%d cid:%d cdw0:%x sqhd:%04x p:%x m:%x dnr:%x\n",
|
||||||
get_status_string(cpl->status.sct, cpl->status.sc),
|
get_status_string(cpl->status.sct, cpl->status.sc),
|
||||||
cpl->status.sct, cpl->status.sc, cpl->sqid, cpl->cid, cpl->cdw0);
|
cpl->status.sct, cpl->status.sc, cpl->sqid, cpl->cid, cpl->cdw0,
|
||||||
|
cpl->sqhd, cpl->status.p, cpl->status.m, cpl->status.dnr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
@ -464,7 +465,7 @@ nvme_qpair_process_completions(struct nvme_qpair *qpair)
|
|||||||
} else {
|
} else {
|
||||||
nvme_printf(qpair->ctrlr,
|
nvme_printf(qpair->ctrlr,
|
||||||
"cpl does not map to outstanding cmd\n");
|
"cpl does not map to outstanding cmd\n");
|
||||||
nvme_dump_completion(cpl);
|
nvme_qpair_print_completion(qpair, cpl);
|
||||||
nvme_assert(0, ("received completion for unknown cmd\n"));
|
nvme_assert(0, ("received completion for unknown cmd\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,60 +163,6 @@ test2(void)
|
|||||||
CU_ASSERT(threads_fail == 4);
|
CU_ASSERT(threads_fail == 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
test_nvme_dump_command(void)
|
|
||||||
{
|
|
||||||
struct nvme_command *cmd = NULL;
|
|
||||||
uint64_t physaddr = 0;
|
|
||||||
|
|
||||||
cmd = nvme_malloc("nvme_command", sizeof(struct nvme_command),
|
|
||||||
64, &physaddr);
|
|
||||||
CU_ASSERT(cmd != NULL);
|
|
||||||
|
|
||||||
cmd->opc = 1;
|
|
||||||
cmd->fuse = 1;
|
|
||||||
cmd->rsvd1 = 1;
|
|
||||||
cmd->cid = 1;
|
|
||||||
cmd->nsid = 1;
|
|
||||||
cmd->rsvd2 = 1;
|
|
||||||
cmd->rsvd3 = 1;
|
|
||||||
cmd->mptr = 1;
|
|
||||||
cmd->dptr.prp.prp1 = 1;
|
|
||||||
cmd->dptr.prp.prp2 = 1;
|
|
||||||
cmd->cdw10 = 1;
|
|
||||||
cmd->cdw11 = 1;
|
|
||||||
cmd->cdw12 = 1;
|
|
||||||
cmd->cdw13 = 1;
|
|
||||||
cmd->cdw14 = 1;
|
|
||||||
cmd->cdw15 = 1;
|
|
||||||
|
|
||||||
nvme_dump_command(cmd);
|
|
||||||
nvme_free(cmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
test_nvme_dump_completion(void)
|
|
||||||
{
|
|
||||||
struct nvme_completion *cpl = NULL;
|
|
||||||
uint64_t physaddr = 0;
|
|
||||||
|
|
||||||
cpl = nvme_malloc("nvme_completion", sizeof(struct nvme_completion),
|
|
||||||
64, &physaddr);
|
|
||||||
CU_ASSERT(cpl != NULL);
|
|
||||||
|
|
||||||
cpl->cdw0 = 1;
|
|
||||||
cpl->sqhd = 1;
|
|
||||||
cpl->sqid = 1;
|
|
||||||
cpl->cid = 1;
|
|
||||||
cpl->status.p = 1;
|
|
||||||
cpl->status.sc = 1;
|
|
||||||
cpl->status.sct = 1;
|
|
||||||
cpl->status.m = 1;
|
|
||||||
cpl->status.dnr = 1;
|
|
||||||
|
|
||||||
nvme_dump_completion(cpl);
|
|
||||||
nvme_free(cpl);
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
@ -236,8 +182,6 @@ int main(int argc, char **argv)
|
|||||||
if (
|
if (
|
||||||
CU_add_test(suite, "test1", test1) == NULL
|
CU_add_test(suite, "test1", test1) == NULL
|
||||||
|| CU_add_test(suite, "test2", test2) == NULL
|
|| CU_add_test(suite, "test2", test2) == NULL
|
||||||
|| CU_add_test(suite, "nvme_dump_command", test_nvme_dump_command) == NULL
|
|
||||||
|| CU_add_test(suite, "nvme_dump_completion", test_nvme_dump_completion) == NULL
|
|
||||||
) {
|
) {
|
||||||
CU_cleanup_registry();
|
CU_cleanup_registry();
|
||||||
return CU_get_error();
|
return CU_get_error();
|
||||||
|
Loading…
Reference in New Issue
Block a user