Hi James/Tom,

MLX4 transport (connectX HCA) need 2 extra S/G entries per work request. One is for the header and one for the checksum at the end. This patch will fix rpc rdma transport to create qp with max_send_sge = device_cap.max_sge - 2 if low-level device hca is connectX

thanks,
-vu

diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c 
b/net/sunrpc/xprtrdma/svc_rdma_transport.c
index e132509..955cd75 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
@@ -827,7 +827,14 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt 
*xprt)
        qp_attr.qp_context = &newxprt->sc_xprt;
        qp_attr.cap.max_send_wr = newxprt->sc_sq_depth;
        qp_attr.cap.max_recv_wr = newxprt->sc_max_requests;
-       qp_attr.cap.max_send_sge = newxprt->sc_max_sge;
+       /*
+        * MLX4 transport (connectX HCA) need 2 extra S/G entries
+        * one for the header and one for the checksum at the end
+        */
+       if (!strnicmp("mlx4", newxprt->sc_cm_id->device->name, 4))
+               qp_attr.cap.max_send_sge = newxprt->sc_max_sge - 2;
+       else
+               qp_attr.cap.max_send_sge = newxprt->sc_max_sge;
        qp_attr.cap.max_recv_sge = newxprt->sc_max_sge;
        qp_attr.sq_sig_type = IB_SIGNAL_REQ_WR;
        qp_attr.qp_type = IB_QPT_RC;
_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to