From owner-freebsd-current@FreeBSD.ORG Fri Sep 4 23:14:28 2009 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84BE2106575E; Fri, 4 Sep 2009 23:14:24 +0000 (UTC) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.freebsd.org (Postfix) with ESMTP id 8D15F8FC0A; Fri, 4 Sep 2009 23:14:24 +0000 (UTC) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.14.2/8.14.1) with ESMTP id n84NENsB072080; Fri, 4 Sep 2009 16:14:23 -0700 (PDT) Received: (from dillon@localhost) by apollo.backplane.com (8.14.2/8.13.4/Submit) id n84NEMAS072077; Fri, 4 Sep 2009 16:14:22 -0700 (PDT) Date: Fri, 4 Sep 2009 16:14:22 -0700 (PDT) From: Matthew Dillon Message-Id: <200909042314.n84NEMAS072077@apollo.backplane.com> To: Scott Long References: <4AA03346.5010608@FreeBSD.org> <200909032210.n83MA67F059073@apollo.backplane.com> Cc: Ryan Rogers , Alexander Motin , current@freebsd.org Subject: Re: non aligned DMA transfer attempted X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Sep 2009 23:14:28 -0000 :> The physio code directly maps the userland buffer via vmapbuf() and :> supplies it as a BIO to the device. The ATA driver does not use :> BUSDMA (and never has)... it assumes BIOs are minimally aligned. :> : :Wrong. By the way Scott, do you honestly believe that idiotic one-line answers just as a means to try to screw over my postings are appropriate for someone of your standing in the FreeBSD community? In anycase, this is what was causing the problem in DragonFly and the code is nearly identicial to FreeBSD. Adding the bounce buffers in physio and cam's pass-through fixed the problem in DragonFly... that is, the programs that we got bug reports about non-aligned DMA transfers started working again after I made those changes. Yes, removing the check might work in some cases, particularly with newer chipsets, since even BUSDMA alignment tends to be conservative for reverse-engineered chipsets, but I've seen userland pass byte-aligned buffers through CAM and physio on numerous occassions and if you actually want it to work reliably you have to enforce at least a base alignment... which BUSDMA can do if the driver uses BUSDMA (except it does it way too deep in the driver stack IMHO). All my points stand. Bounce buffers have created issues both positive and negative from the day they were introduced to this very day. I was very happy to be able to wash my hands of the majority of those problems by enforcing a base alignment closer to the userland boundary, and I would heartily recommend the same approach to any OS project. So, again, if you have a more detailed response that gets at the heart of the problem, I'm sure the original posters are eagerly waiting your next posting. But hey, if you think your type of answer is completely appropriate then maybe I should start following your lead and not bother to supply any detail in my own. Hey, you're wrong! Oh, by the way, I'm not going to bother to say why. Sheesh. You guys are just too full of yourselves these days. -Matt