>From d215882c1305d9c964c9c71ff1cf29a04395234f Mon Sep 17 00:00:00 2001
From: Eli Cohen <[EMAIL PROTECTED]>
Date: Thu, 19 Jun 2008 17:24:07 +0300
Subject: [PATCH] IB/mlx4: Configure QP's max message size

ConnectX declares the max message size it supports through QUERY_DEV_CAP.
When modifying a QP to RTR, the max message size for the QP must be
specified. This value must not exceed the value declared through QUERY_DEV_CAP.
The current code ignores the max allowed size and sets this value 2^31. This
patch sets to all the QPs the max value allowed as queried.

Signed-off-by: Eli Cohen <[EMAIL PROTECTED]>
---
Changes: updated the changelog to be more verbose.


 drivers/infiniband/hw/mlx4/qp.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index 8e02ecf..fe38c85 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -903,7 +903,8 @@ static int __mlx4_ib_modify_qp(struct ib_qp *ibqp,
                               attr->path_mtu);
                        goto out;
                }
-               context->mtu_msgmax = (attr->path_mtu << 5) | 31;
+               context->mtu_msgmax = (attr->path_mtu << 5) |
+                       ilog2(dev->dev->caps.max_msg_sz);
        }
 
        if (qp->rq.wqe_cnt)
-- 
1.5.5.4

_______________________________________________
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