net/mlx5: Honor user input for migratable port fn attr
authorShay Drory <shayd@nvidia.com>
Mon, 3 Jul 2023 14:34:44 +0000 (17:34 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Wed, 26 Jul 2023 21:31:03 +0000 (14:31 -0700)
Currently, whenever a user is setting migratable port fn attr, the
driver is always turn migratable capability on.
Fix it by honor the user input

Fixes: e5b9642a33be ("net/mlx5: E-Switch, Implement devlink port function cmds to control migratable")
Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c

index bdfe609cc9ec4a4924901ef4c687ad9384a21e02..93b2b94d41cdd33a72aa1816bb6c2cfa4e67527d 100644 (file)
@@ -4196,7 +4196,7 @@ int mlx5_devlink_port_fn_migratable_set(struct devlink_port *port, bool enable,
        }
 
        hca_caps = MLX5_ADDR_OF(query_hca_cap_out, query_ctx, capability);
-       MLX5_SET(cmd_hca_cap_2, hca_caps, migratable, 1);
+       MLX5_SET(cmd_hca_cap_2, hca_caps, migratable, enable);
 
        err = mlx5_vport_set_other_func_cap(esw->dev, hca_caps, vport->vport,
                                            MLX5_SET_HCA_CAP_OP_MOD_GENERAL_DEVICE2);