]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
RDS: destroy the ib state that generates call back earlier during shutdown
authorChris Mason <chris.mason@oracle.com>
Fri, 3 Feb 2012 16:07:40 +0000 (11:07 -0500)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 7 Jul 2015 23:41:27 +0000 (16:41 -0700)
Otherwise we can get callbacks after the QP isn't really able to handle them.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
net/rds/ib_cm.c

index 96c4cc01fba577b44b108121de526ebf2ee1708e..709ce2e5d8665ed3025d12890dc56253713e02f5 100644 (file)
@@ -742,6 +742,16 @@ void rds_ib_conn_shutdown(struct rds_connection *conn)
                tasklet_kill(&ic->i_stasklet);
                tasklet_kill(&ic->i_rtasklet);
 
+               /* first destroy the ib state that generates callbacks */
+               if (ic->i_cm_id->qp)
+                       rdma_destroy_qp(ic->i_cm_id);
+               if (ic->i_rcq)
+                       ib_destroy_cq(ic->i_rcq);
+               if (ic->i_scq)
+                       ib_destroy_cq(ic->i_scq);
+               rdma_destroy_id(ic->i_cm_id);
+
+               /* then free the resources that ib callbacks use */
                if (ic->i_send_hdrs)
                        ib_dma_free_coherent(dev,
                                           ic->i_send_ring.w_nr *
@@ -765,14 +775,6 @@ void rds_ib_conn_shutdown(struct rds_connection *conn)
                if (ic->i_recvs)
                        rds_ib_recv_clear_ring(ic);
 
-               if (ic->i_cm_id->qp)
-                       rdma_destroy_qp(ic->i_cm_id);
-               if (ic->i_rcq)
-                       ib_destroy_cq(ic->i_rcq);
-               if (ic->i_scq)
-                       ib_destroy_cq(ic->i_scq);
-               rdma_destroy_id(ic->i_cm_id);
-
                /*
                 * Move connection back to the nodev list.
                 */