public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Tom Talpey <tmtalpey@gmail.com>
To: Steve Wise <swise@opengridcomputing.com>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>,
	tom@opengridcomputing.com, linux-nfs@vger.kernel.org,
	vuhuong@mellanox.com
Subject: Re: [PATCH 2.6.30] xprtrdma: The frmr iova_start values are   truncated by	the nfs rdma client.
Date: Mon, 27 Apr 2009 16:06:52 -0400	[thread overview]
Message-ID: <49f61067.181e640a.3cb9.0e6c@mx.google.com> (raw)
In-Reply-To: <49F60CA0.2020209@opengridcomputing.com>

At 03:50 PM 4/27/2009, Steve Wise wrote:
>Tom Talpey wrote:
>> At 03:32 PM 4/27/2009, Steve Wise wrote:
>>   
>>> Trond Myklebust wrote:
>>>     
>>>> On Mon, 2009-04-27 at 14:05 -0400, Trond Myklebust wrote:
>>>>   
>>>>       
>>>>> It looks looks as though the bug is really that the IB code is using a
>>>>> u64 to store dma handles. As an external user of the IB api, we really
>>>>> shouldn't have to perform this sort of transformation. If it is
>>>>> absolutely necessary, then it should be done by means of specialised
>>>>> accessor functions to initialise/read iova_start value when given a
>>>>> dma_addr_t.
>>>>>
>>>>> I'd therefore prefer the no-cast version (with eventual compiler
>>>>> warnings), in the hope that eventually the IB folks will fix their
>>>>> interface.
>>>>>     
>>>>>         
>>>> Translation: It looks to me as if the interface that we're using is a
>>>> bit too corrupted with IB low level implementation grime. In the future,
>>>> I'd like to see someone come up with a more high level interface for use
>>>> by external code such as the sunrpc module.
>>>>
>>>>   
>>>>       
>>> Clarification:  The iova_start isn't used to store dma handles.  The 
>>>     
>>
>> Agreed, it's more of a hardware register, that ends up on the wire as well.
>>
>> I think the net of this is that the mr_dma should have a more sensible
>> up-cast that yields the right bits in the iova_start. Maybe a nice
>> machine-dependent macro, defined in the RDMA layer, would be a good
>> approach. Surely the other upper layers need it too.
>>
>> While I have the floor, why doesn't the server have this issue? Looking
>> at the code, it has the same (unsigned long) cast as the client when
>> initializing its iova_start.
>>
>>   
>
>The server isn't using the dma address as the iova_start, but rather a 
>kernel virtual address pointer, which is 32b on a i386 system.  If you 
>take the cast off, then the the signed bit gets extended into the u64.  
>Apparently pointers are signed? 

Why is the server using a u64 to store a naked pointer? That has to be
a bug. Casting to (unsigned long) is just hiding it.

Does this address get handed to the RNIC to perform some sort of local
DMA? If so, how does it work if there's an IOMMU in the system? The
kva isn't necessarily the same as the dma_addr, right?

BTW, pointers are unsigned, but the assignment to u64 causes the
compiler to convert the pointer into a ptrdiff_t, in effect evaluating
((pointer) - NULL). Then, since the ptrdiff_t is a signed 32 bits, the
promotion results in the sign extension. I think! IOW, bug.

Tom.

