From owner-freebsd-scsi@FreeBSD.ORG Wed Jun 11 13:30:59 2008 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 479BD1065677 for ; Wed, 11 Jun 2008 13:30:59 +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 E87F48FC15 for ; Wed, 11 Jun 2008 13:30:58 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.local ([192.168.254.200]) (authenticated bits=0) by pooker.samsco.org (8.13.8/8.13.8) with ESMTP id m5BDUpnJ089817; Wed, 11 Jun 2008 07:30:51 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <484FD38B.3050906@samsco.org> Date: Wed, 11 Jun 2008 07:30:51 -0600 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.13) Gecko/20080313 SeaMonkey/1.1.9 MIME-Version: 1.0 To: "Kenneth D. Merry" References: <6B24EEDBA38D764293B27C04FE414CC64E40604C07@G1W0491.americas.hpqcorp.net> <20080609201723.GA95850@nargothrond.kdm.org> In-Reply-To: <20080609201723.GA95850@nargothrond.kdm.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=3.8 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: "Pan, Weimin" , "freebsd-scsi@freebsd.org" Subject: Re: How to directly pass a dma physical address and length from SCSI upper layer to LLD without mapping the dma memory to kernel pages 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: Wed, 11 Jun 2008 13:30:59 -0000 Kenneth D. Merry wrote: > On Mon, Jun 09, 2008 at 18:18:16 +0000, Pan, Weimin wrote: >> SCSI upper layer can pass a scatterlist to middle layer and LLD. Normally the page_link, length, and offset is set in the scatterlist. LLD will convert to dma_address from pages by itself. That means the dma physical address has to map to kernel memory space before it can be passed to LLD for data transfer. If I have a large dma memroy and it doesn't need to be touched by kernel or user mode Apps, it is a performance penalty to force to do that. >> >> Is there a way to directly pass a dma physical address from upper layer to LLD (like use dma_address in a scatterlist)? >> I looked at a couple of LLD drivers and none of them handle this kind of situation. > > In theory, you can pass a physical address in a CAM CCB if you set the > CAM_DATA_PHYS flag on the CCB. > > It looks like quite a few drivers in the tree support that flag, or at > least look at it. > > So take a look at whichever driver you're using, and see if it looks at > that flag in the CCB. > > Ken Most drivers will honor CAM_DATA_PHYS by itself, but don't honor it in conjunction with CAM_SCATTER_VALID. CAM_SG_LIST_PHYS is only supported by the AHC and AHD drivers (and it's not clear to me what the difference is between the two sets of flags). That said, modifying drivers to support physical S/G lists isn't all that hard, and it's something that will happen more and more with the planned changes to moving physio to unmapped physical addresses. Scott