linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] svcrdma: remove rdma_create_qp() failure recovery logic
@ 2014-07-31 20:26 Steve Wise
  2014-08-01 14:15 ` Steve Wise
  2014-08-05 19:10 ` J. Bruce Fields
  0 siblings, 2 replies; 3+ messages in thread
From: Steve Wise @ 2014-07-31 20:26 UTC (permalink / raw)
  To: bfields; +Cc: linux-rdma, linux-nfs

In svc_rdma_accept(), if rdma_create_qp() fails, there is useless
logic to try and call rdma_create_qp() again with reduced sge depths.
The assumption, I guess, was that perhaps the initial sge depths
chosen were too big.  However they initial depths are selected based
on the rdma device attribute max_sge returned from ib_query_device().
If rdma_create_qp() fails, it would not be because the max_send_sge and
max_recv_sge values passed in exceed the device's max.  So just remove
this code.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---

 net/sunrpc/xprtrdma/svc_rdma_transport.c |   19 ++-----------------
 1 files changed, 2 insertions(+), 17 deletions(-)

diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c
index e7323fb..282a43b 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
@@ -942,23 +942,8 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)
 
 	ret = rdma_create_qp(newxprt->sc_cm_id, newxprt->sc_pd, &qp_attr);
 	if (ret) {
-		/*
-		 * XXX: This is a hack. We need a xx_request_qp interface
-		 * that will adjust the qp_attr's with a best-effort
-		 * number
-		 */
-		qp_attr.cap.max_send_sge -= 2;
-		qp_attr.cap.max_recv_sge -= 2;
-		ret = rdma_create_qp(newxprt->sc_cm_id, newxprt->sc_pd,
-				     &qp_attr);
-		if (ret) {
-			dprintk("svcrdma: failed to create QP, ret=%d\n", ret);
-			goto errout;
-		}
-		newxprt->sc_max_sge = qp_attr.cap.max_send_sge;
-		newxprt->sc_max_sge = qp_attr.cap.max_recv_sge;
-		newxprt->sc_sq_depth = qp_attr.cap.max_send_wr;
-		newxprt->sc_max_requests = qp_attr.cap.max_recv_wr;
+		dprintk("svcrdma: failed to create QP, ret=%d\n", ret);
+		goto errout;
 	}
 	newxprt->sc_qp = newxprt->sc_cm_id->qp;
 


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] svcrdma: remove rdma_create_qp() failure recovery logic
  2014-07-31 20:26 [PATCH] svcrdma: remove rdma_create_qp() failure recovery logic Steve Wise
@ 2014-08-01 14:15 ` Steve Wise
  2014-08-05 19:10 ` J. Bruce Fields
  1 sibling, 0 replies; 3+ messages in thread
From: Steve Wise @ 2014-08-01 14:15 UTC (permalink / raw)
  To: bfields; +Cc: linux-rdma, linux-nfs

Tested over cxgb4 and mlx4.

Steve.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] svcrdma: remove rdma_create_qp() failure recovery logic
  2014-07-31 20:26 [PATCH] svcrdma: remove rdma_create_qp() failure recovery logic Steve Wise
  2014-08-01 14:15 ` Steve Wise
@ 2014-08-05 19:10 ` J. Bruce Fields
  1 sibling, 0 replies; 3+ messages in thread
From: J. Bruce Fields @ 2014-08-05 19:10 UTC (permalink / raw)
  To: Steve Wise; +Cc: linux-rdma, linux-nfs

Thanks, applying for 3.17.--b.

On Thu, Jul 31, 2014 at 03:26:07PM -0500, Steve Wise wrote:
> In svc_rdma_accept(), if rdma_create_qp() fails, there is useless
> logic to try and call rdma_create_qp() again with reduced sge depths.
> The assumption, I guess, was that perhaps the initial sge depths
> chosen were too big.  However they initial depths are selected based
> on the rdma device attribute max_sge returned from ib_query_device().
> If rdma_create_qp() fails, it would not be because the max_send_sge and
> max_recv_sge values passed in exceed the device's max.  So just remove
> this code.
> 
> Signed-off-by: Steve Wise <swise@opengridcomputing.com>
> ---
> 
>  net/sunrpc/xprtrdma/svc_rdma_transport.c |   19 ++-----------------
>  1 files changed, 2 insertions(+), 17 deletions(-)
> 
> diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c
> index e7323fb..282a43b 100644
> --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
> +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
> @@ -942,23 +942,8 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)
>  
>  	ret = rdma_create_qp(newxprt->sc_cm_id, newxprt->sc_pd, &qp_attr);
>  	if (ret) {
> -		/*
> -		 * XXX: This is a hack. We need a xx_request_qp interface
> -		 * that will adjust the qp_attr's with a best-effort
> -		 * number
> -		 */
> -		qp_attr.cap.max_send_sge -= 2;
> -		qp_attr.cap.max_recv_sge -= 2;
> -		ret = rdma_create_qp(newxprt->sc_cm_id, newxprt->sc_pd,
> -				     &qp_attr);
> -		if (ret) {
> -			dprintk("svcrdma: failed to create QP, ret=%d\n", ret);
> -			goto errout;
> -		}
> -		newxprt->sc_max_sge = qp_attr.cap.max_send_sge;
> -		newxprt->sc_max_sge = qp_attr.cap.max_recv_sge;
> -		newxprt->sc_sq_depth = qp_attr.cap.max_send_wr;
> -		newxprt->sc_max_requests = qp_attr.cap.max_recv_wr;
> +		dprintk("svcrdma: failed to create QP, ret=%d\n", ret);
> +		goto errout;
>  	}
>  	newxprt->sc_qp = newxprt->sc_cm_id->qp;
>  
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-05 19:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-31 20:26 [PATCH] svcrdma: remove rdma_create_qp() failure recovery logic Steve Wise
2014-08-01 14:15 ` Steve Wise
2014-08-05 19:10 ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).