[openib-general] [PATCH] IB/documentation - add new file to Documentation/infiniband

Ralph Campbell ralph.campbell at qlogic.com
Fri Nov 10 14:51:32 PST 2006


On Fri, 2006-11-10 at 17:14 -0500, James Lentini wrote:
> 
> On Fri, 10 Nov 2006, Ralph Campbell wrote:
> 
> > > > > > +  ib_reg_phys_mr()  This function returns a pointer to struct ib_mr.
> > > > > > +  It takes an array of device DMA addresses and lengths which are used
> > > > > > +  to describe the memory region.  These addresses are created by
> > > > > > +  calling the mapping functions listed for ib_get_dma_mr().
> > > > > 
> > > > > The iova is an in/out parameter. I recommend including a description 
> > > > > of how to initialize it:
> > > > > 
> > > > >  The 'iova' argument can be used by the caller to request an address 
> > > > >  to associate with the first byte of the address region. Upon return, 
> > > > >  the 'iova' argument is the ... <continue with below>
> > > > 
> > > > Iova was at one point in time an in/out parameter but was changed
> > > > to be just an in parameter some time ago.
> > > 
> > > At what point was this changed?
> > 
> > Maybe a year ago. I tried to find it in the SVN log but
> > didn't find which revision changed it.
> > 
> > > In the 1.2 IBTA spec, it is described as an in/out.
> > > 
> > > For mthca, the iova value is an input (see mthca_reg_phys_mr). 
> > 
> > The IBTA spec. wasn't changed.
> > The open-fabrics code was changed since none of the HCAs
> > returned a modified iova value.  
> 
> Where did this change? All the versions of include/rdma/ib_verbs.h 
> (kernel 2.6.18, svn, Roland's git) define ib_reg_phys_mr() as
> 
> struct ib_mr *ib_reg_phys_mr(struct ib_pd *pd,
>                              struct ib_phys_buf *phys_buf_array,
>                              int num_phys_buf,
>                              int mr_access_flags,
>                              u64 *iova_start)
> 
> indicating to me that iova_start is an in/out parameter.
> 
> > Also, there are currently no callers of ib_reg_phys_mr() that I know 
> > of.
> 
> The NFS-RDMA client calls ib_reg_phys_mr() in certain configurations. 
> See the code at http://www.sourceforge.net/projects/nfs-rdma.

I must have woken up on the wrong side of the bed today :-)
Perhaps I am remembering it being changed from in to in/out since
the code obviously is in/out now.
How about:

The 'iova' argument is an in/out parameter which can be used by the
caller to request an address to associate with the first byte of the
memory region.  Upon return, the addresses used with struct ib_sge
'addr' and struct ib_send_wr 'remote_addr' are thus 'iova' plus an
offset within the length of the memory region.





More information about the general mailing list