Support different 'minio' values for rq and bio based dm-multipath
authorChristophe Varoqui <christophe.varoqui@opensvc.com>
Mon, 31 Jan 2011 23:21:17 +0000 (00:21 +0100)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Mon, 31 Jan 2011 23:21:17 +0000 (00:21 +0100)
rq based dm-multipath wants a low minio value for optimal performance
(1-2?) whereas bio-based dm-multipath wants a greater value (128-1000)

Introduce a internal DEFAULT_MINIO_RQ set to 1, and new configuration
parameter name 'rr_min_io_rq' useable in 'default', 'device' and
'multipath' sections. The internal hardware table entries also have
the new 'minio_rq' field.

When dm-multipath driver version is detected >= 1.1.0, only the
rr_min_io_rq (cf), minio_rq (hwe) and DEFAULT_MINIO_RQ (default) are
used. Else, preserve the legacy behaviour.

libmultipath/config.c
libmultipath/config.h
libmultipath/defaults.h
libmultipath/devmapper.c
libmultipath/devmapper.h
libmultipath/dict.c
libmultipath/hwtable.c
libmultipath/propsel.c

index 00acf96..f8ba4aa 100644 (file)
@@ -19,6 +19,7 @@
 #include "blacklist.h"
 #include "defaults.h"
 #include "prio.h"
+#include "devmapper.h"
 
 static int
 hwe_strmatch (struct hwentry *hwe1, struct hwentry *hwe2)
@@ -292,6 +293,7 @@ merge_hwe (struct hwentry * hwe1, struct hwentry * hwe2)
        merge_num(rr_weight);
        merge_num(no_path_retry);
        merge_num(minio);
+       merge_num(minio_rq);
 
        return 0;
 }
@@ -345,6 +347,7 @@ store_hwe (vector hwtable, struct hwentry * dhwe)
        hwe->rr_weight = dhwe->rr_weight;
        hwe->no_path_retry = dhwe->no_path_retry;
        hwe->minio = dhwe->minio;
+       hwe->minio_rq = dhwe->minio_rq;
 
        if (dhwe->bl_product && !(hwe->bl_product = set_param_str(dhwe->bl_product)))
                goto out;
@@ -454,8 +457,10 @@ load_config (char * file)
        if (!conf->verbosity)
                conf->verbosity = DEFAULT_VERBOSITY;
 
+       conf->dmrq = dm_drv_get_rq();
        conf->dev_type = DEV_NONE;
-       conf->minio = 1000;
+       conf->minio = DEFAULT_MINIO;
+       conf->minio_rq = DEFAULT_MINIO_RQ;
        conf->max_fds = 0;
        conf->bindings_file = DEFAULT_BINDINGS_FILE;
        conf->bindings_read_only = 0;
