Lines Matching defs:fg

194 static void fs_del_fg(struct mlx5_flow_group *fg);
318 struct mlx5_flow_group *fg,
326 if (fg->num_ftes == fg->max_ftes)
341 fte->base.parent = &fg->base;
347 list_add_tail(&fte->base.list, &fg->ftes);
348 fg->num_ftes++;
360 struct mlx5_flow_group *fg;
363 fs_get_parent(fg, fte);
372 fg->num_ftes--;
378 struct mlx5_flow_group *fg;
384 fg = kzalloc(sizeof(*fg), GFP_KERNEL);
385 if (!fg)
388 INIT_LIST_HEAD(&fg->ftes);
389 fg->mask.match_criteria_enable = match_criteria_enable;
390 memcpy(&fg->mask.match_criteria, match_criteria,
391 sizeof(fg->mask.match_criteria));
392 fg->base.type = FS_TYPE_FLOW_GROUP;
393 fg->start_index = MLX5_GET(create_flow_group_in, create_fg_in,
395 fg->max_ftes = MLX5_GET(create_flow_group_in, create_fg_in,
396 end_flow_index) - fg->start_index + 1;
397 return fg;
433 src_ft->star_rule.fg->id,
502 struct mlx5_flow_group *fg;
527 fg = fs_alloc_fg(fg_in);
528 if (IS_ERR(fg)) {
529 err = PTR_ERR(fg);
532 ft->star_rule.fg = fg;
536 &fg->id);
540 ft->star_rule.fte = alloc_star_ft_entry(ft, fg,
586 fg->id);
588 kfree(fg);
637 ft->star_rule.fg->id);
640 "flow steering can't destroy star entry group(index:%d) of ft:%s\n", ft->star_rule.fg->start_index,
644 kfree(ft->star_rule.fg);
645 ft->star_rule.fg = NULL;
1051 struct mlx5_flow_group *fg;
1056 fg = fs_alloc_fg(fg_in);
1057 if (IS_ERR(fg))
1058 return fg;
1060 end_index = fg->start_index + fg->max_ftes - 1;
1063 &fg->id);
1071 snprintf(name, sizeof(name), "group_%u", fg->id);
1073 fs_add_node(&fg->base, &ft->base, name, refcount);
1075 list_add(&fg->base.list, prev);
1078 return fg;
1081 kfree(fg);
1088 struct mlx5_flow_group *fg;
1097 fg = fs_create_fg(dev, ft, ft->fgs.prev, in, 1);
1099 return fg;
1104 static void fs_del_fg(struct mlx5_flow_group *fg)
1109 fs_get_parent(parent_ft, fg);
1118 parent_ft->id, fg->id))
1119 mlx5_core_warn(dev, "flow steering can't destroy fg\n");
1122 void mlx5_destroy_flow_group(struct mlx5_flow_group *fg)
1124 fs_remove_node(&fg->base);
1556 struct mlx5_flow_group *fg,
1571 fs_get_parent(ft, fg);
1579 ft->id, fte->index, fg->id, fte->flow_tag,
1617 /* assumed fg is locked */
1618 static unsigned int fs_get_free_fg_index(struct mlx5_flow_group *fg,
1622 unsigned int start = fg->start_index;
1625 *prev = &fg->ftes;
1628 fs_for_each_fte(fte, fg) {
1640 static struct fs_fte *fs_create_fte(struct mlx5_flow_group *fg,
1649 index = fs_get_free_fg_index(fg, prev);
1673 struct mlx5_flow_group *fg;
1689 fs_get_parent(fg, fte);
1690 mutex_lock(&fg->base.lock);
1692 /* ft can't be changed as fg is locked */
1693 fs_get_parent(ft, fg);
1699 ft->id, fte->index, fg->id,
1710 mutex_unlock(&fg->base.lock);
1717 struct mlx5_flow_group *fg;
1721 fs_get_parent(fg, fte);
1722 fs_get_parent(ft, fg);
1733 fg->num_ftes--;
1736 /* assuming parent fg is locked */
1738 static struct mlx5_flow_rule *fs_add_dst_fg(struct mlx5_flow_group *fg,
1750 mutex_lock(&fg->base.lock);
1751 fs_for_each_fte(fte, fg) {
1754 if (fs_match_exact_val(&fg->mask, match_value, &fte->val) &&
1756 dst = _fs_add_dst_fte(fte, fg, dest);
1765 fs_get_parent(ft, fg);
1766 if (fg->num_ftes == fg->max_ftes) {
1771 fte = fs_create_fte(fg, match_value, action, flow_tag, &prev);
1776 dst = _fs_add_dst_fte(fte, fg, dest);
1782 fg->num_ftes++;
1786 fs_add_node(&fte->base, &fg->base, fte_name, 0);
1791 mutex_unlock(&fg->base.lock);
2287 struct mlx5_flow_group *fg;
2294 fs_get_obj(fg, pbase);
2295 return fg->mask.match_criteria_enable;
2315 struct mlx5_flow_group *fg;
2322 fs_get_obj(fg, pbase);
2323 memcpy(match_criteria, &fg->mask.match_criteria,
2324 sizeof(fg->mask.match_criteria));