svcrdma: Use max_sge_rd for destination read depths
[linux-2.6-block.git] / net / sunrpc / xprtrdma / svc_rdma_recvfrom.c
index 2e1348bde325de89d22b8e5fcbcc897d50eba98f..cb51742840740f790d24797e585e7fb520646a09 100644 (file)
@@ -115,15 +115,6 @@ static void rdma_build_arg_xdr(struct svc_rqst *rqstp,
        rqstp->rq_arg.tail[0].iov_len = 0;
 }
 
-static int rdma_read_max_sge(struct svcxprt_rdma *xprt, int sge_count)
-{
-       if (!rdma_cap_read_multi_sge(xprt->sc_cm_id->device,
-                                    xprt->sc_cm_id->port_num))
-               return 1;
-       else
-               return min_t(int, sge_count, xprt->sc_max_sge);
-}
-
 /* Issue an RDMA_READ using the local lkey to map the data sink */
 int rdma_read_chunk_lcl(struct svcxprt_rdma *xprt,
                        struct svc_rqst *rqstp,
@@ -144,8 +135,7 @@ int rdma_read_chunk_lcl(struct svcxprt_rdma *xprt,
 
        ctxt->direction = DMA_FROM_DEVICE;
        ctxt->read_hdr = head;
-       pages_needed =
-               min_t(int, pages_needed, rdma_read_max_sge(xprt, pages_needed));
+       pages_needed = min_t(int, pages_needed, xprt->sc_max_sge_rd);
        read = min_t(int, pages_needed << PAGE_SHIFT, rs_length);
 
        for (pno = 0; pno < pages_needed; pno++) {