From owner-freebsd-scsi@FreeBSD.ORG Thu Oct 11 06:43:27 2012 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E99DD177 for ; Thu, 11 Oct 2012 06:43:27 +0000 (UTC) (envelope-from jacks.1785@gmail.com) Received: from mail-ie0-f182.google.com (mail-ie0-f182.google.com [209.85.223.182]) by mx1.freebsd.org (Postfix) with ESMTP id AF79F8FC08 for ; Thu, 11 Oct 2012 06:43:27 +0000 (UTC) Received: by mail-ie0-f182.google.com with SMTP id k10so3181882iea.13 for ; Wed, 10 Oct 2012 23:43:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=iz8w9xwqRl6oVyyOGef/dtV5C1g1LglOonbCZtYBgsY=; b=CBs6Vja5lMjq9Z1+eJh/Nu33lX/AE1iFS8i3jWmVssFfExPIsswax1Gzq/0DsexKGQ iboZ4YiGY1qx1mPx6ZscSTaoiRE7NWU2RH+jB7eB7FG/7m4/bH10wpQAezsKO9xQkg1z WnILp1DS5ce4gQ7foildo/bUzPMNNl2kM+ceFYQ9UHTQuXBzkTNddQrWmuheZ14gvjkl ErLUp9T9kvG9yKuIgworgvmZIriM3Vjvrjiv1b4qfsVl66BHay1P6VXeJ5foFdxIY+tQ muoAzmD6Y3pu9s05Y/F9qs0WGcvaaa/1LcL7vuuRMhmtAbAUmpHZaL1lmj3u8rgkJ4wA VwkA== MIME-Version: 1.0 Received: by 10.50.152.231 with SMTP id vb7mr7907338igb.1.1349937807174; Wed, 10 Oct 2012 23:43:27 -0700 (PDT) Received: by 10.64.11.166 with HTTP; Wed, 10 Oct 2012 23:43:27 -0700 (PDT) Date: Thu, 11 Oct 2012 12:13:27 +0530 Message-ID: Subject: passstart() and immediate CCBs From: Jack To: freebsd-scsi@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Oct 2012 06:43:28 -0000 Hello all, I was going through cam subsystem source(FreeBSD RELEASE 9 ), and tried understanding how it works. One thing I got stuck is, when exactly is passtart() invoked in case of immediate CCBs. For non-immediate CCBs, it is quite clear to me. In case of scsi pass driver(scsi_pass.c), xpt_schedule() is invoked by cam_periph_getccb(), and cam_periph_ioctl(). But not in case of immediate CCBs. In case of immediate CCBs, xpt_alloc_ccb_nowait() is invoked and then xpt_setup_ccb(). Is it that in case of immediate CCBs, passstart() is never invoked? If it is true then, how does the thread awakens(which is slept by calling cam_periph_ccbwait() inside cam_periph_runccb() ) when HBA driver serves interrupt, and passdone() is invoked. There seems no code inside passdone(), to wakeup the thread, the only code being inside PASS_CCB_WAITING case is not valid for immediate CCBs, as passstart() is never invoked so it didn't set ccb type to PASS_CCB_WAITING. Do immediate and immediate CCBs have any implications on cam priority assignment specified in CCB header? It seems that concept of which queues are in existence in cam subsystem is not clear to me. ie beginning from cam_periph_runccb(), how passdone() is invoked, how passstart() is invoked if it is, and which queues are involved, especially in case of immediate CCBs. As far as I can get, there are at least 2 queues: one is maintained by SCSI HBA driver for I/O requests, the other is queue of CCBs maintained per cam peripheral( ie struct cam_peripheral) ?? or cam device (ie struct cam_ed) ?? at transport layer. I've been looking around, but haven't found anything yet. I'll continue digging though :-) Regards -- Jack