From: Santosh Shilimkar <santosh.shilimkar@oracle.com>
To: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, davem@davemloft.net,
ssantosh@kernel.org,
Santosh Shilimkar <santosh.shilimkar@oracle.com>
Subject: [PATCH 03/14] RDS: destroy the ib state earlier during shutdown
Date: Sat, 22 Aug 2015 15:45:24 -0700 [thread overview]
Message-ID: <1440283535-4800-4-git-send-email-santosh.shilimkar@oracle.com> (raw)
In-Reply-To: <1440283535-4800-1-git-send-email-santosh.shilimkar@oracle.com>
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>
---
net/rds/ib_cm.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c
index 0da2a45..8b40d3c 100644
--- a/net/rds/ib_cm.c
+++ b/net/rds/ib_cm.c
@@ -639,6 +639,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 *
@@ -662,14 +672,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.
*/
--
1.9.1
next prev parent reply other threads:[~2015-08-22 22:45 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-22 22:45 [PATCH 00/14] RDS: Assorted bug fixes Santosh Shilimkar
2015-08-22 22:45 ` [PATCH 01/14] RDS: restore return value in rds_cmsg_rdma_args() Santosh Shilimkar
2015-08-22 22:45 ` [PATCH 02/14] RDS: always free recv frag as we free its ring entry Santosh Shilimkar
2015-08-22 22:45 ` Santosh Shilimkar [this message]
2015-08-22 22:45 ` [PATCH 04/14] RDS: don't update ip address tables if the address hasn't changed Santosh Shilimkar
2015-08-22 22:45 ` [PATCH 05/14] RDS: make sure we post recv buffers Santosh Shilimkar
2015-08-22 22:45 ` [PATCH 06/14] RDS: check for congestion updates during rds_send_xmit Santosh Shilimkar
2015-08-22 22:45 ` [PATCH 07/14] RDS: add a sock_destruct callback debug aid Santosh Shilimkar
2015-08-22 22:45 ` [PATCH 08/14] RDS: Mark message mapped before transmit Santosh Shilimkar
2015-08-22 22:45 ` [PATCH 09/14] RDS: Make sure we do a signaled send for large-send Santosh Shilimkar
2015-08-22 22:45 ` [PATCH 10/14] RDS: Fix assertion level from fatal to warning Santosh Shilimkar
2015-08-22 22:45 ` [PATCH 11/14] RDS: Don't destroy the rdma id until after we're done using it Santosh Shilimkar
2015-08-22 22:45 ` [PATCH 12/14] RDS: make sure rds_send_drop_to properly takes the m_rs_lock Santosh Shilimkar
2015-08-22 22:45 ` [PATCH 13/14] RDS: return EMSGSIZE for oversize requests before processing/queueing Santosh Shilimkar
2015-08-22 22:45 ` [PATCH 14/14] RDS: check for valid cm_id before initiating connection Santosh Shilimkar
2015-08-25 20:35 ` [PATCH 00/14] RDS: Assorted bug fixes David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1440283535-4800-4-git-send-email-santosh.shilimkar@oracle.com \
--to=santosh.shilimkar@oracle.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=ssantosh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).