From owner-svn-src-all@FreeBSD.ORG Tue Aug 17 18:00:01 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 52D0E1065673; Tue, 17 Aug 2010 18:00:01 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id EFEFC8FC12; Tue, 17 Aug 2010 18:00:00 +0000 (UTC) Received: from [127.0.0.1] (pooker.samsco.org [168.103.85.57]) (authenticated bits=0) by pooker.samsco.org (8.14.4/8.14.4) with ESMTP id o7HHxvL5002457; Tue, 17 Aug 2010 11:59:57 -0600 (MDT) (envelope-from scottl@samsco.org) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Scott Long In-Reply-To: <201008171711.o7HHBFce039173@svn.freebsd.org> Date: Tue, 17 Aug 2010 11:59:57 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <810BE039-72EA-4020-8B42-8D1274E888AA@samsco.org> References: <201008171711.o7HHBFce039173@svn.freebsd.org> To: Matt Jacob X-Mailer: Apple Mail (2.1078) X-Spam-Status: No, score=-50.0 required=3.8 tests=ALL_TRUSTED, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on pooker.samsco.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r211434 - head/sys/cam/scsi 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: Tue, 17 Aug 2010 18:00:01 -0000 This is violates the policy that CAM has effectively had for a long time = that separates protocol error handling in the periph from transport = error recovery in the SIM. I think it's better to encourage SIMs to = register an AC_LOST_DEVICE event and handle command aborts themselves. = Most drivers have a busy queue and know what outstanding CCBs belong to = what devices/targets. And in the age of SAS, the SIMs are going to know = about dead devices long before the periph will, and should already be in = the process of aborting the outstanding commands and returning the CCBs. = SIMs that don't probably don't even properly timeout outstanding = commands, so they'll have much deeper problems than this. I'm in the middle of working on this for the mps driver. Your change = may or may not get in the way of the design I already have, where the = SIM autonomously dequeues and completes all outstanding CCBs to dead = devices. I'll hopefully have an answer in the coming weeks and let you = know. Please don't MFC before then. Scott On Aug 17, 2010, at 11:11 AM, Matt Jacob wrote: > Author: mjacob > Date: Tue Aug 17 17:11:15 2010 > New Revision: 211434 > URL: http://svn.freebsd.org/changeset/base/211434 >=20 > Log: > Now is as good a time as any to find out if we induce breakage > by issueing aborts for any pending commands when we're decommssioning > a disk. >=20 > MFC after: 3 months >=20 > Modified: > head/sys/cam/scsi/scsi_da.c >=20 > Modified: head/sys/cam/scsi/scsi_da.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/cam/scsi/scsi_da.c Tue Aug 17 16:41:16 2010 = (r211433) > +++ head/sys/cam/scsi/scsi_da.c Tue Aug 17 17:11:15 2010 = (r211434) > @@ -958,6 +958,8 @@ dainit(void) > static void > daoninvalidate(struct cam_periph *periph) > { > + struct ccb_abort cab; > + struct ccb_hdr *ccb_h, *ccb_h_t; > struct da_softc *softc; >=20 > softc =3D (struct da_softc *)periph->softc; > @@ -967,15 +969,29 @@ daoninvalidate(struct cam_periph *periph > */ > xpt_register_async(0, daasync, periph, periph->path); >=20 > + /* > + * Invalidate the pack label > + */ > softc->flags |=3D DA_FLAG_PACK_INVALID; >=20 > /* > * Return all queued I/O with ENXIO. > - * XXX Handle any transactions queued to the card > - * with XPT_ABORT_CCB. > */ > bioq_flush(&softc->bio_queue, NULL, ENXIO); >=20 > + /* > + * Issue aborts for any pending commands. > + */ > + xpt_setup_ccb(&cab.ccb_h, periph->path, CAM_PRIORITY_NORMAL+1); > + cab.ccb_h.func_code =3D XPT_ABORT; > + LIST_FOREACH_SAFE(ccb_h, &softc->pending_ccbs, periph_links.le, = ccb_h_t) { > + cab.abort_ccb =3D (union ccb *)ccb_h; > + xpt_action((union ccb *)&cab); > + } > + > + /* > + * This disk is *history*.... > + */ > disk_gone(softc->disk); > xpt_print(periph->path, "lost device\n"); > }