From owner-svn-src-projects@FreeBSD.ORG Wed Dec 5 06:41:12 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DFD62EBC; Wed, 5 Dec 2012 06:41:12 +0000 (UTC) (envelope-from gibbs@scsiguy.com) Received: from aslan.scsiguy.com (mail.scsiguy.com [70.89.174.89]) by mx1.freebsd.org (Postfix) with ESMTP id 8C61E8FC0C; Wed, 5 Dec 2012 06:41:12 +0000 (UTC) Received: from [192.168.0.99] (macbook.scsiguy.com [192.168.0.99]) (authenticated bits=0) by aslan.scsiguy.com (8.14.5/8.14.5) with ESMTP id qB56fBpn096690 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 4 Dec 2012 23:41:11 -0700 (MST) (envelope-from gibbs@scsiguy.com) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: svn commit: r243876 - in projects/physbio/sys: cam cam/ctl cam/scsi dev/aac dev/ahci dev/aic dev/arcmsr dev/ciss dev/hpt27xx dev/hptmv dev/hptrr dev/iir dev/isci dev/mly dev/mps dev/mpt kern From: "Justin T. Gibbs" In-Reply-To: <201212050451.qB54px6O065330@svn.freebsd.org> Date: Tue, 4 Dec 2012 23:41:08 -0700 Content-Transfer-Encoding: 7bit Message-Id: References: <201212050451.qB54px6O065330@svn.freebsd.org> To: Jeff Roberson X-Mailer: Apple Mail (2.1499) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (aslan.scsiguy.com [192.168.0.4]); Tue, 04 Dec 2012 23:41:11 -0700 (MST) Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Dec 2012 06:41:12 -0000 On Dec 4, 2012, at 9:51 PM, Jeff Roberson wrote: > Author: jeff > Date: Wed Dec 5 04:51:59 2012 > New Revision: 243876 > URL: http://svnweb.freebsd.org/changeset/base/243876 > > Log: > - Arrange the cam ccb data flags into a 3 bit data type field so that it > can easily be parsed with a switch statement. Define all physical > formats with the low bit set so drivers that don't support any physical > formats may easily reject them. Most of the CAM ccb flags came from the original CAM specification, so their existence in the header doesn't imply usage. But, there are some combinations that the old bit flags support that the new definition does not. For example, it was possible to independently indicate the virtual/physical nature of a pointer to an S/G list (controlled by CAM_DATA_PHYS) as well as the virtual/physical nature of the data pointers within the list (controlled by CAM_SG_LIST_PHYS). In general, I'd like to see this kind of knowledge extracted from CAM in a way that allows data of different formats to be transferred seemlessly between userland/kernel and kernel subsystems. It should be possible for the constructor of a request to specify it in a manner convenient to it (e.g. user addresses) and have the processor convert it into the format necessary to execute the request. bus_dmamap_load (or even bus_vmap_load() if kernel access is required?) already has callback semantics so even potentially blocking operations (like the pinning of user space pages) could be deferred until load time. Just within CAM we have lots of ugly code to deal with address and data format mapping: CAM ccbs that originate from userland go through a complicated mapping process (see cam_periph_mapmem), CTL jumps through different hoops depending on whether its backing store is a file (needs a uio) or a block device (multiple bios), and the driver bits your earlier commit cleans up. I know the immediate goal is to get unmapped I/O working, but it would be nice to at least define a path toward fixing the rest of this problem. -- Justin