aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mana/device.c
diff options
context:
space:
mode:
authorShiraz Saleem <[email protected]>2025-06-10 12:48:37 +0000
committerLeon Romanovsky <[email protected]>2025-06-12 09:07:45 +0000
commitbaa640d924e55eee9210164ac068ad32dbd69c20 (patch)
tree5c660b1de6a09ac6836f839253639c70d7e01924 /drivers/infiniband/hw/mana/device.c
parentRDMA/cxgb4: Delete an unnecessary check before kfree() in c4iw_rdev_open() (diff)
downloadkernel-baa640d924e55eee9210164ac068ad32dbd69c20.tar.gz
kernel-baa640d924e55eee9210164ac068ad32dbd69c20.zip
RDMA/mana_ib: Add device statistics support
Add support for mana device level statistics. Co-developed-by: Solom Tamawy <[email protected]> Signed-off-by: Solom Tamawy <[email protected]> Signed-off-by: Shiraz Saleem <[email protected]> Signed-off-by: Konstantin Taranov <[email protected]> Link: https://patch.msgid.link/[email protected] Reviewed-by: Long Li <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
Diffstat (limited to 'drivers/infiniband/hw/mana/device.c')
-rw-r--r--drivers/infiniband/hw/mana/device.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mana/device.c b/drivers/infiniband/hw/mana/device.c
index 165c0a1e67d1..65d0af740e5a 100644
--- a/drivers/infiniband/hw/mana/device.c
+++ b/drivers/infiniband/hw/mana/device.c
@@ -65,6 +65,10 @@ static const struct ib_device_ops mana_ib_stats_ops = {
.get_hw_stats = mana_ib_get_hw_stats,
};
+static const struct ib_device_ops mana_ib_device_stats_ops = {
+ .alloc_hw_device_stats = mana_ib_alloc_hw_device_stats,
+};
+
static int mana_ib_netdev_event(struct notifier_block *this,
unsigned long event, void *ptr)
{
@@ -153,6 +157,8 @@ static int mana_ib_probe(struct auxiliary_device *adev,
}
ib_set_device_ops(&dev->ib_dev, &mana_ib_stats_ops);
+ if (dev->adapter_caps.feature_flags & MANA_IB_FEATURE_DEV_COUNTERS_SUPPORT)
+ ib_set_device_ops(&dev->ib_dev, &mana_ib_device_stats_ops);
ret = mana_ib_create_eqs(dev);
if (ret) {