dataplacement: remove FDP_MAX_RUHS
authorAnkit Kumar <ankit.kumar@samsung.com>
Wed, 17 Jul 2024 05:57:27 +0000 (11:27 +0530)
committerAnkit Kumar <ankit.kumar@samsung.com>
Wed, 17 Jul 2024 14:11:40 +0000 (19:41 +0530)
Earlier fio used to have different limits on the max number of data
placement ID indices which user can pass, and the max number of ruhs
which can be stored. As during initialization we now fetch all the ruhs
from the device and then allocate buffer for the requested ones, there
is no need for FDP_MAX_RUHS.

Add missing error message if incorrect placement ID index is specified.

Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
dataplacement.c
dataplacement.h

index ec1427c843214d60a33ca5d99571abc23e49d39a..2286a2cdfd824aa3494adf8d1446c5a0e37c8b90 100644 (file)
@@ -52,7 +52,7 @@ static int init_ruh_info(struct thread_data *td, struct fio_file *f)
                        log_err("fio: stream IDs must be provided for dataplacement=streams\n");
                        return -EINVAL;
                }
-               ruhs = scalloc(1, sizeof(*ruhs) + FDP_MAX_RUHS * sizeof(*ruhs->plis));
+               ruhs = scalloc(1, sizeof(*ruhs) + FIO_MAX_DP_IDS * sizeof(*ruhs->plis));
                if (!ruhs)
                        return -ENOMEM;
 
@@ -94,15 +94,14 @@ static int init_ruh_info(struct thread_data *td, struct fio_file *f)
        }
 
        if (td->o.dp_nr_ids == 0) {
-               if (ruhs->nr_ruhs > FDP_MAX_RUHS)
-                       ruhs->nr_ruhs = FDP_MAX_RUHS;
+               if (ruhs->nr_ruhs > FIO_MAX_DP_IDS)
+                       ruhs->nr_ruhs = FIO_MAX_DP_IDS;
        } else {
-               if (td->o.dp_nr_ids > FDP_MAX_RUHS) {
-                       ret = -EINVAL;
-                       goto out;
-               }
                for (i = 0; i < td->o.dp_nr_ids; i++) {
                        if (td->o.dp_ids[i] >= ruhs->nr_ruhs) {
+                               log_err("fio: for %s PID index %d must be smaller than %d\n",
+                                       f->file_name, td->o.dp_ids[i],
+                                       ruhs->nr_ruhs);
                                ret = -EINVAL;
                                goto out;
                        }
index 3267a46040c10b13f2eb76101b3a39ea38403662..84b7be5b407fe1811e77d2cfe5461d8c612a0de0 100644 (file)
@@ -5,7 +5,6 @@
 
 #define STREAMS_DIR_DTYPE      1
 #define FDP_DIR_DTYPE          2
-#define FDP_MAX_RUHS           128
 #define FIO_MAX_DP_IDS                 128
 #define DP_MAX_SCHEME_ENTRIES  32