Lines Matching refs:cnts
151 return is_mdev_switchdev_mode(dev->mdev) ? &dev->port[0].cnts :
152 &dev->port[port_num].cnts;
166 const struct mlx5_ib_counters *cnts = get_counters(dev, port_num);
168 return cnts->set_id;
175 const struct mlx5_ib_counters *cnts;
181 cnts = get_counters(dev, port_num - 1);
183 return rdma_alloc_hw_stats_struct(cnts->names,
184 cnts->num_q_counters +
185 cnts->num_cong_counters +
186 cnts->num_ext_ppcnt_counters,
191 const struct mlx5_ib_counters *cnts,
206 for (i = 0; i < cnts->num_q_counters; i++) {
207 val = *(__be32 *)((void *)out + cnts->offsets[i]);
215 const struct mlx5_ib_counters *cnts,
218 int offset = cnts->num_q_counters + cnts->num_cong_counters;
235 for (i = 0; i < cnts->num_ext_ppcnt_counters; i++)
238 cnts->offsets[i + offset]));
249 const struct mlx5_ib_counters *cnts = get_counters(dev, port_num - 1);
257 num_counters = cnts->num_q_counters +
258 cnts->num_cong_counters +
259 cnts->num_ext_ppcnt_counters;
262 ret = mlx5_ib_query_q_counters(dev->mdev, cnts, stats, cnts->set_id);
267 ret = mlx5_ib_query_ext_ppcnt_counters(dev, cnts, stats);
284 cnts->num_q_counters,
285 cnts->num_cong_counters,
286 cnts->offsets +
287 cnts->num_q_counters);
302 const struct mlx5_ib_counters *cnts =
305 return rdma_alloc_hw_stats_struct(cnts->names,
306 cnts->num_q_counters +
307 cnts->num_cong_counters +
308 cnts->num_ext_ppcnt_counters,
315 const struct mlx5_ib_counters *cnts =
318 return mlx5_ib_query_q_counters(dev->mdev, cnts,
432 struct mlx5_ib_counters *cnts)
450 cnts->num_q_counters = num_counters;
453 cnts->num_cong_counters = ARRAY_SIZE(cong_cnts);
457 cnts->num_ext_ppcnt_counters = ARRAY_SIZE(ext_ppcnt_cnts);
460 cnts->names = kcalloc(num_counters, sizeof(*cnts->names), GFP_KERNEL);
461 if (!cnts->names)
464 cnts->offsets = kcalloc(num_counters,
465 sizeof(*cnts->offsets), GFP_KERNEL);
466 if (!cnts->offsets)
472 kfree(cnts->names);
473 cnts->names = NULL;
489 if (dev->port[i].cnts.set_id) {
491 dev->port[i].cnts.set_id);
494 kfree(dev->port[i].cnts.names);
495 kfree(dev->port[i].cnts.offsets);
513 err = __mlx5_ib_alloc_counters(dev, &dev->port[i].cnts);
517 mlx5_ib_fill_counters(dev, dev->port[i].cnts.names,
518 dev->port[i].cnts.offsets);
531 dev->port[i].cnts.set_id =