Blob Blame History Raw
From e6bc5ebe2450cc5fd71e4cbd859541423f13c9e0 Mon Sep 17 00:00:00 2001
From: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
Date: Mon, 29 Jul 2019 20:19:55 +0200
Subject: [PATCH] mlx5: add parameter to disable enhanced IPoIB
Patch-mainline: Never, better fix based on netlink is being worked on
References: bsc#1142095

Recent ConnextX-[45] HCA have enhanced IPoIB enabled which prevents the use of the connected mode.
Although not an issue in a fully compatible setup, it can be an issue in a mixed HW one.

Mellanox OFED uses a ipoib_enhanced flag on the ib_ipoib module to work around the issue.
This patch adds a similarly name flag to the mlx5_ib module to disable enhanced IPoIB for
all mlx5 HCA and allow users to pick datagram/connected the usual way.

Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
---
 drivers/infiniband/hw/mlx5/main.c |    5 +++++
 1 file changed, 5 insertions(+)


--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -76,6 +76,10 @@ MODULE_AUTHOR("Eli Cohen <eli@mellanox.c
 MODULE_DESCRIPTION("Mellanox Connect-IB HCA IB driver");
 MODULE_LICENSE("Dual BSD/GPL");
 
+static int ipoib_enhanced = 1;
+module_param(ipoib_enhanced, int, 0444);
+MODULE_PARM_DESC(ipoib_enhanced, "Enable IPoIB enhanced for capable devices (default = 1) (0-1)");
+
 static char mlx5_version[] =
 	DRIVER_NAME ": Mellanox Connect-IB Infiniband driver v"
 	DRIVER_VERSION "\n";
@@ -5821,6 +5825,7 @@ int mlx5_ib_stage_caps_init(struct mlx5_
 	dev->ib_dev.check_mr_status	= mlx5_ib_check_mr_status;
 	dev->ib_dev.get_dev_fw_str      = get_dev_fw_str;
 	if (MLX5_CAP_GEN(mdev, ipoib_enhanced_offloads) &&
+	    ipoib_enhanced &&
 	    IS_ENABLED(CONFIG_MLX5_CORE_IPOIB))
 		dev->ib_dev.rdma_netdev_get_params = mlx5_ib_rn_get_params;