diff options
author | Vincent Fu <vincent.fu@samsung.com> | 2024-01-17 15:19:07 +0000 |
---|---|---|
committer | Vincent Fu <vincent.fu@samsung.com> | 2024-04-24 13:44:09 -0400 |
commit | 1a3a21b73727358c8bb9b4a9762ce30acd9e492e (patch) | |
tree | d938ea74bafd6aa8efd3fd201a450a0f6e708973 | |
parent | ece3a998831dff9f111eb8432dd85ee476fc5a56 (diff) | |
download | fio-1a3a21b73727358c8bb9b4a9762ce30acd9e492e.tar.gz |
fio: support NVMe streams
Make small adjustments to the code supporting FDP to accommodate NVMe
streams.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
-rw-r--r-- | dataplacement.c | 16 | ||||
-rw-r--r-- | dataplacement.h | 7 | ||||
-rw-r--r-- | filesetup.c | 2 | ||||
-rw-r--r-- | io_u.c | 2 |
4 files changed, 21 insertions, 6 deletions
diff --git a/dataplacement.c b/dataplacement.c index a71708639..a409b8250 100644 --- a/dataplacement.c +++ b/dataplacement.c @@ -49,6 +49,20 @@ static int init_ruh_info(struct thread_data *td, struct fio_file *f) 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", @@ -129,6 +143,6 @@ void dp_fill_dspec_data(struct thread_data *td, struct io_u *io_u) 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; io_u->dspec = dspec; } diff --git a/dataplacement.h b/dataplacement.h index b6ceb5bce..b5718c869 100644 --- a/dataplacement.h +++ b/dataplacement.h @@ -3,9 +3,10 @@ #include "io_u.h" -#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 diff --git a/filesetup.c b/filesetup.c index 6fbfced57..cb42a852c 100644 --- a/filesetup.c +++ b/filesetup.c @@ -1411,7 +1411,7 @@ done: 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; @@ -1065,7 +1065,7 @@ static int fill_io_u(struct thread_data *td, struct io_u *io_u) } } - 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) { |