aboutsummaryrefslogtreecommitdiffstats
path: root/net/rds/ib_send.c
diff options
context:
space:
mode:
authorAndy Grover <andy.grover@oracle.com>2010-01-15 18:55:26 -0500
committerAndy Grover <andy.grover@oracle.com>2010-09-08 21:11:53 -0400
commitc8de3f1005e8359ea07083e37f3f993646e1adba (patch)
treec453d9c52e3569617014e6da54f307f75d1c49d8 /net/rds/ib_send.c
parent1d34f175712b59ad292ecbbaa8fc05402a1fd8ed (diff)
RDS/IB: Make all flow control code conditional on i_flowctl
Maybe things worked fine with the flow control code running even in the non-flow-control case, but making it explicitly conditional helps the non-fc case be easier to read. Signed-off-by: Andy Grover <andy.grover@oracle.com>
Diffstat (limited to 'net/rds/ib_send.c')
-rw-r--r--net/rds/ib_send.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/net/rds/ib_send.c b/net/rds/ib_send.c
index 48724b71f26c..d839b403d46b 100644
--- a/net/rds/ib_send.c
+++ b/net/rds/ib_send.c
@@ -489,7 +489,7 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm,
489 if (credit_alloc < work_alloc) { 489 if (credit_alloc < work_alloc) {
490 rds_ib_ring_unalloc(&ic->i_send_ring, work_alloc - credit_alloc); 490 rds_ib_ring_unalloc(&ic->i_send_ring, work_alloc - credit_alloc);
491 work_alloc = credit_alloc; 491 work_alloc = credit_alloc;
492 flow_controlled++; 492 flow_controlled = 1;
493 } 493 }
494 if (work_alloc == 0) { 494 if (work_alloc == 0) {
495 set_bit(RDS_LL_SEND_FULL, &conn->c_flags); 495 set_bit(RDS_LL_SEND_FULL, &conn->c_flags);
@@ -552,9 +552,11 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm,
552 /* 552 /*
553 * Update adv_credits since we reset the ACK_REQUIRED bit. 553 * Update adv_credits since we reset the ACK_REQUIRED bit.
554 */ 554 */
555 rds_ib_send_grab_credits(ic, 0, &posted, 1, RDS_MAX_ADV_CREDIT - adv_credits); 555 if (ic->i_flowctl) {
556 adv_credits += posted; 556 rds_ib_send_grab_credits(ic, 0, &posted, 1, RDS_MAX_ADV_CREDIT - adv_credits);
557 BUG_ON(adv_credits > 255); 557 adv_credits += posted;
558 BUG_ON(adv_credits > 255);
559 }
558 } 560 }
559 561
560 /* Sometimes you want to put a fence between an RDMA 562 /* Sometimes you want to put a fence between an RDMA
@@ -619,13 +621,13 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm,
619 /* 621 /*
620 * Always signal the last one if we're stopping due to flow control. 622 * Always signal the last one if we're stopping due to flow control.
621 */ 623 */
622 if (flow_controlled && i == (work_alloc-1)) 624 if (ic->i_flowctl && flow_controlled && i == (work_alloc-1))
623 send->s_wr.send_flags |= IB_SEND_SIGNALED | IB_SEND_SOLICITED; 625 send->s_wr.send_flags |= IB_SEND_SIGNALED | IB_SEND_SOLICITED;
624 626
625 rdsdebug("send %p wr %p num_sge %u next %p\n", send, 627 rdsdebug("send %p wr %p num_sge %u next %p\n", send,
626 &send->s_wr, send->s_wr.num_sge, send->s_wr.next); 628 &send->s_wr, send->s_wr.num_sge, send->s_wr.next);
627 629
628 if (adv_credits) { 630 if (ic->i_flowctl && adv_credits) {
629 struct rds_header *hdr = &ic->i_send_hdrs[pos]; 631 struct rds_header *hdr = &ic->i_send_hdrs[pos];
630 632
631 /* add credit and redo the header checksum */ 633 /* add credit and redo the header checksum */