nvme: Remove duplicate command printing routine

Both nvme_dump_command and nvme_qpair_print_command print nvme
commands. The former latter better. Recode the one call to
nvme_dump_command to use nvme_qpair_print_command and delete the
former. No sense having two nearly identical routines. A future commit
will convert to sbuf.

Sponsored by:		Netflix
Reviewed by:		chuck, mav, jhb
Differential Revision:	https://reviews.freebsd.org/D41309
This commit is contained in:
Warner Losh 2023-08-07 16:34:54 -06:00
parent 6f76d49386
commit 7be0b06885
4 changed files with 4 additions and 16 deletions

View File

@ -82,19 +82,6 @@ nvme_shutdown(device_t dev)
return (0);
}
void
nvme_dump_command(struct nvme_command *cmd)
{
printf(
"opc:%x f:%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->cid, le32toh(cmd->nsid),
cmd->rsvd2, cmd->rsvd3,
(uintmax_t)le64toh(cmd->mptr), (uintmax_t)le64toh(cmd->prp1), (uintmax_t)le64toh(cmd->prp2),
le32toh(cmd->cdw10), le32toh(cmd->cdw11), le32toh(cmd->cdw12),
le32toh(cmd->cdw13), le32toh(cmd->cdw14), le32toh(cmd->cdw15));
}
int
nvme_attach(device_t dev)
{

View File

@ -443,7 +443,8 @@ void nvme_ns_destruct(struct nvme_namespace *ns);
void nvme_sysctl_initialize_ctrlr(struct nvme_controller *ctrlr);
void nvme_dump_command(struct nvme_command *cmd);
void nvme_qpair_print_command(struct nvme_qpair *qpair,
struct nvme_command *cmd);
void nvme_qpair_print_completion(struct nvme_qpair *qpair,
struct nvme_completion *cpl);

View File

@ -174,7 +174,7 @@ nvme_io_qpair_print_command(struct nvme_qpair *qpair,
}
}
static void
void
nvme_qpair_print_command(struct nvme_qpair *qpair, struct nvme_command *cmd)
{
if (qpair->id == 0)

View File

@ -72,7 +72,7 @@ nvme_dump_queue(struct nvme_qpair *qpair)
for (i = 0; i < qpair->num_entries; i++) {
cmd = &qpair->cmd[i];
printf("%05d: ", i);
nvme_dump_command(cmd);
nvme_qpair_print_command(qpair, cmd);
}
}