mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-06 04:19:23 -04:00
net/mlx5: Query to see if host PF is disabled
The host PF can be disabled, query firmware to check if the host PF of this function exists. Signed-off-by: Daniel Jurgens <danielj@nvidia.com> Reviewed-by: William Tu <witu@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/1755112796-467444-2-git-send-email-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
d0f110773d
commit
9e84de72ae
@@ -1038,6 +1038,25 @@ const u32 *mlx5_esw_query_functions(struct mlx5_core_dev *dev)
|
||||
return ERR_PTR(err);
|
||||
}
|
||||
|
||||
static int mlx5_esw_host_functions_enabled_query(struct mlx5_eswitch *esw)
|
||||
{
|
||||
const u32 *query_host_out;
|
||||
|
||||
if (!mlx5_core_is_ecpf_esw_manager(esw->dev))
|
||||
return 0;
|
||||
|
||||
query_host_out = mlx5_esw_query_functions(esw->dev);
|
||||
if (IS_ERR(query_host_out))
|
||||
return PTR_ERR(query_host_out);
|
||||
|
||||
esw->esw_funcs.host_funcs_disabled =
|
||||
MLX5_GET(query_esw_functions_out, query_host_out,
|
||||
host_params_context.host_pf_not_exist);
|
||||
|
||||
kvfree(query_host_out);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void mlx5_eswitch_event_handler_register(struct mlx5_eswitch *esw)
|
||||
{
|
||||
if (esw->mode == MLX5_ESWITCH_OFFLOADS && mlx5_eswitch_is_funcs_handler(esw->dev)) {
|
||||
@@ -1874,6 +1893,10 @@ int mlx5_eswitch_init(struct mlx5_core_dev *dev)
|
||||
goto abort;
|
||||
}
|
||||
|
||||
err = mlx5_esw_host_functions_enabled_query(esw);
|
||||
if (err)
|
||||
goto abort;
|
||||
|
||||
err = mlx5_esw_vports_init(esw);
|
||||
if (err)
|
||||
goto abort;
|
||||
|
||||
@@ -323,6 +323,7 @@ struct mlx5_host_work {
|
||||
|
||||
struct mlx5_esw_functions {
|
||||
struct mlx5_nb nb;
|
||||
bool host_funcs_disabled;
|
||||
u16 num_vfs;
|
||||
u16 num_ec_vfs;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user