Skip to content

Commit

Permalink
RDS: destroy the ib state earlier during shutdown
Browse files Browse the repository at this point in the history
Destroy ib state early during shutdown. Otherwise we can get callbacks
after the QP isn't really able to handle them.

Reviewed-by: Ajaykumar Hotchandani <ajaykumar.hotchandani@oracle.com>
Signed-off-by: Santosh Shilimkar <ssantosh@kernel.org>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
santosh.shilimkar@oracle.com authored and David S. Miller committed Aug 25, 2015
1 parent 43962dd commit 1bc7b86
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions net/rds/ib_cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,16 @@ void rds_ib_conn_shutdown(struct rds_connection *conn)
(atomic_read(&ic->i_signaled_sends) == 0));
tasklet_kill(&ic->i_recv_tasklet);

/* first destroy the ib state that generates callbacks */
if (ic->i_cm_id->qp)
rdma_destroy_qp(ic->i_cm_id);
if (ic->i_send_cq)
ib_destroy_cq(ic->i_send_cq);
if (ic->i_recv_cq)
ib_destroy_cq(ic->i_recv_cq);
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 *
Expand All @@ -663,14 +673,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_send_cq)
ib_destroy_cq(ic->i_send_cq);
if (ic->i_recv_cq)
ib_destroy_cq(ic->i_recv_cq);
rdma_destroy_id(ic->i_cm_id);

/*
* Move connection back to the nodev list.
*/
Expand Down

0 comments on commit 1bc7b86

Please sign in to comment.