]> git.openfabrics.org - ~shefty/librdmacm.git/commitdiff
librdmacm: auto create QPs in rdma_get_request
authorSean Hefty <sean.hefty@intel.com>
Thu, 6 May 2010 22:47:58 +0000 (15:47 -0700)
committerSean Hefty <sean.hefty@intel.com>
Thu, 6 May 2010 22:47:58 +0000 (15:47 -0700)
If the user passed initial QP attributes into rdma_create_ep,
allocate a QP for the user as part of rdma_get_request.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
src/cma.c

index 5d0b8fa9426dac4eed47ab66e993cd3000350782..ffa7690ac68ae664b259c8317ab77444141ed0fa 100644 (file)
--- a/src/cma.c
+++ b/src/cma.c
@@ -1287,6 +1287,12 @@ int rdma_get_request(struct rdma_cm_id *listen, struct rdma_cm_id **id)
                goto err;
        }
 
+       if (id_priv->qp_init_attr) {
+               ret = rdma_create_qp(event->id, id_priv->pd, id_priv->qp_init_attr);
+               if (ret)
+                       goto err;
+       }
+
        *id = event->id;
        (*id)->event = event;
        return 0;