[rds-devel] [PATCH 2/3] RDS/iWARP: Remove cm_id's from the device cm_id list.
Steve Wise
swise at opengridcomputing.com
Mon Jan 26 12:13:59 PST 2009
From: Steve Wise <swise at opengridcomputing.com>
Signed-off-by: Steve Wise <swise at opengridcomputing.com>
---
drivers/infiniband/ulp/rds/iw.h | 1 +
drivers/infiniband/ulp/rds/iw_cm.c | 8 ++++++--
drivers/infiniband/ulp/rds/iw_rdma.c | 2 +-
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/infiniband/ulp/rds/iw.h b/drivers/infiniband/ulp/rds/iw.h
index fa0cd2f..6e7b8f4 100644
--- a/drivers/infiniband/ulp/rds/iw.h
+++ b/drivers/infiniband/ulp/rds/iw.h
@@ -304,6 +304,7 @@ void *rds_iw_get_mr(struct scatterlist *sg, unsigned long nents,
void rds_iw_sync_mr(void *trans_private, int dir);
void rds_iw_free_mr(void *trans_private, int invalidate);
void rds_iw_flush_mrs(void);
+void rds_iw_remove_cm_id(struct rds_iw_device *rds_ibdev, struct rdma_cm_id *cm_id);
/* ib_recv.c */
int __init rds_iw_recv_init(void);
diff --git a/drivers/infiniband/ulp/rds/iw_cm.c b/drivers/infiniband/ulp/rds/iw_cm.c
index f51060f..f9da16c 100644
--- a/drivers/infiniband/ulp/rds/iw_cm.c
+++ b/drivers/infiniband/ulp/rds/iw_cm.c
@@ -772,10 +772,11 @@ void rds_iw_conn_shutdown(struct rds_connection *conn)
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.
+ * If associated with an rds_iw_device:
+ * Move connection back to the nodev list.
+ * Remove cm_id from the device cm_id list.
*/
if (ic->rds_ibdev) {
@@ -787,9 +788,12 @@ void rds_iw_conn_shutdown(struct rds_connection *conn)
spin_lock_irq(&iw_nodev_conns_lock);
list_add_tail(&ic->iw_node, &iw_nodev_conns);
spin_unlock_irq(&iw_nodev_conns_lock);
+ rds_iw_remove_cm_id(ic->rds_ibdev, ic->i_cm_id);
ic->rds_ibdev = NULL;
}
+ rdma_destroy_id(ic->i_cm_id);
+
ic->i_cm_id = NULL;
ic->i_pd = NULL;
ic->i_mr = NULL;
diff --git a/drivers/infiniband/ulp/rds/iw_rdma.c b/drivers/infiniband/ulp/rds/iw_rdma.c
index 898821b..6381276 100644
--- a/drivers/infiniband/ulp/rds/iw_rdma.c
+++ b/drivers/infiniband/ulp/rds/iw_rdma.c
@@ -155,7 +155,7 @@ static int rds_iw_add_cm_id(struct rds_iw_device *rds_ibdev, struct rdma_cm_id *
return 0;
}
-static void rds_iw_remove_cm_id(struct rds_iw_device *rds_ibdev, struct rdma_cm_id *cm_id)
+void rds_iw_remove_cm_id(struct rds_iw_device *rds_ibdev, struct rdma_cm_id *cm_id)
{
struct rds_iw_cm_id *i_cm_id;
More information about the rds-devel
mailing list