Pete Wyckoff wrote:
> [EMAIL PROTECTED] wrote on Sun, 04 May 2008 11:21 +0300:
>> Pete Wyckoff wrote:
>>> [EMAIL PROTECTED] wrote on Mon, 28 Apr 2008 11:20 -0500:
>>>> Erez Zilber wrote:
>>>>> I understand that IB's requirements are too difficult to force. I guess
>>>>> that we will do something like:
>>>>>     * If the scatterlist is aligned, just use it as is.
>>>>>     * If some elements at the beginning/end of the scatterlist are
>>>>>       unaligned, we can copy only them (and use the rest of the
>>>>>       scatterlist as is). We saw that sometimes (e.g. GFS), only the 1st
>>>>>       element is unaligned, so copying the whole data is unnecessary.
>>>>>     * Else, copy the whole scatterlist to buffers that iSER allocates.
>>>>>       This is what we do today with unaligned buffers.
>>>> Pete, we are discissing the dma_alignment patch you sent. Above are the 
>>>> dma 
>>>> restrictions the iser driver has right now. For the 3rd requirement does 
>>>> that mean we want to set the alignment to be page aligned right?
>>> Erez's alignment rules leave out one case:  when the sg list
>>> has only one element, there are no restrictions on start/end
>>> alignment.
>> Yeah, this is the trivial case (which is already covered in the iSER code).
>>> The iser alignment requirements are too complex to express with the
>>> q->dma_alignment approach.  In iser, as Erez suggests, bouncing can
>>> be done.  His second (*) would be a nice addition that would
>>> definitely help some of our apps.
>> We will try to send a patch for that soon.
>>> My patch "iscsi iser: remove DMA alignment restriction" changes
>>> iser to make the alignment 0, rather than the default 512, to avoid
>>> the bounce buffering in __blk_rq_map_user().
>> Just to make sure that I understand - "alignment 0 " means that the
>> block layer doesn't care at all about alignment?
> Yep.  The lines to think about are in __blk_rq_map_user:
>         alignment = queue_dma_alignment(q) | q->dma_pad_mask;
>         if (!(uaddr & alignment) && !(len & alignment))
>                 bio = bio_map_user(q, NULL, uaddr, len, reading);
>         else
>                 bio = bio_copy_user(q, uaddr, len, reading);
> As it stands, queue_dma_alignment(q) returns 511.  That forces the
> use of the bio_copy_user path for anything that isn't aligned (start
> and end) on a 512 byte boundary.  Changing it to page alignment
> isn't what we want either.  Zero disables the copy path, and lets
> iser do everything.  You can add printks and test my patch using sg
> or bsg to submit from userspace, to see.

Oh yeah, Pete is right. Since iser has that code already to handle its 
issues we can avoid all the mess by just setting it to zero.

You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at

Reply via email to