From owner-svn-src-all@FreeBSD.ORG Wed May 26 18:56:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED9CA1065672; Wed, 26 May 2010 18:56:06 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DBA178FC1F; Wed, 26 May 2010 18:56:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4QIu6j2030474; Wed, 26 May 2010 18:56:06 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4QIu6Vg030471; Wed, 26 May 2010 18:56:06 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201005261856.o4QIu6Vg030471@svn.freebsd.org> From: Matt Jacob Date: Wed, 26 May 2010 18:56:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208578 - stable/8/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2010 18:56:07 -0000 Author: mjacob Date: Wed May 26 18:56:06 2010 New Revision: 208578 URL: http://svn.freebsd.org/changeset/base/208578 Log: This is an MFC of 208119, 208129 Hook up some wires that were forgotten a few months ago and restore the zombie device timeout code and the loop down time code and the fabric hysteresis code. Approved by: re (ken smith) Modified: stable/8/sys/dev/isp/isp_freebsd.c stable/8/sys/dev/isp/ispvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/8/sys/dev/isp/isp_freebsd.c Wed May 26 18:55:40 2010 (r208577) +++ stable/8/sys/dev/isp/isp_freebsd.c Wed May 26 18:56:06 2010 (r208578) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); MODULE_VERSION(isp, 1); MODULE_DEPEND(isp, cam, 1, 1, 1); int isp_announced = 0; -int isp_fabric_hysteresis = 3; +int isp_fabric_hysteresis = 5; int isp_loop_down_limit = 60; /* default loop down limit */ int isp_change_is_bad = 0; /* "changed" devices are bad */ int isp_quickboot_time = 7; /* don't wait more than N secs for loop up */ @@ -141,9 +141,12 @@ isp_attach_chan(ispsoftc_t *isp, struct fc->path = path; fc->isp = isp; fc->ready = 1; - + fc->gone_device_time = isp_gone_device_time; + fc->loop_down_limit = isp_loop_down_limit; + fc->hysteresis = isp_fabric_hysteresis; callout_init_mtx(&fc->ldt, &isp->isp_osinfo.lock, 0); callout_init_mtx(&fc->gdt, &isp->isp_osinfo.lock, 0); + /* * We start by being "loop down" if we have an initiator role */ @@ -3935,7 +3938,7 @@ isp_gdt(void *arg) fcportdb_t *lp; int dbidx, tgt, more_to_do = 0; - isp_prt(isp, ISP_LOGDEBUG0, "Chan %d GDT timer expired", chan); + isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d GDT timer expired @ %lu", chan, (unsigned long) time_uptime); for (dbidx = 0; dbidx < MAX_FC_TARG; dbidx++) { lp = &FCPARAM(isp, chan)->portdb[dbidx]; @@ -3945,15 +3948,8 @@ isp_gdt(void *arg) if (lp->dev_map_idx == 0 || lp->target_mode) { continue; } - /* - * We can use new_portid here because it is untouched - * while the state is ZOMBIE - */ - if (lp->new_portid == 0) { - continue; - } - lp->new_portid -= 1; - if (lp->new_portid != 0) { + if (lp->gone_timer != 0) { + lp->gone_timer -= 1; more_to_do++; continue; } @@ -3968,7 +3964,7 @@ isp_gdt(void *arg) if (more_to_do) { callout_reset(&fc->gdt, hz, isp_gdt, fc); } else { - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d stopping Gone Device Timer", chan); + isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d Stopping Gone Device Timer", chan); } } } @@ -4937,7 +4933,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm } if (!callout_active(&fc->ldt)) { callout_reset(&fc->ldt, fc->loop_down_limit * hz, isp_ldt, fc); - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "starting Loop Down Timer @ %lu", (unsigned long) time_uptime); + isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Starting Loop Down Timer @ %lu", (unsigned long) time_uptime); } } } @@ -4967,6 +4963,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm va_end(ap); fc = ISP_FC_PC(isp, bus); lp->reserved = 0; + lp->gone_timer = 0; if ((FCPARAM(isp, bus)->role & ISP_ROLE_INITIATOR) && (lp->roles & (SVC3_TGT_ROLE >> SVC3_ROLE_SHIFT))) { int dbidx = lp - FCPARAM(isp, bus)->portdb; int i; @@ -5002,6 +4999,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm va_end(ap); fc = ISP_FC_PC(isp, bus); lp->reserved = 0; + lp->gone_timer = 0; if (isp_change_is_bad) { lp->state = FC_PORTDB_STATE_NIL; if (lp->dev_map_idx) { @@ -5056,15 +5054,13 @@ isp_async(ispsoftc_t *isp, ispasync_t cm * If it isn't marked that isp_gdt is going to get rid of it, * announce that it's gone. * - * We can use new_portid for the gone timer because it's - * undefined while the state is ZOMBIE. */ if (lp->dev_map_idx && lp->reserved == 0) { lp->reserved = 1; - lp->new_portid = ISP_FC_PC(isp, bus)->gone_device_time; lp->state = FC_PORTDB_STATE_ZOMBIE; + lp->gone_timer = ISP_FC_PC(isp, bus)->gone_device_time; if (fc->ready && !callout_active(&fc->gdt)) { - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d starting Gone Device Timer", bus); + isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d Starting Gone Device Timer with %u seconds time now %lu", bus, lp->gone_timer, (unsigned long)time_uptime); callout_reset(&fc->gdt, hz, isp_gdt, fc); } tgt = lp->dev_map_idx - 1; Modified: stable/8/sys/dev/isp/ispvar.h ============================================================================== --- stable/8/sys/dev/isp/ispvar.h Wed May 26 18:55:40 2010 (r208577) +++ stable/8/sys/dev/isp/ispvar.h Wed May 26 18:56:06 2010 (r208578) @@ -426,6 +426,7 @@ typedef struct { new_portid : 24; uint64_t node_wwn; uint64_t port_wwn; + uint32_t gone_timer; } fcportdb_t; #define FC_PORTDB_STATE_NIL 0