]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
xprtrdma: Remove arbitrary limit on initiator depth
authorChuck Lever <chuck.lever@oracle.com>
Wed, 28 Feb 2018 20:30:33 +0000 (15:30 -0500)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Tue, 10 Apr 2018 20:06:22 +0000 (16:06 -0400)
Clean up: We need to check only that the value does not exceed the
range of the u8 field it's going into.

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

index e6f84a6434a049e41d83092a0764668a21416d4c..7cc3465993840f8cf951926ec9afa25432a9e5bc 100644 (file)
@@ -589,11 +589,8 @@ rpcrdma_ep_create(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia,
 
        /* Client offers RDMA Read but does not initiate */
        ep->rep_remote_cma.initiator_depth = 0;
-       if (ia->ri_device->attrs.max_qp_rd_atom > 32)   /* arbitrary but <= 255 */
-               ep->rep_remote_cma.responder_resources = 32;
-       else
-               ep->rep_remote_cma.responder_resources =
-                                               ia->ri_device->attrs.max_qp_rd_atom;
+       ep->rep_remote_cma.responder_resources =
+               min_t(int, U8_MAX, ia->ri_device->attrs.max_qp_rd_atom);
 
        /* Limit transport retries so client can detect server
         * GID changes quickly. RPC layer handles re-establishing