Lines Matching refs:mcounters

3184 	struct mlx5_ib_mcounters *mcounters = to_mcounters(counters);  in counters_clear_description()  local
3186 mutex_lock(&mcounters->mcntrs_mutex); in counters_clear_description()
3187 kfree(mcounters->counters_data); in counters_clear_description()
3188 mcounters->counters_data = NULL; in counters_clear_description()
3189 mcounters->cntrs_max_index = 0; in counters_clear_description()
3190 mutex_unlock(&mcounters->mcntrs_mutex); in counters_clear_description()
3385 struct mlx5_ib_mcounters *mcounters = to_mcounters(counters); in counters_set_description() local
3393 mcounters->type = counters_type; in counters_set_description()
3394 mcounters->read_counters = read_flow_counters; in counters_set_description()
3395 mcounters->counters_num = FLOW_COUNTERS_NUM; in counters_set_description()
3396 mcounters->ncounters = ncounters; in counters_set_description()
3406 mutex_lock(&mcounters->mcntrs_mutex); in counters_set_description()
3407 mcounters->counters_data = desc_data; in counters_set_description()
3408 mcounters->cntrs_max_index = cntrs_max_index; in counters_set_description()
3409 mutex_unlock(&mcounters->mcntrs_mutex); in counters_set_description()
3418 struct mlx5_ib_mcounters *mcounters = to_mcounters(ibcounters); in flow_counters_set_data() local
3443 if (!mcounters->hw_cntrs_hndl) { in flow_counters_set_data()
3444 mcounters->hw_cntrs_hndl = mlx5_fc_create( in flow_counters_set_data()
3446 if (IS_ERR(mcounters->hw_cntrs_hndl)) { in flow_counters_set_data()
3447 ret = PTR_ERR(mcounters->hw_cntrs_hndl); in flow_counters_set_data()
3455 if (mcounters->cntrs_max_index) { in flow_counters_set_data()
3467 } else if (!mcounters->cntrs_max_index) { in flow_counters_set_data()
3478 mcounters->hw_cntrs_hndl); in flow_counters_set_data()
3479 mcounters->hw_cntrs_hndl = NULL; in flow_counters_set_data()
3591 struct mlx5_ib_mcounters *mcounters; in _create_flow_rule() local
3597 mcounters = to_mcounters(flow_act.counters); in _create_flow_rule()
3602 mlx5_fc_id(mcounters->hw_cntrs_hndl); in _create_flow_rule()
6079 struct mlx5_ib_mcounters *mcounters = to_mcounters(counters); in mlx5_ib_read_counters() local
6084 mutex_lock(&mcounters->mcntrs_mutex); in mlx5_ib_read_counters()
6085 if (mcounters->cntrs_max_index > read_attr->ncounters) { in mlx5_ib_read_counters()
6090 mread_attr.out = kcalloc(mcounters->counters_num, sizeof(u64), in mlx5_ib_read_counters()
6097 mread_attr.hw_cntrs_hndl = mcounters->hw_cntrs_hndl; in mlx5_ib_read_counters()
6099 ret = mcounters->read_counters(counters->device, &mread_attr); in mlx5_ib_read_counters()
6106 desc = mcounters->counters_data; in mlx5_ib_read_counters()
6107 for (i = 0; i < mcounters->ncounters; i++) in mlx5_ib_read_counters()
6113 mutex_unlock(&mcounters->mcntrs_mutex); in mlx5_ib_read_counters()
6119 struct mlx5_ib_mcounters *mcounters = to_mcounters(counters); in mlx5_ib_destroy_counters() local
6122 if (mcounters->hw_cntrs_hndl) in mlx5_ib_destroy_counters()
6124 mcounters->hw_cntrs_hndl); in mlx5_ib_destroy_counters()
6126 kfree(mcounters); in mlx5_ib_destroy_counters()
6134 struct mlx5_ib_mcounters *mcounters; in mlx5_ib_create_counters() local
6136 mcounters = kzalloc(sizeof(*mcounters), GFP_KERNEL); in mlx5_ib_create_counters()
6137 if (!mcounters) in mlx5_ib_create_counters()
6140 mutex_init(&mcounters->mcntrs_mutex); in mlx5_ib_create_counters()
6142 return &mcounters->ibcntrs; in mlx5_ib_create_counters()