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)) {
                goto abort;
        }
 
+       err = mlx5_esw_host_functions_enabled_query(esw);
+       if (err)
+               goto abort;
+
        err = mlx5_esw_vports_init(esw);
        if (err)
                goto abort;