nvme/fio_plugin: Fix the issue that DIF context is initialized only for write I/O
DIF context has to be initialized both for read and write I/O. However, it had been initialized only for write I/O unintentionally after refining error processing. This patch fixes the issue. Signed-off-by: James Bergsten <jamesx.bergsten@intel.com> Signed-off-by: Changpeng Liu <changpeng.liu@intel.com> Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: I363da40ddba186e52fd0dfce37cfb0dea325040d Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468015 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: James Bergsten <jrb@thebergstens.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
11f6b77370
commit
e97148d5dd
@ -593,6 +593,10 @@ fio_extended_lba_setup_pi(struct spdk_fio_qpair *fio_qpair, struct io_u *io_u)
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (io_u->ddir != DDIR_WRITE) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
iov.iov_base = io_u->buf;
|
||||
iov.iov_len = io_u->xfer_buflen;
|
||||
rc = spdk_dif_generate(&iov, 1, lba_count, &fio_req->dif_ctx);
|
||||
@ -627,6 +631,10 @@ fio_separate_md_setup_pi(struct spdk_fio_qpair *fio_qpair, struct io_u *io_u)
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (io_u->ddir != DDIR_WRITE) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
iov.iov_base = io_u->buf;
|
||||
iov.iov_len = io_u->xfer_buflen;
|
||||
md_iov.iov_base = fio_req->md_buf;
|
||||
@ -785,7 +793,7 @@ spdk_fio_queue(struct thread_data *td, struct io_u *io_u)
|
||||
lba_count = io_u->xfer_buflen / block_size;
|
||||
|
||||
/* TODO: considering situations that fio will randomize and verify io_u */
|
||||
if (fio_qpair->do_nvme_pi && io_u->ddir == DDIR_WRITE) {
|
||||
if (fio_qpair->do_nvme_pi) {
|
||||
if (fio_qpair->extended_lba) {
|
||||
rc = fio_extended_lba_setup_pi(fio_qpair, io_u);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user