]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
rds: Fix inaccurate accounting of unsignaled wrs
authorHåkon Bugge <Haakon.Bugge@oracle.com>
Tue, 24 Oct 2017 14:16:28 +0000 (16:16 +0200)
committerDhaval Giani <dhaval.giani@oracle.com>
Wed, 15 Nov 2017 06:10:05 +0000 (01:10 -0500)
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.

Orabug: 27090772

Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry-picked from upstream a0c0865fa0abcbc142c11fabec3a2bffc1a4229d)

Conflicts:
net/rds/ib_send.c

Reviewed-by: Knut Omang <knut.omang@oracle.com>
Reviewed-by: Wei Lin Guay <wei.lin.guay@oracle.com>
Reviewed-by: Avinash Repaka <avinash.repaka@oracle.com>
--
changes from v1:
- Inclusion of upstream cherry-picked SHA

Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
net/rds/ib_send.c

index c80b08a03f4d0136d4ad94b17ab33405d64b8fb7..46ab6bea7b2fda39ac749bf6d5cc0ffaa00f518b 100644 (file)
@@ -752,13 +752,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++;
@@ -797,11 +799,8 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm,
                prev->s_op = ic->i_data_op;
                prev->s_wr.send_flags |= IB_SEND_SOLICITED;
                if (!(prev->s_wr.send_flags & IB_SEND_SIGNALED) ||
-                    (rm->rdma.op_active && rm->rdma.op_remote_complete)) {
-                       ic->i_unsignaled_wrs = rds_ib_sysctl_max_unsig_wrs;
-                       prev->s_wr.send_flags |= IB_SEND_SIGNALED;
-                       nr_sig++;
-               }
+                   (rm->rdma.op_active && rm->rdma.op_remote_complete))
+                       nr_sig += rds_ib_set_wr_signal_state(ic, prev, true);
                ic->i_data_op = NULL;
        }