Lines Matching refs:cnts
144 return is_mdev_switchdev_mode(dev->mdev) ? &dev->port[0].cnts : in get_counters()
145 &dev->port[port_num].cnts; in get_counters()
159 const struct mlx5_ib_counters *cnts = get_counters(dev, port_num); in mlx5_ib_get_counters_id() local
161 return cnts->set_id; in mlx5_ib_get_counters_id()
168 const struct mlx5_ib_counters *cnts = &dev->port[0].cnts; in mlx5_ib_alloc_hw_device_stats() local
170 return rdma_alloc_hw_stats_struct(cnts->names, in mlx5_ib_alloc_hw_device_stats()
171 cnts->num_q_counters + in mlx5_ib_alloc_hw_device_stats()
172 cnts->num_cong_counters + in mlx5_ib_alloc_hw_device_stats()
173 cnts->num_ext_ppcnt_counters, in mlx5_ib_alloc_hw_device_stats()
181 const struct mlx5_ib_counters *cnts = &dev->port[port_num - 1].cnts; in mlx5_ib_alloc_hw_port_stats() local
183 return rdma_alloc_hw_stats_struct(cnts->names, in mlx5_ib_alloc_hw_port_stats()
184 cnts->num_q_counters + in mlx5_ib_alloc_hw_port_stats()
185 cnts->num_cong_counters + in mlx5_ib_alloc_hw_port_stats()
186 cnts->num_ext_ppcnt_counters, in mlx5_ib_alloc_hw_port_stats()
191 const struct mlx5_ib_counters *cnts, in mlx5_ib_query_q_counters() argument
206 for (i = 0; i < cnts->num_q_counters; i++) { in mlx5_ib_query_q_counters()
207 val = *(__be32 *)((void *)out + cnts->offsets[i]); in mlx5_ib_query_q_counters()
215 const struct mlx5_ib_counters *cnts, in mlx5_ib_query_ext_ppcnt_counters() argument
218 int offset = cnts->num_q_counters + cnts->num_cong_counters; in mlx5_ib_query_ext_ppcnt_counters()
235 for (i = 0; i < cnts->num_ext_ppcnt_counters; i++) in mlx5_ib_query_ext_ppcnt_counters()
238 cnts->offsets[i + offset])); in mlx5_ib_query_ext_ppcnt_counters()
249 const struct mlx5_ib_counters *cnts = get_counters(dev, port_num - 1); in mlx5_ib_get_hw_stats() local
256 num_counters = cnts->num_q_counters + in mlx5_ib_get_hw_stats()
257 cnts->num_cong_counters + in mlx5_ib_get_hw_stats()
258 cnts->num_ext_ppcnt_counters; in mlx5_ib_get_hw_stats()
261 ret = mlx5_ib_query_q_counters(dev->mdev, cnts, stats, cnts->set_id); in mlx5_ib_get_hw_stats()
266 ret = mlx5_ib_query_ext_ppcnt_counters(dev, cnts, stats); in mlx5_ib_get_hw_stats()
284 cnts->num_q_counters, in mlx5_ib_get_hw_stats()
285 cnts->num_cong_counters, in mlx5_ib_get_hw_stats()
286 cnts->offsets + in mlx5_ib_get_hw_stats()
287 cnts->num_q_counters); in mlx5_ib_get_hw_stats()
302 const struct mlx5_ib_counters *cnts = in mlx5_ib_counter_alloc_stats() local
305 return rdma_alloc_hw_stats_struct(cnts->names, in mlx5_ib_counter_alloc_stats()
306 cnts->num_q_counters + in mlx5_ib_counter_alloc_stats()
307 cnts->num_cong_counters + in mlx5_ib_counter_alloc_stats()
308 cnts->num_ext_ppcnt_counters, in mlx5_ib_counter_alloc_stats()
315 const struct mlx5_ib_counters *cnts = in mlx5_ib_counter_update_stats() local
318 return mlx5_ib_query_q_counters(dev->mdev, cnts, in mlx5_ib_counter_update_stats()
432 struct mlx5_ib_counters *cnts) in __mlx5_ib_alloc_counters() argument
450 cnts->num_q_counters = num_counters; in __mlx5_ib_alloc_counters()
453 cnts->num_cong_counters = ARRAY_SIZE(cong_cnts); in __mlx5_ib_alloc_counters()
457 cnts->num_ext_ppcnt_counters = ARRAY_SIZE(ext_ppcnt_cnts); in __mlx5_ib_alloc_counters()
460 cnts->names = kcalloc(num_counters, sizeof(*cnts->names), GFP_KERNEL); in __mlx5_ib_alloc_counters()
461 if (!cnts->names) in __mlx5_ib_alloc_counters()
464 cnts->offsets = kcalloc(num_counters, in __mlx5_ib_alloc_counters()
465 sizeof(*cnts->offsets), GFP_KERNEL); in __mlx5_ib_alloc_counters()
466 if (!cnts->offsets) in __mlx5_ib_alloc_counters()
472 kfree(cnts->names); in __mlx5_ib_alloc_counters()
473 cnts->names = NULL; in __mlx5_ib_alloc_counters()
489 if (dev->port[i].cnts.set_id) { in mlx5_ib_dealloc_counters()
491 dev->port[i].cnts.set_id); in mlx5_ib_dealloc_counters()
494 kfree(dev->port[i].cnts.names); in mlx5_ib_dealloc_counters()
495 kfree(dev->port[i].cnts.offsets); in mlx5_ib_dealloc_counters()
513 err = __mlx5_ib_alloc_counters(dev, &dev->port[i].cnts); in mlx5_ib_alloc_counters()
517 mlx5_ib_fill_counters(dev, dev->port[i].cnts.names, in mlx5_ib_alloc_counters()
518 dev->port[i].cnts.offsets); in mlx5_ib_alloc_counters()
531 dev->port[i].cnts.set_id = in mlx5_ib_alloc_counters()