Commit fed1f52b authored by Artur Paszkiewicz's avatar Artur Paszkiewicz Committed by Tomasz Zawadzki
Browse files

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: default avatarArtur Paszkiewicz <artur.paszkiewicz@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15627


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent 8a1f5ccf
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;

	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;
+1 −0
Original line number Diff line number Diff line
@@ -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)