Lines Matching refs:cnts

212 		return &dev->port[0].cnts;
215 &dev->port[1].cnts : &dev->port[port_num - 1].cnts;
229 const struct mlx5_ib_counters *cnts = get_counters(dev, port_num + 1);
231 return cnts->set_id;
234 static struct rdma_hw_stats *do_alloc_stats(const struct mlx5_ib_counters *cnts)
240 num_hw_counters = cnts->num_q_counters + cnts->num_cong_counters +
241 cnts->num_ext_ppcnt_counters;
242 stats = rdma_alloc_hw_stats_struct(cnts->descs,
244 cnts->num_op_counters,
249 for (i = 0; i < cnts->num_op_counters; i++)
259 const struct mlx5_ib_counters *cnts = &dev->port[0].cnts;
261 return do_alloc_stats(cnts);
268 const struct mlx5_ib_counters *cnts = get_counters(dev, port_num);
270 return do_alloc_stats(cnts);
274 const struct mlx5_ib_counters *cnts,
289 for (i = 0; i < cnts->num_q_counters; i++) {
290 val = *(__be32 *)((void *)out + cnts->offsets[i]);
298 const struct mlx5_ib_counters *cnts,
301 int offset = cnts->num_q_counters + cnts->num_cong_counters;
318 for (i = 0; i < cnts->num_ext_ppcnt_counters; i++)
321 cnts->offsets[i + offset]));
329 const struct mlx5_ib_counters *cnts,
356 for (i = 0; i < cnts->num_q_counters; i++) {
357 val = *(__be32 *)((void *)out + cnts->offsets[i]);
369 const struct mlx5_ib_counters *cnts = get_counters(dev, port_num);
376 num_counters = cnts->num_q_counters +
377 cnts->num_cong_counters +
378 cnts->num_ext_ppcnt_counters;
381 ret = mlx5_ib_query_q_counters_vport(dev, port_num - 1, cnts,
384 ret = mlx5_ib_query_q_counters(dev->mdev, cnts, stats,
385 cnts->set_id);
394 ret = mlx5_ib_query_ext_ppcnt_counters(dev, cnts, stats);
412 cnts->num_q_counters,
413 cnts->num_cong_counters,
414 cnts->offsets +
415 cnts->num_q_counters);
431 const struct mlx5_ib_counters *cnts;
437 cnts = get_counters(dev, port_num);
439 opfcs = cnts->opfcs;
440 type = *(u32 *)cnts->descs[index].priv;
462 const struct mlx5_ib_counters *cnts;
465 cnts = get_counters(dev, port_num);
466 num_hw_counters = cnts->num_q_counters + cnts->num_cong_counters +
467 cnts->num_ext_ppcnt_counters;
469 index < (num_hw_counters + cnts->num_op_counters); index++) {
475 return cnts->num_op_counters;
484 const struct mlx5_ib_counters *cnts;
486 cnts = get_counters(dev, port_num);
487 num_hw_counters = cnts->num_q_counters + cnts->num_cong_counters +
488 cnts->num_ext_ppcnt_counters;
489 num_counters = num_hw_counters + cnts->num_op_counters;
513 const struct mlx5_ib_counters *cnts = get_counters(dev, counter->port);
515 return do_alloc_stats(cnts);
521 const struct mlx5_ib_counters *cnts = get_counters(dev, counter->port);
523 return mlx5_ib_query_q_counters(dev->mdev, cnts,
680 struct mlx5_ib_counters *cnts, u32 port_num)
710 cnts->num_q_counters = num_counters;
716 cnts->num_cong_counters = ARRAY_SIZE(cong_cnts);
720 cnts->num_ext_ppcnt_counters = ARRAY_SIZE(ext_ppcnt_cnts);
735 cnts->num_op_counters = num_op_counters;
737 cnts->descs = kcalloc(num_counters,
739 if (!cnts->descs)
742 cnts->offsets = kcalloc(num_counters,
743 sizeof(*cnts->offsets), GFP_KERNEL);
744 if (!cnts->offsets)
750 kfree(cnts->descs);
751 cnts->descs = NULL;
768 if (dev->port[i].cnts.set_id) {
770 dev->port[i].cnts.set_id);
773 kfree(dev->port[i].cnts.descs);
774 kfree(dev->port[i].cnts.offsets);
777 if (!dev->port[i].cnts.opfcs[j].fc)
782 &dev->port[i].cnts.opfcs[j], j);
784 dev->port[i].cnts.opfcs[j].fc);
785 dev->port[i].cnts.opfcs[j].fc = NULL;
812 err = __mlx5_ib_alloc_counters(dev, &dev->port[i].cnts, i);
816 mlx5_ib_fill_counters(dev, dev->port[i].cnts.descs,
817 dev->port[i].cnts.offsets, i);
830 dev->port[i].cnts.set_id =
978 struct mlx5_ib_counters *cnts;
983 cnts = &dev->port[port - 1].cnts;
984 num_hw_counters = cnts->num_q_counters + cnts->num_cong_counters +
985 cnts->num_ext_ppcnt_counters;
987 index >= (num_hw_counters + cnts->num_op_counters))
990 if (!(cnts->descs[index].flags & IB_STAT_FLAG_OPTIONAL))
993 type = *(u32 *)cnts->descs[index].priv;
997 opfc = &cnts->opfcs[type];