This action allows to go to a flow table based on the table id.
Goto flow table id is required for supporting user space SW.
Signed-off-by: Alex Vesker <valex@mellanox.com>
Reviewed-by: Erez Shitrit <erezsh@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
        return dr_action_create_generic(DR_ACTION_TYP_DROP);
 }
 
+struct mlx5dr_action *
+mlx5dr_action_create_dest_table_num(struct mlx5dr_domain *dmn, u32 table_num)
+{
+       struct mlx5dr_action *action;
+
+       action = dr_action_create_generic(DR_ACTION_TYP_FT);
+       if (!action)
+               return NULL;
+
+       action->dest_tbl.is_fw_tbl = true;
+       action->dest_tbl.fw_tbl.dmn = dmn;
+       action->dest_tbl.fw_tbl.id = table_num;
+       action->dest_tbl.fw_tbl.type = FS_FT_FDB;
+       refcount_inc(&dmn->refcount);
+
+       return action;
+}
+
 struct mlx5dr_action *
 mlx5dr_action_create_dest_table(struct mlx5dr_table *tbl)
 {
 
        if (fte->action.action & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST) {
                list_for_each_entry(dst, &fte->node.children, node.list) {
                        enum mlx5_flow_destination_type type = dst->dest_attr.type;
+                       u32 ft_id;
 
                        if (num_actions == MLX5_FLOW_CONTEXT_ACTION_MAX ||
                            num_term_actions >= MLX5_FLOW_CONTEXT_ACTION_MAX) {
 
                                num_term_actions++;
                                break;
+                       case MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE_NUM:
+                               ft_id = dst->dest_attr.ft_num;
+                               tmp_action = mlx5dr_action_create_dest_table_num(domain,
+                                                                                ft_id);
+                               if (!tmp_action) {
+                                       err = -ENOMEM;
+                                       goto free_actions;
+                               }
+                               fs_dr_actions[fs_dr_num_actions++] = tmp_action;
+                               term_actions[num_term_actions++].dest = tmp_action;
+                               break;
                        default:
                                err = -EOPNOTSUPP;
                                goto free_actions;
 
 int mlx5dr_table_set_miss_action(struct mlx5dr_table *tbl,
                                 struct mlx5dr_action *action);
 
+struct mlx5dr_action *
+mlx5dr_action_create_dest_table_num(struct mlx5dr_domain *dmn, u32 table_num);
+
 struct mlx5dr_action *
 mlx5dr_action_create_dest_table(struct mlx5dr_table *table);