diff options
author | Or Gerlitz <ogerlitz@mellanox.com> | 2014-12-17 09:17:34 -0500 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2015-02-16 19:36:09 -0500 |
commit | e9a7faf11af94957e5107b40af46c2e329541510 (patch) | |
tree | bab5661b7f56e81374c128e7f86479a10cc5b033 /drivers/infiniband/hw | |
parent | bfa76d49576599a4b9f9b7a71f23d73d6dcff735 (diff) |
IB/mlx4: Fix wrong usage of IPv4 protocol for multicast attach/detach
The MLX4_PROT_IB_IPV4 protocol should only be used with RoCEv2 and such.
Removing this wrong usage allows to run multicast applications over RoCE.
Fixes: d487ee77740c ("IB/mlx4: Use IBoE (RoCE) IP based GIDs in the port GID table")
Reported-by: Carol Soto <clsoto@linux.vnet.ibm.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r-- | drivers/infiniband/hw/mlx4/main.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index 9117b7a2d5f8..0b280b1c98df 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c | |||
@@ -1222,8 +1222,7 @@ static int mlx4_ib_mcg_attach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid) | |||
1222 | struct mlx4_ib_qp *mqp = to_mqp(ibqp); | 1222 | struct mlx4_ib_qp *mqp = to_mqp(ibqp); |
1223 | u64 reg_id; | 1223 | u64 reg_id; |
1224 | struct mlx4_ib_steering *ib_steering = NULL; | 1224 | struct mlx4_ib_steering *ib_steering = NULL; |
1225 | enum mlx4_protocol prot = (gid->raw[1] == 0x0e) ? | 1225 | enum mlx4_protocol prot = MLX4_PROT_IB_IPV6; |
1226 | MLX4_PROT_IB_IPV4 : MLX4_PROT_IB_IPV6; | ||
1227 | 1226 | ||
1228 | if (mdev->dev->caps.steering_mode == | 1227 | if (mdev->dev->caps.steering_mode == |
1229 | MLX4_STEERING_MODE_DEVICE_MANAGED) { | 1228 | MLX4_STEERING_MODE_DEVICE_MANAGED) { |
@@ -1236,8 +1235,10 @@ static int mlx4_ib_mcg_attach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid) | |||
1236 | !!(mqp->flags & | 1235 | !!(mqp->flags & |
1237 | MLX4_IB_QP_BLOCK_MULTICAST_LOOPBACK), | 1236 | MLX4_IB_QP_BLOCK_MULTICAST_LOOPBACK), |
1238 | prot, ®_id); | 1237 | prot, ®_id); |
1239 | if (err) | 1238 | if (err) { |
1239 | pr_err("multicast attach op failed, err %d\n", err); | ||
1240 | goto err_malloc; | 1240 | goto err_malloc; |
1241 | } | ||
1241 | 1242 | ||
1242 | err = add_gid_entry(ibqp, gid); | 1243 | err = add_gid_entry(ibqp, gid); |
1243 | if (err) | 1244 | if (err) |
@@ -1285,8 +1286,7 @@ static int mlx4_ib_mcg_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid) | |||
1285 | struct net_device *ndev; | 1286 | struct net_device *ndev; |
1286 | struct mlx4_ib_gid_entry *ge; | 1287 | struct mlx4_ib_gid_entry *ge; |
1287 | u64 reg_id = 0; | 1288 | u64 reg_id = 0; |
1288 | enum mlx4_protocol prot = (gid->raw[1] == 0x0e) ? | 1289 | enum mlx4_protocol prot = MLX4_PROT_IB_IPV6; |
1289 | MLX4_PROT_IB_IPV4 : MLX4_PROT_IB_IPV6; | ||
1290 | 1290 | ||
1291 | if (mdev->dev->caps.steering_mode == | 1291 | if (mdev->dev->caps.steering_mode == |
1292 | MLX4_STEERING_MODE_DEVICE_MANAGED) { | 1292 | MLX4_STEERING_MODE_DEVICE_MANAGED) { |