Commit 25d5f262 authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Ben Walker
Browse files

nvme/fio_plugin: Set PRACT flag to the correct bit position



When the NVMe namespace is formatted with PI enabled, PRACT value
is set to the bit 0 unexpectedly and cause the following error.

nvme_ns_cmd.c: 447:_nvme_ns_cmd_rw: *ERROR*: io_flags 0x1 bottom 16 bits is not empty

Change-Id: Ib99c7a974c6a224d4e702b54b654136f10291b18
Signed-off-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/430874


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarXiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
parent 49e9bfda
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -335,6 +335,15 @@ static void parse_prchk_flags(const char *prchk_str)
	}
}

static void parse_pract_flag(int pract)
{
	if (pract == 1) {
		spdk_pract_flag = SPDK_NVME_IO_FLAGS_PRACT;
	} else {
		spdk_pract_flag = 0;
	}
}

/* Called once at initialization. This is responsible for gathering the size of
 * each "file", which in our case are in the form
 * 'key=value [key=value] ... ns=value'
@@ -376,7 +385,7 @@ static int spdk_fio_setup(struct thread_data *td)
		opts.mem_size = fio_options->mem_size;
		opts.shm_id = fio_options->shm_id;
		spdk_enable_sgl = fio_options->enable_sgl;
		spdk_pract_flag = fio_options->pi_act;
		parse_pract_flag(fio_options->pi_act);
		parse_prchk_flags(fio_options->pi_chk);
		if (spdk_env_init(&opts) < 0) {
			SPDK_ERRLOG("Unable to initialize SPDK env\n");