[ofa-general] [PATCH] IB/ipath - don't allow the QP path MTU to be set higher than port MTU

Ralph Campbell ralph.campbell at qlogic.com
Tue Aug 12 10:15:37 PDT 2008


OpenMPI uses a configuration file to pick the path MTU when modifying
a QP to RTR. This can cause MPI programs to hang if the currently
configured port neighbor MTU is less than the requested QP path MTU
since packets will be continuously dropped by the switch.
This patch fixes the problem by returning an error when attempting
to set the QP path MTU greater than the port MTU.

Signed-off-by: Ralph Campbell <ralph.campbell at qlogic.com>
---

 drivers/infiniband/hw/ipath/ipath_qp.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/infiniband/hw/ipath/ipath_qp.c b/drivers/infiniband/hw/ipath/ipath_qp.c
index 4715911..8ba6267 100644
--- a/drivers/infiniband/hw/ipath/ipath_qp.c
+++ b/drivers/infiniband/hw/ipath/ipath_qp.c
@@ -488,13 +488,15 @@ int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
 			goto inval;
 
 	/*
-	 * don't allow invalid Path MTU values or greater than 2048
-	 * unless we are configured for a 4KB MTU
+	 * Don't allow path MTU values greater than the currently
+	 * configured port neighbor MTU.
 	 */
-	if ((attr_mask & IB_QP_PATH_MTU) &&
-		(ib_mtu_enum_to_int(attr->path_mtu) == -1 ||
-		(attr->path_mtu > IB_MTU_2048 && !ipath_mtu4096)))
-		goto inval;
+	if (attr_mask & IB_QP_PATH_MTU) {
+		int mtu = ib_mtu_enum_to_int(attr->path_mtu);
+
+		if (mtu == -1 || mtu > dev->dd->ipath_ibmtu)
+			goto inval;
+	}
 
 	if (attr_mask & IB_QP_PATH_MIG_STATE)
 		if (attr->path_mig_state != IB_MIG_MIGRATED &&




More information about the general mailing list