diff mbox

[2/8] librdmacm: Use SRQ in rdma_create_qp

Message ID 1404281479-6755-3-git-send-email-sean.hefty@intel.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Hefty, Sean July 2, 2014, 6:11 a.m. UTC
From: Sean Hefty <sean.hefty@intel.com>

If an application has allocated an SRQ on an rdma_cm_id, use
it when creating a QP.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
---
 src/cma.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/src/cma.c b/src/cma.c
index 1a88e5c..192d9ed 100644
--- a/src/cma.c
+++ b/src/cma.c
@@ -1303,6 +1303,8 @@  int rdma_create_qp(struct rdma_cm_id *id, struct ibv_pd *pd,
 		qp_init_attr->send_cq = id->send_cq;
 	if (!qp_init_attr->recv_cq)
 		qp_init_attr->recv_cq = id->recv_cq;
+	if (id->srq && !qp_init_attr->srq)
+		qp_init_attr->srq = id->srq;
 	qp = ibv_create_qp(pd, qp_init_attr);
 	if (!qp) {
 		ret = ERR(ENOMEM);