public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* ibv_reg_mr call failed
@ 2013-05-24 17:43 Liu Ginhann
       [not found] ` <B78BFEBC60BCD84AABFE4C6AE4239F303631433D-PabevnM9DETuy2SDsQ9Xi/nBZW37Ciw+nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Liu Ginhann @ 2013-05-24 17:43 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

We are running into an unexpected problem while registering memory for IB operation. Ibv_reg_mr() call return EFAULT - bad address. 

The pointer passed into ibv_reg_mr call is mmap back from memory allocated in our kernel driver. Our test code is able to use this mapped back virtual address to peek and poke without issue; the size is expected. This memory is a fixed size FIFO buffer designed to be used as our FPGA device buffer and IB transport buffer. There is host software to manage buffer usage. If we just malloc memory from app and pass it into ibv_reg_mr call, memory register call return ok.

It seems like for some reason, ibv_reg_mr doesn't like the pointer we passed in. Here is how we allocate and map the buffer inside the driver, 
. 4M memory is created and allocated using the kmem_cache_create, kmem_cache_alloc call during driver initialization.
. When mmap is called from user application at run-time, remap_pfn_range is called to map the buffer into the process's virtual address space. page_to_pfn(virt_to_page(buffer) is used to convert kernel virtual address into page and pfn.

We tried to change flags during allocation or mapping, but none of them work.

Any suggestion how to solve this problem?

Here is version information of our test chassis,
64-bit Suse Linux: 3.0.35-rt58-0.5-rt
OFED Info: MLNX_OFED_LINUX-1.5.3-3.1.0 (OFED-1.5.3-3.1.0)

Regards, 



Hank Liu



--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-06-09  7:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-24 17:43 ibv_reg_mr call failed Liu Ginhann
     [not found] ` <B78BFEBC60BCD84AABFE4C6AE4239F303631433D-PabevnM9DETuy2SDsQ9Xi/nBZW37Ciw+nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2013-05-26  6:59   ` Or Gerlitz
     [not found]     ` <51A1B2D7.6050201-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2013-05-26 12:52       ` Liu Ginhann
2013-05-26 13:36   ` Or Gerlitz
     [not found]     ` <51A20FC0.8070906-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2013-05-26 13:52       ` Liu Ginhann
     [not found]         ` <2AB4BFEB-D0E5-47E5-9E99-024BA7BB16AA-Omk3PdybHIaN9aS15agKxg@public.gmane.org>
2013-05-27  7:52           ` Or Gerlitz
     [not found]             ` <CAJZOPZ+ESd4bq2dG4yYJG4qumaBWfd+4t_bTn4cHmFgCg8AYgw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-05-30 23:05               ` Liu Ginhann
     [not found]                 ` <B78BFEBC60BCD84AABFE4C6AE4239F303631FD9E-PabevnM9DETuy2SDsQ9Xi/nBZW37Ciw+nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2013-05-31  6:23                   ` Or Gerlitz
     [not found]             ` <B78BFEBC60BCD84AABFE4C6AE4239F303633B73E@BY2PRD0412MB622.namprd04.prod.outlook.com>
     [not found]               ` <B78BFEBC60BCD84AABFE4C6AE4239F303633B73E-PabevnM9DETuy2SDsQ9Xi/nBZW37Ciw+nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2013-06-09  7:33                 ` Or Gerlitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox