From owner-freebsd-scsi@FreeBSD.ORG Mon May 17 03:20:41 2010 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 631FA106564A for ; Mon, 17 May 2010 03:20:41 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id 111248FC22 for ; Mon, 17 May 2010 03:20:40 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id o4H3Kc7R034717; Sun, 16 May 2010 21:20:38 -0600 (MDT) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id o4H3KcqC034716; Sun, 16 May 2010 21:20:38 -0600 (MDT) (envelope-from ken) Date: Sun, 16 May 2010 21:20:37 -0600 From: "Kenneth D. Merry" To: Matthew Jacob Message-ID: <20100517032037.GA34571@nargothrond.kdm.org> References: <4BEDF5BD.9040502@feral.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4BEDF5BD.9040502@feral.com> User-Agent: Mutt/1.4.2i Cc: freebsd-scsi@freebsd.org Subject: Re: addition of an XPT_SCAN_TGT code X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 May 2010 03:20:41 -0000 On Fri, May 14, 2010 at 18:15:41 -0700, Matthew Jacob wrote: > Sometimes, particularly in relation to a hotplug event, you just want to > scan a target id, not the whole bus. It's lighter weight. > > The attached patch adds this with a relatively light touch. I'm not > super happy with it, but it does make rescanning on a target basis doable. > > Comments? Looks good, good idea! Just two comments: > diff -r 85c0fa25a2fc sys/cam/cam_ccb.h > --- a/sys/cam/cam_ccb.h Fri May 14 15:55:34 2010 -0700 > +++ b/sys/cam/cam_ccb.h Fri May 14 18:14:46 2010 -0700 > @@ -207,6 +207,10 @@ > /* Notify Host Target driver of event */ > XPT_NOTIFY_ACKNOWLEDGE = 0x37 | XPT_FC_QUEUED | XPT_FC_USER_CCB, > /* Acknowledgement of event */ > +/* overflow commands: 0x40 ->0x4F */ > + XPT_SCAN_TGT = 0x40 | XPT_FC_QUEUED | XPT_FC_USER_CCB > + | XPT_FC_XPT_ONLY, > + /* (Re)Scan the SCSI Bus */ > Perhaps this would be better put at 0x1e? XPT_SCAN_LUN is in the same group, and this is similar. > diff -r 85c0fa25a2fc sys/dev/isp/isp_freebsd.c > --- a/sys/dev/isp/isp_freebsd.c Fri May 14 15:55:34 2010 -0700 > +++ b/sys/dev/isp/isp_freebsd.c Fri May 14 18:14:46 2010 -0700 > @@ -3898,7 +3898,7 @@ > * Scan the whole bus instead of target, which will then > * force a scan of all luns. > */ > - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(fc->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { > + if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(fc->sim), tgt, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { > isp_prt(isp, ISP_LOGWARN, "unable to create path for rescan"); > xpt_free_ccb(ccb); > return; The comment above should probably be updated. Ken -- Kenneth Merry ken@kdm.org