>
>For instance, the server had a kva of 0xf5b75000.  If you remove the 
>(unsigned long) cast and stuff that into a u64, it ends up as 
>0xfffffffff5b75000.
>
>here was a trace I took of the server doing the first rdma write using 
>an frmr:
>
>Apr 26 13:14:07 rac2 kernel: build_fastreg iova_start 0xfffffffff5b75000 
>rkey 0x500 len 4096
>Apr 26 13:14:07 rac2 kernel: build_fastreg pbl[0] 0x35b75000
>Apr 26 13:14:07 rac2 kernel: build_rdma_write sge[0] lkey 0x500 addr 
>0xf5b75000 len 24
>Apr 26 13:14:07 rac2 kernel: post_qp_event - AE qpid 0x23 opcode 0 
>status 0x6 type 1 wrid.hi 0x1 wrid.lo 0x0
>
>
>So the frmr registration ends up with 0xfffffffff5b75000 as the 
>iova_start, yet the rdma write work request has 0xf5b75000 as the sge 
>address entry.   And the rnic fails this WR with a base/bounds violation 
>(status 0x6 in the chelsio Async Event).
>
>Steve.
>
>


  reply	other threads:[~2009-04-27 20:07 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-24 19:05 [PATCH 2.6.30] xprtrdma: The frmr iova_start values are truncated by the nfs rdma client Steve Wise
     [not found] ` <20090424190510.3134.90405.stgit-T4OLL4TyM9aNDNWfRnPdfg@public.gmane.org>
2009-04-25 14:11   ` Steve Wise
2009-04-26 18:57     ` Steve Wise
2009-04-27  2:17       ` Tom Talpey
     [not found]         ` <49f515a5.1d1e640a.1c82.6677-ATjtLOhZ0NVl57MIdRCFDg@public.gmane.org>
2009-04-27 17:37           ` Steve Wise
2009-04-27 18:05             ` Trond Myklebust
     [not found]               ` <1240855510.8818.9.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-04-27 18:23                 ` Trond Myklebust
     [not found]                   ` <1240856613.8818.16.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-04-27 19:32                     ` Steve Wise
2009-04-27 19:42                       ` Tom Talpey
     [not found]                         ` <49f60ac4.1c1d640a.2d0a.61a7-ATjtLOhZ0NVl57MIdRCFDg@public.gmane.org>
2009-04-27 19:50                           ` Steve Wise
2009-04-27 20:06                             ` Tom Talpey [this message]
     [not found]                               ` <49f61067.181e640a.3cb9.0e6c-ATjtLOhZ0NVl57MIdRCFDg@public.gmane.org>
2009-04-27 20:20                                 ` Steve Wise
2009-04-27 20:46                       ` Trond Myklebust
     [not found]                         ` <1240865214.8818.73.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-04-27 20:49                           ` Steve Wise
2009-05-11 22:25                           ` Steve Wise
2009-05-11 22:50                             ` Trond Myklebust
     [not found]                               ` <1242082203.1743.11.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-05-12  0:13                                 ` Steve Wise
2009-05-12  0:23                                   ` Tom Talpey
     [not found]                                     ` <4a08c1b5.151e640a.0a99.fffff868-ATjtLOhZ0NVl57MIdRCFDg@public.gmane.org>
2009-05-12  0:44                                       ` Steve Wise
2009-05-12  0:44                                   ` Trond Myklebust
     [not found]                                     ` <1242089066.1743.19.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-05-12  1:14                                       ` Tom Talpey
     [not found]                                         ` <4a08cd7b.48c3f10a.6bb1.fffff6d3-ATjtLOhZ0NVl57MIdRCFDg@public.gmane.org>
2009-05-12  1:35                                           ` Trond Myklebust
     [not found]                                             ` <1242092150.16618.15.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-05-12  3:06                                               ` Steve Wise
2009-05-12 16:11                                                 ` [ofa-general] " Steve Wise
2009-05-12 16:23                                                   ` Steve Wise
2009-05-13 21:35                                                     ` Roland Dreier
     [not found]                                                       ` <adak54kr8iz.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2009-05-14  7:22                                                         ` Or Gerlitz
     [not found]                                                           ` <4A0BC6A6.1070002-smomgflXvOZWk0Htik3J/w@public.gmane.org>
2009-05-14 13:41                                                             ` Steve Wise
2009-05-14 13:45                                                               ` Or Gerlitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49f61067.181e640a.3cb9.0e6c@mx.google.com \
    --to=tmtalpey@gmail.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=swise@opengridcomputing.com \
    --cc=tom@opengridcomputing.com \
    --cc=trond.myklebust@fys.uio.no \
    --cc=vuhuong@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox