From: Klaus Birkelund Jensen <klaus@birkelund.eu>
To: qemu-block@nongnu.org
Cc: Keith Busch <keith.busch@intel.com>,
Kevin Wolf <kwolf@redhat.com>,
qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>
Subject: [Qemu-devel] [PATCH 7/8] nvme: keep a copy of the NVMe command in request
Date: Fri, 17 May 2019 10:42:33 +0200 [thread overview]
Message-ID: <20190517084234.26923-8-klaus@birkelund.eu> (raw)
In-Reply-To: <20190517084234.26923-1-klaus@birkelund.eu>
Signed-off-by: Klaus Birkelund Jensen <klaus.jensen@cnexlabs.com>
---
hw/block/nvme.c | 4 ++--
hw/block/nvme.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 81201a8b4834..5cd593806701 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -184,7 +184,7 @@ static uint16_t nvme_map_prp(NvmeCtrl *n, QEMUSGList *qsg, uint64_t prp1,
int num_prps = (len >> n->page_bits) + 1;
uint16_t status = NVME_SUCCESS;
- trace_nvme_map_prp(req->cmd_opcode, trans_len, len, prp1, prp2, num_prps);
+ trace_nvme_map_prp(req->cmd.opcode, trans_len, len, prp1, prp2, num_prps);
if (unlikely(!prp1)) {
trace_nvme_err_invalid_prp();
@@ -1559,7 +1559,7 @@ static void nvme_init_req(NvmeCtrl *n, NvmeCmd *cmd, NvmeRequest *req)
memset(&req->cqe, 0, sizeof(req->cqe));
req->cqe.cid = le16_to_cpu(cmd->cid);
- req->cmd_opcode = cmd->opcode;
+ memcpy(&req->cmd, cmd, sizeof(NvmeCmd));
req->is_cmb = false;
req->status = NVME_SUCCESS;
diff --git a/hw/block/nvme.h b/hw/block/nvme.h
index 70f4781a1b61..7e1e026d90e6 100644
--- a/hw/block/nvme.h
+++ b/hw/block/nvme.h
@@ -52,7 +52,7 @@ typedef struct NvmeRequest {
uint16_t status;
bool is_cmb;
bool is_write;
- uint8_t cmd_opcode;
+ NvmeCmd cmd;
QTAILQ_HEAD(, NvmeBlockBackendRequest) blk_req_tailq;
QTAILQ_ENTRY(NvmeRequest)entry;
@@ -143,7 +143,7 @@ typedef struct NvmeCtrl {
static inline bool nvme_rw_is_write(NvmeRequest *req)
{
- return req->cmd_opcode == NVME_CMD_WRITE;
+ return req->cmd.opcode == NVME_CMD_WRITE;
}
static inline bool nvme_is_error(uint16_t status, uint16_t err)
--
2.21.0
next prev parent reply other threads:[~2019-05-17 8:46 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-17 8:42 [Qemu-devel] [PATCH 0/8] nvme: v1.3, sgls, metadata and new 'ocssd' device Klaus Birkelund Jensen
2019-05-17 8:42 ` [Qemu-devel] [PATCH 1/8] nvme: move device parameters to separate struct Klaus Birkelund Jensen
2019-05-17 8:42 ` [Qemu-devel] [PATCH 2/8] nvme: bump supported spec to 1.3 Klaus Birkelund Jensen
2019-05-17 8:42 ` [Qemu-devel] [PATCH 3/8] nvme: simplify PRP mappings Klaus Birkelund Jensen
2019-05-17 8:42 ` [Qemu-devel] [PATCH 4/8] nvme: allow multiple i/o's per request Klaus Birkelund Jensen
2019-05-17 8:42 ` [Qemu-devel] [PATCH 5/8] nvme: add support for metadata Klaus Birkelund Jensen
2019-05-22 6:12 ` [Qemu-devel] [Qemu-block] " Klaus Birkelund
2019-05-17 8:42 ` [Qemu-devel] [PATCH 6/8] nvme: add support for scatter gather lists Klaus Birkelund Jensen
2019-05-17 8:42 ` Klaus Birkelund Jensen [this message]
2019-05-17 8:42 ` [Qemu-devel] [PATCH 8/8] nvme: add an OpenChannel 2.0 NVMe device (ocssd) Klaus Birkelund Jensen
2019-05-20 16:45 ` Eric Blake
2019-05-20 17:33 ` Klaus Birkelund
2019-05-20 13:01 ` [Qemu-devel] [PATCH 0/8] nvme: v1.3, sgls, metadata and new 'ocssd' device Kevin Wolf
2019-05-20 13:32 ` Klaus Birkelund
[not found] ` <20190520193445.GA22742@apples.localdomain>
[not found] ` <20190521080115.GA4971@linux.fritz.box>
2019-05-21 20:14 ` Klaus Birkelund
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190517084234.26923-8-klaus@birkelund.eu \
--to=klaus@birkelund.eu \
--cc=keith.busch@intel.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).