[ofa-general] [PATCH RFC] RDMA: New Memory Extensions.

Steve Wise swise at opengridcomputing.com
Thu May 15 12:05:45 PDT 2008


>> We're not talking about allocating the pages themselves. 
>>
>> Here's an example (ignoring errors):
>>
>> page_list = ib_alloc_fast_reg_page_list(device, 1);
>>
>> v = get_free_page(GFP_KERNEL);
>>
>> page_list->page_list[0] = ib_dma_map_single(device, v, PAGE_SIZE,
>>                                                                 
>> DMA_TO_DEVICE|DMA_FROM_DEVICE);
>>
>> wr.opcode = IB_WR_FAST_REG_MR;
>> wr.next = NULL;
>> wr.send_flags = 0;
>> wr.wr_id = 0xdeadbeef;
>> wr.wr.fast_reg.mr = mr;
>> wr.wr.fast_reg.page_list = page_list;
>> wr.wr.fast_reg.page_size = PAGE_SIZE;
>> wr.wr.fast_reg.page_list_len = 1;
>> wr.wr.fast_reg.first_byte_offset = 0;
>> wr.wr.fast_reg.iova_start = (u64)v;
>> wr.wr.fast_reg.length = PAGE_SIZE;
>> wr.wr.fast_reg.access_flags = IB_ACCESS_LOCAL_WRITE |
>>                                                         
>> IB_ACCESS_REMOTE_READ |
>>                                                         
>> IB_ACCESS_REMOTE_WRITE;
>>
>> ib_post_send(qp, &wr, &bad_wr);
>>     
>
> OK. Thanks for clarifying. This wasn't clear to me from the
> original description but I understand now.
>   

Perhaps ib_alloc_fast_reg_page_list() isn't clear.  Maybe 
ib_alloc_fast_reg_page_list_mem() is better?  That's getting too long 
for my taste, but if others thing it helps... I'll change it.


Steve.



More information about the general mailing list