nvmef: don't set optimal I/O boundary if write_unit_size != 1

Optimal I/O boundary causes I/O to be split in the nvme driver. This is
a problem for writes if write_unit_size > 1 because the split I/O may
not match the write_unit_size.

Fixes: #2791
Change-Id: I437e6cb6d8e2415658d5b46539feeacb5363fd46
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15627
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Artur Paszkiewicz 2022-11-24 10:08:16 +01:00 committed by Tomasz Zawadzki
parent 8a1f5ccf07
commit fed1f52b9e
2 changed files with 4 additions and 1 deletions

View File

@ -159,7 +159,9 @@ nvmf_bdev_ctrlr_identify_ns(struct spdk_nvmf_ns *ns, struct spdk_nvme_ns_data *n
nsdata->npdg = nsdata->npwg;
nsdata->npda = nsdata->npwg;
nsdata->noiob = spdk_bdev_get_optimal_io_boundary(bdev);
if (spdk_bdev_get_write_unit_size(bdev) == 1) {
nsdata->noiob = spdk_bdev_get_optimal_io_boundary(bdev);
}
nsdata->nmic.can_share = 1;
if (ns->ptpl_file != NULL) {
nsdata->nsrescap.rescap.persist = 1;

View File

@ -42,6 +42,7 @@ DEFINE_STUB(spdk_bdev_abort, int,
DEFINE_STUB_V(spdk_bdev_io_get_iovec,
(struct spdk_bdev_io *bdev_io, struct iovec **iovp, int *iovcntp));
DEFINE_STUB(spdk_bdev_get_write_unit_size, uint32_t, (const struct spdk_bdev *bdev), 1);
uint32_t
spdk_bdev_get_optimal_io_boundary(const struct spdk_bdev *bdev)