summaryrefslogtreecommitdiffstats
path: root/sys/dev/isp/isp_pci.c
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>2006-11-14 08:45:48 +0000
committermjacob <mjacob@FreeBSD.org>2006-11-14 08:45:48 +0000
commitd01394099a796814ca94610a8346a06938477b62 (patch)
tree0dc9331f44aaf2008f03701417bb906d67a662ce /sys/dev/isp/isp_pci.c
parent2243c89dab13821877b37a12fc641ace8c50891d (diff)
downloadFreeBSD-src-d01394099a796814ca94610a8346a06938477b62.zip
FreeBSD-src-d01394099a796814ca94610a8346a06938477b62.tar.gz
Push things closer to path failover by implementing loop down and
gone device timers and zombie state entries. There are tunables that can be used to select a number of parameters. loop_down_limit - how long to wait for loop to come back up before declaring all devices dead (default 300 seconds) gone_device_time- how long to wait for a device that has appeared to leave the loop or fabric to reappear (default 30 seconds) Internal tunables include (which should be externalized): quick_boot_time- how long to wait when booting for loop to come up change_is_bad- whether or not to accept devices with the same WWNN/WWPN that reappear at a different PortID as being the 'same' device. Keen students of some of the subtle issues here will ask how one can keep devices from being re-accepted at all (the answer is to set a gone_device_time to zero- that effectively would be the same thing).
Diffstat (limited to 'sys/dev/isp/isp_pci.c')
-rw-r--r--sys/dev/isp/isp_pci.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/sys/dev/isp/isp_pci.c b/sys/dev/isp/isp_pci.c
index db17cc7..2f9c9a5 100644
--- a/sys/dev/isp/isp_pci.c
+++ b/sys/dev/isp/isp_pci.c
@@ -432,6 +432,9 @@ isp_get_options(device_t dev, ispsoftc_t *isp)
uint64_t wwn;
int bitmap, unit;
+ callout_handle_init(&isp->isp_osinfo.ldt);
+ callout_handle_init(&isp->isp_osinfo.gdt);
+
unit = device_get_unit(dev);
if (getenv_int("isp_disable", &bitmap)) {
if (bitmap & (1 << unit)) {
@@ -520,6 +523,14 @@ isp_get_options(device_t dev, ispsoftc_t *isp)
isp->isp_osinfo.loop_down_limit = isp_loop_down_limit;
}
+ bitmap = 0;
+ (void) getenv_int("isp_gone_device_time", &bitmap);
+ if (bitmap >= 0 && bitmap < 0xffff) {
+ isp->isp_osinfo.gone_device_time = bitmap;
+ } else {
+ isp->isp_osinfo.gone_device_time = isp_gone_device_time;
+ }
+
#ifdef ISP_FW_CRASH_DUMP
bitmap = 0;
@@ -578,6 +589,10 @@ isp_get_options(device_t dev, ispsoftc_t *isp)
{
int tval;
const char *sptr;
+
+ callout_handle_init(&isp->isp_osinfo.ldt);
+ callout_handle_init(&isp->isp_osinfo.gdt);
+
/*
* Figure out if we're supposed to skip this one.
*/
@@ -733,7 +748,7 @@ isp_get_options(device_t dev, ispsoftc_t *isp)
isp->isp_osinfo.hysteresis = isp_fabric_hysteresis;
}
- tval = 0;
+ tval = -1;
(void) resource_int_value(device_get_name(dev), device_get_unit(dev),
"loop_down_limit", &tval);
if (tval >= 0 && tval < 0xffff) {
@@ -742,6 +757,14 @@ isp_get_options(device_t dev, ispsoftc_t *isp)
isp->isp_osinfo.loop_down_limit = isp_loop_down_limit;
}
+ tval = -1;
+ (void) resource_int_value(device_get_name(dev), device_get_unit(dev),
+ "gone_device_time", &tval);
+ if (tval >= 0 && tval < 0xffff) {
+ isp->isp_osinfo.gone_device_time = tval;
+ } else {
+ isp->isp_osinfo.gone_device_time = isp_gone_device_time;
+ }
}
static void
@@ -795,7 +818,7 @@ isp_pci_attach(device_t dev)
isp = &pcs->pci_isp;
/*
- * Get Generic Options
+ * Set and Get Generic Options
*/
isp_get_options(dev, isp);
@@ -814,7 +837,6 @@ isp_pci_attach(device_t dev)
*/
isp_get_pci_options(dev, &m1, &m2);
-
linesz = PCI_DFLT_LNSZ;
irq = regs = NULL;
rgd = rtp = iqd = 0;
OpenPOWER on IntegriCloud