summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2013-08-27 00:53:11 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2013-08-27 00:53:11 +0000
commit4113944c94ed8ed679fbc0e3e99f6d8bbf900719 (patch)
tree4e7c6d0940c30da810b837ccab4a334082191fcb
parent7293eb683ef570f5ebe82bec57f518663131177d (diff)
get rid of the different path scheduler types, which simplifies the
code that picks the next path. we assume roundrobin within a group of paths now. the asym sym(4) devices work around this by putting every path in its own group.
-rw-r--r--sys/scsi/mpath.c28
-rw-r--r--sys/scsi/mpath_emc.c5
-rw-r--r--sys/scsi/mpath_hds.c5
-rw-r--r--sys/scsi/mpath_rdac.c5
-rw-r--r--sys/scsi/mpath_sym.c8
-rw-r--r--sys/scsi/mpathvar.h7
6 files changed, 23 insertions, 35 deletions
diff --git a/sys/scsi/mpath.c b/sys/scsi/mpath.c
index c3aef7a19f3..7cd5d134f21 100644
--- a/sys/scsi/mpath.c
+++ b/sys/scsi/mpath.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpath.c,v 1.31 2013/08/26 12:20:12 dlg Exp $ */
+/* $OpenBSD: mpath.c,v 1.32 2013/08/27 00:53:09 dlg Exp $ */
/*
* Copyright (c) 2009 David Gwynne <dlg@openbsd.org>
@@ -92,7 +92,7 @@ void mpath_cmd(struct scsi_xfer *);
void mpath_minphys(struct buf *, struct scsi_link *);
int mpath_probe(struct scsi_link *);
-struct mpath_path *mpath_next_path(struct mpath_dev *, int);
+struct mpath_path *mpath_next_path(struct mpath_dev *);
void mpath_done(struct scsi_xfer *);
void mpath_failover(struct mpath_dev *);
@@ -159,21 +159,21 @@ mpath_probe(struct scsi_link *link)
}
struct mpath_path *
-mpath_next_path(struct mpath_dev *d, int next)
+mpath_next_path(struct mpath_dev *d)
{
struct mpath_group *g;
struct mpath_path *p;
+#ifdef DIAGNOSTIC
if (d == NULL)
panic("%s: d is NULL", __func__);
+#endif
p = d->d_next_path;
- if (p != NULL && next == MPATH_NEXT) {
- d->d_next_path = TAILQ_NEXT(p, p_entry);
- if (d->d_next_path == NULL) {
- g = TAILQ_FIRST(&d->d_groups);
- d->d_next_path = TAILQ_FIRST(&g->g_paths);
- }
+ d->d_next_path = TAILQ_NEXT(p, p_entry);
+ if (d->d_next_path == NULL) {
+ g = TAILQ_FIRST(&d->d_groups);
+ d->d_next_path = TAILQ_FIRST(&g->g_paths);
}
return (p);
@@ -195,7 +195,7 @@ mpath_cmd(struct scsi_xfer *xs)
if (ISSET(xs->flags, SCSI_POLL)) {
mtx_enter(&d->d_mtx);
- p = mpath_next_path(d, d->d_ops->op_schedule);
+ p = mpath_next_path(d);
mtx_leave(&d->d_mtx);
if (p == NULL) {
mpath_xs_stuffup(xs);
@@ -231,7 +231,7 @@ mpath_cmd(struct scsi_xfer *xs)
mtx_enter(&d->d_mtx);
SIMPLEQ_INSERT_TAIL(&d->d_xfers, xs, xfer_list);
- p = mpath_next_path(d, d->d_ops->op_schedule);
+ p = mpath_next_path(d);
mtx_leave(&d->d_mtx);
if (p != NULL)
@@ -290,15 +290,13 @@ mpath_done(struct scsi_xfer *mxs)
struct mpath_softc *sc = link->adapter_softc;
struct mpath_dev *d = sc->sc_devs[link->target];
struct mpath_path *p;
- int next = d->d_ops->op_schedule;
switch (mxs->error) {
case XS_SELTIMEOUT: /* physical path is gone, try the next */
- next = MPATH_NEXT;
case XS_RESET:
mtx_enter(&d->d_mtx);
SIMPLEQ_INSERT_HEAD(&d->d_xfers, xs, xfer_list);
- p = mpath_next_path(d, next);
+ p = mpath_next_path(d);
mtx_leave(&d->d_mtx);
scsi_xs_put(mxs);
@@ -311,7 +309,7 @@ mpath_done(struct scsi_xfer *mxs)
case MPATH_SENSE_FAILOVER:
mtx_enter(&d->d_mtx);
SIMPLEQ_INSERT_HEAD(&d->d_xfers, xs, xfer_list);
- p = mpath_next_path(d, next);
+ p = mpath_next_path(d);
mtx_leave(&d->d_mtx);
scsi_xs_put(mxs);
diff --git a/sys/scsi/mpath_emc.c b/sys/scsi/mpath_emc.c
index 18ff55941ac..dcca2e103fa 100644
--- a/sys/scsi/mpath_emc.c
+++ b/sys/scsi/mpath_emc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpath_emc.c,v 1.12 2013/08/27 00:24:03 dlg Exp $ */
+/* $OpenBSD: mpath_emc.c,v 1.13 2013/08/27 00:53:09 dlg Exp $ */
/*
* Copyright (c) 2011 David Gwynne <dlg@openbsd.org>
@@ -96,8 +96,7 @@ void emc_mpath_status(struct scsi_link *);
const struct mpath_ops emc_mpath_ops = {
"emc",
emc_mpath_checksense,
- emc_mpath_status,
- MPATH_ROUNDROBIN
+ emc_mpath_status
};
struct emc_device {
diff --git a/sys/scsi/mpath_hds.c b/sys/scsi/mpath_hds.c
index e4f28508bdb..9e5b969e1d4 100644
--- a/sys/scsi/mpath_hds.c
+++ b/sys/scsi/mpath_hds.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpath_hds.c,v 1.10 2013/08/27 00:24:03 dlg Exp $ */
+/* $OpenBSD: mpath_hds.c,v 1.11 2013/08/27 00:53:10 dlg Exp $ */
/*
* Copyright (c) 2011 David Gwynne <dlg@openbsd.org>
@@ -91,8 +91,7 @@ void hds_mpath_status(struct scsi_link *);
const struct mpath_ops hds_mpath_ops = {
"hds",
hds_mpath_checksense,
- hds_mpath_status,
- MPATH_ROUNDROBIN
+ hds_mpath_status
};
struct hds_device {
diff --git a/sys/scsi/mpath_rdac.c b/sys/scsi/mpath_rdac.c
index 39b39691ece..246c582dfd8 100644
--- a/sys/scsi/mpath_rdac.c
+++ b/sys/scsi/mpath_rdac.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpath_rdac.c,v 1.16 2013/08/26 12:20:12 dlg Exp $ */
+/* $OpenBSD: mpath_rdac.c,v 1.17 2013/08/27 00:53:10 dlg Exp $ */
/*
* Copyright (c) 2010 David Gwynne <dlg@openbsd.org>
@@ -152,8 +152,7 @@ void rdac_mpath_status(struct scsi_link *);
const struct mpath_ops rdac_mpath_ops = {
"rdac",
rdac_mpath_checksense,
- rdac_mpath_status,
- MPATH_ROUNDROBIN
+ rdac_mpath_status
};
int rdac_extdevid(struct rdac_softc *);
diff --git a/sys/scsi/mpath_sym.c b/sys/scsi/mpath_sym.c
index b2f15630e3a..95a87df0825 100644
--- a/sys/scsi/mpath_sym.c
+++ b/sys/scsi/mpath_sym.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpath_sym.c,v 1.15 2013/08/26 12:20:12 dlg Exp $ */
+/* $OpenBSD: mpath_sym.c,v 1.16 2013/08/27 00:53:10 dlg Exp $ */
/*
* Copyright (c) 2010 David Gwynne <dlg@openbsd.org>
@@ -67,15 +67,13 @@ void sym_mpath_status(struct scsi_link *);
const struct mpath_ops sym_mpath_sym_ops = {
"sym",
sym_mpath_checksense,
- sym_mpath_status,
- MPATH_ROUNDROBIN
+ sym_mpath_status
};
const struct mpath_ops sym_mpath_asym_ops = {
"sym",
sym_mpath_checksense,
- sym_mpath_status,
- MPATH_MRU
+ sym_mpath_status
};
struct sym_device {
diff --git a/sys/scsi/mpathvar.h b/sys/scsi/mpathvar.h
index 224f60e5631..45fd4c2e00a 100644
--- a/sys/scsi/mpathvar.h
+++ b/sys/scsi/mpathvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpathvar.h,v 1.8 2013/08/26 12:20:12 dlg Exp $ */
+/* $OpenBSD: mpathvar.h,v 1.9 2013/08/27 00:53:10 dlg Exp $ */
/*
* Copyright (c) 2010 David Gwynne <dlg@openbsd.org>
@@ -25,7 +25,6 @@ struct mpath_ops {
char op_name[16];
int (*op_checksense)(struct scsi_xfer *);
void (*op_status)(struct scsi_link *);
- int op_schedule;
};
#define MPATH_SENSE_DECLINED 0 /* path driver declined to interpret sense */
@@ -35,10 +34,6 @@ struct mpath_ops {
#define MPATH_S_ACTIVE 0
#define MPATH_S_PASSIVE 1
-#define MPATH_ROUNDROBIN 0 /* use all active paths */
-#define MPATH_NEXT MPATH_ROUNDROBIN
-#define MPATH_MRU 1 /* use most recently used path */
-
struct mpath_path {
/* the path driver must set these */
struct scsi_xshandler p_xsh;