Function prefix was changed to be similar to other action APIs.
In order to support other FW tables the mlx5_flow_table struct was
replaced with table id and type.
Signed-off-by: Alex Vesker <valex@mellanox.com>
Reviewed-by: Erez Shitrit <erezsh@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
 
                                /* get the relevant addresses */
                                if (!action->dest_tbl.fw_tbl.rx_icm_addr) {
-                                       ret = mlx5dr_cmd_query_flow_table(action->dest_tbl.fw_tbl.mdev,
-                                                                         action->dest_tbl.fw_tbl.ft->type,
-                                                                         action->dest_tbl.fw_tbl.ft->id,
+                                       ret = mlx5dr_cmd_query_flow_table(dmn->mdev,
+                                                                         action->dest_tbl.fw_tbl.type,
+                                                                         action->dest_tbl.fw_tbl.id,
                                                                          &output);
                                        if (!ret) {
                                                action->dest_tbl.fw_tbl.tx_icm_addr =
 }
 
 struct mlx5dr_action *
-mlx5dr_create_action_dest_flow_fw_table(struct mlx5_flow_table *ft,
-                                       struct mlx5_core_dev *mdev)
+mlx5dr_action_create_dest_flow_fw_table(struct mlx5dr_domain *dmn,
+                                       struct mlx5_flow_table *ft)
 {
        struct mlx5dr_action *action;
 
                return NULL;
 
        action->dest_tbl.is_fw_tbl = 1;
-       action->dest_tbl.fw_tbl.ft = ft;
-       action->dest_tbl.fw_tbl.mdev = mdev;
+       action->dest_tbl.fw_tbl.type = ft->type;
+       action->dest_tbl.fw_tbl.id = ft->id;
+       action->dest_tbl.fw_tbl.dmn = dmn;
+
+       refcount_inc(&dmn->refcount);
 
        return action;
 }
 
        switch (action->action_type) {
        case DR_ACTION_TYP_FT:
-               if (!action->dest_tbl.is_fw_tbl)
+               if (action->dest_tbl.is_fw_tbl)
+                       refcount_dec(&action->dest_tbl.fw_tbl.dmn->refcount);
+               else
                        refcount_dec(&action->dest_tbl.tbl->refcount);
                break;
        case DR_ACTION_TYP_TNL_L2_TO_L2:
 
                        union {
                                struct mlx5dr_table *tbl;
                                struct {
-                                       struct mlx5_flow_table *ft;
+                                       struct mlx5dr_domain *dmn;
+                                       u32 id;
+                                       enum fs_flow_table_type type;
                                        u64 rx_icm_addr;
                                        u64 tx_icm_addr;
-                                       struct mlx5_core_dev *mdev;
                                } fw_tbl;
                        };
                } dest_tbl;
 
                                               dest_attr->vport.vhca_id);
 }
 
-static struct mlx5dr_action *create_ft_action(struct mlx5_core_dev *dev,
+static struct mlx5dr_action *create_ft_action(struct mlx5dr_domain *domain,
                                              struct mlx5_flow_rule *dst)
 {
        struct mlx5_flow_table *dest_ft = dst->dest_attr.ft;
 
        if (mlx5_dr_is_fw_table(dest_ft->flags))
-               return mlx5dr_create_action_dest_flow_fw_table(dest_ft, dev);
+               return mlx5dr_action_create_dest_flow_fw_table(domain, dest_ft);
        return mlx5dr_action_create_dest_table(dest_ft->fs_dr_table.dr_table);
 }
 
                                actions[num_actions++] = tmp_action;
                                break;
                        case MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE:
-                               tmp_action = create_ft_action(dev, dst);
+                               tmp_action = create_ft_action(domain, dst);
                                if (!tmp_action) {
                                        err = -ENOMEM;
                                        goto free_actions;
 
 mlx5dr_action_create_dest_table(struct mlx5dr_table *table);
 
 struct mlx5dr_action *
-mlx5dr_create_action_dest_flow_fw_table(struct mlx5_flow_table *ft,
-                                       struct mlx5_core_dev *mdev);
+mlx5dr_action_create_dest_flow_fw_table(struct mlx5dr_domain *domain,
+                                       struct mlx5_flow_table *ft);
 
 struct mlx5dr_action *
 mlx5dr_action_create_dest_vport(struct mlx5dr_domain *domain,
 mlx5dr_action_create_dest_table(struct mlx5dr_table *table) { return NULL; }
 
 static inline struct mlx5dr_action *
-mlx5dr_create_action_dest_flow_fw_table(struct mlx5_flow_table *ft,
-                                       struct mlx5_core_dev *mdev) { return NULL; }
+mlx5dr_action_create_dest_flow_fw_table(struct mlx5dr_domain *domain,
+                                       struct mlx5_flow_table *ft) { return NULL; }
 
 static inline struct mlx5dr_action *
 mlx5dr_action_create_dest_vport(struct mlx5dr_domain *domain,