[openib-general] [PATCH 2/3] uDAPL cma: fix issues with creating qp without rcv resources
Fix some issues supporting create qp without recv cq handle or recv qp resources. IB verbs assume a recv_cq handle and uDAPL dapl_ep_create assumes there is always recv_sge resources specified. Signed-off by: Arlin Davis [EMAIL PROTECTED] Index: dapl/common/dapl_ep_create.c === --- dapl/common/dapl_ep_create.c(revision 10032) +++ dapl/common/dapl_ep_create.c(working copy) @@ -166,7 +166,7 @@ dapl_ep_create ( (recv_evd_handle != DAT_HANDLE_NULL ep_attr-max_recv_dtos == 0) || (request_evd_handle == DAT_HANDLE_NULL ep_attr-max_request_dtos != 0) || (request_evd_handle != DAT_HANDLE_NULL ep_attr-max_request_dtos == 0) || -ep_attr-max_recv_iov == 0 || +(recv_evd_handle != DAT_HANDLE_NULL ep_attr-max_recv_iov == 0) || ep_attr-max_request_iov == 0 || (DAT_SUCCESS != dapl_ep_check_recv_completion_flags ( ep_attr-recv_completion_flags)) )) Index: dapl/openib_cma/dapl_ib_qp.c === --- dapl/openib_cma/dapl_ib_qp.c(revision 10032) +++ dapl/openib_cma/dapl_ib_qp.c(working copy) @@ -143,13 +143,21 @@ DAT_RETURN dapls_ib_qp_alloc(IN DAPL_IA /* Setup attributes and create qp */ dapl_os_memzero((void*)qp_create, sizeof(qp_create)); qp_create.cap.max_send_wr = attr-max_request_dtos; - qp_create.cap.max_recv_wr = attr-max_recv_dtos; qp_create.cap.max_send_sge = attr-max_request_iov; - qp_create.cap.max_recv_sge = attr-max_recv_iov; qp_create.cap.max_inline_data = ia_ptr-hca_ptr-ib_trans.max_inline_send; qp_create.send_cq = req_cq; - qp_create.recv_cq = rcv_cq; + + /* ibv assumes rcv_cq is never NULL, set to req_cq */ + if (rcv_cq == NULL) { + qp_create.recv_cq = req_cq; + qp_create.cap.max_recv_wr = 0; + qp_create.cap.max_recv_sge = 0; + } else { + qp_create.recv_cq = rcv_cq; + qp_create.cap.max_recv_wr = attr-max_recv_dtos; + qp_create.cap.max_recv_sge = attr-max_recv_iov; + } qp_create.qp_type = IBV_QPT_RC; qp_create.qp_context = (void*)ep_ptr; ___ openib-general mailing list openib-general@openib.org http://openib.org/mailman/listinfo/openib-general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
[openib-general] [PATCH 2/3] uDAPL cma: fix issues with creating qp without rcv resources
Fix some issues supporting create qp without recv cq handle or recv qp resources. IB verbs assume a recv_cq handle and uDAPL dapl_ep_create assumes there is always recv_sge resources specified. Signed-off by: Arlin Davis [EMAIL PROTECTED] Index: dapl/common/dapl_ep_create.c === --- dapl/common/dapl_ep_create.c (revision 9916) +++ dapl/common/dapl_ep_create.c (working copy) @@ -166,7 +166,7 @@ (recv_evd_handle != DAT_HANDLE_NULL ep_attr-max_recv_dtos == 0) || (request_evd_handle == DAT_HANDLE_NULL ep_attr-max_request_dtos != 0) || (request_evd_handle != DAT_HANDLE_NULL ep_attr-max_request_dtos == 0) || - ep_attr-max_recv_iov == 0 || + (recv_evd_handle != DAT_HANDLE_NULL ep_attr-max_recv_iov == 0) || ep_attr-max_request_iov == 0 || (DAT_SUCCESS != dapl_ep_check_recv_completion_flags ( ep_attr-recv_completion_flags)) )) Index: dapl/openib_cma/dapl_ib_qp.c === --- dapl/openib_cma/dapl_ib_qp.c (revision 10032) +++ dapl/openib_cma/dapl_ib_qp.c (working copy) @@ -143,13 +143,21 @@ /* Setup attributes and create qp */ dapl_os_memzero((void*)qp_create, sizeof(qp_create)); qp_create.cap.max_send_wr = attr-max_request_dtos; - qp_create.cap.max_recv_wr = attr-max_recv_dtos; qp_create.cap.max_send_sge = attr-max_request_iov; - qp_create.cap.max_recv_sge = attr-max_recv_iov; qp_create.cap.max_inline_data = ia_ptr-hca_ptr-ib_trans.max_inline_send; qp_create.send_cq = req_cq; - qp_create.recv_cq = rcv_cq; + + /* ibv assumes rcv_cq is never NULL, set to req_cq */ + if (rcv_cq == NULL) { + qp_create.recv_cq = req_cq; + qp_create.cap.max_recv_wr = 0; + qp_create.cap.max_recv_sge = 0; + } else { + qp_create.recv_cq = rcv_cq; + qp_create.cap.max_recv_wr = attr-max_recv_dtos; + qp_create.cap.max_recv_sge = attr-max_recv_iov; + } qp_create.qp_type = IBV_QPT_RC; qp_create.qp_context = (void*)ep_ptr; ___ openib-general mailing list openib-general@openib.org http://openib.org/mailman/listinfo/openib-general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general