Re: [Ocf-linux-users] OCF Talitos driver - DMA alignment
Brought to you by:
david-m
From: David M. <dav...@mc...> - 2010-05-12 00:38:29
|
Jivin Kim Phillips lays it down ... > On Tue, 11 May 2010 13:22:38 +0300 > avital sela <avi...@gm...> wrote: > > > Hi Kim, > > Hi Avital, > > > I'm working on an ocf driver for a custom made hw that does AES and SHA, and > > uses DMA. > > I've noticed that in your talitos driver you also used DMA but you never > > checked for alignment, whereas in David's Safenet code he did check for > > alignments. > > My questions are: > > 1. are you using a 1-byte aligned DMA, therefore you don't need alignment? > > correct, talitos drives h/w that doesn't have alignment restrictions. Yep, it's purely a HW limitation, some crypto devices can handle the unaligned data and some can't. Same thing in network driver land. The solution is usually "bounce buffers" of some kind. > > 2. or alternatively, is there some way to guarantee that buffers are 32bit > > aligned beforehand? > > In OCF-linux, both safe and hifn drivers look like they copy data to > ensure alignment. For most uses you will receive aligned data. Some of the OCF drivers handle unaligned data, and some just fail the request. > In the upstream kernel's crypto API, it looks like a crypto > drivers' .cra_alignmask setting is used for this purpose. > > [cc:ing ocf list in case there's something I'm missing.] Nothing missing that I can see ;-) Cheers, Davidm -- David McCullough, dav...@mc..., Ph:+61 734352815 McAfee - SnapGear http://www.mcafee.com http://www.uCdot.org |