static int mlx5_cmd_stub_create_flow_table(struct mlx5_flow_root_namespace *ns,
                                           struct mlx5_flow_table *ft,
-                                          unsigned int size,
+                                          struct mlx5_flow_table_attr *ft_attr,
                                           struct mlx5_flow_table *next_ft)
 {
-       ft->max_fte = size ? roundup_pow_of_two(size) : 1;
+       int max_fte = ft_attr->max_fte;
+
+       ft->max_fte = max_fte ? roundup_pow_of_two(max_fte) : 1;
 
        return 0;
 }
 
 static int mlx5_cmd_create_flow_table(struct mlx5_flow_root_namespace *ns,
                                      struct mlx5_flow_table *ft,
-                                     unsigned int size,
+                                     struct mlx5_flow_table_attr *ft_attr,
                                      struct mlx5_flow_table *next_ft)
 {
        int en_encap = !!(ft->flags & MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT);
        u32 out[MLX5_ST_SZ_DW(create_flow_table_out)] = {};
        u32 in[MLX5_ST_SZ_DW(create_flow_table_in)] = {};
        struct mlx5_core_dev *dev = ns->dev;
+       unsigned int size;
        int err;
 
-       if (size != POOL_NEXT_SIZE)
-               size = roundup_pow_of_two(size);
-       size = mlx5_ft_pool_get_avail_sz(dev, ft->type, size);
+       if (ft_attr->max_fte != POOL_NEXT_SIZE)
+               size = roundup_pow_of_two(ft_attr->max_fte);
+       size = mlx5_ft_pool_get_avail_sz(dev, ft->type, ft_attr->max_fte);
        if (!size)
                return -ENOSPC;
 
        MLX5_SET(create_flow_table_in, in, opcode,
                 MLX5_CMD_OP_CREATE_FLOW_TABLE);
 
+       MLX5_SET(create_flow_table_in, in, uid, ft_attr->uid);
        MLX5_SET(create_flow_table_in, in, table_type, ft->type);
        MLX5_SET(create_flow_table_in, in, flow_table_context.level, ft->level);
        MLX5_SET(create_flow_table_in, in, flow_table_context.log_size, size ? ilog2(size) : 0);
 
 struct mlx5_flow_cmds {
        int (*create_flow_table)(struct mlx5_flow_root_namespace *ns,
                                 struct mlx5_flow_table *ft,
-                                unsigned int size,
+                                struct mlx5_flow_table_attr *ft_attr,
                                 struct mlx5_flow_table *next_ft);
        int (*destroy_flow_table)(struct mlx5_flow_root_namespace *ns,
                                  struct mlx5_flow_table *ft);
 
                              find_next_chained_ft(fs_prio);
        ft->def_miss_action = ns->def_miss_action;
        ft->ns = ns;
-       err = root->cmds->create_flow_table(root, ft, ft_attr->max_fte, next_ft);
+       err = root->cmds->create_flow_table(root, ft, ft_attr, next_ft);
        if (err)
                goto free_ft;
 
 
 
        MLX5_SET(create_flow_table_in, in, opcode, MLX5_CMD_OP_CREATE_FLOW_TABLE);
        MLX5_SET(create_flow_table_in, in, table_type, attr->table_type);
+       MLX5_SET(create_flow_table_in, in, uid, attr->uid);
 
        ft_mdev = MLX5_ADDR_OF(create_flow_table_in, in, flow_table_context);
        MLX5_SET(flow_table_context, ft_mdev, termination_table, attr->term_tbl);
 
                                             tbl->table_type);
 }
 
-static int dr_table_create_sw_owned_tbl(struct mlx5dr_table *tbl)
+static int dr_table_create_sw_owned_tbl(struct mlx5dr_table *tbl, u16 uid)
 {
        bool en_encap = !!(tbl->flags & MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT);
        bool en_decap = !!(tbl->flags & MLX5_FLOW_TABLE_TUNNEL_EN_DECAP);
        ft_attr.sw_owner = true;
        ft_attr.decap_en = en_decap;
        ft_attr.reformat_en = en_encap;
+       ft_attr.uid = uid;
 
        ret = mlx5dr_cmd_create_flow_table(tbl->dmn->mdev, &ft_attr,
                                           NULL, &tbl->table_id);
        return ret;
 }
 
-struct mlx5dr_table *mlx5dr_table_create(struct mlx5dr_domain *dmn, u32 level, u32 flags)
+struct mlx5dr_table *mlx5dr_table_create(struct mlx5dr_domain *dmn, u32 level,
+                                        u32 flags, u16 uid)
 {
        struct mlx5dr_table *tbl;
        int ret;
        if (ret)
                goto free_tbl;
 
-       ret = dr_table_create_sw_owned_tbl(tbl);
+       ret = dr_table_create_sw_owned_tbl(tbl, uid);
        if (ret)
                goto uninit_tbl;
 
 
 
 struct mlx5dr_cmd_create_flow_table_attr {
        u32 table_type;
+       u16 uid;
        u64 icm_addr_rx;
        u64 icm_addr_tx;
        u8 level;
 
 
 static int mlx5_cmd_dr_create_flow_table(struct mlx5_flow_root_namespace *ns,
                                         struct mlx5_flow_table *ft,
-                                        unsigned int size,
+                                        struct mlx5_flow_table_attr *ft_attr,
                                         struct mlx5_flow_table *next_ft)
 {
        struct mlx5dr_table *tbl;
 
        if (mlx5_dr_is_fw_table(ft->flags))
                return mlx5_fs_cmd_get_fw_cmds()->create_flow_table(ns, ft,
-                                                                   size,
+                                                                   ft_attr,
                                                                    next_ft);
        flags = ft->flags;
        /* turn off encap/decap if not supported for sw-str by fw */
                flags = ft->flags & ~(MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT |
                                      MLX5_FLOW_TABLE_TUNNEL_EN_DECAP);
 
-       tbl = mlx5dr_table_create(ns->fs_dr_domain.dr_domain, ft->level, flags);
+       tbl = mlx5dr_table_create(ns->fs_dr_domain.dr_domain, ft->level, flags,
+                                 ft_attr->uid);
        if (!tbl) {
                mlx5_core_err(ns->dev, "Failed creating dr flow_table\n");
                return -EINVAL;
 
                            struct mlx5dr_domain *peer_dmn);
 
 struct mlx5dr_table *
-mlx5dr_table_create(struct mlx5dr_domain *domain, u32 level, u32 flags);
+mlx5dr_table_create(struct mlx5dr_domain *domain, u32 level, u32 flags,
+                   u16 uid);
 
 struct mlx5dr_table *
 mlx5dr_table_get_from_fs_ft(struct mlx5_flow_table *ft);
 
        int max_fte;
        u32 level;
        u32 flags;
+       u16 uid;
        struct mlx5_flow_table *next_ft;
 
        struct {