From 3c0b8367a2ce30c62befa431e1720df65cfc1f49 Mon Sep 17 00:00:00 2001 From: jimharris Date: Tue, 26 Mar 2013 21:00:18 +0000 Subject: Create struct nvme_status. NVMe error log entries include status, so breaking this out into its own data structure allows it to be included in both the nvme_completion data structure as well as error log entry data structures. While here, expose nvme_completion_is_error(), and change all of the places that were explicitly looking at sc/sct bits to use this macro instead. Sponsored by: Intel Reviewed by: carl --- sys/dev/nvme/nvme_qpair.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'sys/dev/nvme/nvme_qpair.c') diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index b6a2633..3841095 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -38,13 +38,6 @@ static void _nvme_qpair_submit_request(struct nvme_qpair *qpair, struct nvme_request *req); static boolean_t -nvme_completion_is_error(struct nvme_completion *cpl) -{ - - return (cpl->sf_sc != 0 || cpl->sf_sct != 0); -} - -static boolean_t nvme_completion_is_retry(const struct nvme_completion *cpl) { /* @@ -53,13 +46,13 @@ nvme_completion_is_retry(const struct nvme_completion *cpl) * NAMESPACE_NOT_READY is the only case where we should * look at the DNR bit. */ - switch (cpl->sf_sct) { + switch (cpl->status.sct) { case NVME_SCT_GENERIC: - switch (cpl->sf_sc) { + switch (cpl->status.sc) { case NVME_SC_ABORTED_BY_REQUEST: return (1); case NVME_SC_NAMESPACE_NOT_READY: - if (cpl->sf_dnr) + if (cpl->status.dnr) return (0); else return (1); @@ -168,8 +161,8 @@ nvme_qpair_manual_complete_tracker(struct nvme_qpair *qpair, memset(&cpl, 0, sizeof(cpl)); cpl.sqid = qpair->id; cpl.cid = tr->cid; - cpl.sf_sct = sct; - cpl.sf_sc = sc; + cpl.status.sct = sct; + cpl.status.sc = sc; nvme_qpair_complete_tracker(qpair, tr, &cpl, print_on_error); } @@ -193,7 +186,7 @@ nvme_qpair_process_completions(struct nvme_qpair *qpair) while (1) { cpl = &qpair->cpl[qpair->cq_head]; - if (cpl->p != qpair->phase) + if (cpl->status.p != qpair->phase) break; tr = qpair->act_tr[cpl->cid]; -- cgit v1.1