diff options
author | Christoph Hellwig <hch@lst.de> | 2016-11-10 07:32:34 -0800 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-11-10 10:06:26 -0700 |
commit | 7bf58533a0bc257edff883619befe7e5a1e8caca (patch) | |
tree | 0ffacc930004c83ee064ae0bb9a035b6744a04e4 /drivers/nvme/host/core.c | |
parent | d49187e97e94e2eb613cb6fed810356972077cc3 (diff) |
nvme: don't pass the full CQE to nvme_complete_async_event
We only need the status and result fields, and passing them explicitly
makes life a lot easier for the Fibre Channel transport which doesn't
have a full CQE for the fast path case.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/nvme/host/core.c')
-rw-r--r-- | drivers/nvme/host/core.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 2fd632bcd975..53584d21c805 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -1895,18 +1895,25 @@ static void nvme_async_event_work(struct work_struct *work) spin_unlock_irq(&ctrl->lock); } -void nvme_complete_async_event(struct nvme_ctrl *ctrl, - struct nvme_completion *cqe) +void nvme_complete_async_event(struct nvme_ctrl *ctrl, __le16 status, + union nvme_result *res) { - u16 status = le16_to_cpu(cqe->status) >> 1; - u32 result = le32_to_cpu(cqe->result.u32); + u32 result = le32_to_cpu(res->u32); + bool done = true; - if (status == NVME_SC_SUCCESS || status == NVME_SC_ABORT_REQ) { + switch (le16_to_cpu(status) >> 1) { + case NVME_SC_SUCCESS: + done = false; + /*FALLTHRU*/ + case NVME_SC_ABORT_REQ: ++ctrl->event_limit; schedule_work(&ctrl->async_event_work); + break; + default: + break; } - if (status != NVME_SC_SUCCESS) + if (done) return; switch (result & 0xff07) { |