[rds-devel] [PATCH 2/2] RDS/IWARP: Fix reconnect logic to handle rejects.

Steve Wise swise at opengridcomputing.com
Thu Jan 8 13:26:10 PST 2009


From: Steve Wise <swise at opengridcomputing.com>

For connection rejects, the QP must be moved to ERR
to force a flush.  So just always move to ERR. 

Signed-off-by: Steve Wise <swise at opengridcomputing.com>
---

 drivers/infiniband/ulp/rds/iw_cm.c |   17 +++--------------
 1 files changed, 3 insertions(+), 14 deletions(-)

diff --git a/drivers/infiniband/ulp/rds/iw_cm.c b/drivers/infiniband/ulp/rds/iw_cm.c
index 68ac1b3..91d3bb6 100644
--- a/drivers/infiniband/ulp/rds/iw_cm.c
+++ b/drivers/infiniband/ulp/rds/iw_cm.c
@@ -750,21 +750,9 @@ void rds_ib_conn_shutdown(struct rds_connection *conn)
 				   " cm: %p err %d\n", ic->i_cm_id, err);
 		}
 
-		/* For IB, we have to move the QP to error state.
-		 * This is not needed for iWARP */
-		if (ic->i_cm_id->qp && !ic->i_iwarp) {
+		if (ic->i_cm_id->qp) {
 			qp_attr.qp_state = IB_QPS_ERR;
-			err = ib_modify_qp(ic->i_cm_id->qp, &qp_attr, IB_QP_STATE);
-			if (err) {
-				printk(KERN_WARNING "rds_ib_conn_shutdown: failed to"
-					   " modify QP to ERR state: id %p qp %p err %d\n",
-					   ic->i_cm_id, ic->i_cm_id->qp, err);
-
-				while (!rds_ib_ring_empty(&ic->i_send_ring))
-					rds_ib_ring_unalloc(&ic->i_send_ring, 1);
-				while (!rds_ib_ring_empty(&ic->i_recv_ring))
-					rds_ib_ring_unalloc(&ic->i_recv_ring, 1);
-			}
+			ib_modify_qp(ic->i_cm_id->qp, &qp_attr, IB_QP_STATE);
 		}
 
 		wait_event(rds_ib_ring_empty_wait,
@@ -843,6 +831,7 @@ void rds_ib_conn_shutdown(struct rds_connection *conn)
 	ic->i_sends = NULL;
 	vfree(ic->i_recvs);
 	ic->i_recvs = NULL;
+	rdsdebug("shutdown complete\n");
 }
 
 int rds_ib_conn_alloc(struct rds_connection *conn, gfp_t gfp)



More information about the rds-devel mailing list