[EMAIL PROTECTED] wrote on Mon, 28 Apr 2008 11:20 -0500:
> Erez Zilber wrote:
>> Mike Christie wrote:
>>> Erez Zilber wrote:
>>>   
>>>> This new thread summarizes and continues a discussion that we (Mike, Or
>>>> and myself) had outside the list. This is what we have so far:
>>>>
>>>>     * Having a parent device: commit
>>>>       62786b526687db54c6dc22a1786d6df8b03da3f3 in the bnx2i branch looks
>>>>       ok, and will solve the DMA mask problem. I think that it's cleaner
>>>>       than calling slave_alloc etc. However, this code cannot be used
>>>>       outside the bnx2i branch. I think that we need to create another
>>>>       patch (based on this one) to submit upstream. Mike - what do you
>>>>       think?
>>>>     
>>> I am going to push that code soon. Since it is not critical for 2.6.26 I 
>>> am waiting to push it for .27.
>>>   
>>
>> I agree - the DMA mask is not so urgent. However, as you said, Pete is
>> waiting with his patch. Do you want to post something in linux-scsi?
>
> Yeah, will do. I ccd him here too, so we could talk about the dma alignment 
> patch.

Sorry for the delay.  This commit id has changed, and I'm not
finding what you mean.  Perhaps this is the endpoint stuff,
which is good.

>>>>     * iSER alignment issue: I'm not sure if we can force our
>>>>       restrictions through scsi_host_template. Again, the restrictions are:
>>>>           o The 1st element must end at the page boundary.
>>>>           o The last element must start at the page boundary.
>>>>           o All other elements must be page aligned (i.e. start at the
>>>>             beginning of a page and end at the page boundary).
>>>>
>>>>        Can it be done using blk_queue_dma_alignment? pad_mask?
>>>>     
>>
>> 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.

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.

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().  Else confirming
single-element or multi-element sg lists will be bounced
unnecessarily.  As bouncing already exists in iser, anything that
the block layer might do is purely duplicative, so it is best to
turn it off.  This can be done now.

Here it is for reference.  I updated the commentary; hopefully
it makes sense.  Expect some fuzz as this is against an older
2.6.25-rc4.

                -- Pete

commit 47eaf146cde1ddd0a80aa45a1f50514f6a05b928
Author: Pete Wyckoff <[EMAIL PROTECTED]>
Date:   Fri May 2 10:31:58 2008 -0400

    iscsi iser: remove block-layer DMA alignment restriction
    
    iser has rather complex rules for data alignment that come from
    its particular use of memory mapping hardware on IB.  iser uses
    its own bouncing layer to satisfy these requirements.
    
    This patch removes the 512-byte DMA alignment requirement that
    is imposed by default at the block layer.  Without this change,
    IO from userspace (through sg or bsg, for example) would be
    bounced at the block layer even if that is not required by iser.
    
    Signed-off-by: Pete Wyckoff <[EMAIL PROTECTED]>

diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c 
b/drivers/infiniband/ulp/iser/iscsi_iser.c
index be1b9fb..313f102 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.c
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.c
@@ -543,6 +543,12 @@ iscsi_iser_ep_disconnect(__u64 ep_handle)
        iser_conn_terminate(ib_conn);
 }
 
+static int iscsi_iser_slave_configure(struct scsi_device *sdev)
+{
+       blk_queue_dma_alignment(sdev->request_queue, 0);
+       return 0;
+}
+
 static struct scsi_host_template iscsi_iser_sht = {
        .module                 = THIS_MODULE,
        .name                   = "iSCSI Initiator over iSER, v." DRV_VER,
@@ -556,6 +562,7 @@ static struct scsi_host_template iscsi_iser_sht = {
        .eh_device_reset_handler= iscsi_eh_device_reset,
        .eh_host_reset_handler  = iscsi_eh_host_reset,
        .use_clustering         = DISABLE_CLUSTERING,
+       .slave_configure        = iscsi_iser_slave_configure,
        .proc_name              = "iscsi_iser",
        .this_id                = -1,
 };

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-iscsi@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/open-iscsi
-~----------~----~----~----~------~----~------~--~---

Reply via email to