]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
xprtrdma: Reduce the doorbell rate (Receive)
authorChuck Lever <chuck.lever@oracle.com>
Mon, 11 Feb 2019 16:23:54 +0000 (11:23 -0500)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Wed, 13 Feb 2019 15:30:11 +0000 (10:30 -0500)
Post RECV WRs in batches to reduce the hardware doorbell rate per
transport. This helps the RPC-over-RDMA client scale better in
number of transports.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
net/sunrpc/xprtrdma/verbs.c
net/sunrpc/xprtrdma/xprt_rdma.h

index 4994e75945b848c1dfba523e6a23cb2d45613ef5..b4e997d53ec711810737c1f1c520fa68ff5937ba 100644 (file)
@@ -1480,6 +1480,8 @@ rpcrdma_post_recvs(struct rpcrdma_xprt *r_xprt, bool temp)
        if (ep->rep_receive_count > needed)
                goto out;
        needed -= ep->rep_receive_count;
+       if (!temp)
+               needed += RPCRDMA_MAX_RECV_BATCH;
 
        count = 0;
        wr = NULL;
index 33db208fa9a887831f7ea2fa6021e07070fcb59b..10f6593e1a6abc38a739491f462bde1f792cd4e7 100644 (file)
@@ -205,6 +205,16 @@ struct rpcrdma_rep {
        struct ib_recv_wr       rr_recv_wr;
 };
 
+/* To reduce the rate at which a transport invokes ib_post_recv
+ * (and thus the hardware doorbell rate), xprtrdma posts Receive
+ * WRs in batches.
+ *
+ * Setting this to zero disables Receive post batching.
+ */
+enum {
+       RPCRDMA_MAX_RECV_BATCH = 7,
+};
+
 /* struct rpcrdma_sendctx - DMA mapped SGEs to unmap after Send completes
  */
 struct rpcrdma_req;