Commit dffb272c authored by Niklas Cassel's avatar Niklas Cassel Committed by Tomasz Zawadzki
Browse files

examples/nvme_fio_plugin: error out on unsupported blocksize



According to the SPDK nvme fio plugin documentation:

"Blocksize should be set as the sum of data and metadata.
For example, if data blocksize is 512 Byte, host generated
PI metadata is 8 Byte, then blocksize in fio configure file
should be 520 Byte."

Error out if this requirement is not satisfied.
This requirement does not apply for the separate metadata case.

Signed-off-by: default avatarNiklas Cassel <niklas.cassel@wdc.com>
Change-Id: I730a83beb6a85695c8a4b80995340b4064375d5a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5557


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent d80b4f42
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -400,6 +400,14 @@ attach_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid,
			fio_qpair->extended_lba ? "extended lba" : "separate metadata");
	}

	if (spdk_nvme_ns_supports_extended_lba(ns) &&
	    (spdk_nvme_ns_get_extended_sector_size(ns) != td->o.bs[DDIR_READ] ||
	     spdk_nvme_ns_get_extended_sector_size(ns) != td->o.bs[DDIR_WRITE])) {
		SPDK_ERRLOG("--bs has to be equal to LBA data size + Metadata size\n");
		g_error = true;
		return;
	}

	f->real_file_size = spdk_nvme_ns_get_size(fio_qpair->ns);
	if (f->real_file_size <= 0) {
		g_error = true;