summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2012-08-14 10:13:40 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2012-08-14 10:13:40 +0000
commitf7a4b821dc596d271e337b16e2630785f23f1cb5 (patch)
tree4cc5a18c4cddcb50dc0af38950aed53997055890 /sys
parent9544025c4e922307d4b391f2c5d68a1f7eeb462d (diff)
expose the max number of logical volumes the hardware supports as the width
of its scsibus. only advertise 1 lun on logical volumes instead of letting the midlayer fix it up to 8. give every target on the bus max_cmds openings. iopools means they will properly share access to them. this in particular is useful on skinny controllers which only advertise 31 command slots. if you have 16 volumes, theyll only get 1 opening each with the old maths. this way round the ones that are busy will share the slots. tested on a perc5 with two volumes and hard workloads.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/mfi.c19
-rw-r--r--sys/dev/ic/mfivar.h3
2 files changed, 8 insertions, 14 deletions
diff --git a/sys/dev/ic/mfi.c b/sys/dev/ic/mfi.c
index ed02ac29cc8..02cbf90ce00 100644
--- a/sys/dev/ic/mfi.c
+++ b/sys/dev/ic/mfi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mfi.c,v 1.128 2012/08/14 04:07:53 dlg Exp $ */
+/* $OpenBSD: mfi.c,v 1.129 2012/08/14 10:13:39 dlg Exp $ */
/*
* Copyright (c) 2006 Marco Peereboom <marco@peereboom.us>
*
@@ -742,19 +742,15 @@ mfi_attach(struct mfi_softc *sc, enum mfi_iop iop)
printf("\n");
sc->sc_ld_cnt = sc->sc_info.mci_lds_present;
- sc->sc_max_ld = sc->sc_ld_cnt;
for (i = 0; i < sc->sc_ld_cnt; i++)
sc->sc_ld[i].ld_present = 1;
- if (sc->sc_ld_cnt)
- sc->sc_link.openings = sc->sc_max_cmds / sc->sc_ld_cnt;
- else
- sc->sc_link.openings = sc->sc_max_cmds;
-
- sc->sc_link.adapter_softc = sc;
sc->sc_link.adapter = &mfi_switch;
- sc->sc_link.adapter_target = MFI_MAX_LD;
- sc->sc_link.adapter_buswidth = sc->sc_max_ld;
+ sc->sc_link.adapter_softc = sc;
+ sc->sc_link.adapter_buswidth = sc->sc_info.mci_max_lds;
+ sc->sc_link.adapter_target = -1;
+ sc->sc_link.luns = 1;
+ sc->sc_link.openings = sc->sc_max_cmds - 1;
sc->sc_link.pool = &sc->sc_iopool;
bzero(&saa, sizeof(saa));
@@ -1041,8 +1037,7 @@ mfi_scsi_cmd(struct scsi_xfer *xs)
DNPRINTF(MFI_D_CMD, "%s: mfi_scsi_cmd opcode: %#x\n",
DEVNAME(sc), xs->cmd->opcode);
- if (target >= MFI_MAX_LD || !sc->sc_ld[target].ld_present ||
- link->lun != 0) {
+ if (!sc->sc_ld[target].ld_present) {
DNPRINTF(MFI_D_CMD, "%s: invalid target %d\n",
DEVNAME(sc), target);
goto stuffup;
diff --git a/sys/dev/ic/mfivar.h b/sys/dev/ic/mfivar.h
index adc4f7a013b..6e5e49086c3 100644
--- a/sys/dev/ic/mfivar.h
+++ b/sys/dev/ic/mfivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mfivar.h,v 1.46 2012/08/14 03:46:46 dlg Exp $ */
+/* $OpenBSD: mfivar.h,v 1.47 2012/08/14 10:13:39 dlg Exp $ */
/*
* Copyright (c) 2006 Marco Peereboom <marco@peereboom.us>
*
@@ -137,7 +137,6 @@ struct mfi_softc {
uint32_t sc_max_cmds;
uint32_t sc_max_sgl;
uint32_t sc_sgl_size;
- uint32_t sc_max_ld;
uint32_t sc_ld_cnt;
uint16_t sc_sgl_flags;