Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 May 2010 21:20:37 -0600
From:      "Kenneth D. Merry" <ken@kdm.org>
To:        Matthew Jacob <mj@feral.com>
Cc:        freebsd-scsi@freebsd.org
Subject:   Re: addition of an XPT_SCAN_TGT code
Message-ID:  <20100517032037.GA34571@nargothrond.kdm.org>
In-Reply-To: <4BEDF5BD.9040502@feral.com>
References:  <4BEDF5BD.9040502@feral.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100517032037.GA34571>