Lines Matching refs:cnts

216 		return &dev->port[0].cnts;  in get_counters()
219 &dev->port[1].cnts : &dev->port[port_num - 1].cnts; in get_counters()
233 const struct mlx5_ib_counters *cnts = get_counters(dev, port_num + 1); in mlx5_ib_get_counters_id() local
235 return cnts->set_id; in mlx5_ib_get_counters_id()
238 static struct rdma_hw_stats *do_alloc_stats(const struct mlx5_ib_counters *cnts) in do_alloc_stats() argument
244 num_hw_counters = cnts->num_q_counters + cnts->num_cong_counters + in do_alloc_stats()
245 cnts->num_ext_ppcnt_counters; in do_alloc_stats()
246 stats = rdma_alloc_hw_stats_struct(cnts->descs, in do_alloc_stats()
248 cnts->num_op_counters, in do_alloc_stats()
253 for (i = 0; i < cnts->num_op_counters; i++) in do_alloc_stats()
263 const struct mlx5_ib_counters *cnts = &dev->port[0].cnts; in mlx5_ib_alloc_hw_device_stats() local
265 return do_alloc_stats(cnts); in mlx5_ib_alloc_hw_device_stats()
272 const struct mlx5_ib_counters *cnts = get_counters(dev, port_num); in mlx5_ib_alloc_hw_port_stats() local
274 return do_alloc_stats(cnts); in mlx5_ib_alloc_hw_port_stats()
278 const struct mlx5_ib_counters *cnts, in mlx5_ib_query_q_counters() argument
293 for (i = 0; i < cnts->num_q_counters; i++) { in mlx5_ib_query_q_counters()
294 val = *(__be32 *)((void *)out + cnts->offsets[i]); in mlx5_ib_query_q_counters()
302 const struct mlx5_ib_counters *cnts, in mlx5_ib_query_ext_ppcnt_counters() argument
305 int offset = cnts->num_q_counters + cnts->num_cong_counters; in mlx5_ib_query_ext_ppcnt_counters()
322 for (i = 0; i < cnts->num_ext_ppcnt_counters; i++) in mlx5_ib_query_ext_ppcnt_counters()
325 cnts->offsets[i + offset])); in mlx5_ib_query_ext_ppcnt_counters()
333 const struct mlx5_ib_counters *cnts, in mlx5_ib_query_q_counters_vport() argument
360 for (i = 0; i < cnts->num_q_counters; i++) { in mlx5_ib_query_q_counters_vport()
361 val = *(__be32 *)((void *)out + cnts->offsets[i]); in mlx5_ib_query_q_counters_vport()
373 const struct mlx5_ib_counters *cnts = get_counters(dev, port_num); in do_get_hw_stats() local
380 num_counters = cnts->num_q_counters + in do_get_hw_stats()
381 cnts->num_cong_counters + in do_get_hw_stats()
382 cnts->num_ext_ppcnt_counters; in do_get_hw_stats()
385 ret = mlx5_ib_query_q_counters_vport(dev, port_num - 1, cnts, in do_get_hw_stats()
388 ret = mlx5_ib_query_q_counters(dev->mdev, cnts, stats, in do_get_hw_stats()
389 cnts->set_id); in do_get_hw_stats()
398 ret = mlx5_ib_query_ext_ppcnt_counters(dev, cnts, stats); in do_get_hw_stats()
416 cnts->num_q_counters, in do_get_hw_stats()
417 cnts->num_cong_counters, in do_get_hw_stats()
418 cnts->offsets + in do_get_hw_stats()
419 cnts->num_q_counters); in do_get_hw_stats()
435 const struct mlx5_ib_counters *cnts; in do_get_op_stat() local
441 cnts = get_counters(dev, port_num); in do_get_op_stat()
443 opfcs = cnts->opfcs; in do_get_op_stat()
444 type = *(u32 *)cnts->descs[index].priv; in do_get_op_stat()
466 const struct mlx5_ib_counters *cnts; in do_get_op_stats() local
469 cnts = get_counters(dev, port_num); in do_get_op_stats()
470 num_hw_counters = cnts->num_q_counters + cnts->num_cong_counters + in do_get_op_stats()
471 cnts->num_ext_ppcnt_counters; in do_get_op_stats()
473 index < (num_hw_counters + cnts->num_op_counters); index++) { in do_get_op_stats()
479 return cnts->num_op_counters; in do_get_op_stats()
488 const struct mlx5_ib_counters *cnts; in mlx5_ib_get_hw_stats() local
490 cnts = get_counters(dev, port_num); in mlx5_ib_get_hw_stats()
491 num_hw_counters = cnts->num_q_counters + cnts->num_cong_counters + in mlx5_ib_get_hw_stats()
492 cnts->num_ext_ppcnt_counters; in mlx5_ib_get_hw_stats()
493 num_counters = num_hw_counters + cnts->num_op_counters; in mlx5_ib_get_hw_stats()
517 const struct mlx5_ib_counters *cnts = get_counters(dev, counter->port); in mlx5_ib_counter_alloc_stats() local
519 return do_alloc_stats(cnts); in mlx5_ib_counter_alloc_stats()
525 const struct mlx5_ib_counters *cnts = get_counters(dev, counter->port); in mlx5_ib_counter_update_stats() local
527 return mlx5_ib_query_q_counters(dev->mdev, cnts, in mlx5_ib_counter_update_stats()
684 struct mlx5_ib_counters *cnts, u32 port_num) in __mlx5_ib_alloc_counters() argument
714 cnts->num_q_counters = num_counters; in __mlx5_ib_alloc_counters()
720 cnts->num_cong_counters = ARRAY_SIZE(cong_cnts); in __mlx5_ib_alloc_counters()
724 cnts->num_ext_ppcnt_counters = ARRAY_SIZE(ext_ppcnt_cnts); in __mlx5_ib_alloc_counters()
739 cnts->num_op_counters = num_op_counters; in __mlx5_ib_alloc_counters()
741 cnts->descs = kcalloc(num_counters, in __mlx5_ib_alloc_counters()
743 if (!cnts->descs) in __mlx5_ib_alloc_counters()
746 cnts->offsets = kcalloc(num_counters, in __mlx5_ib_alloc_counters()
747 sizeof(*cnts->offsets), GFP_KERNEL); in __mlx5_ib_alloc_counters()
748 if (!cnts->offsets) in __mlx5_ib_alloc_counters()
754 kfree(cnts->descs); in __mlx5_ib_alloc_counters()
755 cnts->descs = NULL; in __mlx5_ib_alloc_counters()
772 if (dev->port[i].cnts.set_id) { in mlx5_ib_dealloc_counters()
774 dev->port[i].cnts.set_id); in mlx5_ib_dealloc_counters()
777 kfree(dev->port[i].cnts.descs); in mlx5_ib_dealloc_counters()
778 kfree(dev->port[i].cnts.offsets); in mlx5_ib_dealloc_counters()
781 if (!dev->port[i].cnts.opfcs[j].fc) in mlx5_ib_dealloc_counters()
786 &dev->port[i].cnts.opfcs[j], j); in mlx5_ib_dealloc_counters()
788 dev->port[i].cnts.opfcs[j].fc); in mlx5_ib_dealloc_counters()
789 dev->port[i].cnts.opfcs[j].fc = NULL; in mlx5_ib_dealloc_counters()
816 err = __mlx5_ib_alloc_counters(dev, &dev->port[i].cnts, i); in mlx5_ib_alloc_counters()
820 mlx5_ib_fill_counters(dev, dev->port[i].cnts.descs, in mlx5_ib_alloc_counters()
821 dev->port[i].cnts.offsets, i); in mlx5_ib_alloc_counters()
834 dev->port[i].cnts.set_id = in mlx5_ib_alloc_counters()
982 struct mlx5_ib_counters *cnts; in mlx5_ib_modify_stat() local
987 cnts = &dev->port[port - 1].cnts; in mlx5_ib_modify_stat()
988 num_hw_counters = cnts->num_q_counters + cnts->num_cong_counters + in mlx5_ib_modify_stat()
989 cnts->num_ext_ppcnt_counters; in mlx5_ib_modify_stat()
991 index >= (num_hw_counters + cnts->num_op_counters)) in mlx5_ib_modify_stat()
994 if (!(cnts->descs[index].flags & IB_STAT_FLAG_OPTIONAL)) in mlx5_ib_modify_stat()
997 type = *(u32 *)cnts->descs[index].priv; in mlx5_ib_modify_stat()
1001 opfc = &cnts->opfcs[type]; in mlx5_ib_modify_stat()