diff options
author | mjacob <mjacob@FreeBSD.org> | 2006-11-14 08:45:48 +0000 |
---|---|---|
committer | mjacob <mjacob@FreeBSD.org> | 2006-11-14 08:45:48 +0000 |
commit | d01394099a796814ca94610a8346a06938477b62 (patch) | |
tree | 0dc9331f44aaf2008f03701417bb906d67a662ce /sys/dev/isp/isp_library.c | |
parent | 2243c89dab13821877b37a12fc641ace8c50891d (diff) | |
download | FreeBSD-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_library.c')
-rw-r--r-- | sys/dev/isp/isp_library.c | 59 |
1 files changed, 53 insertions, 6 deletions
diff --git a/sys/dev/isp/isp_library.c b/sys/dev/isp/isp_library.c index 072d726..9b086f6 100644 --- a/sys/dev/isp/isp_library.c +++ b/sys/dev/isp/isp_library.c @@ -197,13 +197,13 @@ isp_fc_runstate(ispsoftc_t *isp, int tval) if (fcp->isp_fwstate < FW_READY || fcp->isp_loopstate < LOOP_PDB_RCVD) { if (isp_control(isp, ISPCTL_FCLINK_TEST, tptr) != 0) { - isp_prt(isp, ISP_LOGINFO, + isp_prt(isp, ISP_LOGSANCFG, "isp_fc_runstate: linktest failed"); return (-1); } if (fcp->isp_fwstate != FW_READY || fcp->isp_loopstate < LOOP_PDB_RCVD) { - isp_prt(isp, ISP_LOGINFO, + isp_prt(isp, ISP_LOGSANCFG, "isp_fc_runstate: f/w not ready"); return (-1); } @@ -212,27 +212,74 @@ isp_fc_runstate(ispsoftc_t *isp, int tval) return (0); } if (isp_control(isp, ISPCTL_SCAN_LOOP, NULL) != 0) { - isp_prt(isp, ISP_LOGINFO, + isp_prt(isp, ISP_LOGSANCFG, "isp_fc_runstate: scan loop fails"); return (LOOP_PDB_RCVD); } if (isp_control(isp, ISPCTL_SCAN_FABRIC, NULL) != 0) { - isp_prt(isp, ISP_LOGINFO, + isp_prt(isp, ISP_LOGSANCFG, "isp_fc_runstate: scan fabric fails"); return (LOOP_LSCAN_DONE); } if (isp_control(isp, ISPCTL_PDB_SYNC, NULL) != 0) { - isp_prt(isp, ISP_LOGINFO, "isp_fc_runstate: pdb_sync fails"); + isp_prt(isp, ISP_LOGSANCFG, "isp_fc_runstate: pdb_sync fails"); return (LOOP_FSCAN_DONE); } if (fcp->isp_fwstate != FW_READY || fcp->isp_loopstate != LOOP_READY) { - isp_prt(isp, ISP_LOGINFO, + isp_prt(isp, ISP_LOGSANCFG, "isp_fc_runstate: f/w not ready again"); return (-1); } return (0); } +/* + * Fibre Channel Support- get the port database for the id. + */ +void +isp_dump_portdb(ispsoftc_t *isp) +{ + fcparam *fcp = (fcparam *) isp->isp_param; + int i; + + for (i = 0; i < MAX_FC_TARG; i++) { + char mb[4]; + const char *dbs[8] = { + "NIL ", + "PROB", + "DEAD", + "CHGD", + "NEW ", + "PVLD", + "ZOMB", + "VLD " + }; + const char *roles[4] = { + " UNK", " TGT", " INI", "TINI" + }; + fcportdb_t *lp = &fcp->portdb[i]; + + if (lp->state == FC_PORTDB_STATE_NIL) { + continue; + } + if (lp->ini_map_idx) { + SNPRINTF(mb, sizeof (mb), "%3d", + ((int) lp->ini_map_idx) - 1); + } else { + SNPRINTF(mb, sizeof (mb), "---"); + } + isp_prt(isp, ISP_LOGALL, "%d: %s al%d tgt %s %s 0x%06x =>%s" + " 0x%06x; WWNN 0x%08x%08x WWPN 0x%08x%08x", i, + dbs[lp->state], lp->autologin, mb, + roles[lp->roles], lp->portid, + roles[lp->new_roles], lp->new_portid, + (uint32_t) (lp->node_wwn >> 32), + (uint32_t) (lp->node_wwn), + (uint32_t) (lp->port_wwn >> 32), + (uint32_t) (lp->port_wwn)); + } +} + void isp_shutdown(ispsoftc_t *isp) { |