[rds-devel] [PATCH future/20090207 3/3] RDS/iWARP: clean up connect_complete.
Steve Wise
swise at opengridcomputing.com
Tue Feb 10 12:07:44 PST 2009
- don't need to modify the qp.
- fix up the printk to dump local and remote addrs.
- remove rnr stuff from iwarp transport.
Signed-off-by: Steve Wise <swise at opengridcomputing.com>
---
net/rds/iw_cm.c | 61 +++++--------------------------------------------------
1 files changed, 6 insertions(+), 55 deletions(-)
diff --git a/net/rds/iw_cm.c b/net/rds/iw_cm.c
index 5d9efcc..bef8217 100644
--- a/net/rds/iw_cm.c
+++ b/net/rds/iw_cm.c
@@ -63,45 +63,6 @@ static void rds_iw_set_flow_control(struct rds_connection *conn, u32 credits)
}
/*
- * Tune RNR behavior. Without flow control, we use a rather
- * low timeout, but not the absolute minimum - this should
- * be tunable.
- *
- * We already set the RNR retry count to 7 (which is the
- * smallest infinite number :-) above.
- * If flow control is off, we want to change this back to 0
- * so that we learn quickly when our credit accounting is
- * buggy.
- *
- * Caller passes in a qp_attr pointer - don't waste stack spacv
- * by allocation this twice.
- */
-static void
-rds_iw_tune_rnr(struct rds_iw_connection *ic, struct ib_qp_attr *attr)
-{
- int ret;
-
- if (ic->i_flowctl) {
- /* It seems we have to take a brief detour through SQD state
- * in order to change the RNR retry count. */
- attr->qp_state = IB_QPS_SQD;
- ret = ib_modify_qp(ic->i_cm_id->qp, attr, IB_QP_STATE);
- if (ret)
- printk(KERN_NOTICE "ib_modify_qp(IB_QP_STATE, SQD): err=%d\n", -ret);
-
- attr->rnr_retry = 0;
- ret = ib_modify_qp(ic->i_cm_id->qp, attr, IB_QP_RNR_RETRY);
- if (ret)
- printk(KERN_NOTICE "ib_modify_qp(IB_QP_RNR_RETRY, 0): err=%d\n", -ret);
- } else {
- attr->min_rnr_timer = IB_RNR_TIMER_000_32;
- ret = ib_modify_qp(ic->i_cm_id->qp, attr, IB_QP_MIN_RNR_TIMER);
- if (ret)
- printk(KERN_NOTICE "ib_modify_qp(IB_QP_MIN_RNR_TIMER): err=%d\n", -ret);
- }
-}
-
-/*
* Connection established.
* We get here for both outgoing and incoming connection.
*/
@@ -110,7 +71,6 @@ static void rds_iw_connect_complete(struct rds_connection *conn, struct rdma_cm_
const struct rds_iw_connect_private *dp = NULL;
struct rds_iw_connection *ic = conn->c_transport_data;
struct rds_iw_device *rds_ibdev;
- struct ib_qp_attr qp_attr;
int err;
if (event->param.conn.private_data_len) {
@@ -122,21 +82,6 @@ static void rds_iw_connect_complete(struct rds_connection *conn, struct rdma_cm_
rds_iw_set_flow_control(conn, be32_to_cpu(dp->dp_credit));
}
- printk(KERN_NOTICE "RDS/IW: connected to %u.%u.%u.%u version %u.%u%s\n",
- NIPQUAD(conn->c_laddr),
- RDS_PROTOCOL_MAJOR(conn->c_version),
- RDS_PROTOCOL_MINOR(conn->c_version),
- ic->i_flowctl ? ", flow control" : "");
-
- /* Tune RNR behavior - but not for iWARP */
- if (!ic->i_iwarp)
- rds_iw_tune_rnr(ic, &qp_attr);
-
- qp_attr.qp_state = IB_QPS_RTS;
- err = ib_modify_qp(ic->i_cm_id->qp, &qp_attr, IB_QP_STATE);
- if (err)
- printk(KERN_NOTICE "ib_modify_qp(IB_QP_STATE, RTS): err=%d\n", err);
-
/* update ib_device with this local ipaddr & conn */
rds_ibdev = ib_get_client_data(ic->i_cm_id->device, &rds_iw_client);
err = rds_iw_update_cm_id(rds_ibdev, ic->i_cm_id);
@@ -151,6 +96,12 @@ static void rds_iw_connect_complete(struct rds_connection *conn, struct rdma_cm_
if (dp && dp->dp_ack_seq)
rds_send_drop_acked(conn, be64_to_cpu(dp->dp_ack_seq), NULL);
+ printk(KERN_NOTICE "RDS/IW: connected to %u.%u.%u.%u<->%u.%u.%u.%u version %u.%u%s\n",
+ NIPQUAD(conn->c_laddr), NIPQUAD(conn->c_faddr),
+ RDS_PROTOCOL_MAJOR(conn->c_version),
+ RDS_PROTOCOL_MINOR(conn->c_version),
+ ic->i_flowctl ? ", flow control" : "");
+
rds_connect_complete(conn);
}
More information about the rds-devel
mailing list