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 *
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.
*/