From: Chris Mason Date: Fri, 3 Feb 2012 16:07:40 +0000 (-0500) Subject: RDS: destroy the ib state that generates call back earlier during shutdown X-Git-Tag: v4.1.12-92~319^2^2~2^2~60 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=e849a2b37ccc60937976602b7f08ad44620e5b87;p=users%2Fjedix%2Flinux-maple.git RDS: destroy the ib state that generates call back earlier during shutdown Otherwise we can get callbacks after the QP isn't really able to handle them. Signed-off-by: Chris Mason Signed-off-by: Bang Nguyen --- diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c index 96c4cc01fba5..709ce2e5d866 100644 --- a/net/rds/ib_cm.c +++ b/net/rds/ib_cm.c @@ -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. */