From owner-freebsd-scsi@FreeBSD.ORG Tue Dec 15 09:54:27 2009 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 41C43106568B; Tue, 15 Dec 2009 09:54:27 +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 E16158FC16; Tue, 15 Dec 2009 09:54:26 +0000 (UTC) Received: from [IPv6:::1] (pooker.samsco.org [168.103.85.57]) (authenticated bits=0) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id nBF9sJ3a079891; Tue, 15 Dec 2009 02:54:20 -0700 (MST) (envelope-from scottl@samsco.org) Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes From: Scott Long In-Reply-To: <3c0b01820912141347y366a7252y5d9711b1141b9b70@mail.gmail.com> Date: Tue, 15 Dec 2009 02:54:19 -0700 Content-Transfer-Encoding: 7bit Message-Id: <978BBD51-222D-42F0-9D3A-FFACCBCC886D@samsco.org> References: <3c0b01820912141347y366a7252y5d9711b1141b9b70@mail.gmail.com> To: Alexander Sack X-Mailer: Apple Mail (2.1076) X-Spam-Status: No, score=-4.6 required=3.8 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: freebsd-scsi@freebsd.org, freebsd-current@freebsd.org Subject: Re: aac(4) handling of probe when no devices are there 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: Tue, 15 Dec 2009 09:54:27 -0000 On Dec 14, 2009, at 2:47 PM, Alexander Sack wrote: > Hello Again: > > I guess I have a technical question/concern that I was looking for > feedback. During the probe sequence, aac(4) conditionally responds > to INQUIRY commands depending on target LUN: > > aac_cam.c/aac_cam_complete(): > 532 if (command == INQUIRY) { > 533 if (ccb->ccb_h.status == > CAM_REQ_CMP) { > 534 device = ccb->csio.data_ptr[0] & > 0x1f; > 535 /* > 536 * We want DASD and PROC devices > to only be > 537 * visible through the pass > device. > 538 */ > 539 if ((device == T_DIRECT) || > 540 (device == T_PROCESSOR) || > 541 (sc->flags & > AAC_FLAGS_CAM_PASSONLY)) > 542 ccb->csio.data_ptr[0] = > 543 ((device & 0xe0) | > T_NODEVICE); > 544 } else if (ccb->ccb_h.status == > CAM_SEL_TIMEOUT && > 545 ccb->ccb_h.target_lun != > 0) { > 546 /* fix for INQUIRYs on > Lun>0 */ > 547 ccb->ccb_h.status = > CAM_DEV_NOT_THERE; > 548 } > 549 } > > Why is CAM_DEV_NOT_THERE skipped on LUN 0? In the parallel scsi world, a selection timeout means that all LUNs within the entire target do not (or no longer) exist. So returning CAM_SEL_TIMEOUT for LUN 1 would tell CAM to invalidate LUN 0 as well. If you look higher up in this function, you'll see a note about the error/status codes from the AAC firmware coincidentally matching CAM's status codes. My guess is that somewhere along the line, someone at Adaptec stopped reading the SCSI spec and starting returning CAM_SEL_TIMEOUT for LUNs greater than 0, which is why this work-around is now in the driver. > This is true on my target > 6.1-amd64 machine as well as CURRENT. The reason why I ask this is > because now that aac(4) is sequential scanned, there are a lot of cam > interrupts that come in on my 6.x machine where the threshold is only > 500 and I get the interrupt storm threshold warning for swi2 pretty > quickly: > > Interrupt storm detected on "swi2:"; throttling interrupt source > > Obviously its contingent on the number of adapters you have on your > system. On CURRENT I didn't see this because the threshold is double > (I think its a 1000 by default). > > The issue is the number of xpt_async(AC_LOST_DEVICE, ..) calls during > the scan. The probe sequence in CURRENT as well as 6.1 handles > CAM_SEL_TIMEOUT a little differently depending on context. > It's not at all clear to me what is going on here. Can you instrument the code to record the status of everything that is being issued to the aac_cam module? Scott