@@ -144,6 +144,7 @@ static const struct verbs_context_ops mlx5_ctx_common_ops = {
.post_srq_ops = mlx5_post_srq_ops,
.query_device_ex = mlx5_query_device_ex,
.query_rt_values = mlx5_query_rt_values,
+ .read_counters = mlx5_read_counters,
.reg_dm_mr = mlx5_reg_dm_mr,
};
@@ -858,6 +858,10 @@ int mlx5_destroy_counters(struct ibv_counters *counters);
int mlx5_attach_counters_point_flow(struct ibv_counters *counters,
struct ibv_counter_attach_attr *attr,
struct ibv_flow *flow);
+int mlx5_read_counters(struct ibv_counters *counters,
+ uint64_t *counters_value,
+ uint32_t ncounters,
+ uint32_t flags);
static inline void *mlx5_find_uidx(struct mlx5_context *ctx, uint32_t uidx)
{
@@ -3323,3 +3323,18 @@ int mlx5_attach_counters_point_flow(struct ibv_counters *counters,
return 0;
}
+
+int mlx5_read_counters(struct ibv_counters *counters,
+ uint64_t *counters_value,
+ uint32_t ncounters,
+ uint32_t flags)
+{
+ struct mlx5_counters *mcntrs = to_mcounters(counters);
+
+ return ibv_cmd_read_counters(&mcntrs->vcounters,
+ counters_value,
+ ncounters,
+ flags,
+ NULL);
+
+}