Lines Matching defs:sampler

44 	struct mlx5e_sampler *sampler;
116 sampler_obj_create(struct mlx5_core_dev *mdev, struct mlx5e_sampler *sampler)
134 MLX5_SET(sampler_obj, obj, sample_ratio, sampler->sample_ratio);
135 MLX5_SET(sampler_obj, obj, sample_table_id, sampler->sample_table_id);
136 MLX5_SET(sampler_obj, obj, default_table_id, sampler->default_table_id);
142 sampler->sampler_id = MLX5_GET(general_obj_out_cmd_hdr, out, obj_id);
175 struct mlx5e_sampler *sampler;
181 hash_for_each_possible(tc_psample->hashtbl, sampler, hlist, hash_key)
182 if (!sampler_cmp(sampler->sample_ratio, sampler->default_table_id,
186 sampler = kzalloc(sizeof(*sampler), GFP_KERNEL);
187 if (!sampler) {
192 sampler->sample_table_id = tc_psample->termtbl->id;
193 sampler->default_table_id = default_table_id;
194 sampler->sample_ratio = sample_ratio;
196 err = sampler_obj_create(tc_psample->esw->dev, sampler);
200 hash_add(tc_psample->hashtbl, &sampler->hlist, hash_key);
203 sampler->count++;
205 return sampler;
208 kfree(sampler);
215 sampler_put(struct mlx5e_tc_psample *tc_psample, struct mlx5e_sampler *sampler)
218 if (--sampler->count == 0) {
219 hash_del(&sampler->hlist);
220 sampler_obj_destroy(tc_psample->esw->dev, sampler->sampler_id);
221 kfree(sampler);
354 * only one default table for the same sampler object. Rules with different
511 /* Create sampler object. */
512 sample_flow->sampler = sampler_get(tc_psample, sample_attr->rate, default_tbl_id);
513 if (IS_ERR(sample_flow->sampler)) {
514 err = PTR_ERR(sample_flow->sampler);
517 sample_attr->sampler_id = sample_flow->sampler->sampler_id;
539 * sample action. The destination is the sampler object.
579 sampler_put(tc_psample, sample_flow->sampler);
608 sampler_put(tc_psample, sample_flow->sampler);