aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Grover <andy.grover@oracle.com>2009-07-17 09:13:29 -0400
committerDavid S. Miller <davem@davemloft.net>2009-07-20 11:03:08 -0400
commite11d912a7dd4dfe388f38ba3080a6d067a57b23d (patch)
tree0309ef7caba1742cb091be47930ee330a5392d38
parent9099707ded4b3aeda7b1a6c1c87076bd18578d24 (diff)
RDS/IB: Move tx/rx ring init and refill to later
Since RDS 3.0 and 3.1 have different packet formats, we need to wait until after protocol negotiation is complete to layout the rx buffers. Signed-off-by: Andy Grover <andy.grover@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/rds/ib_cm.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c
index f621086f8038..0ad749c17c2c 100644
--- a/net/rds/ib_cm.c
+++ b/net/rds/ib_cm.c
@@ -116,6 +116,16 @@ void rds_ib_cm_connect_complete(struct rds_connection *conn, struct rdma_cm_even
116 RDS_PROTOCOL_MINOR(conn->c_version), 116 RDS_PROTOCOL_MINOR(conn->c_version),
117 ic->i_flowctl ? ", flow control" : ""); 117 ic->i_flowctl ? ", flow control" : "");
118 118
119 /*
120 * Init rings and fill recv. this needs to wait until protocol negotiation
121 * is complete, since ring layout is different from 3.0 to 3.1.
122 */
123 rds_ib_send_init_ring(ic);
124 rds_ib_recv_init_ring(ic);
125 /* Post receive buffers - as a side effect, this will update
126 * the posted credit count. */
127 rds_ib_recv_refill(conn, GFP_KERNEL, GFP_HIGHUSER, 1);
128
119 /* Tune RNR behavior */ 129 /* Tune RNR behavior */
120 rds_ib_tune_rnr(ic, &qp_attr); 130 rds_ib_tune_rnr(ic, &qp_attr);
121 131
@@ -324,7 +334,7 @@ static int rds_ib_setup_qp(struct rds_connection *conn)
324 rdsdebug("send allocation failed\n"); 334 rdsdebug("send allocation failed\n");
325 goto out; 335 goto out;
326 } 336 }
327 rds_ib_send_init_ring(ic); 337 memset(ic->i_sends, 0, ic->i_send_ring.w_nr * sizeof(struct rds_ib_send_work));
328 338
329 ic->i_recvs = vmalloc(ic->i_recv_ring.w_nr * sizeof(struct rds_ib_recv_work)); 339 ic->i_recvs = vmalloc(ic->i_recv_ring.w_nr * sizeof(struct rds_ib_recv_work));
330 if (ic->i_recvs == NULL) { 340 if (ic->i_recvs == NULL) {
@@ -332,14 +342,10 @@ static int rds_ib_setup_qp(struct rds_connection *conn)
332 rdsdebug("recv allocation failed\n"); 342 rdsdebug("recv allocation failed\n");
333 goto out; 343 goto out;
334 } 344 }
345 memset(ic->i_recvs, 0, ic->i_recv_ring.w_nr * sizeof(struct rds_ib_recv_work));
335 346
336 rds_ib_recv_init_ring(ic);
337 rds_ib_recv_init_ack(ic); 347 rds_ib_recv_init_ack(ic);
338 348
339 /* Post receive buffers - as a side effect, this will update
340 * the posted credit count. */
341 rds_ib_recv_refill(conn, GFP_KERNEL, GFP_HIGHUSER, 1);
342
343 rdsdebug("conn %p pd %p mr %p cq %p %p\n", conn, ic->i_pd, ic->i_mr, 349 rdsdebug("conn %p pd %p mr %p cq %p %p\n", conn, ic->i_pd, ic->i_mr,
344 ic->i_send_cq, ic->i_recv_cq); 350 ic->i_send_cq, ic->i_recv_cq);
345 351