summaryrefslogtreecommitdiffstats
path: root/hw/nvme/ctrl.c
diff options
context:
space:
mode:
authorKlaus Jensen2021-06-17 21:06:50 +0200
committerKlaus Jensen2021-06-29 07:16:25 +0200
commit0ca5c3ccac72ce58a11f97b74f304934df72e90a (patch)
tree2adc1f020a269b6657630539170e41eb013aa609 /hw/nvme/ctrl.c
parenthw/nvme: reimplement dsm to allow cancellation (diff)
downloadqemu-0ca5c3ccac72ce58a11f97b74f304934df72e90a.tar.gz
qemu-0ca5c3ccac72ce58a11f97b74f304934df72e90a.tar.xz
qemu-0ca5c3ccac72ce58a11f97b74f304934df72e90a.zip
hw/nvme: save reftag when generating pi
Prepare nvme_dif_pract_generate_dif() and nvme_dif_check() to be callable in smaller increments by making the reftag a pointer parameter updated by the function. Signed-off-by: Klaus Jensen <k.jensen@samsung.com> Reviewed-by: Keith Busch <kbusch@kernel.org>
Diffstat (limited to 'hw/nvme/ctrl.c')
-rw-r--r--hw/nvme/ctrl.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
index bb9ee93615..699919ad1a 100644
--- a/hw/nvme/ctrl.c
+++ b/hw/nvme/ctrl.c
@@ -1968,7 +1968,7 @@ static void nvme_verify_cb(void *opaque, int ret)
req->status = nvme_dif_check(ns, ctx->data.bounce, ctx->data.iov.size,
ctx->mdata.bounce, ctx->mdata.iov.size,
- ctrl, slba, apptag, appmask, reftag);
+ ctrl, slba, apptag, appmask, &reftag);
}
out:
@@ -2204,7 +2204,7 @@ static void nvme_copy_in_complete(NvmeRequest *req)
reftag = le32_to_cpu(range->reftag);
status = nvme_dif_check(ns, buf, len, mbuf, mlen, prinfor, slba,
- apptag, appmask, reftag);
+ apptag, appmask, &reftag);
if (status) {
goto invalid;
}
@@ -2227,10 +2227,10 @@ static void nvme_copy_in_complete(NvmeRequest *req)
}
nvme_dif_pract_generate_dif(ns, ctx->bounce, len, ctx->mbounce,
- mlen, apptag, reftag);
+ mlen, apptag, &reftag);
} else {
status = nvme_dif_check(ns, ctx->bounce, len, ctx->mbounce, mlen,
- prinfow, sdlba, apptag, appmask, reftag);
+ prinfow, sdlba, apptag, appmask, &reftag);
if (status) {
goto invalid;
}
@@ -2370,7 +2370,7 @@ static void nvme_compare_mdata_cb(void *opaque, int ret)
status = nvme_dif_check(ns, ctx->data.bounce, ctx->data.iov.size,
ctx->mdata.bounce, ctx->mdata.iov.size, ctrl,
- slba, apptag, appmask, reftag);
+ slba, apptag, appmask, &reftag);
if (status) {
req->status = status;
goto out;