Skip to content

Commit a0c0865

Browse files
Hakon-Buggedavem330
authored andcommitted
rds: Fix inaccurate accounting of unsignaled wrs
The number of unsignaled work-requests posted to the IB send queue is tracked by a counter in the rds_ib_connection struct. When it reaches zero, or the caller explicitly asks for it, the send-signaled bit is set in send_flags and the counter is reset. This is performed by the rds_ib_set_wr_signal_state() function. However, this function is not always used which yields inaccurate accounting. This commit fixes this, re-factors a code bloat related to the matter, and makes the actual parameter type to the function consistent. Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent e9a0b99 commit a0c0865

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

‎net/rds/ib_send.c‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -661,13 +661,15 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm,
661661
}
662662
}
663663

664-
rds_ib_set_wr_signal_state(ic, send, 0);
664+
rds_ib_set_wr_signal_state(ic, send, false);
665665

666666
/*
667667
* Always signal the last one if we're stopping due to flow control.
668668
*/
669-
if (ic->i_flowctl && flow_controlled && i == (work_alloc-1))
670-
send->s_wr.send_flags |= IB_SEND_SIGNALED | IB_SEND_SOLICITED;
669+
if (ic->i_flowctl && flow_controlled && i == (work_alloc - 1)) {
670+
rds_ib_set_wr_signal_state(ic, send, true);
671+
send->s_wr.send_flags |= IB_SEND_SOLICITED;
672+
}
671673

672674
if (send->s_wr.send_flags & IB_SEND_SIGNALED)
673675
nr_sig++;
@@ -705,11 +707,8 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm,
705707
if (scat == &rm->data.op_sg[rm->data.op_count]) {
706708
prev->s_op = ic->i_data_op;
707709
prev->s_wr.send_flags |= IB_SEND_SOLICITED;
708-
if (!(prev->s_wr.send_flags & IB_SEND_SIGNALED)) {
709-
ic->i_unsignaled_wrs = rds_ib_sysctl_max_unsig_wrs;
710-
prev->s_wr.send_flags |= IB_SEND_SIGNALED;
711-
nr_sig++;
712-
}
710+
if (!(prev->s_wr.send_flags & IB_SEND_SIGNALED))
711+
nr_sig += rds_ib_set_wr_signal_state(ic, prev, true);
713712
ic->i_data_op = NULL;
714713
}
715714

0 commit comments

Comments
 (0)