\r
\r
#ifdef CL_KERNEL\r
-\r
-typedef struct _ib_fmr\r
+typedef struct _mlnx_fmr\r
{\r
al_obj_t obj;\r
- ib_fmr_handle_t h_ci_fmr; /* Actual HW handle. */\r
-} ib_fmr_t;\r
+ mlnx_fmr_handle_t h_ci_fmr; /* Actual HW handle. */\r
+\r
+} mlnx_fmr_t;\r
+\r
\r
cl_status_t\r
-fmr_ctor(\r
+mlnx_fmr_ctor(\r
IN void* const p_object,\r
IN void* context,\r
OUT cl_pool_item_t** const pp_pool_item );\r
\r
\r
void\r
-fmr_dtor(\r
+mlnx_fmr_dtor(\r
IN const cl_pool_item_t* const p_pool_item,\r
IN void* context );\r
-\r
-\r
-ib_api_status_t\r
-create_fmr(\r
- IN const ib_pd_handle_t h_pd,\r
- IN const ib_fmr_create_t* const p_fmr_create,\r
- OUT ib_fmr_handle_t* const ph_fmr );\r
-\r
-\r
-ib_api_status_t\r
-map_phys_fmr(\r
- IN const ib_fmr_handle_t h_fmr,\r
- IN const void* __ptr64 paddr_list,\r
- IN const int list_len,\r
- IN OUT void** __ptr64 const p_vaddr,\r
- OUT net32_t* const p_lkey,\r
- OUT net32_t* const p_rkey);\r
-\r
-\r
-ib_api_status_t\r
-unmap_fmr(\r
- IN const ib_fmr_handle_t h_fmr);\r
-\r
-ib_api_status_t\r
-destroy_fmr(\r
- IN ib_fmr_handle_t const ph_fmr );\r
-\r
#endif\r
\r
\r
IN al_obj_t *p_obj );\r
\r
\r
-#ifdef CL_KERNEL\r
-static void\r
-__cleanup_fmr(\r
- IN struct _al_obj *p_obj );\r
-\r
-static void\r
-__return_fmr(\r
- IN al_obj_t *p_obj );\r
-#endif\r
-\r
-\r
cl_status_t\r
mr_ctor(\r
IN void* const p_object,\r
OUT net32_t* const p_lkey,\r
OUT net32_t* const p_rkey,\r
OUT ib_mr_handle_t* const ph_mr )\r
-{\r
- return reg_phys(\r
- h_pd, p_phys_create, p_vaddr, p_lkey, p_rkey, ph_mr, FALSE );\r
-}\r
-\r
-\r
-\r
-ib_api_status_t\r
-reg_phys(\r
- IN const ib_pd_handle_t h_pd,\r
- IN const ib_phys_create_t* const p_phys_create,\r
- IN OUT uint64_t* const p_vaddr,\r
- OUT net32_t* const p_lkey,\r
- OUT net32_t* const p_rkey,\r
- OUT ib_mr_handle_t* const ph_mr,\r
- IN boolean_t um_call )\r
{\r
ib_mr_handle_t h_mr;\r
ib_api_status_t status;\r
OUT net32_t* const p_lkey,\r
OUT net32_t* const p_rkey,\r
IN const ib_pd_handle_t h_pd OPTIONAL )\r
-{\r
- return rereg_phys( h_mr, mr_mod_mask, p_phys_create, p_vaddr, p_lkey,\r
- p_rkey, h_pd, FALSE );\r
-}\r
-\r
-\r
-ib_api_status_t\r
-rereg_phys(\r
- IN const ib_mr_handle_t h_mr,\r
- IN const ib_mr_mod_t mr_mod_mask,\r
- IN const ib_phys_create_t* const p_phys_create OPTIONAL,\r
- IN OUT uint64_t* const p_vaddr,\r
- OUT uint32_t* const p_lkey,\r
- OUT uint32_t* const p_rkey,\r
- IN const ib_pd_handle_t h_pd OPTIONAL,\r
- IN boolean_t um_call )\r
{\r
ib_api_status_t status;\r
\r
CL_EXIT( AL_DBG_MR, g_al_dbg_lvl );\r
return status;\r
}\r
-\r
-\r
-#ifdef CL_KERNEL\r
-cl_status_t\r
-fmr_ctor(\r
- IN void* const p_object,\r
- IN void* context,\r
- OUT cl_pool_item_t** const pp_pool_item )\r
-{\r
- ib_api_status_t status;\r
- ib_fmr_handle_t h_fmr;\r
-\r
- UNUSED_PARAM( context );\r
-\r
- h_fmr = (ib_fmr_handle_t)p_object;\r
- cl_memclr( h_fmr, sizeof( ib_fmr_t ) );\r
-\r
- construct_al_obj( &h_fmr->obj, AL_OBJ_TYPE_H_FMR );\r
- status = init_al_obj( &h_fmr->obj, NULL, FALSE, NULL,\r
- __cleanup_fmr, __return_fmr );\r
- if( status != IB_SUCCESS )\r
- {\r
- return CL_ERROR;\r
- }\r
-\r
- *pp_pool_item = &((ib_fmr_handle_t)p_object)->obj.pool_item;\r
-\r
- /* Release the reference taken in init_al_obj. */\r
- deref_al_obj( &h_fmr->obj );\r
-\r
- return CL_SUCCESS;\r
-}\r
-\r
-\r
-\r
-void\r
-fmr_dtor(\r
- IN const cl_pool_item_t* const p_pool_item,\r
- IN void* context )\r
-{\r
- al_obj_t *p_obj;\r
-\r
- UNUSED_PARAM( context );\r
-\r
- p_obj = PARENT_STRUCT( p_pool_item, al_obj_t, pool_item );\r
-\r
- /*\r
- * The FMR is being totally destroyed. Modify the free_cb to destroy the\r
- * AL object.\r
- */\r
- p_obj->pfn_free = (al_pfn_free_t)destroy_al_obj;\r
- ref_al_obj( p_obj );\r
- p_obj->pfn_destroy( p_obj, NULL );\r
-}\r
-\r
-\r
-\r
-static void\r
-__cleanup_fmr(\r
- IN struct _al_obj *p_obj )\r
-{\r
- ib_api_status_t status;\r
- ib_fmr_handle_t h_fmr;\r
-\r
- CL_ASSERT( p_obj );\r
- h_fmr = PARENT_STRUCT( p_obj, ib_fmr_t, obj );\r
-\r
- /* Deregister the memory. */\r
- if( verbs_check_fmr(h_fmr) )\r
- {\r
- status = verbs_destroy_fmr( h_fmr);\r
- CL_ASSERT( status == IB_SUCCESS );\r
-\r
- h_fmr->h_ci_fmr = NULL;\r
- }\r
-}\r
-\r
-\r
-\r
-static void\r
-__return_fmr(\r
- IN al_obj_t *p_obj )\r
-{\r
- ib_fmr_handle_t h_fmr;\r
-\r
- h_fmr = PARENT_STRUCT( p_obj, ib_fmr_t, obj );\r
- reset_al_obj( p_obj );\r
- put_fmr( h_fmr );\r
-}\r
-\r
-\r
-\r
-ib_api_status_t\r
-ib_create_fmr(\r
- IN const ib_pd_handle_t h_pd,\r
- IN const ib_fmr_create_t* const p_fmr_create,\r
- OUT ib_fmr_handle_t* const ph_fmr )\r
-{\r
- ib_api_status_t status;\r
-\r
- CL_ENTER( AL_DBG_MR, g_al_dbg_lvl );\r
-\r
- if( AL_OBJ_INVALID_HANDLE( h_pd, AL_OBJ_TYPE_H_PD ) )\r
- {\r
- CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PD_HANDLE\n") );\r
- return IB_INVALID_PD_HANDLE;\r
- }\r
-\r
- status = create_fmr( h_pd, p_fmr_create, ph_fmr);\r
-\r
- /* Release the reference taken in alloc_fmr for initialization. */\r
- if( status == IB_SUCCESS )\r
- deref_al_obj( &(*ph_fmr)->obj );\r
-\r
- AL_EXIT( AL_DBG_MR );\r
- return status;\r
-}\r
-\r
-\r
-\r
-ib_api_status_t\r
-create_fmr(\r
- IN const ib_pd_handle_t h_pd,\r
- IN const ib_fmr_create_t* const p_fmr_create,\r
- OUT ib_fmr_handle_t* const ph_fmr)\r
-{\r
- ib_fmr_handle_t h_fmr;\r
- ib_api_status_t status;\r
-\r
- CL_ENTER( AL_DBG_MR, g_al_dbg_lvl );\r
-\r
- if( !p_fmr_create || !ph_fmr )\r
- {\r
- CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
- return IB_INVALID_PARAMETER;\r
- }\r
-\r
- /* Get a MR tracking structure. */\r
- h_fmr = alloc_fmr();\r
- if( !h_fmr )\r
- {\r
- CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl,\r
- ("unable to allocate memory handle\n") );\r
- return IB_INSUFFICIENT_MEMORY;\r
- }\r
-\r
- status = attach_al_obj( &h_pd->obj, &h_fmr->obj );\r
- if( status != IB_SUCCESS )\r
- {\r
- h_fmr->obj.pfn_destroy( &h_fmr->obj, NULL );\r
- AL_TRACE_EXIT( AL_DBG_ERROR,\r
- ("attach_al_obj returned %s.\n", ib_get_err_str(status)) );\r
- return status;\r
- }\r
-\r
- /* Register the memory region. */\r
- status = verbs_create_fmr( h_pd, p_fmr_create, h_fmr );\r
- if( status != IB_SUCCESS )\r
- {\r
- h_fmr->obj.pfn_destroy( &h_fmr->obj, NULL );\r
- CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl,\r
- ("unable to register memory: %s\n", ib_get_err_str(status)) );\r
- return status;\r
- }\r
-\r
- *ph_fmr = h_fmr;\r
-\r
- CL_EXIT( AL_DBG_MR, g_al_dbg_lvl );\r
- return IB_SUCCESS;\r
-}\r
-\r
-\r
-ib_api_status_t\r
-ib_map_phys_fmr(\r
- IN const ib_fmr_handle_t h_fmr,\r
- IN const void* __ptr64 paddr_list,\r
- IN const int list_len,\r
- IN OUT void** __ptr64 const p_vaddr,\r
- OUT net32_t* const p_lkey,\r
- OUT net32_t* const p_rkey)\r
-{\r
- ib_api_status_t status;\r
-\r
- CL_ENTER( AL_DBG_MR, g_al_dbg_lvl );\r
-\r
- if( AL_OBJ_INVALID_HANDLE( h_fmr, AL_OBJ_TYPE_H_FMR ) )\r
- {\r
- CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_FMR_HANDLE\n") );\r
- return IB_INVALID_FMR_HANDLE;\r
- }\r
-\r
- ref_al_obj( &h_fmr->obj );\r
-\r
- status = map_phys_fmr( h_fmr, paddr_list, list_len, p_vaddr, p_lkey, p_rkey );\r
-\r
- deref_al_obj( &h_fmr->obj );\r
-\r
- AL_EXIT( AL_DBG_MR );\r
- return status;\r
-}\r
-\r
-\r
-\r
-ib_api_status_t\r
-map_phys_fmr(\r
- IN const ib_fmr_handle_t h_fmr,\r
- IN const void* __ptr64 paddr_list,\r
- IN const int list_len,\r
- IN OUT void** __ptr64 const p_vaddr,\r
- OUT net32_t* const p_lkey,\r
- OUT net32_t* const p_rkey)\r
-{\r
- ib_api_status_t status;\r
-\r
- CL_ENTER( AL_DBG_MR, g_al_dbg_lvl );\r
-\r
- if( !paddr_list || !p_vaddr || !p_lkey || !p_rkey)\r
- {\r
- CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
- return IB_INVALID_PARAMETER;\r
- }\r
-\r
- /* Register the memory region. */\r
- status = verbs_map_phys_fmr( h_fmr, paddr_list, list_len, p_vaddr, p_lkey, p_rkey);\r
- if( status != IB_SUCCESS )\r
- {\r
- //TODO: do we need to do something more about the error ?\r
- CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl,\r
- ("unable to map FMR: %s\n", ib_get_err_str(status)) );\r
- return status;\r
- }\r
-\r
-\r
- CL_EXIT( AL_DBG_MR, g_al_dbg_lvl );\r
- return IB_SUCCESS;\r
-}\r
-\r
-ib_api_status_t\r
-ib_unmap_fmr(\r
- IN const ib_fmr_handle_t h_fmr)\r
-{\r
- ib_api_status_t status;\r
-\r
- CL_ENTER( AL_DBG_MR, g_al_dbg_lvl );\r
-\r
- if( AL_OBJ_INVALID_HANDLE( h_fmr, AL_OBJ_TYPE_H_FMR ) )\r
- {\r
- CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_FMR_HANDLE\n") );\r
- return IB_INVALID_FMR_HANDLE;\r
- }\r
-\r
- ref_al_obj( &h_fmr->obj );\r
-\r
- status = unmap_fmr( h_fmr );\r
-\r
- deref_al_obj( &h_fmr->obj );\r
-\r
- CL_EXIT( AL_DBG_MR, g_al_dbg_lvl );\r
- return status;\r
-}\r
-\r
-ib_api_status_t\r
-unmap_fmr(\r
- IN const ib_fmr_handle_t h_fmr)\r
-{\r
- ib_api_status_t status;\r
-\r
- AL_ENTER( AL_DBG_MR );\r
-\r
- if( !verbs_check_fmr(h_fmr) )\r
- {\r
- CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_FMR_HANDLE\n") );\r
- return IB_INVALID_FMR_HANDLE;\r
- }\r
-\r
- status = verbs_unmap_fmr(h_fmr);\r
-\r
- CL_EXIT( AL_DBG_MR, g_al_dbg_lvl );\r
- return status;\r
-}\r
-\r
-\r
-ib_api_status_t\r
-ib_destroy_fmr(\r
- IN const ib_fmr_handle_t h_fmr )\r
-{\r
- ib_api_status_t status;\r
-\r
- CL_ENTER( AL_DBG_MR, g_al_dbg_lvl );\r
-\r
- if( AL_OBJ_INVALID_HANDLE( h_fmr, AL_OBJ_TYPE_H_FMR ) )\r
- {\r
- CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_FMR_HANDLE\n") );\r
- return IB_INVALID_FMR_HANDLE;\r
- }\r
-\r
- ref_al_obj( &h_fmr->obj );\r
-\r
- status = destroy_fmr( h_fmr );\r
- if( status != IB_SUCCESS )\r
- deref_al_obj( &h_fmr->obj );\r
-\r
- CL_EXIT( AL_DBG_MR, g_al_dbg_lvl );\r
- return status;\r
-}\r
-\r
-\r
-\r
-ib_api_status_t\r
-destroy_fmr(\r
- IN const ib_fmr_handle_t h_fmr )\r
-{\r
- ib_api_status_t status;\r
-\r
- AL_ENTER( AL_DBG_MR );\r
-\r
- if( !verbs_check_fmr(h_fmr) )\r
- {\r
- CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_FMR_HANDLE\n") );\r
- return IB_INVALID_FMR_HANDLE;\r
- }\r
-\r
- /* FMR's are destroyed synchronously */\r
- status = verbs_destroy_fmr(h_fmr);\r
-\r
- if( status == IB_SUCCESS )\r
- {\r
- h_fmr->h_ci_fmr = NULL;\r
- /* We're good to destroy the object. */\r
- h_fmr->obj.pfn_destroy( &h_fmr->obj, NULL );\r
- }\r
-\r
- CL_EXIT( AL_DBG_MR, g_al_dbg_lvl );\r
- return status;\r
-}\r
-\r
-\r
-\r
-#endif\r
-\r
-\r
#define AL_MR_POOL_SIZE (4096 / sizeof( ib_mr_t ))\r
#define AL_AV_POOL_SIZE (4096 / sizeof( ib_av_t ))\r
#ifdef CL_KERNEL\r
-#define AL_FMR_POOL_SIZE (4096 / sizeof( ib_fmr_t ))\r
+#define AL_FMR_POOL_SIZE (4096 / sizeof( mlnx_fmr_t ))\r
#endif\r
\r
al_res_mgr_t *gp_res_mgr;\r
#ifdef CL_KERNEL\r
/* Initialize the pool of fast memory regions. */\r
cl_status = cl_qpool_init( &gp_res_mgr->fmr_pool,\r
- AL_FMR_POOL_SIZE, 0, AL_FMR_POOL_SIZE, sizeof( ib_fmr_t ),\r
- fmr_ctor, fmr_dtor, gp_res_mgr );\r
+ AL_FMR_POOL_SIZE, 0, AL_FMR_POOL_SIZE, sizeof(mlnx_fmr_t),\r
+ mlnx_fmr_ctor, mlnx_fmr_dtor, gp_res_mgr );\r
if( cl_status != CL_SUCCESS )\r
{\r
gp_res_mgr->obj.pfn_destroy( &gp_res_mgr->obj, NULL );\r
deref_al_obj( &gp_res_mgr->obj );\r
}\r
\r
-#ifdef CL_KERNEL\r
\r
+#ifdef CL_KERNEL\r
/*\r
* Get a fast memory region structure to track registration requests.\r
*/\r
-ib_fmr_handle_t\r
-alloc_fmr()\r
+mlnx_fmr_handle_t\r
+alloc_mlnx_fmr()\r
{\r
al_obj_t *p_obj;\r
cl_pool_item_t *p_pool_item;\r
*/\r
ref_al_obj( p_obj );\r
\r
- return PARENT_STRUCT( p_obj, ib_fmr_t, obj );\r
+ return PARENT_STRUCT( p_obj, mlnx_fmr_t, obj );\r
}\r
\r
\r
* Return a memory region structure to the available pool.\r
*/\r
void\r
-put_fmr(\r
- IN ib_fmr_handle_t h_fmr )\r
+put_mlnx_fmr(\r
+ IN mlnx_fmr_handle_t h_fmr )\r
{\r
cl_spinlock_acquire( &gp_res_mgr->obj.lock );\r
cl_qpool_put( &gp_res_mgr->fmr_pool, &h_fmr->obj.pool_item );\r
cl_spinlock_release( &gp_res_mgr->obj.lock );\r
deref_al_obj( &gp_res_mgr->obj );\r
}\r
-\r
#endif\r
\r
+\r
/*\r
* Get an address vector from the available pool.\r
*/\r
#ifdef CL_KERNEL\r
cl_qpool_t fmr_pool;\r
#endif\r
+\r
} al_res_mgr_t;\r
\r
\r
IN ib_mr_handle_t h_mr );\r
\r
#ifdef CL_KERNEL\r
-ib_fmr_handle_t\r
-alloc_fmr(void);\r
+mlnx_fmr_handle_t\r
+alloc_mlnx_fmr(void);\r
\r
\r
void\r
-put_fmr(\r
- IN ib_fmr_handle_t h_fmr );\r
-\r
+put_mlnx_fmr(\r
+ IN mlnx_fmr_handle_t h_fmr );\r
#endif\r
\r
ib_av_handle_t\r
#define verbs_register_pmr(h_pd, p_phys_create, p_vaddr,\\r
p_lkey, p_rkey, h_mr) \\r
h_mr->obj.p_ci_ca->verbs.register_pmr( h_pd->h_ci_pd,\\r
- p_phys_create, p_vaddr, p_lkey, p_rkey, &h_mr->h_ci_mr,\\r
- um_call )\r
+ p_phys_create, p_vaddr, p_lkey, p_rkey, &h_mr->h_ci_mr, FALSE )\r
\r
#define verbs_check_mr(h_mr) ((h_mr)->h_ci_mr)\r
-#define verbs_check_fmr(h_fmr) ((h_fmr)->h_ci_fmr)\r
+#define verbs_check_mlnx_fmr(h_fmr) ((h_fmr)->h_ci_fmr)\r
#define verbs_deregister_mr(h_mr) \\r
h_mr->obj.p_ci_ca->verbs.deregister_mr( h_mr->h_ci_mr )\r
\r
p_vaddr, p_lkey, p_rkey, h_pd ) \\r
h_mr->obj.p_ci_ca->verbs.modify_pmr( h_mr->h_ci_mr, mr_modify_mask, \\r
p_pmr_create, p_vaddr, p_lkey, p_rkey, \\r
- h_pd ? h_pd->h_ci_pd : NULL, um_call )\r
+ h_pd ? h_pd->h_ci_pd : NULL, FALSE )\r
\r
#define verbs_register_smr(h_mr, h_pd, access_ctrl, p_vaddr, p_lkey, \\r
p_rkey, ph_mr ) \\r
access_ctrl, p_vaddr, p_lkey, p_rkey, &(ph_mr->h_ci_mr), \\r
um_call )\r
\r
-#define verbs_create_fmr(h_pd, p_fmr_create, h_fmr) \\r
- h_fmr->obj.p_ci_ca->verbs.alloc_fmr( h_pd->h_ci_pd,\\r
- p_fmr_create, &h_fmr->h_ci_fmr)\r
+#define verbs_create_mlnx_fmr(h_pd, p_fmr_create, h_fmr ) \\r
+ h_fmr->obj.p_ci_ca->verbs.alloc_mlnx_fmr( h_pd->h_ci_pd,\\r
+ p_fmr_create, &h_fmr->h_ci_fmr )\r
\r
-#define verbs_map_phys_fmr( h_fmr, plist_addr, list_len, p_vaddr, p_lkey, p_rkey) \\r
- h_fmr->obj.p_ci_ca->verbs.map_phys_fmr( h_fmr->h_ci_fmr,\\r
- plist_addr, list_len, p_vaddr, p_lkey, p_rkey)\r
+#define verbs_map_phys_mlnx_fmr( h_fmr, plist_addr, list_len, p_vaddr, p_lkey, p_rkey) \\r
+ h_fmr->obj.p_ci_ca->verbs.map_phys_mlnx_fmr( h_fmr->h_ci_fmr,\\r
+ plist_addr, list_len, p_vaddr, p_lkey, p_rkey )\r
\r
-#define verbs_unmap_fmr( h_fmr) \\r
- h_fmr->obj.p_ci_ca->verbs.unmap_fmr( h_fmr->h_ci_fmr)\r
+#define verbs_unmap_mlnx_fmr( h_fmr ) \\r
+ h_fmr->obj.p_ci_ca->verbs.unmap_mlnx_fmr( h_fmr->h_ci_fmr)\r
\r
-#define verbs_destroy_fmr(h_fmr) \\r
- h_fmr->obj.p_ci_ca->verbs.dealloc_fmr(h_fmr->h_ci_fmr)\r
+#define verbs_destroy_mlnx_fmr( h_fmr ) \\r
+ h_fmr->obj.p_ci_ca->verbs.dealloc_mlnx_fmr( h_fmr->h_ci_fmr )\r
\r
\r
#define verbs_create_mw(h_pd, p_rkey, h_mw) \\r
UNUSED_PARAM( p_vaddr ); \\r
UNUSED_PARAM( p_lkey ); \\r
UNUSED_PARAM( p_rkey ); \\r
- UNUSED_PARAM( h_mr ); \\r
- UNUSED_PARAM( um_call )\r
+ UNUSED_PARAM( h_mr )\r
\r
#define verbs_check_mr(h_mr) ((h_mr)->h_ci_mr || (h_mr)->obj.hdl)\r
#define verbs_deregister_mr(h_mr) \\r
UNUSED_PARAM( p_vaddr ); \\r
UNUSED_PARAM( p_lkey ); \\r
UNUSED_PARAM( p_rkey ); \\r
- UNUSED_PARAM( h_pd ); \\r
- UNUSED_PARAM( um_call )\r
+ UNUSED_PARAM( h_pd )\r
\r
#define verbs_register_smr(h_mr, h_pd, access_ctrl, p_vaddr, p_lkey, \\r
p_rkey, ph_mr ) \\r
#include "ib_common.h"\r
\r
\r
+static void\r
+__cleanup_mlnx_fmr(\r
+ IN struct _al_obj *p_obj );\r
+\r
+static void\r
+__return_mlnx_fmr(\r
+ IN al_obj_t *p_obj );\r
+\r
+\r
static al_shmid_t*\r
__create_shmid(\r
IN const int shmid );\r
IN struct _al_obj *p_obj );\r
\r
\r
+cl_status_t\r
+mlnx_fmr_ctor(\r
+ IN void* const p_object,\r
+ IN void* context,\r
+ OUT cl_pool_item_t** const pp_pool_item )\r
+{\r
+ ib_api_status_t status;\r
+ mlnx_fmr_handle_t h_fmr;\r
+\r
+ UNUSED_PARAM( context );\r
+\r
+ h_fmr = (mlnx_fmr_handle_t)p_object;\r
+ cl_memclr( h_fmr, sizeof(mlnx_fmr_t) );\r
+\r
+ construct_al_obj( &h_fmr->obj, AL_OBJ_TYPE_H_FMR );\r
+ status = init_al_obj( &h_fmr->obj, NULL, FALSE, NULL,\r
+ __cleanup_mlnx_fmr, __return_mlnx_fmr );\r
+ if( status != IB_SUCCESS )\r
+ {\r
+ return CL_ERROR;\r
+ }\r
+\r
+ *pp_pool_item = &((mlnx_fmr_handle_t)p_object)->obj.pool_item;\r
+\r
+ /* Release the reference taken in init_al_obj. */\r
+ deref_al_obj( &h_fmr->obj );\r
+\r
+ return CL_SUCCESS;\r
+}\r
+\r
+\r
+\r
+void\r
+mlnx_fmr_dtor(\r
+ IN const cl_pool_item_t* const p_pool_item,\r
+ IN void* context )\r
+{\r
+ al_obj_t *p_obj;\r
+\r
+ UNUSED_PARAM( context );\r
+\r
+ p_obj = PARENT_STRUCT( p_pool_item, al_obj_t, pool_item );\r
+\r
+ /*\r
+ * The FMR is being totally destroyed. Modify the free_cb to destroy the\r
+ * AL object.\r
+ */\r
+ p_obj->pfn_free = (al_pfn_free_t)destroy_al_obj;\r
+ ref_al_obj( p_obj );\r
+ p_obj->pfn_destroy( p_obj, NULL );\r
+}\r
+\r
+\r
+\r
+static void\r
+__cleanup_mlnx_fmr(\r
+ IN struct _al_obj *p_obj )\r
+{\r
+ ib_api_status_t status;\r
+ mlnx_fmr_handle_t h_fmr;\r
+\r
+ CL_ASSERT( p_obj );\r
+ h_fmr = PARENT_STRUCT( p_obj, mlnx_fmr_t, obj );\r
+\r
+ /* Deregister the memory. */\r
+ if( verbs_check_mlnx_fmr( h_fmr ) )\r
+ {\r
+ status = verbs_destroy_mlnx_fmr( h_fmr );\r
+ CL_ASSERT( status == IB_SUCCESS );\r
+\r
+ h_fmr->h_ci_fmr = NULL;\r
+ }\r
+}\r
+\r
+\r
+\r
+static void\r
+__return_mlnx_fmr(\r
+ IN al_obj_t *p_obj )\r
+{\r
+ mlnx_fmr_handle_t h_fmr;\r
+\r
+ h_fmr = PARENT_STRUCT( p_obj, mlnx_fmr_t, obj );\r
+ reset_al_obj( p_obj );\r
+ put_mlnx_fmr( h_fmr );\r
+}\r
+\r
+\r
+\r
+ib_api_status_t\r
+mlnx_create_fmr(\r
+ IN const ib_pd_handle_t h_pd,\r
+ IN const mlnx_fmr_create_t* const p_fmr_create,\r
+ OUT mlnx_fmr_handle_t* const ph_fmr )\r
+{\r
+ mlnx_fmr_handle_t h_fmr;\r
+ ib_api_status_t status;\r
+\r
+ AL_ENTER( AL_DBG_MR );\r
+\r
+ if( AL_OBJ_INVALID_HANDLE( h_pd, AL_OBJ_TYPE_H_PD ) )\r
+ {\r
+ CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PD_HANDLE\n") );\r
+ return IB_INVALID_PD_HANDLE;\r
+ }\r
+\r
+ if( !p_fmr_create || !ph_fmr )\r
+ {\r
+ CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+ return IB_INVALID_PARAMETER;\r
+ }\r
+\r
+ /* Get a MR tracking structure. */\r
+ h_fmr = alloc_mlnx_fmr();\r
+ if( !h_fmr )\r
+ {\r
+ CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl,\r
+ ("unable to allocate memory handle\n") );\r
+ return IB_INSUFFICIENT_MEMORY;\r
+ }\r
+\r
+ status = attach_al_obj( &h_pd->obj, &h_fmr->obj );\r
+ if( status != IB_SUCCESS )\r
+ {\r
+ h_fmr->obj.pfn_destroy( &h_fmr->obj, NULL );\r
+ AL_TRACE_EXIT( AL_DBG_ERROR,\r
+ ("attach_al_obj returned %s.\n", ib_get_err_str(status)) );\r
+ return status;\r
+ }\r
+\r
+ /* Register the memory region. */\r
+ status = verbs_create_mlnx_fmr( h_pd, p_fmr_create, h_fmr );\r
+ if( status != IB_SUCCESS )\r
+ {\r
+ h_fmr->obj.pfn_destroy( &h_fmr->obj, NULL );\r
+ CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl,\r
+ ("unable to register memory: %s\n", ib_get_err_str(status)) );\r
+ return status;\r
+ }\r
+\r
+ *ph_fmr = h_fmr;\r
+ deref_al_obj( &(*ph_fmr )->obj );\r
+\r
+ AL_EXIT( AL_DBG_MR );\r
+ return IB_SUCCESS;\r
+}\r
+\r
+\r
+ib_api_status_t\r
+mlnx_map_phys_fmr(\r
+ IN const mlnx_fmr_handle_t h_fmr,\r
+ IN const uint64_t* const paddr_list,\r
+ IN const int list_len,\r
+ IN OUT uint64_t* const p_vaddr,\r
+ OUT net32_t* const p_lkey,\r
+ OUT net32_t* const p_rkey)\r
+{\r
+ ib_api_status_t status;\r
+\r
+ AL_ENTER( AL_DBG_MR );\r
+\r
+ if( AL_OBJ_INVALID_HANDLE( h_fmr, AL_OBJ_TYPE_H_FMR ) )\r
+ {\r
+ CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_FMR_HANDLE\n") );\r
+ return IB_INVALID_FMR_HANDLE;\r
+ }\r
+\r
+ if( !paddr_list || !p_vaddr || !p_lkey || !p_rkey )\r
+ {\r
+ CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+ return IB_INVALID_PARAMETER;\r
+ }\r
+\r
+ ref_al_obj( &h_fmr->obj );\r
+\r
+ /* Register the memory region. */\r
+ status = verbs_map_phys_mlnx_fmr( h_fmr, paddr_list, list_len, p_vaddr, p_lkey, p_rkey);\r
+ if( status != IB_SUCCESS )\r
+ {\r
+ //TODO: do we need to do something more about the error ?\r
+ CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl,\r
+ ("unable to map FMR: %s\n", ib_get_err_str(status)) );\r
+ }\r
+\r
+ deref_al_obj( &h_fmr->obj );\r
+\r
+ AL_EXIT( AL_DBG_MR );\r
+ return status;\r
+}\r
+\r
+\r
+ib_api_status_t\r
+mlnx_unmap_fmr(\r
+ IN const mlnx_fmr_handle_t h_fmr )\r
+{\r
+ ib_api_status_t status;\r
+\r
+ AL_ENTER( AL_DBG_MR );\r
+\r
+ if( AL_OBJ_INVALID_HANDLE( h_fmr, AL_OBJ_TYPE_H_FMR ) )\r
+ {\r
+ CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_FMR_HANDLE\n") );\r
+ return IB_INVALID_FMR_HANDLE;\r
+ }\r
+\r
+ ref_al_obj( &h_fmr->obj );\r
+ status = verbs_unmap_mlnx_fmr( h_fmr );\r
+ deref_al_obj( &h_fmr->obj );\r
+\r
+ AL_EXIT( AL_DBG_MR );\r
+ return status;\r
+}\r
+\r
+\r
+ib_api_status_t\r
+mlnx_destroy_fmr(\r
+ IN const mlnx_fmr_handle_t h_fmr )\r
+{\r
+ ib_api_status_t status;\r
+\r
+ AL_ENTER( AL_DBG_MR );\r
+\r
+ if( AL_OBJ_INVALID_HANDLE( h_fmr, AL_OBJ_TYPE_H_FMR ) )\r
+ {\r
+ CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_FMR_HANDLE\n") );\r
+ return IB_INVALID_FMR_HANDLE;\r
+ }\r
+\r
+ if( !verbs_check_mlnx_fmr( h_fmr ) )\r
+ {\r
+ CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_FMR_HANDLE\n") );\r
+ return IB_INVALID_FMR_HANDLE;\r
+ }\r
+\r
+ ref_al_obj( &h_fmr->obj );\r
+\r
+ /* FMR's are destroyed synchronously */\r
+ status = verbs_destroy_mlnx_fmr( h_fmr );\r
+\r
+ if( status == IB_SUCCESS )\r
+ {\r
+ h_fmr->h_ci_fmr = NULL;\r
+ /* We're good to destroy the object. */\r
+ h_fmr->obj.pfn_destroy( &h_fmr->obj, NULL );\r
+ }\r
+ deref_al_obj( &h_fmr->obj );\r
+\r
+ AL_EXIT( AL_DBG_MR );\r
+ return status;\r
+}\r
+\r
+\r
\r
ib_api_status_t\r
ib_create_shmid(\r
p_ifc->close_al = ib_close_al;\r
p_ifc->get_err_str = ib_get_err_str;\r
p_ifc->get_wc_status_str = ib_get_wc_status_str;\r
- p_ifc->create_fmr = ib_create_fmr;\r
- p_ifc->map_phys_fmr = ib_map_phys_fmr;\r
- p_ifc->unmap_fmr = ib_unmap_fmr;\r
- p_ifc->destroy_fmr = ib_destroy_fmr;\r
+ p_ifc->create_mlnx_fmr = mlnx_create_fmr;\r
+ p_ifc->map_phys_mlnx_fmr = mlnx_map_phys_fmr;\r
+ p_ifc->unmap_mlnx_fmr = mlnx_unmap_fmr;\r
+ p_ifc->destroy_mlnx_fmr = mlnx_destroy_fmr;\r
\r
BUS_EXIT( BUS_DBG_PNP );\r
}\r
return status;\r
}\r
\r
+\r
+\r
+ib_api_status_t\r
+mlnx_alloc_fmr(\r
+ IN const ib_pd_handle_t h_pd,\r
+ IN const mlnx_fmr_create_t* const p_fmr_create,\r
+ OUT mlnx_fmr_handle_t* const ph_fmr\r
+ )\r
+{\r
+ UNUSED_PARAM( h_pd );\r
+ UNUSED_PARAM( p_fmr_create );\r
+ UNUSED_PARAM( ph_fmr );\r
+ return IB_UNSUPPORTED;\r
+}\r
+\r
+\r
+ib_api_status_t\r
+mlnx_map_phys_fmr (\r
+ IN const mlnx_fmr_handle_t h_fmr,\r
+ IN const uint64_t* const page_list,\r
+ IN const int list_len,\r
+ IN OUT uint64_t* const p_vaddr,\r
+ OUT net32_t* const p_lkey,\r
+ OUT net32_t* const p_rkey\r
+ )\r
+{\r
+ UNUSED_PARAM( h_fmr );\r
+ UNUSED_PARAM( page_list );\r
+ UNUSED_PARAM( list_len );\r
+ UNUSED_PARAM( p_vaddr );\r
+ UNUSED_PARAM( p_lkey );\r
+ UNUSED_PARAM( p_rkey );\r
+ return IB_UNSUPPORTED;\r
+}\r
+\r
+\r
+ib_api_status_t\r
+mlnx_unmap_fmr (\r
+ IN const mlnx_fmr_handle_t h_fmr)\r
+{\r
+ UNUSED_PARAM( h_fmr );\r
+ return IB_UNSUPPORTED;\r
+}\r
+\r
+\r
+ib_api_status_t\r
+mlnx_dealloc_fmr (\r
+ IN const mlnx_fmr_handle_t h_fmr\r
+ )\r
+{\r
+ UNUSED_PARAM( h_fmr );\r
+ return IB_UNSUPPORTED;\r
+}\r
+\r
+\r
/*\r
* Memory Window Verbs.\r
*/\r
p_interface->register_smr = mlnx_register_smr;\r
p_interface->deregister_mr = mlnx_deregister_mr;\r
\r
+ p_interface->alloc_mlnx_fmr = mlnx_alloc_fmr;\r
+ p_interface->map_phys_mlnx_fmr = mlnx_map_phys_fmr;\r
+ p_interface->unmap_mlnx_fmr = mlnx_unmap_fmr;\r
+ p_interface->dealloc_mlnx_fmr = mlnx_dealloc_fmr;\r
+\r
p_interface->create_mw = mlnx_create_mw;\r
p_interface->query_mw = mlnx_query_mw;\r
p_interface->destroy_mw = mlnx_destroy_mw;\r
}\r
\r
ib_api_status_t\r
-mlnx_alloc_fmr (\r
+mlnx_alloc_fmr(\r
IN const ib_pd_handle_t h_pd,\r
- IN const ib_fmr_create_t *p_fmr_create,\r
- OUT ib_fmr_handle_t* const ph_fmr\r
+ IN const mlnx_fmr_create_t* const p_fmr_create,\r
+ OUT mlnx_fmr_handle_t* const ph_fmr\r
)\r
{\r
ib_api_status_t status;\r
}\r
\r
// results\r
- if (ph_fmr) *ph_fmr = (ib_fmr_handle_t)fmr_p;\r
+ if (ph_fmr) *ph_fmr = (mlnx_fmr_handle_t)fmr_p;\r
status = IB_SUCCESS;\r
\r
err_alloc_fmr:\r
\r
ib_api_status_t\r
mlnx_map_phys_fmr (\r
- IN const ib_fmr_handle_t h_fmr,\r
- IN const void* __ptr64 page_list,\r
+ IN const mlnx_fmr_handle_t h_fmr,\r
+ IN const uint64_t* const page_list,\r
IN const int list_len,\r
- IN OUT void** __ptr64 const p_vaddr,\r
- OUT net32_t* const p_lkey,\r
- OUT net32_t* const p_rkey\r
+ IN OUT uint64_t* const p_vaddr,\r
+ OUT net32_t* const p_lkey,\r
+ OUT net32_t* const p_rkey\r
)\r
{\r
int err;\r
ib_api_status_t status;\r
struct ib_fmr *ib_fmr = (struct ib_fmr *)h_fmr;\r
- void *vaddr = PAGE_ALIGN(*p_vaddr);\r
- uint64_t *paddr_list = (uint64_t *__ptr64)page_list;\r
+ uint64_t vaddr = (*p_vaddr) & ~(PAGE_SIZE - 1);\r
PREP_IBDEV_FOR_PRINT(ib_fmr->device)\r
\r
HCA_ENTER(HCA_DBG_MEMORY);\r
\r
\r
// mapping \r
- err = ibv_map_phys_fmr(ib_fmr, paddr_list, list_len, (uint64_t)(ULONG_PTR)vaddr);\r
+ err = ibv_map_phys_fmr(ib_fmr, (u64*)page_list, list_len, (uint64_t)(ULONG_PTR)vaddr);\r
if (err) {\r
status = errno_to_iberr(err);\r
HCA_PRINT(TRACE_LEVEL_ERROR , HCA_DBG_MEMORY ,\r
HCA_PRINT_EXIT(TRACE_LEVEL_ERROR , HCA_DBG_MEMORY,\r
("completes with ERROR status %s\n", IB_GET_ERR_STR(status)));\r
return status;\r
- \r
- \r
}\r
\r
\r
\r
ib_api_status_t\r
mlnx_unmap_fmr (\r
- IN const ib_fmr_handle_t h_fmr)\r
+ IN const mlnx_fmr_handle_t h_fmr)\r
{\r
ib_api_status_t status;\r
int err;\r
\r
ib_api_status_t\r
mlnx_dealloc_fmr (\r
- IN ib_fmr_handle_t const h_fmr\r
+ IN const mlnx_fmr_handle_t h_fmr\r
)\r
{\r
ib_api_status_t status;\r
p_interface->register_smr = mlnx_register_smr;\r
p_interface->deregister_mr = mlnx_deregister_mr;\r
\r
- p_interface->alloc_fmr = mlnx_alloc_fmr;\r
- p_interface->map_phys_fmr = mlnx_map_phys_fmr;\r
- p_interface->unmap_fmr = mlnx_unmap_fmr;\r
- p_interface->dealloc_fmr = mlnx_dealloc_fmr;\r
+ p_interface->alloc_mlnx_fmr = mlnx_alloc_fmr;\r
+ p_interface->map_phys_mlnx_fmr = mlnx_map_phys_fmr;\r
+ p_interface->unmap_mlnx_fmr = mlnx_unmap_fmr;\r
+ p_interface->dealloc_mlnx_fmr = mlnx_dealloc_fmr;\r
\r
p_interface->create_mw = mlnx_create_mw;\r
p_interface->query_mw = mlnx_query_mw;\r
* ib_reg_mem, ib_reg_phys, ib_reg_shared\r
*****/\r
\r
+\r
#ifdef CL_KERNEL\r
\r
-/****f* Access Layer/ib_create_fmr\r
+/****f* Access Layer/mlnx_create_fmr\r
* NAME\r
-* ib_create_fmr\r
+* mlnx_create_fmr\r
*\r
* DESCRIPTION\r
-* Modifies the attributes of an existing memory region.\r
+* Creates a Mellanox fast memory region.\r
*\r
* SYNOPSIS\r
*/\r
AL_EXPORT ib_api_status_t AL_API\r
-ib_create_fmr(\r
+mlnx_create_fmr(\r
IN const ib_pd_handle_t h_pd,\r
- IN const ib_fmr_create_t* const p_fmr_create,\r
- OUT ib_fmr_handle_t* const ph_fmr);\r
+ IN const mlnx_fmr_create_t* const p_fmr_create,\r
+ OUT mlnx_fmr_handle_t* const ph_fmr );\r
/*\r
* PARAMETERS\r
* h_pd\r
* The memory region has windows bound to it.\r
*\r
* NOTES\r
-* //TODO \r
+* This is a Mellanox specific extension to verbs.\r
*\r
* SEE ALSO\r
-* ib_destroy_fmr, ib_fmr_create_t\r
+* mlnx_destroy_fmr, mlnx_fmr_create_t\r
*****/\r
\r
\r
-/****f* Access Layer/ib_map_fmr\r
+/****f* Access Layer/mlnx_map_fmr\r
* NAME\r
-* ib_map_fmr\r
+* mlnx_map_fmr\r
*\r
* DESCRIPTION\r
* //TODO\r
* SYNOPSIS\r
*/\r
AL_EXPORT ib_api_status_t AL_API\r
-ib_map_phys_fmr(\r
- IN const ib_fmr_handle_t h_fmr,\r
- IN const void* __ptr64 paddr_list,\r
- IN const int list_len,\r
- IN OUT void** __ptr64 const p_vaddr,\r
- OUT net32_t* const p_lkey,\r
- OUT net32_t* const p_rkey);\r
+mlnx_map_phys_fmr(\r
+ IN const mlnx_fmr_handle_t h_fmr,\r
+ IN const uint64_t* const paddr_list,\r
+ IN const int list_len,\r
+ IN OUT uint64_t* const p_vaddr,\r
+ OUT net32_t* const p_lkey,\r
+ OUT net32_t* const p_rkey );\r
/*\r
* PARAMETERS\r
* h_fmr\r
* [out] A key that may be used by a remote end-point when performing\r
* RDMA or atomic operations to this registered memory region.\r
*\r
-\r
* RETURN VALUES\r
* IB_SUCCESS\r
* The memory region attributes were modified successfully.\r
* The memory region has windows bound to it.\r
*\r
* NOTES\r
-* //TODO \r
+* This is a Mellanox specific extension to verbs.\r
*\r
* SEE ALSO\r
-* ib_destroy_fmr, ib_fmr_create_t\r
+* mlnx_destroy_fmr, mlnx_fmr_create_t\r
*****/\r
\r
\r
-/****f* Access Layer/ib_unmap_fmr\r
+/****f* Access Layer/mlnx_unmap_fmr\r
* NAME\r
-* ib_unmap_fmr\r
+* mlnx_unmap_fmr\r
*\r
* DESCRIPTION\r
* //TODO\r
* SYNOPSIS\r
*/\r
AL_EXPORT ib_api_status_t AL_API\r
-ib_unmap_fmr(\r
- IN const ib_fmr_handle_t h_fmr);\r
+mlnx_unmap_fmr(\r
+ IN const mlnx_fmr_handle_t h_fmr );\r
/*\r
* PARAMETERS\r
* h_fmr\r
* The memory region has windows bound to it.\r
*\r
* NOTES\r
-* //TODO \r
+* This is a Mellanox specific extension to verbs.\r
*\r
* SEE ALSO\r
-* ib_destroy_fmr, ib_fmr_create_t\r
+* mlnx_destroy_fmr, mlnx_fmr_create_t\r
*****/\r
\r
\r
-/****f* Access Layer/ib_destroy_fmr\r
+/****f* Access Layer/mlnx_destroy_fmr\r
* NAME\r
-* ib_destroy_fmr\r
+* mlnx_destroy_fmr\r
*\r
* DESCRIPTION\r
-* Modifies the attributes of an existing memory region.\r
+* Destroys an existing Mellanox fast memory region.\r
*\r
* SYNOPSIS\r
*/\r
AL_EXPORT ib_api_status_t AL_API\r
-ib_destroy_fmr(\r
- IN ib_fmr_handle_t const h_fmr);\r
+mlnx_destroy_fmr(\r
+ IN const mlnx_fmr_handle_t h_fmr );\r
/*\r
* PARAMETERS\r
* h_fmr\r
* The memory region has windows bound to it.\r
*\r
* NOTES\r
-* //TODO \r
+* This is a Mellanox specific extension to verbs.\r
*\r
* SEE ALSO\r
-* ib_destroy_fmr, ib_fmr_create_t\r
+* mlnx_destroy_fmr, mlnx_fmr_create_t\r
*****/\r
\r
-#endif\r
+#endif /* CL_KERNEL */\r
\r
/****f* Access Layer/ib_create_mw\r
* NAME\r
******\r
*/\r
\r
-#ifdef CL_KERNEL\r
\r
-/****f* Verbs/ci_alloc_fmr\r
+#ifdef CL_KERNEL\r
+/****f* Verbs/ci_alloc_mlnx_fmr\r
* NAME\r
-* ci_alloc_fmr -- Allocate a fast memory region with the HCA.\r
+* ci_alloc_mlnx_fmr -- Allocate a Mellanox fast memory region with the HCA.\r
* SYNOPSIS\r
*/\r
-\r
typedef ib_api_status_t\r
-(*ci_alloc_fmr) (\r
+(*ci_alloc_mlnx_fmr) (\r
IN const ib_pd_handle_t h_pd,\r
- IN ib_fmr_create_t const *p_fmr_ctreate,\r
- OUT ib_fmr_handle_t* const ph_fmr);\r
+ IN mlnx_fmr_create_t const *p_fmr_ctreate,\r
+ OUT mlnx_fmr_handle_t* const ph_fmr);\r
/*\r
* DESCRIPTION\r
* //TODO \r
* ph_fmr\r
* [out] Handle to the fast memory region. This handle is used when\r
* mapin/unmaping fmr\r
+* \r
* RETURN VALUE\r
* IB_SUCCESS\r
* Registration with the adapter was successful.\r
* Invalid pd handle\r
* IB_INVALID_PERMISSION\r
* Invalid access rights.\r
+*\r
* NOTES\r
* The Alloc operation does not map nor pinned any memory.\r
-* In order to use the FMR the user need to call map \r
+* In order to use the FMR the user need to call map\r
+*\r
+* This is a Mellanox specific extension to verbs.\r
*\r
* SEE ALSO\r
-* ci_dealloc_fmr, ci_map_phys_fmr, ci_unmap_fmr\r
+* ci_dealloc_mlnx_fmr, ci_map_phys_mlnx_fmr, ci_unmap_mlnx_fmr\r
******\r
*/\r
\r
\r
-/****f* Verbs/ci_map_phys_fmr\r
+/****f* Verbs/ci_map_phys_mlnx_fmr\r
* NAME\r
-* ci_map_phys_fmr -- Map a fast memory region with given page list.\r
+* ci_map_phys_mlnx_fmr -- Map a Mellanox fast memory region with a\r
+* given page list.\r
+*\r
* SYNOPSIS\r
*/\r
-\r
typedef ib_api_status_t\r
-(*ci_map_phys_fmr) (\r
- IN const ib_fmr_handle_t h_fmr,\r
- IN const void* __ptr64 paddr_list,\r
+(*ci_map_phys_mlnx_fmr) (\r
+ IN const mlnx_fmr_handle_t h_fmr,\r
+ IN const uint64_t* const paddr_list,\r
IN const int list_len,\r
- IN OUT void** __ptr64 const p_vaddr,\r
- OUT net32_t* const p_lkey,\r
- OUT net32_t* const p_rkey);\r
+ IN OUT uint64_t* const p_vaddr,\r
+ OUT net32_t* const p_lkey,\r
+ OUT net32_t* const p_rkey);\r
/*\r
* DESCRIPTION\r
-* //TODO \r
+* //TODO\r
+*\r
* PARAMETERS\r
* h_fmr\r
* [in] Handle to the fast memory region that these pages map to \r
* Invalid pd handle\r
* IB_INVALID_PERMISSION\r
* Invalid access rights.\r
+*\r
* NOTES\r
* The Alloc operation does not map nor pinned any memory.\r
* In order to use the FMR the user need to call map \r
*\r
+* This is a Mellanox specific extension to verbs.\r
+*\r
* SEE ALSO\r
-* ci_dealloc_fmr, ci_alloc_fmr, ci_unmap_fmr\r
+* ci_dealloc_mlnx_fmr, ci_alloc_mlnx_fmr, ci_unmap_mlnx_fmr\r
******\r
*/\r
\r
\r
-/****f* Verbs/ci_unmap_fmr\r
+/****f* Verbs/ci_unmap_mlnx_fmr\r
* NAME\r
-* ci_unmap_fmr -- UnMap a fast memory region with given page list.\r
+* ci_unmap_mlnx_fmr -- UnMap a Mellanox fast memory region.\r
* SYNOPSIS\r
*/\r
-\r
typedef ib_api_status_t\r
-(*ci_unmap_fmr) (\r
- IN const ib_fmr_handle_t h_fmr);\r
+(*ci_unmap_mlnx_fmr) (\r
+ IN const mlnx_fmr_handle_t h_fmr);\r
/*\r
* DESCRIPTION\r
-* //TODO \r
+* //TODO\r
+*\r
* PARAMETERS\r
* h_fmr\r
* [in] Handle to the fast memory region that these pages map to \r
* Invalid pd handle\r
* IB_INVALID_PERMISSION\r
* Invalid access rights.\r
+*\r
* NOTES\r
* The Alloc operation does not map nor pinned any memory.\r
* In order to use the FMR the user need to call map \r
*\r
+* This is a Mellanox specific extension to verbs.\r
+*\r
* SEE ALSO\r
-* ci_dealloc_fmr, ci_alloc_fmr, ci_map_phy_fmr\r
+* ci_dealloc_mlnx_fmr, ci_alloc_mlnx_fmr, ci_map_phy_mlnx_fmr\r
******\r
*/\r
\r
\r
-/****f* Verbs/ci_dealloc_fmr\r
+/****f* Verbs/ci_dealloc_mlnx_fmr\r
* NAME\r
-* ci_dealloc_fmr -- Deallocate a fast memory region with the HCA.\r
+* ci_dealloc_mlnx_fmr -- Deallocate a Mellanox fast memory region.\r
+*\r
* SYNOPSIS\r
*/\r
-\r
typedef ib_api_status_t\r
-(*ci_dealloc_fmr) (\r
- IN ib_fmr_handle_t const h_fmr);\r
+(*ci_dealloc_mlnx_fmr) (\r
+ IN mlnx_fmr_handle_t const h_fmr);\r
/*\r
* DESCRIPTION\r
-* //TODO \r
+* //TODO\r
+*\r
* PARAMETERS\r
- h_fmr\r
-* [out] Handle to the fast memory region. This handle is used when\r
+* h_fmr\r
+* [in] Handle to the fast memory region. This handle is used when\r
* mapin/unmaping fmr\r
+*\r
* RETURN VALUE\r
* IB_SUCCESS\r
* Registration with the adapter was successful.\r
* Invalid pd handle\r
* IB_INVALID_PERMISSION\r
* Invalid access rights.\r
+*\r
* NOTES\r
-* //TODO\r
-\r
+* This is a Mellanox specific extension to verbs.\r
+*\r
* SEE ALSO\r
-* ci_dealloc_fmr, ci_map_phys_fmr, ci_unmap_fmr\r
+* ci_dealloc_mlnx_fmr, ci_map_phys_mlnx_fmr, ci_unmap_mlnx_fmr\r
******\r
*/\r
-\r
#endif\r
\r
+\r
/****f* Verbs/ci_create_mw\r
* NAME\r
* ci_create_mw -- Create a memory window entry for later use\r
*****/\r
\r
\r
+#define MAX_LIB_NAME 32\r
+\r
+#ifdef CL_KERNEL\r
+\r
/****s* Verbs/ci_interface_t\r
* NAME\r
* ci_interface_t -- Interface holding Channel Interface API's\r
* providing verbs functionality.\r
* SOURCE\r
*/\r
-#define MAX_LIB_NAME 32\r
\r
typedef struct _ci_interface\r
{\r
ci_register_smr register_smr;\r
ci_deregister_mr deregister_mr;\r
\r
-#ifdef CL_KERNEL\r
-\r
/*\r
- * Fast Memory Management Verbs\r
+ * Mellanox Fast Memory Management Verbs\r
*/\r
- ci_alloc_fmr alloc_fmr;\r
- ci_map_phys_fmr map_phys_fmr;\r
- ci_unmap_fmr unmap_fmr;\r
- ci_dealloc_fmr dealloc_fmr;\r
+ ci_alloc_mlnx_fmr alloc_mlnx_fmr;\r
+ ci_map_phys_mlnx_fmr map_phys_mlnx_fmr;\r
+ ci_unmap_mlnx_fmr unmap_mlnx_fmr;\r
+ ci_dealloc_mlnx_fmr dealloc_mlnx_fmr;\r
\r
-#endif\r
\r
/*\r
* Memory Window Verbs\r
} ci_interface_t;\r
/********/\r
\r
+\r
/****f* Verbs/ib_register_ca\r
* NAME\r
* ib_register_ca -- Inform the IB Access Layer about a new HCA\r
* SEE ALSO\r
* ib_register_ca, ci_interface_t\r
*******/\r
+#endif /* CL_KERNEL */\r
\r
\r
#ifdef __cplusplus\r
typedef struct _ib_ca* __ptr64 ib_ca_handle_t;\r
typedef struct _ib_pd* __ptr64 ib_pd_handle_t;\r
typedef struct _ib_mr* __ptr64 ib_mr_handle_t;\r
-typedef struct _ib_fmr* __ptr64 ib_fmr_handle_t;\r
+typedef struct _mlnx_fmr* __ptr64 mlnx_fmr_handle_t;\r
typedef struct _ib_mw* __ptr64 ib_mw_handle_t;\r
typedef struct _ib_qp* __ptr64 ib_qp_handle_t;\r
typedef struct _ib_cq* __ptr64 ib_cq_handle_t;\r
\r
#ifdef CL_KERNEL\r
\r
-/****s* Access Layer/ib_fmr_create_t\r
+/****s* Access Layer/mlnx_fmr_create_t\r
* NAME\r
-* ib_fmr_create_t\r
+* mlnx_fmr_create_t\r
*\r
* DESCRIPTION\r
-* Information required to create a fast memory region.\r
+* Information required to create a Mellanox fast memory region.\r
*\r
* SYNOPSIS\r
*/\r
-typedef struct _ib_fmr_create\r
+typedef struct _mlnx_fmr_create\r
{\r
int max_pages;\r
int max_maps;\r
uint8_t page_size;\r
ib_access_t access_ctrl;\r
\r
-} ib_fmr_create_t;\r
+} mlnx_fmr_create_t;\r
/*\r
* FIELDS\r
* max_pages\r
* access_ctrl\r
* Access rights of the registered region.\r
*\r
+* NOTES\r
+* This is a Mellanox specific extension to verbs.\r
+*\r
* SEE ALSO\r
* ib_access_t\r
*****/\r
IN const ib_mr_handle_t h_mr );\r
\r
typedef ib_api_status_t\r
-(*ib_pfn_create_fmr_t)(\r
+(*mlnx_pfn_create_fmr_t)(\r
IN const ib_pd_handle_t h_pd,\r
- IN const ib_fmr_create_t* const p_fmr_create,\r
- OUT ib_fmr_handle_t* const ph_mr);\r
+ IN const mlnx_fmr_create_t* const p_fmr_create,\r
+ OUT mlnx_fmr_handle_t* const ph_fmr );\r
\r
typedef ib_api_status_t\r
-(*ib_pfn_map_phys_fmr_t)(\r
- IN const ib_fmr_handle_t h_fmr,\r
- IN const void* __ptr64 paddr_list,\r
+(*mlnx_pfn_map_phys_fmr_t)(\r
+ IN const mlnx_fmr_handle_t h_fmr,\r
+ IN const uint64_t* const paddr_list,\r
IN const int list_len,\r
- IN OUT void** __ptr64 const p_vaddr,\r
- OUT net32_t* const p_lkey,\r
- OUT net32_t* const p_rkey);\r
+ IN OUT uint64_t* const p_vaddr,\r
+ OUT net32_t* const p_lkey,\r
+ OUT net32_t* const p_rkey );\r
\r
typedef ib_api_status_t\r
-(*ib_pfn_unmap_fmr_t)(\r
- IN const ib_fmr_handle_t h_fmr);\r
+(*mlnx_pfn_unmap_fmr_t)(\r
+ IN const mlnx_fmr_handle_t h_fmr );\r
\r
typedef ib_api_status_t\r
-(*ib_pfn_destroy_fmr_t)(\r
- IN ib_fmr_handle_t const h_fmr);\r
+(*mlnx_pfn_destroy_fmr_t)(\r
+ IN mlnx_fmr_handle_t const h_fmr );\r
\r
typedef ib_api_status_t\r
(*ib_pfn_create_mw_t)(\r
ib_pfn_close_al_t close_al;\r
ib_pfn_get_err_str_t get_err_str;\r
ib_pfn_get_wc_status_str_t get_wc_status_str;\r
- ib_pfn_create_fmr_t create_fmr;\r
- ib_pfn_map_phys_fmr_t map_phys_fmr;\r
- ib_pfn_unmap_fmr_t unmap_fmr;\r
- ib_pfn_destroy_fmr_t destroy_fmr;\r
+ mlnx_pfn_create_fmr_t create_mlnx_fmr;\r
+ mlnx_pfn_map_phys_fmr_t map_phys_mlnx_fmr;\r
+ mlnx_pfn_unmap_fmr_t unmap_mlnx_fmr;\r
+ mlnx_pfn_destroy_fmr_t destroy_mlnx_fmr;\r
\r
} ib_al_ifc_t;\r
\r