diff options
author | Leon Romanovsky <leonro@mellanox.com> | 2018-05-29 14:56:13 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2018-06-01 11:16:23 -0400 |
commit | f77f3036264b2e0d9abd2938b8999dc9d33819ed (patch) | |
tree | cd70134cc5a553a83899d080e3dbb68f0a71d5a6 /drivers | |
parent | 367d2f0787e8363f30cbac4d5270a772b69828c1 (diff) |
RDMA/mlx4: Catch FW<->SW misalignment without machine crash
Any steering QP is supposed be above steering_qp_base,
see function mlx4_ib_steer_qp_alloc() for it, however in case
of misalignment between SW and FW, this qp_base can be wrong.
Use WARN() to catch such situation without killing the machine.
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/infiniband/hw/mlx4/main.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index 59aed458d3be..1fea1497263b 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c @@ -3017,7 +3017,10 @@ void mlx4_ib_steer_qp_free(struct mlx4_ib_dev *dev, u32 qpn, int count) dev->steering_support != MLX4_STEERING_MODE_DEVICE_MANAGED) return; - BUG_ON(qpn < dev->steer_qpn_base); + if (WARN(qpn < dev->steer_qpn_base, "qpn = %u, steer_qpn_base = %u\n", + qpn, dev->steer_qpn_base)) + /* not supposed to be here */ + return; bitmap_release_region(dev->ib_uc_qpns_bitmap, qpn - dev->steer_qpn_base, |