svcrdma: remove rdma_create_qp() failure recovery logic
Subsystems (4)
PATCH 1/1 svcrdma: remove rdma_create_qp() failure recovery logic
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.
---
net/sunrpc/xprtrdma/svc_rdma_transport.c | 19 ++----------------- 1 files changed, 2 insertions(+), 17 deletions(-)
net/sunrpc/xprtrdma/svc_rdma_transport.c +2 -17
@@ -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;
Tested over cxgb4 and mlx4.
Steve.
Thanks, applying for 3.17.--b.
Quoted 36 lines · Steve Wise
In
svc_rdma_accept(), ifrdma_create_qp()fails, there is useless logic to try and callrdma_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 attributemax_sgereturned fromib_query_device(). Ifrdma_create_qp()fails, it would not be because themax_send_sgeandmax_recv_sgevalues passed in exceed the device's max. So just remove this code.Signed-off-by Steve Wise <[email protected]>---
net/sunrpc/xprtrdma/svc_rdma_transport.c | 19 ++----------------- 1 files changed, 2 insertions(+), 17 deletions(-)net/sunrpc/xprtrdma/svc_rdma_transport.c +0
-12@@ -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;
net/sunrpc/xprtrdma/svc_rdma_transport.c static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt) · line 949
Quoted 10 lines
net/sunrpc/xprtrdma/svc_rdma_transport.c +2
-5- } - 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;
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html