diff options
-rw-r--r-- | net/sunrpc/xprtrdma/svc_rdma_transport.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c index 7647789a1f68..80104f4999d5 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c | |||
@@ -606,7 +606,7 @@ int svc_rdma_post_recv(struct svcxprt_rdma *xprt) | |||
606 | * will call the recvfrom method on the listen xprt which will accept the new | 606 | * will call the recvfrom method on the listen xprt which will accept the new |
607 | * connection. | 607 | * connection. |
608 | */ | 608 | */ |
609 | static void handle_connect_req(struct rdma_cm_id *new_cma_id) | 609 | static void handle_connect_req(struct rdma_cm_id *new_cma_id, size_t client_ird) |
610 | { | 610 | { |
611 | struct svcxprt_rdma *listen_xprt = new_cma_id->context; | 611 | struct svcxprt_rdma *listen_xprt = new_cma_id->context; |
612 | struct svcxprt_rdma *newxprt; | 612 | struct svcxprt_rdma *newxprt; |
@@ -623,6 +623,9 @@ static void handle_connect_req(struct rdma_cm_id *new_cma_id) | |||
623 | dprintk("svcrdma: Creating newxprt=%p, cm_id=%p, listenxprt=%p\n", | 623 | dprintk("svcrdma: Creating newxprt=%p, cm_id=%p, listenxprt=%p\n", |
624 | newxprt, newxprt->sc_cm_id, listen_xprt); | 624 | newxprt, newxprt->sc_cm_id, listen_xprt); |
625 | 625 | ||
626 | /* Save client advertised inbound read limit for use later in accept. */ | ||
627 | newxprt->sc_ord = client_ird; | ||
628 | |||
626 | /* Set the local and remote addresses in the transport */ | 629 | /* Set the local and remote addresses in the transport */ |
627 | sa = (struct sockaddr *)&newxprt->sc_cm_id->route.addr.dst_addr; | 630 | sa = (struct sockaddr *)&newxprt->sc_cm_id->route.addr.dst_addr; |
628 | svc_xprt_set_remote(&newxprt->sc_xprt, sa, svc_addr_len(sa)); | 631 | svc_xprt_set_remote(&newxprt->sc_xprt, sa, svc_addr_len(sa)); |
@@ -659,7 +662,8 @@ static int rdma_listen_handler(struct rdma_cm_id *cma_id, | |||
659 | case RDMA_CM_EVENT_CONNECT_REQUEST: | 662 | case RDMA_CM_EVENT_CONNECT_REQUEST: |
660 | dprintk("svcrdma: Connect request on cma_id=%p, xprt = %p, " | 663 | dprintk("svcrdma: Connect request on cma_id=%p, xprt = %p, " |
661 | "event=%d\n", cma_id, cma_id->context, event->event); | 664 | "event=%d\n", cma_id, cma_id->context, event->event); |
662 | handle_connect_req(cma_id); | 665 | handle_connect_req(cma_id, |
666 | event->param.conn.responder_resources); | ||
663 | break; | 667 | break; |
664 | 668 | ||
665 | case RDMA_CM_EVENT_ESTABLISHED: | 669 | case RDMA_CM_EVENT_ESTABLISHED: |
@@ -833,8 +837,12 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt) | |||
833 | (size_t)svcrdma_max_requests); | 837 | (size_t)svcrdma_max_requests); |
834 | newxprt->sc_sq_depth = RPCRDMA_SQ_DEPTH_MULT * newxprt->sc_max_requests; | 838 | newxprt->sc_sq_depth = RPCRDMA_SQ_DEPTH_MULT * newxprt->sc_max_requests; |
835 | 839 | ||
836 | newxprt->sc_ord = min((size_t)devattr.max_qp_rd_atom, | 840 | /* |
837 | (size_t)svcrdma_ord); | 841 | * Limit ORD based on client limit, local device limit, and |
842 | * configured svcrdma limit. | ||
843 | */ | ||
844 | newxprt->sc_ord = min_t(size_t, devattr.max_qp_rd_atom, newxprt->sc_ord); | ||
845 | newxprt->sc_ord = min_t(size_t, svcrdma_ord, newxprt->sc_ord); | ||
838 | 846 | ||
839 | newxprt->sc_pd = ib_alloc_pd(newxprt->sc_cm_id->device); | 847 | newxprt->sc_pd = ib_alloc_pd(newxprt->sc_cm_id->device); |
840 | if (IS_ERR(newxprt->sc_pd)) { | 848 | if (IS_ERR(newxprt->sc_pd)) { |