[ofa-general] qperf: destroy QPs before destroying any other objects

Ralph Campbell ralph.campbell at qlogic.com
Tue May 12 15:10:21 PDT 2009


The QP contains references to the protection domain (PD), memory
regions (MR), address handles, completion queues (CQ), address
handles (AH), etc.
The QP should be destroyed before any other objects are destroyed
so that the referenced object is not busy.

Signed-off-by: Ralph Campbell <ralph.campbell at qlogic.com>

diff --git a/src/rdma.c b/src/rdma.c
index 845c35f..492d240 100644
--- a/src/rdma.c
+++ b/src/rdma.c
@@ -1577,6 +1577,10 @@ show_node_info(DEVICE *dev)
 static void
 rd_close(DEVICE *dev)
 {
+    if (Req.use_cm)
+        cm_close(dev);
+    else
+        ib_close(dev);
     if (dev->ah)
         ibv_destroy_ah(dev->ah);
     if (dev->cq)
@@ -1585,10 +1589,6 @@ rd_close(DEVICE *dev)
         ibv_dealloc_pd(dev->pd);
     if (dev->channel)
         ibv_destroy_comp_channel(dev->channel);
-    if (Req.use_cm)
-        cm_close(dev);
-    else
-        ib_close(dev);
     rd_mrfree(dev);
 
     memset(dev, 0, sizeof(*dev));





More information about the general mailing list