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
@@ -55,6 +55,10 @@ MODULE_AUTHOR("Eli Cohen <eli@mellanox.c
MODULE_DESCRIPTION("Mellanox 5th generation network adapters (ConnectX series) 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)");
+
struct mlx5_ib_event_work {
struct work_struct work;
union {
@@ -3839,6 +3843,7 @@ static int mlx5_ib_stage_caps_init(struc
int err;
if (MLX5_CAP_GEN(mdev, ipoib_enhanced_offloads) &&
+ ipoib_enhanced &&
IS_ENABLED(CONFIG_MLX5_CORE_IPOIB))
ib_set_device_ops(&dev->ib_dev,
&mlx5_ib_dev_ipoib_enhanced_ops);