Skip to content

Commit

Permalink
rds: Fix inaccurate accounting of unsignaled wrs
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Hakon-Bugge authored and davem330 committed Oct 26, 2017
1 parent e9a0b99 commit a0c0865
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions net/rds/ib_send.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,13 +661,15 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm,
}
}

rds_ib_set_wr_signal_state(ic, send, 0);
rds_ib_set_wr_signal_state(ic, send, false);

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

if (send->s_wr.send_flags & IB_SEND_SIGNALED)
nr_sig++;
Expand Down Expand Up @@ -705,11 +707,8 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm,
if (scat == &rm->data.op_sg[rm->data.op_count]) {
prev->s_op = ic->i_data_op;
prev->s_wr.send_flags |= IB_SEND_SOLICITED;
if (!(prev->s_wr.send_flags & IB_SEND_SIGNALED)) {
ic->i_unsignaled_wrs = rds_ib_sysctl_max_unsig_wrs;
prev->s_wr.send_flags |= IB_SEND_SIGNALED;
nr_sig++;
}
if (!(prev->s_wr.send_flags & IB_SEND_SIGNALED))
nr_sig += rds_ib_set_wr_signal_state(ic, prev, true);
ic->i_data_op = NULL;
}

Expand Down

0 comments on commit a0c0865

Please sign in to comment.