]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
IB/mlx5: Add counter set id as a parameter for mlx5_ib_query_q_counters()
authorMark Zhang <markz@mellanox.com>
Tue, 2 Jul 2019 10:02:37 +0000 (13:02 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 5 Jul 2019 13:22:55 +0000 (10:22 -0300)
Add counter set id as a parameter so that this API can be used for
querying any q counter.

Signed-off-by: Mark Zhang <markz@mellanox.com>
Reviewed-by: Majd Dibbiny <majd@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/mlx5/main.c

index 1af36497d54c171a13856719a9788e3e40c31d44..ac09706b9407a26665e15935a6893d0aad8a6b13 100644 (file)
@@ -5477,7 +5477,8 @@ static struct rdma_hw_stats *mlx5_ib_alloc_hw_stats(struct ib_device *ibdev,
 
 static int mlx5_ib_query_q_counters(struct mlx5_core_dev *mdev,
                                    struct mlx5_ib_port *port,
-                                   struct rdma_hw_stats *stats)
+                                   struct rdma_hw_stats *stats,
+                                   u16 set_id)
 {
        int outlen = MLX5_ST_SZ_BYTES(query_q_counter_out);
        void *out;
@@ -5488,9 +5489,7 @@ static int mlx5_ib_query_q_counters(struct mlx5_core_dev *mdev,
        if (!out)
                return -ENOMEM;
 
-       ret = mlx5_core_query_q_counter(mdev,
-                                       port->cnts.set_id, 0,
-                                       out, outlen);
+       ret = mlx5_core_query_q_counter(mdev, set_id, 0, out, outlen);
        if (ret)
                goto free;
 
@@ -5550,7 +5549,8 @@ static int mlx5_ib_get_hw_stats(struct ib_device *ibdev,
                       port->cnts.num_ext_ppcnt_counters;
 
        /* q_counters are per IB device, query the master mdev */
-       ret = mlx5_ib_query_q_counters(dev->mdev, port, stats);
+       ret = mlx5_ib_query_q_counters(dev->mdev, port, stats,
+                                      port->cnts.set_id);
        if (ret)
                return ret;