From cc539da903d49d08f220d67cb62a41b7f1ca2189 Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Wed, 11 Sep 2019 12:44:25 +0900 Subject: [PATCH] nvme/fio_plugin: Fix the issue that PRACT is not set in NVMe command If PRACT is enabled, DIF context was not initialized. However it was expected that PRACT is passed through DIF flags of the DIF context. Hence PRACT was not set in NVMe command even if user set PRACT. This patch fixes the issue by passing fio_qpair->io_flags instead of dif_ctx->dif_flags. Signed-off-by: James Bergsten Signed-off-by: Changpeng Liu Signed-off-by: Shuhei Matsumoto Change-Id: Ibcb74fc8f74f863d8b53d53484fdea66f4b5db8e Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468016 Tested-by: SPDK CI Jenkins Reviewed-by: James Bergsten Reviewed-by: Ben Walker --- examples/nvme/fio_plugin/fio_plugin.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/nvme/fio_plugin/fio_plugin.c b/examples/nvme/fio_plugin/fio_plugin.c index 1278f30e0..a7e39077f 100644 --- a/examples/nvme/fio_plugin/fio_plugin.c +++ b/examples/nvme/fio_plugin/fio_plugin.c @@ -810,10 +810,10 @@ spdk_fio_queue(struct thread_data *td, struct io_u *io_u) if (!g_spdk_enable_sgl) { rc = spdk_nvme_ns_cmd_read_with_md(ns, fio_qpair->qpair, io_u->buf, md_buf, lba, lba_count, spdk_fio_completion_cb, fio_req, - dif_ctx->dif_flags, dif_ctx->apptag_mask, dif_ctx->app_tag); + fio_qpair->io_flags, dif_ctx->apptag_mask, dif_ctx->app_tag); } else { rc = spdk_nvme_ns_cmd_readv_with_md(ns, fio_qpair->qpair, lba, - lba_count, spdk_fio_completion_cb, fio_req, dif_ctx->dif_flags, + lba_count, spdk_fio_completion_cb, fio_req, fio_qpair->io_flags, spdk_nvme_io_reset_sgl, spdk_nvme_io_next_sge, md_buf, dif_ctx->apptag_mask, dif_ctx->app_tag); } @@ -823,10 +823,10 @@ spdk_fio_queue(struct thread_data *td, struct io_u *io_u) rc = spdk_nvme_ns_cmd_write_with_md(ns, fio_qpair->qpair, io_u->buf, md_buf, lba, lba_count, spdk_fio_completion_cb, fio_req, - dif_ctx->dif_flags, dif_ctx->apptag_mask, dif_ctx->app_tag); + fio_qpair->io_flags, dif_ctx->apptag_mask, dif_ctx->app_tag); } else { rc = spdk_nvme_ns_cmd_writev_with_md(ns, fio_qpair->qpair, lba, - lba_count, spdk_fio_completion_cb, fio_req, dif_ctx->dif_flags, + lba_count, spdk_fio_completion_cb, fio_req, fio_qpair->io_flags, spdk_nvme_io_reset_sgl, spdk_nvme_io_next_sge, md_buf, dif_ctx->apptag_mask, dif_ctx->app_tag); }