Lines Matching refs:mcounters
147 struct mlx5_ib_mcounters *mcounters = to_mcounters(counters); in mlx5_ib_read_counters() local
152 mutex_lock(&mcounters->mcntrs_mutex); in mlx5_ib_read_counters()
153 if (mcounters->cntrs_max_index > read_attr->ncounters) { in mlx5_ib_read_counters()
158 mread_attr.out = kcalloc(mcounters->counters_num, sizeof(u64), in mlx5_ib_read_counters()
165 mread_attr.hw_cntrs_hndl = mcounters->hw_cntrs_hndl; in mlx5_ib_read_counters()
167 ret = mcounters->read_counters(counters->device, &mread_attr); in mlx5_ib_read_counters()
174 desc = mcounters->counters_data; in mlx5_ib_read_counters()
175 for (i = 0; i < mcounters->ncounters; i++) in mlx5_ib_read_counters()
181 mutex_unlock(&mcounters->mcntrs_mutex); in mlx5_ib_read_counters()
187 struct mlx5_ib_mcounters *mcounters = to_mcounters(counters); in mlx5_ib_destroy_counters() local
190 if (mcounters->hw_cntrs_hndl) in mlx5_ib_destroy_counters()
192 mcounters->hw_cntrs_hndl); in mlx5_ib_destroy_counters()
199 struct mlx5_ib_mcounters *mcounters = to_mcounters(counters); in mlx5_ib_create_counters() local
201 mutex_init(&mcounters->mcntrs_mutex); in mlx5_ib_create_counters()
861 struct mlx5_ib_mcounters *mcounters = to_mcounters(counters); in counters_set_description() local
869 mcounters->type = counters_type; in counters_set_description()
870 mcounters->read_counters = read_flow_counters; in counters_set_description()
871 mcounters->counters_num = FLOW_COUNTERS_NUM; in counters_set_description()
872 mcounters->ncounters = ncounters; in counters_set_description()
882 mutex_lock(&mcounters->mcntrs_mutex); in counters_set_description()
883 mcounters->counters_data = desc_data; in counters_set_description()
884 mcounters->cntrs_max_index = cntrs_max_index; in counters_set_description()
885 mutex_unlock(&mcounters->mcntrs_mutex); in counters_set_description()
894 struct mlx5_ib_mcounters *mcounters = to_mcounters(ibcounters); in mlx5_ib_flow_counters_set_data() local
919 if (!mcounters->hw_cntrs_hndl) { in mlx5_ib_flow_counters_set_data()
920 mcounters->hw_cntrs_hndl = mlx5_fc_create( in mlx5_ib_flow_counters_set_data()
922 if (IS_ERR(mcounters->hw_cntrs_hndl)) { in mlx5_ib_flow_counters_set_data()
923 ret = PTR_ERR(mcounters->hw_cntrs_hndl); in mlx5_ib_flow_counters_set_data()
931 if (mcounters->cntrs_max_index) { in mlx5_ib_flow_counters_set_data()
943 } else if (!mcounters->cntrs_max_index) { in mlx5_ib_flow_counters_set_data()
954 mcounters->hw_cntrs_hndl); in mlx5_ib_flow_counters_set_data()
955 mcounters->hw_cntrs_hndl = NULL; in mlx5_ib_flow_counters_set_data()
964 struct mlx5_ib_mcounters *mcounters; in mlx5_ib_counters_clear_description() local
969 mcounters = to_mcounters(counters); in mlx5_ib_counters_clear_description()
971 mutex_lock(&mcounters->mcntrs_mutex); in mlx5_ib_counters_clear_description()
972 kfree(mcounters->counters_data); in mlx5_ib_counters_clear_description()
973 mcounters->counters_data = NULL; in mlx5_ib_counters_clear_description()
974 mcounters->cntrs_max_index = 0; in mlx5_ib_counters_clear_description()
975 mutex_unlock(&mcounters->mcntrs_mutex); in mlx5_ib_counters_clear_description()