index 3877520..46cd32a 100644 (file)
@@ -32,6 +32,7 @@ struct hwentry {
        int rr_weight;
        int no_path_retry;
        int minio;
+       int minio_rq;
        int pg_timeout;
        int flush_on_last_del;
        int fast_io_fail;
@@ -50,6 +51,7 @@ struct mpentry {
        int rr_weight;
        int no_path_retry;
        int minio;
+       int minio_rq;
        int pg_timeout;
        int flush_on_last_del;
        int attribute_flags;
@@ -59,6 +61,7 @@ struct mpentry {
 };
 
 struct config {
+       int dmrq;
        int verbosity;
        int dry_run;
        int list;
@@ -67,6 +70,7 @@ struct config {
        int pgpolicy;
        enum devtypes dev_type;
        int minio;
+       int minio_rq;
        int checkint;
        int max_checkint;
        int pgfailback;
index 77526dd..aa5d538 100644 (file)
@@ -6,6 +6,7 @@
 #define DEFAULT_FEATURES       "0"
 #define DEFAULT_HWHANDLER      "0"
 #define DEFAULT_MINIO          1000
+#define DEFAULT_MINIO_RQ       1
 #define DEFAULT_PGPOLICY       FAILOVER
 #define DEFAULT_FAILBACK       -FAILBACK_MANUAL
 #define DEFAULT_RR_WEIGHT      RR_WEIGHT_NONE
index 4a25563..edd7692 100644 (file)
@@ -72,6 +72,12 @@ dm_init(void) {
        dm_log_init_verbose(conf ? conf->verbosity + 3 : 0);
 }
 
+#define VERSION_GE(v, minv) ( \
+ (v[0] > minv[0]) || \
+ ((v[0] == minv[0]) && (v[1] > minv[1])) || \
+ ((v[0] == minv[0]) && (v[1] == minv[1]) && (v[2] >= minv[2])) \
+)
+
 static int
 dm_libprereq (void)
 {
@@ -83,9 +89,7 @@ dm_libprereq (void)
        condlog(3, "libdevmapper version %s", version);
        sscanf(version, "%d.%d.%d ", &v[0], &v[1], &v[2]);
 
-       if ((v[0] > minv[0]) ||
-           ((v[0] ==  minv[0]) && (v[1] > minv[1])) ||
-           ((v[0] == minv[0]) && (v[1] == minv[1]) && (v[2] >= minv[2])))
+       if VERSION_GE(v, minv)
                return 0;
        condlog(0, "libdevmapper version must be >= %d.%.2d.%.2d",
                minv[0], minv[1], minv[2]);
@@ -93,17 +97,16 @@ dm_libprereq (void)
 }
 
 static int
-dm_drvprereq (char * str)
+dm_drv_version (unsigned int * version, char * str)
 {
        int r = 2;
        struct dm_task *dmt;
        struct dm_versions *target;
        struct dm_versions *last_target;
-       int minv[3] = {1, 0, 3};
        unsigned int *v;
 
        if (!(dmt = dm_task_create(DM_DEVICE_LIST_VERSIONS)))
-               return 3;
+               return 1;
 
        dm_task_no_open_count(dmt);
 
@@ -123,23 +126,71 @@ dm_drvprereq (char * str)
        } while (last_target != target);
 
        if (r == 2) {
-               condlog(0, "DM multipath kernel driver not loaded");
+               condlog(0, "DM %s kernel driver not loaded", str);
                goto out;
        }
        v = target->version;
-       if ((v[0] > minv[0]) ||
-           ((v[0] == minv[0]) && (v[1] > minv[1])) ||
-           ((v[0] == minv[0]) && (v[1] == minv[1]) && (v[2] >= minv[2]))) {
-               r = 0;
-               goto out;
-       }
-       condlog(0, "DM multipath kernel driver must be >= %u.%.2u.%.2u",
-               minv[0], minv[1], minv[2]);
+        version[0] = v[0];
+        version[1] = v[1];
+        version[2] = v[2];
+       r = 0;
 out:
        dm_task_destroy(dmt);
        return r;
 }
 
+int
+dm_drv_get_rq (void)
+{
+       unsigned int minv_dmrq[3] = {1, 1, 0};
+       unsigned int *v;
+
+       v = zalloc(3);
+       if (!v)
+               return 0;
+
+       if (dm_drv_version(v, TGT_MPATH)) {
+               /* in doubt return least capable */
+               return 0;
+       }
+
+       /* test request based multipath capability */
+       if VERSION_GE(v, minv_dmrq) {
+               condlog(3, "activate request-based multipathing mode "
+                          "(driver >= v%u.%u.%u)",
+                       minv_dmrq[0], minv_dmrq[1], minv_dmrq[2]);
+               return 1;
+       }
+       return 0;
+}
+
+static int
+dm_drvprereq (char * str)
+{
+       unsigned int minv[3] = {1, 0, 3};
+       unsigned int *v;
+
+       v = zalloc(3);
+       if (!v)
+               return 0;
+
+       if (dm_drv_version(v, str)) {
+               /* in doubt return not capable */
+               return 1;
+       }
+
+       /* test request based multipath capability */
+       condlog(3, "DM multipath kernel driver v%u.%u.%u",
+               v[0], v[1], v[2]);
+
+       if VERSION_GE(v, minv)
+               return 1;
+
+       condlog(0, "DM multipath kernel driver must be >= v%u.%u.%u",
+               minv[0], minv[1], minv[2]);
+       return 0;
+}
+
 extern int
 dm_prereq (void)
 {
index d2dd572..1322e22 100644 (file)
@@ -8,6 +8,7 @@
 
 void dm_init(void);
 int dm_prereq (void);
+int dm_drv_get_rq (void);
 int dm_simplecmd_flush (int, const char *, int);
 int dm_simplecmd_noflush (int, const char *);
 int dm_addmap_create (struct multipath *mpp);
index c5c085d..fdeaec2 100644 (file)
@@ -207,6 +207,22 @@ def_minio_handler(vector strvec)
        return 0;
 }
 
+static int
+def_minio_rq_handler(vector strvec)
+{
+       char * buff;
+
+       buff = set_value(strvec);
+
+       if (!buff)
+               return 1;
+
+       conf->minio_rq = atoi(buff);
+       FREE(buff);
+
+       return 0;
+}
+
 static int
 get_sys_max_fds(int *max_fds)
 {
@@ -991,6 +1007,26 @@ hw_minio_handler(vector strvec)
        return 0;
 }
 
+static int
+hw_minio_rq_handler(vector strvec)
+{
+       struct hwentry *hwe = VECTOR_LAST_SLOT(conf->hwtable);
+       char * buff;
+
+       if (!hwe)
+               return 1;
+
+       buff = set_value(strvec);
+
+       if (!buff)
+               return 1;
+
+       hwe->minio_rq = atoi(buff);
+       FREE(buff);
+
+       return 0;
+}
+
 static int
 hw_pg_timeout_handler(vector strvec)
 {
@@ -1323,6 +1359,26 @@ mp_minio_handler(vector strvec)
        return 0;
 }
 
+static int
+mp_minio_rq_handler(vector strvec)
+{
+       struct mpentry *mpe = VECTOR_LAST_SLOT(conf->mptable);
+       char * buff;
+
+       if (!mpe)
+               return 1;
+
+       buff = set_value(strvec);
+
+       if (!buff)
+               return 1;
+
+       mpe->minio_rq = atoi(buff);
+       FREE(buff);
+
+       return 0;
+}
+
 static int
 mp_pg_timeout_handler(vector strvec)
 {
@@ -1523,6 +1579,17 @@ snprint_mp_rr_min_io (char * buff, int len, void * data)
        return snprintf(buff, len, "%u", mpe->minio);
 }
 
+static int
+snprint_mp_rr_min_io_rq (char * buff, int len, void * data)
+{
+       struct mpentry * mpe = (struct mpentry *)data;
+
+       if (!mpe->minio_rq)
+               return 0;
+
+       return snprintf(buff, len, "%u", mpe->minio_rq);
+}
+
 static int
 snprint_mp_pg_timeout (char * buff, int len, void * data)
 {
@@ -1767,6 +1834,17 @@ snprint_hw_rr_min_io (char * buff, int len, void * data)
        return snprintf(buff, len, "%u", hwe->minio);
 }
 
+static int
+snprint_hw_rr_min_io_rq (char * buff, int len, void * data)
+{
+       struct hwentry * hwe = (struct hwentry *)data;
+
+       if (!hwe->minio_rq)
+               return 0;
+
+       return snprintf(buff, len, "%u", hwe->minio_rq);
+}
+
 static int
 snprint_hw_pg_timeout (char * buff, int len, void * data)
 {
@@ -1956,6 +2034,15 @@ snprint_def_rr_min_io (char * buff, int len, void * data)
        return snprintf(buff, len, "%u", conf->minio);
 }
 
+static int
+snprint_def_rr_min_io_rq (char * buff, int len, void * data)
+{
+       if (!conf->minio_rq)
+               return 0;
+
+       return snprintf(buff, len, "%u", conf->minio_rq);
+}
+
 static int
 snprint_max_fds (char * buff, int len, void * data)
 {
@@ -2128,6 +2215,7 @@ init_keywords(void)
        install_keyword("alias_prefix", &def_alias_prefix_handler, &snprint_def_alias_prefix);
        install_keyword("failback", &default_failback_handler, &snprint_def_failback);
        install_keyword("rr_min_io", &def_minio_handler, &snprint_def_rr_min_io);
+       install_keyword("rr_min_io_rq", &def_minio_rq_handler, &snprint_def_rr_min_io_rq);
        install_keyword("max_fds", &max_fds_handler, &snprint_max_fds);
        install_keyword("rr_weight", &def_weight_handler, &snprint_def_rr_weight);
        install_keyword("no_path_retry", &def_no_path_retry_handler, &snprint_def_no_path_retry);
@@ -2195,6 +2283,7 @@ init_keywords(void)
        install_keyword("rr_weight", &hw_weight_handler, &snprint_hw_rr_weight);
        install_keyword("no_path_retry", &hw_no_path_retry_handler, &snprint_hw_no_path_retry);
        install_keyword("rr_min_io", &hw_minio_handler, &snprint_hw_rr_min_io);
+       install_keyword("rr_min_io_rq", &hw_minio_rq_handler, &snprint_hw_rr_min_io_rq);
        install_keyword("pg_timeout", &hw_pg_timeout_handler, &snprint_hw_pg_timeout);
        install_keyword("flush_on_last_del", &hw_flush_on_last_del_handler, &snprint_hw_flush_on_last_del);
        install_keyword("fast_io_fail_tmo", &hw_fast_io_fail_handler, &snprint_hw_fast_io_fail);
@@ -2212,6 +2301,7 @@ init_keywords(void)
        install_keyword("rr_weight", &mp_weight_handler, &snprint_mp_rr_weight);
        install_keyword("no_path_retry", &mp_no_path_retry_handler, &snprint_mp_no_path_retry);
        install_keyword("rr_min_io", &mp_minio_handler, &snprint_mp_rr_min_io);
+       install_keyword("rr_min_io_rq", &mp_minio_rq_handler, &snprint_mp_rr_min_io_rq);
        install_keyword("pg_timeout", &mp_pg_timeout_handler, &snprint_mp_pg_timeout);
        install_keyword("flush_on_last_del", &mp_flush_on_last_del_handler, &snprint_mp_flush_on_last_del);
        install_keyword("mode", &mp_mode_handler, &snprint_mp_mode);
index 18c704c..9e6888e 100644 (file)
@@ -35,6 +35,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_QUEUE,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = TUR,
                .prio_name     = DEFAULT_PRIO,
                .prio_args     = NULL,
@@ -57,6 +58,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_UNDEF,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = DEFAULT_CHECKER,
                .prio_name     = DEFAULT_PRIO,
                .prio_args     = NULL,
@@ -79,6 +81,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_UNDEF,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = DEFAULT_CHECKER,
                .prio_name     = DEFAULT_PRIO,
                .prio_args     = NULL,
@@ -95,6 +98,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_UNDEF,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = HP_SW,
                .prio_name     = PRIO_HP_SW,
                .prio_args     = NULL,
@@ -111,6 +115,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = 12,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = DIRECTIO,
                .prio_name     = DEFAULT_PRIO,
                .prio_args     = NULL,
@@ -232,6 +237,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = 12,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = TUR,
                .prio_name     = DEFAULT_PRIO,
                .prio_args     = NULL,
@@ -254,6 +260,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_UNDEF,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = DIRECTIO,
                .prio_name     = DEFAULT_PRIO,
                .prio_args     = NULL,
@@ -276,6 +283,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_UNDEF,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = DIRECTIO,
                .prio_name     = DEFAULT_PRIO,
                .prio_args     = NULL,
@@ -293,6 +301,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = (300 / DEFAULT_CHECKINT),
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = EMC_CLARIION,
                .prio_name     = PRIO_EMC,
                .prio_args     = NULL,
@@ -310,6 +319,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = 5,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .prio_name     = DEFAULT_PRIO,
                .prio_args     = NULL,
        },
@@ -331,6 +341,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_UNDEF,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = DIRECTIO,
                .prio_name     = DEFAULT_PRIO,
                .prio_args     = NULL,
@@ -348,6 +359,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = 5,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = TUR,
                .prio_name     = DEFAULT_PRIO,
                .prio_args     = NULL,
@@ -370,6 +382,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_UNDEF,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = TUR,
                .prio_name     = DEFAULT_PRIO,
                .prio_args     = NULL,
@@ -386,6 +399,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_UNDEF,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = TUR,
                .prio_name     = PRIO_HDS,
                .prio_args     = NULL,
@@ -408,6 +422,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_UNDEF,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = DIRECTIO,
                .prio_name     = DEFAULT_PRIO,
                .prio_args     = NULL,
@@ -425,6 +440,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = 300,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
                .prio_args     = NULL,
@@ -442,6 +458,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = 300,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
                .prio_args     = NULL,
@@ -459,6 +476,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = 300,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
                .prio_args     = NULL,
@@ -476,6 +494,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_QUEUE,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
                .prio_args     = NULL,
@@ -492,6 +511,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = 15,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
                .prio_args     = NULL,
@@ -509,6 +529,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_QUEUE,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
                .prio_args     = NULL,
@@ -526,6 +547,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_QUEUE,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
                .prio_args     = NULL,
@@ -543,6 +565,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_QUEUE,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
                .prio_args     = NULL,
@@ -560,6 +583,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_QUEUE,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
                .prio_args     = NULL,
@@ -577,6 +601,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_UNDEF,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = TUR,
                .prio_name     = DEFAULT_PRIO,
                .prio_args     = NULL,
@@ -594,6 +619,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_UNDEF,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = TUR,
                .prio_name     = DEFAULT_PRIO,
                .prio_args     = NULL,
@@ -611,6 +637,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_UNDEF,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = TUR,
                .prio_name     = DEFAULT_PRIO,
                .prio_args     = NULL,
@@ -628,6 +655,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_UNDEF,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = TUR,
                .prio_name     = PRIO_ALUA,
                .prio_args     = NULL,
@@ -645,6 +673,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_UNDEF,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = TUR,
                .prio_name     = DEFAULT_PRIO,
                .prio_args     = NULL,
@@ -662,6 +691,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_UNDEF,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = TUR,
                .prio_name     = PRIO_ALUA,
                .prio_args     = NULL,
@@ -680,6 +710,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_UNDEF,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = DIRECTIO,
                .prio_name     = DEFAULT_PRIO,
                .prio_args     = NULL,
@@ -698,6 +729,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_UNDEF,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = DIRECTIO,
                .prio_name     = DEFAULT_PRIO,
                .prio_args     = NULL,
@@ -715,6 +747,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_UNDEF,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = TUR,
                .prio_name     = PRIO_ALUA,
                .prio_args     = NULL,
@@ -738,6 +771,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = (300 / DEFAULT_CHECKINT),
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = DIRECTIO,
                .prio_name     = DEFAULT_PRIO,
                .prio_args     = NULL,
@@ -755,6 +789,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = (300 / DEFAULT_CHECKINT),
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = TUR,
                .prio_name     = DEFAULT_PRIO,
                .prio_args     = NULL,
@@ -772,6 +807,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = (300 / DEFAULT_CHECKINT),
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = TUR,
                .prio_name     = PRIO_ALUA,
                .prio_args     = NULL,
@@ -789,6 +825,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = 15,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
                .prio_args     = NULL,
@@ -806,6 +843,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = 15,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
                .prio_args     = NULL,
@@ -823,6 +861,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = 15,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
                .prio_args     = NULL,
@@ -840,6 +879,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = 15,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
                .prio_args     = NULL,
@@ -928,6 +968,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_UNDEF,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = TUR,
                .prio_name     = PRIO_ALUA,
                .prio_args     = NULL,
@@ -951,6 +992,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_UNDEF,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = DIRECTIO,
                .prio_name     = DEFAULT_PRIO,
                .prio_args     = NULL,
@@ -967,6 +1009,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_QUEUE,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
                .prio_args     = NULL,
@@ -983,6 +1026,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = 15,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
                .prio_args     = NULL,
@@ -1005,6 +1049,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_UNDEF,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = TUR,
                .prio_name     = PRIO_RDAC,
                .prio_args     = NULL,
@@ -1027,6 +1072,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_UNDEF,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = DIRECTIO,
                .prio_name     = DEFAULT_PRIO,
                .prio_args     = NULL,
@@ -1043,6 +1089,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_UNDEF,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = DEFAULT_CHECKER,
                .prio_name     = DEFAULT_PRIO,
        },
@@ -1080,6 +1127,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_QUEUE,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
                .prio_args     = NULL,
@@ -1097,6 +1145,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_QUEUE,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
                .prio_args     = NULL,
@@ -1114,6 +1163,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = 15,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
                .prio_args     = NULL,
@@ -1131,6 +1181,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = RR_WEIGHT_NONE,
                .no_path_retry = NO_PATH_RETRY_QUEUE,
                .minio         = DEFAULT_MINIO,
+               .minio_rq      = DEFAULT_MINIO_RQ,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
                .prio_args     = NULL,
@@ -1150,6 +1201,7 @@ static struct hwentry default_hw[] = {
                .rr_weight     = 0,
                .no_path_retry = 0,
                .minio         = 0,
+               .minio_rq      = 0,
                .checker_name  = NULL,
                .prio_name     = NULL,
                .prio_args     = NULL,
index 5e67019..2055d2a 100644 (file)
@@ -418,8 +418,35 @@ select_no_path_retry(struct multipath *mp)
        return 0;
 }
 
-extern int
-select_minio (struct multipath * mp)
+int
+select_minio_rq (struct multipath * mp)
+{
+       if (mp->mpe && mp->mpe->minio_rq) {
+               mp->minio = mp->mpe->minio_rq;
+               condlog(3, "%s: minio = %i rq (LUN setting)",
+                       mp->alias, mp->minio);
+               return 0;
+       }
+       if (mp->hwe && mp->hwe->minio_rq) {
+               mp->minio = mp->hwe->minio_rq;
+               condlog(3, "%s: minio = %i rq (controller setting)",
+                       mp->alias, mp->minio);
+               return 0;
+       }
+       if (conf->minio) {
+               mp->minio = conf->minio_rq;
+               condlog(3, "%s: minio = %i rq (config file default)",
+                       mp->alias, mp->minio);
+               return 0;
+       }
+       mp->minio = DEFAULT_MINIO_RQ;
+       condlog(3, "%s: minio = %i rq (internal default)",
+               mp->alias, mp->minio);
+       return 0;
+}
+
+int
+select_minio_bio (struct multipath * mp)
 {
        if (mp->mpe && mp->mpe->minio) {
                mp->minio = mp->mpe->minio;
@@ -445,6 +472,15 @@ select_minio (struct multipath * mp)
        return 0;
 }
 
+extern int
+select_minio (struct multipath * mp)
+{
+       if (conf->dmrq)
+               return select_minio_rq(mp);
+       else
+               return select_minio_bio(mp);
+}
+
 extern int
 select_pg_timeout(struct multipath *mp)
 {