* Patch "IB/mlx5: Verify that Q counters are supported" has been added to the 4.9-stable tree
@ 2017-03-16 14:04 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-03-16 14:04 UTC (permalink / raw)
To: kamalh, dledford, gregkh, leon, markb; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
IB/mlx5: Verify that Q counters are supported
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
ib-mlx5-verify-that-q-counters-are-supported.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 45bded2c216da6010184ac5ebe88c27f73439009 Mon Sep 17 00:00:00 2001
From: Kamal Heib <kamalh@mellanox.com>
Date: Wed, 18 Jan 2017 14:10:32 +0200
Subject: IB/mlx5: Verify that Q counters are supported
From: Kamal Heib <kamalh@mellanox.com>
commit 45bded2c216da6010184ac5ebe88c27f73439009 upstream.
Make sure that the Q counters are supported by the FW before trying
to allocate/deallocte them, this will avoid driver load failure when
they aren't supported by the FW.
Fixes: 0837e86a7a34 ('IB/mlx5: Add per port counters')
Signed-off-by: Kamal Heib <kamalh@mellanox.com>
Reviewed-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/infiniband/hw/mlx5/main.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -3141,9 +3141,11 @@ static void *mlx5_ib_add(struct mlx5_cor
if (err)
goto err_rsrc;
- err = mlx5_ib_alloc_q_counters(dev);
- if (err)
- goto err_odp;
+ if (MLX5_CAP_GEN(dev->mdev, max_qp_cnt)) {
+ err = mlx5_ib_alloc_q_counters(dev);
+ if (err)
+ goto err_odp;
+ }
err = ib_register_device(&dev->ib_dev, NULL);
if (err)
@@ -3171,7 +3173,8 @@ err_dev:
ib_unregister_device(&dev->ib_dev);
err_q_cnt:
- mlx5_ib_dealloc_q_counters(dev);
+ if (MLX5_CAP_GEN(dev->mdev, max_qp_cnt))
+ mlx5_ib_dealloc_q_counters(dev);
err_odp:
mlx5_ib_odp_remove_one(dev);
@@ -3201,7 +3204,8 @@ static void mlx5_ib_remove(struct mlx5_c
mlx5_remove_roce_notifier(dev);
ib_unregister_device(&dev->ib_dev);
- mlx5_ib_dealloc_q_counters(dev);
+ if (MLX5_CAP_GEN(dev->mdev, max_qp_cnt))
+ mlx5_ib_dealloc_q_counters(dev);
destroy_umrc_res(dev);
mlx5_ib_odp_remove_one(dev);
destroy_dev_resources(&dev->devr);
Patches currently in stable-queue which might be from kamalh@mellanox.com are
queue-4.9/ib-mlx5-verify-that-q-counters-are-supported.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-03-16 14:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-16 14:04 Patch "IB/mlx5: Verify that Q counters are supported" has been added to the 4.9-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).