[openib-general] API clarification: ib_get_dma_mr()

somenath somenath at veritas.com
Wed Jul 19 10:16:26 PDT 2006


only documentation I find on this API is:

/**
 * ib_get_dma_mr - Returns a memory region for system memory that is
 *   usable for DMA.
 * @pd: The protection domain associated with the memory region.
 * @mr_access_flags: Specifies the memory access rights.
 */

I see there is no address associated with it, so I assume this is some 
kind of
reserved key stuff. now my questions are:

1. it basically returns l_key and r_key: can those keys be used with any 
phys/bus addresseses?
     (address returned by dma_map_single(), dma_map_xxx(), 
virt_to_phys() etc)

2. can the same l_key and r_key be used for different addresses at the 
same time? I mean can one just
    use the API once to get a pair of l_key and r_key and use for all 
post_recv and send ops
    (including rdma's)?


and my next question is on (valid for another similar API on fast memory 
reg too):


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);

q1:is there any use of  iova_start returned by this API? 
phys_buf_arrary, l_key and r_key
     are only used in subsequent APIs..
q2: is there any merit of using this API (or the one with fast memory 
reg) vs ib_get_dma_mr()?
       I see the advatage that its little bit more secure that it gives 
seperate l_key/r_key for a given
       phys address. Is there any other benefit?


thanks, som.





More information about the general mailing list