diff options
author | santosh.shilimkar@oracle.com <santosh.shilimkar@oracle.com> | 2015-08-22 18:45:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-08-25 16:35:29 -0400 |
commit | 1bc7b863f230e429dd7a06c0956ada7933d69f50 (patch) | |
tree | 4112282f59110966504fc3cbff44f3f0b68f12b8 /net/rds/ib_cm.c | |
parent | 43962dd7ee192299c6e0c6cd7f0a65997308f1f4 (diff) |
RDS: destroy the ib state earlier during shutdown
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>
Diffstat (limited to 'net/rds/ib_cm.c')
-rw-r--r-- | net/rds/ib_cm.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c index f40d8f52b753..94d4427377b2 100644 --- a/net/rds/ib_cm.c +++ b/net/rds/ib_cm.c | |||
@@ -640,6 +640,16 @@ void rds_ib_conn_shutdown(struct rds_connection *conn) | |||
640 | (atomic_read(&ic->i_signaled_sends) == 0)); | 640 | (atomic_read(&ic->i_signaled_sends) == 0)); |
641 | tasklet_kill(&ic->i_recv_tasklet); | 641 | tasklet_kill(&ic->i_recv_tasklet); |
642 | 642 | ||
643 | /* first destroy the ib state that generates callbacks */ | ||
644 | if (ic->i_cm_id->qp) | ||
645 | rdma_destroy_qp(ic->i_cm_id); | ||
646 | if (ic->i_send_cq) | ||
647 | ib_destroy_cq(ic->i_send_cq); | ||
648 | if (ic->i_recv_cq) | ||
649 | ib_destroy_cq(ic->i_recv_cq); | ||
650 | rdma_destroy_id(ic->i_cm_id); | ||
651 | |||
652 | /* then free the resources that ib callbacks use */ | ||
643 | if (ic->i_send_hdrs) | 653 | if (ic->i_send_hdrs) |
644 | ib_dma_free_coherent(dev, | 654 | ib_dma_free_coherent(dev, |
645 | ic->i_send_ring.w_nr * | 655 | ic->i_send_ring.w_nr * |
@@ -663,14 +673,6 @@ void rds_ib_conn_shutdown(struct rds_connection *conn) | |||
663 | if (ic->i_recvs) | 673 | if (ic->i_recvs) |
664 | rds_ib_recv_clear_ring(ic); | 674 | rds_ib_recv_clear_ring(ic); |
665 | 675 | ||
666 | if (ic->i_cm_id->qp) | ||
667 | rdma_destroy_qp(ic->i_cm_id); | ||
668 | if (ic->i_send_cq) | ||
669 | ib_destroy_cq(ic->i_send_cq); | ||
670 | if (ic->i_recv_cq) | ||
671 | ib_destroy_cq(ic->i_recv_cq); | ||
672 | rdma_destroy_id(ic->i_cm_id); | ||
673 | |||
674 | /* | 676 | /* |
675 | * Move connection back to the nodev list. | 677 | * Move connection back to the nodev list. |
676 | */ | 678 | */ |