summaryrefslogtreecommitdiffstats
path: root/sys/dev/nvme/nvme_qpair.c
diff options
context:
space:
mode:
authorjimharris <jimharris@FreeBSD.org>2013-03-26 21:00:18 +0000
committerjimharris <jimharris@FreeBSD.org>2013-03-26 21:00:18 +0000
commit3c0b8367a2ce30c62befa431e1720df65cfc1f49 (patch)
treead79338c72d5a2294eab91a297a57e1b956519e0 /sys/dev/nvme/nvme_qpair.c
parentd0a775e7949e871c4beabbef339069ca9560c538 (diff)
downloadFreeBSD-src-3c0b8367a2ce30c62befa431e1720df65cfc1f49.zip
FreeBSD-src-3c0b8367a2ce30c62befa431e1720df65cfc1f49.tar.gz
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
Diffstat (limited to 'sys/dev/nvme/nvme_qpair.c')
-rw-r--r--sys/dev/nvme/nvme_qpair.c19
1 files changed, 6 insertions, 13 deletions
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];
OpenPOWER on IntegriCloud