summaryrefslogtreecommitdiff
path: root/drivers/infiniband/hw/mlx5/counters.h
diff options
context:
space:
mode:
authorLeon Romanovsky <leonro@mellanox.com>2020-07-02 11:18:06 +0300
committerJason Gunthorpe <jgg@nvidia.com>2020-07-07 20:05:51 +0300
commit64825827ae3a53e01fc9bb9483b1a2ed7cb2b657 (patch)
tree46a08cff8f8757adb394384150ed09a23b132035 /drivers/infiniband/hw/mlx5/counters.h
parentb572ebe6675526be5d3b0e831e9d567c4fc0fd5d (diff)
downloadlinux-64825827ae3a53e01fc9bb9483b1a2ed7cb2b657.tar.xz
RDMA/mlx5: Separate counters from main.c
There are number of counters types supported in mlx5_ib: HW counters, congestion counters, Q-counters and flow counters. Almost all supporting code was placed in main.c that made almost impossible to maintain the code anymore. Let's create separate code namespace for the counters to easy future generalization effort. Link: https://lore.kernel.org/r/20200702081809.423482-4-leon@kernel.org Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx5/counters.h')
-rw-r--r--drivers/infiniband/hw/mlx5/counters.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mlx5/counters.h b/drivers/infiniband/hw/mlx5/counters.h
new file mode 100644
index 000000000000..1aa30c2f3f4d
--- /dev/null
+++ b/drivers/infiniband/hw/mlx5/counters.h
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
+/*
+ * Copyright (c) 2013-2020, Mellanox Technologies inc. All rights reserved.
+ */
+
+#ifndef _MLX5_IB_COUNTERS_H
+#define _MLX5_IB_COUNTERS_H
+
+#include "mlx5_ib.h"
+
+int mlx5_ib_counters_init(struct mlx5_ib_dev *dev);
+void mlx5_ib_counters_cleanup(struct mlx5_ib_dev *dev);
+void mlx5_ib_counters_clear_description(struct ib_counters *counters);
+int mlx5_ib_flow_counters_set_data(struct ib_counters *ibcounters,
+ struct mlx5_ib_create_flow *ucmd);
+u16 mlx5_ib_get_counters_id(struct mlx5_ib_dev *dev, u8 port_num);
+#endif /* _MLX5_IB_COUNTERS_H */