int pgfailback;
int rr_weight;
int no_path_retry;
+ int minio;
char * vendor;
char * product;
int pgfailback;
int rr_weight;
int no_path_retry;
+ int minio;
char * wwid;
char * selector;
return 0;
}
+static int
+hw_minio_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 = atoi(buff);
+ FREE(buff);
+
+ return 0;
+}
+
/*
* multipaths block handlers
*/
return 0;
}
+static int
+mp_minio_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 = atoi(buff);
+ FREE(buff);
+
+ return 0;
+}
+
vector
init_keywords(void)
{
install_keyword("failback", &hw_failback_handler);
install_keyword("rr_weight", &hw_weight_handler);
install_keyword("no_path_retry", &hw_no_path_retry_handler);
+ install_keyword("rr_min_io", &hw_minio_handler);
install_sublevel_end();
install_keyword_root("multipaths", &multipaths_handler);
install_keyword("failback", &mp_failback_handler);
install_keyword("rr_weight", &mp_weight_handler);
install_keyword("no_path_retry", &mp_no_path_retry_handler);
+ install_keyword("rr_min_io", &mp_minio_handler);
install_sublevel_end();
return keywords;
pp->pgindex = i + 1;
for (k = 0; k < num_paths_args; k++)
- p += get_word(p, NULL);
+ if (k == 0 && !strncmp(mpp->selector,
+ "round-robin", 11)) {
+ p += get_word(p, &word);
+ mpp->minio = atoi(word);
+
+ if (mpp->rr_weight)
+ mpp->minio /= mpp->rr_weight;
+
+ FREE(word);
+ }
+ else
+ p += get_word(p, NULL);
+
}
}
return 0;
condlog(3, "no_path_retry = NONE (internal default)");
return 0;
}
+
+extern int
+select_minio (struct multipath * mp)
+{
+ if (mp->mpe && mp->mpe->minio) {
+ mp->minio = mp->mpe->minio;
+ condlog(3, "minio = %i (LUN setting)",
+ mp->minio);
+ return 0;
+ }
+ if (mp->hwe && mp->hwe->minio) {
+ mp->minio = mp->hwe->minio;
+ condlog(3, "minio = %i (controler setting)",
+ mp->minio);
+ return 0;
+ }
+ if (conf->minio) {
+ mp->minio = conf->minio;
+ condlog(3, "minio = %i (config file default)",
+ mp->minio);
+ return 0;
+ }
+ mp->minio = 1000;
+ condlog(3, "minio = %i (internal default)",
+ mp->minio);
+ return 0;
+}
+
int select_getuid (struct path * pp);
int select_getprio (struct path * pp);
int select_no_path_retry(struct multipath *mp);
+int select_minio(struct multipath *mp);
int nr_active; /* current available(= not known as failed) paths */
int no_path_retry; /* number of retries after all paths are down */
int retry_tick; /* remaining times for retries */
+ int minio;
unsigned long long size;
vector paths;
vector pg;
# # default : (null)
# #
# #no_path_retry queue
+#
+# #
+# # name : rr_min_io
+# # scope : multipath
+# # desc : the number of IO to route to a path before switching
+# # to the next in the same path group
+# # default : 1000
+# #
+# rr_min_io 100
# }
# multipath {
# wwid 1DEC_____321816758474
# # default : immediate
# #
# failback 30
+#
+# #
+# # name : rr_min_io
+# # scope : multipath
+# # desc : the number of IO to route to a path before switching
+# # to the next in the same path group
+# # default : 1000
+# #
+# rr_min_io 100
# }
# device {
# vendor "COMPAQ "
# failback manual
# rr_weight priorities
# no_path_retry 5
+# rr_min_io 100
# }
# multipath {
# wwid 1DEC_____321816758474
# failback 15
# rr_weight priorities
# no_path_retry queue
+# rr_min_io 100
# }
# device {
# vendor "COMPAQ "
struct pathgroup * pgp;
struct path * pp;
+ minio = mp->minio;
p = mp->params;
freechar = sizeof(mp->params);
freechar -= shift;
vector_foreach_slot (pgp->paths, pp, j) {
- minio = conf->minio;
-
if (mp->rr_weight == RR_WEIGHT_PRIO && pp->priority)
minio *= pp->priority;
select_hwhandler(mpp);
select_rr_weight(mpp);
select_no_path_retry(mpp);
+ select_minio(mpp);
/*
* apply selected grouping policy to valid paths
condlog(3, "set ACT_RELOAD: selector change");
return;
}
+ if (cmpp->minio != mpp->minio) {
+ mpp->action = ACT_RELOAD;
+ condlog(3, "set ACT_RELOAD: minio change (%u->%u)",
+ cmpp->minio, mpp->minio);
+ return;
+ }
if (VECTOR_SIZE(cmpp->pg) != VECTOR_SIZE(mpp->pg)) {
mpp->action = ACT_RELOAD;
condlog(3, "set ACT_RELOAD: number of path group change");