Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/nvme/nvme_qpair.c
Show First 20 Lines • Show All 119 Lines • ▼ Show 20 Lines | get_io_opcode_string(uint16_t opc) | ||||
return (entry->str); | return (entry->str); | ||||
} | } | ||||
static void | static void | ||||
nvme_admin_qpair_print_command(struct nvme_qpair *qpair, | nvme_admin_qpair_print_command(struct nvme_qpair *qpair, | ||||
struct nvme_command *cmd) | struct nvme_command *cmd) | ||||
{ | { | ||||
uint16_t opc; | |||||
opc = le16toh(cmd->opc_fuse) & NVME_CMD_OPC_MASK; | |||||
nvme_printf(qpair->ctrlr, "%s (%02x) sqid:%d cid:%d nsid:%x " | nvme_printf(qpair->ctrlr, "%s (%02x) sqid:%d cid:%d nsid:%x " | ||||
"cdw10:%08x cdw11:%08x\n", | "cdw10:%08x cdw11:%08x\n", | ||||
get_admin_opcode_string(opc), opc, qpair->id, cmd->cid, | get_admin_opcode_string(cmd->opc), cmd->opc, qpair->id, cmd->cid, | ||||
le32toh(cmd->nsid), le32toh(cmd->cdw10), le32toh(cmd->cdw11)); | le32toh(cmd->nsid), le32toh(cmd->cdw10), le32toh(cmd->cdw11)); | ||||
} | } | ||||
static void | static void | ||||
nvme_io_qpair_print_command(struct nvme_qpair *qpair, | nvme_io_qpair_print_command(struct nvme_qpair *qpair, | ||||
struct nvme_command *cmd) | struct nvme_command *cmd) | ||||
{ | { | ||||
uint16_t opc; | |||||
opc = le16toh(cmd->opc_fuse) & NVME_CMD_OPC_MASK; | switch (cmd->opc) { | ||||
switch (opc) { | |||||
case NVME_OPC_WRITE: | case NVME_OPC_WRITE: | ||||
case NVME_OPC_READ: | case NVME_OPC_READ: | ||||
case NVME_OPC_WRITE_UNCORRECTABLE: | case NVME_OPC_WRITE_UNCORRECTABLE: | ||||
case NVME_OPC_COMPARE: | case NVME_OPC_COMPARE: | ||||
case NVME_OPC_WRITE_ZEROES: | case NVME_OPC_WRITE_ZEROES: | ||||
nvme_printf(qpair->ctrlr, "%s sqid:%d cid:%d nsid:%d " | nvme_printf(qpair->ctrlr, "%s sqid:%d cid:%d nsid:%d " | ||||
"lba:%llu len:%d\n", | "lba:%llu len:%d\n", | ||||
get_io_opcode_string(opc), qpair->id, cmd->cid, le32toh(cmd->nsid), | get_io_opcode_string(cmd->opc), qpair->id, cmd->cid, le32toh(cmd->nsid), | ||||
((unsigned long long)le32toh(cmd->cdw11) << 32) + le32toh(cmd->cdw10), | ((unsigned long long)le32toh(cmd->cdw11) << 32) + le32toh(cmd->cdw10), | ||||
(le32toh(cmd->cdw12) & 0xFFFF) + 1); | (le32toh(cmd->cdw12) & 0xFFFF) + 1); | ||||
break; | break; | ||||
case NVME_OPC_FLUSH: | case NVME_OPC_FLUSH: | ||||
case NVME_OPC_DATASET_MANAGEMENT: | case NVME_OPC_DATASET_MANAGEMENT: | ||||
case NVME_OPC_RESERVATION_REGISTER: | case NVME_OPC_RESERVATION_REGISTER: | ||||
case NVME_OPC_RESERVATION_REPORT: | case NVME_OPC_RESERVATION_REPORT: | ||||
case NVME_OPC_RESERVATION_ACQUIRE: | case NVME_OPC_RESERVATION_ACQUIRE: | ||||
case NVME_OPC_RESERVATION_RELEASE: | case NVME_OPC_RESERVATION_RELEASE: | ||||
nvme_printf(qpair->ctrlr, "%s sqid:%d cid:%d nsid:%d\n", | nvme_printf(qpair->ctrlr, "%s sqid:%d cid:%d nsid:%d\n", | ||||
get_io_opcode_string(opc), qpair->id, cmd->cid, le32toh(cmd->nsid)); | get_io_opcode_string(cmd->opc), qpair->id, cmd->cid, le32toh(cmd->nsid)); | ||||
break; | break; | ||||
default: | default: | ||||
nvme_printf(qpair->ctrlr, "%s (%02x) sqid:%d cid:%d nsid:%d\n", | nvme_printf(qpair->ctrlr, "%s (%02x) sqid:%d cid:%d nsid:%d\n", | ||||
get_io_opcode_string(opc), opc, qpair->id, | get_io_opcode_string(cmd->opc), cmd->opc, qpair->id, | ||||
cmd->cid, le32toh(cmd->nsid)); | cmd->cid, le32toh(cmd->nsid)); | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
static void | static void | ||||
nvme_qpair_print_command(struct nvme_qpair *qpair, struct nvme_command *cmd) | nvme_qpair_print_command(struct nvme_qpair *qpair, struct nvme_command *cmd) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 534 Lines • ▼ Show 20 Lines | |||||
static void | static void | ||||
nvme_admin_qpair_abort_aers(struct nvme_qpair *qpair) | nvme_admin_qpair_abort_aers(struct nvme_qpair *qpair) | ||||
{ | { | ||||
struct nvme_tracker *tr; | struct nvme_tracker *tr; | ||||
tr = TAILQ_FIRST(&qpair->outstanding_tr); | tr = TAILQ_FIRST(&qpair->outstanding_tr); | ||||
while (tr != NULL) { | while (tr != NULL) { | ||||
if ((le16toh(tr->req->cmd.opc_fuse) & NVME_CMD_OPC_MASK) == NVME_OPC_ASYNC_EVENT_REQUEST) { | if (tr->req->cmd.opc == NVME_OPC_ASYNC_EVENT_REQUEST) { | ||||
nvme_qpair_manual_complete_tracker(qpair, tr, | nvme_qpair_manual_complete_tracker(qpair, tr, | ||||
NVME_SCT_GENERIC, NVME_SC_ABORTED_SQ_DELETION, 0, | NVME_SCT_GENERIC, NVME_SC_ABORTED_SQ_DELETION, 0, | ||||
FALSE); | FALSE); | ||||
tr = TAILQ_FIRST(&qpair->outstanding_tr); | tr = TAILQ_FIRST(&qpair->outstanding_tr); | ||||
} else { | } else { | ||||
tr = TAILQ_NEXT(tr, tailq); | tr = TAILQ_NEXT(tr, tailq); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 417 Lines • Show Last 20 Lines |