Re: IO buffer alignment for block devices

James Bottomley
2004-09-13T14:14:39Z

On Mon, 2004-09-13 at 08:48, Saeed Bishara wrote:
> Is there any minimal alignment for the IO buffers (sg and single)
> sent to a scsi LLD?
> I found that buffers that come from buffer cache, page cache and sg
> are page aligned , and the raw driver send sector aligned buffers.
> so can I assume that the minimal alignment of the buffer is 512 bytes?

You can assume it will be whatever you set blk_queue_dma_alignment() to
in your slave configure routines. If the LLD doesn't set this, then it
will be 8 bytes. However, beware, setting this higher can cause user
generated commands to be errored if they fail the alignment checks.

James