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

James Lentini jlentini at netapp.com
Fri Nov 3 10:52:18 PST 2006



On Fri, 3 Nov 2006, 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 only documentation I've ever seen on this topic is here:

 http://www.linuxjournal.com/article/8009

It says:

"The address in the gather list is a DMA address obtained from 
dma_map_single() rather than a virtual address"

NFS-RDMA is the only ULP I know of that uses ib_reg_phys_mr(). 
NFS-RDMA uses the DMA mapping API to initialize the iova_start address 
passed into ib_reg_phys_mr(). That is what the Mellanox driver 
expected (at the time, that was the best documentation I had). 
Subsequent work request addresses are calculated based on the 
iova_start address (as you point out), but the iova_start was 
generated using the DMA mapping API.




More information about the general mailing list