Date: Fri, 4 Sep 2009 16:14:22 -0700 (PDT) From: Matthew Dillon <dillon@apollo.backplane.com> To: Scott Long <scottl@samsco.org> Cc: Ryan Rogers <webmaster@doghouserepair.com>, Alexander Motin <mav@freebsd.org>, current@freebsd.org Subject: Re: non aligned DMA transfer attempted Message-ID: <200909042314.n84NEMAS072077@apollo.backplane.com> References: <h7p0a3$k3m$1@FreeBSD.cs.nctu.edu.tw> <4AA03346.5010608@FreeBSD.org> <200909032210.n83MA67F059073@apollo.backplane.com> <A1B223C6-7291-4F86-B8AC-4EB5EF12F409@samsco.org>
next in thread | previous in thread | raw e-mail | index | archive | help
:> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200909042314.n84NEMAS072077>