Make small adjustments to the code supporting FDP to accommodate NVMe
streams.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
if (!ruhs)
return -ENOMEM;
if (!ruhs)
return -ENOMEM;
+ /* set up the data structure used for FDP to work with the supplied stream IDs */
+ if (td->o.dp_type == FIO_DP_STREAMS) {
+ if (!td->o.dp_nr_ids) {
+ log_err("fio: stream IDs must be provided for dataplacement=streams\n");
+ return -EINVAL;
+ }
+ ruhs->nr_ruhs = td->o.dp_nr_ids;
+ for (int i = 0; i < ruhs->nr_ruhs; i++)
+ ruhs->plis[i] = td->o.dp_ids[i];
+
+ f->ruhs_info = ruhs;
+ return 0;
+ }
+
ret = fdp_ruh_info(td, f, ruhs);
if (ret) {
log_info("fio: ruh info failed for %s (%d)\n",
ret = fdp_ruh_info(td, f, ruhs);
if (ret) {
log_info("fio: ruh info failed for %s (%d)\n",
dspec = ruhs->plis[ruhs->pli_loc];
}
dspec = ruhs->plis[ruhs->pli_loc];
}
- io_u->dtype = FDP_DIR_DTYPE;
+ io_u->dtype = td->o.dp_type == FIO_DP_FDP ? FDP_DIR_DTYPE : STREAMS_DIR_DTYPE;
-#define FDP_DIR_DTYPE 2
-#define FDP_MAX_RUHS 128
-#define FIO_MAX_DP_IDS 16
+#define STREAMS_DIR_DTYPE 1
+#define FDP_DIR_DTYPE 2
+#define FDP_MAX_RUHS 128
+#define FIO_MAX_DP_IDS 16
/*
* How fio chooses what placement identifier to use next. Choice of
/*
* How fio chooses what placement identifier to use next. Choice of
td_restore_runstate(td, old_state);
td_restore_runstate(td, old_state);
- if (td->o.dp_type == FIO_DP_FDP) {
+ if (td->o.dp_type != FIO_DP_NONE) {
err = dp_init(td);
if (err)
goto err_out;
err = dp_init(td);
if (err)
goto err_out;
- if (td->o.dp_type == FIO_DP_FDP)
+ if (td->o.dp_type != FIO_DP_NONE)
dp_fill_dspec_data(td, io_u);
if (io_u->offset + io_u->buflen > io_u->file->real_file_size) {
dp_fill_dspec_data(td, io_u);
if (io_u->offset + io_u->buflen > io_u->file->real_file_size) {