h_cq->h_rearm_n_cq = h_cq;\r
}\r
\r
- if( status != IB_SUCCESS )\r
- {\r
- CL_ASSERT( !h_cq->h_ci_cq );\r
- /*\r
- * If we failed to create the CQ in the kernel, clear the h_ci_cq\r
- * pointer to prevent trying to clean it up later. This is needed\r
- * to work-around the uVPD incorrectly setting the handle in the\r
- * post_create_cq call even in the case of a failure.\r
- */\r
- /* TODO: Fix the UVP. */\r
- h_cq->h_ci_cq = NULL;\r
- }\r
-\r
AL_EXIT( AL_DBG_CQ );\r
return status;\r
}\r
if (!mlx4_fill_context(context, p_resp))\r
{\r
status = IB_INSUFFICIENT_RESOURCES;\r
+ *ph_uvp_ca = NULL;\r
goto end;\r
}\r
}\r
CL_ASSERT(context);\r
\r
if (IB_SUCCESS == ioctl_status)\r
+ \r
mlx4_free_context(context);\r
\r
return IB_SUCCESS;\r
else\r
{\r
cl_free(to_mpd(pd));\r
+ *ph_uvp_pd = NULL;\r
}\r
\r
cl_free(p_resp);\r
else\r
{\r
mlx4_post_destroy_cq (*ph_uvp_cq, IB_SUCCESS);\r
+ *ph_uvp_cq = NULL;\r
}\r
\r
cl_free(p_resp);\r
else\r
{\r
mlx4_post_destroy_srq (*ph_uvp_srq, IB_SUCCESS);\r
+ *ph_uvp_srq = NULL;\r
}\r
\r
cl_free(p_resp);\r
else\r
{\r
mlx4_post_destroy_qp(*ph_uvp_qp, IB_SUCCESS);\r
+ *ph_uvp_qp = NULL;\r
}\r
\r
cl_free(p_resp);\r
\r
// convert parameters \r
cl_memset(&attr, 0, sizeof(attr));\r
- status = __to_ah(p_av_attr, &attr);\r
- if (status)\r
- goto end;\r
+ __to_ah(p_av_attr, &attr);\r
\r
ah->ibv_ah.pd = pd;\r
ah->ibv_ah.context = pd->context;\r
else\r
{\r
mlx4_post_destroy_srq (*ph_uvp_srq, IB_SUCCESS);\r
+ *ph_uvp_srq = NULL;\r
}\r
\r
cl_free( p_resp );\r
else\r
{\r
cl_free(to_mxrcd(xrcd));\r
+ *ph_uvp_xrcd = NULL;\r
}\r
\r
cl_free(p_resp);\r
struct ibv_create_cq *p_create_cq;\r
int err;\r
\r
- UNREFERENCED_PARAMETER(ph_uvp_cq);\r
-\r
UVP_ENTER(UVP_DBG_CQ);\r
\r
CL_ASSERT(p_umv_buf);\r
goto err_alloc_cq;\r
}\r
\r
+ *ph_uvp_cq = (ib_cq_handle_t)(ULONG_PTR)p_create_cq->user_handle;\r
goto end;\r
\r
err_alloc_cq:\r
\r
*ph_uvp_cq = (ib_cq_handle_t)ibv_cq;\r
}\r
- goto end;\r
+ else {\r
+ ibv_cq = (struct ibv_cq *)*ph_uvp_cq;\r
+ ibv_cq->context = h_uvp_ca->ibv_ctx;\r
+ ibv_cq->context->ops.destroy_cq( ibv_cq );\r
+ *ph_uvp_cq = NULL;\r
+ }\r
\r
- p_hobul->ibv_ctx->ops.destroy_cq(ibv_cq);\r
err_create_cq:\r
-end: \r
if (p_resp)\r
cl_free( p_resp );\r
UVP_EXIT(UVP_DBG_CQ);\r