[openib-general] [PATCH 1/7] IB/core - Add DMA mapping functions to allow device drivers to interpose

Ralph Campbell ralph.campbell at qlogic.com
Fri Nov 3 10:20:03 PST 2006


On Fri, 2006-11-03 at 12:08 -0600, Steve Wise wrote:
> > > 
> > > But how?
> > > Wait, work request posting functions actually get a virtual
> > > address and a key, not a dma address. 
> > 
> > Work requests posted using ib_post_send/recv are specified using a dma 
> > address obtained using the appropriate Linux DMA mapping API function. 
> > They are not virtual addresses.
> > 
> 
> This isn't necessarily true.  The addr field in the WR is a dma addr
> when using a MR allocated via ib_get_dma_mr().  For MRs allocated via
> ib_reg_phys_mem(), then the addr field is something relative to the
> iova_start u64 passed into the ib_reg_phys_mem().  Right?  

The addr field in the send and receive work requests are actually
offsets within the memory region specified by the Lkey.
The open-fabrics verbs layer has chosen to define the Lkey returned
from ib_get_dma_mr() as memory region representing all of physical
memory and the offset as a device specific bus address which should
be created with the ib_dma_*() functions I just posted.
Similar rules apply to ib_map_phys_fmr() and ib_phys_buf.

I will write this up as James has suggested in a
Documentation/infiniband/memory_regions.txt file.





More information about the general mailing list