[PATCH net-next 13/13] net/mlx5: E-switch, disable host functions for a non PF e-switch manager
From: Tariq Toukan
Date: Wed Sep 23 2026 - 07:02:18 EST
From: Shay Drory <shayd@xxxxxxxxxx>
mlx5_esw_host_functions_enabled() only treated host functions as
disabled for an ECPF manager.
To support a non PF acting as an e-switch manager, add a check for a non
PF e-switch manager that treats host functions as disabled. This will
avoid allocating a host-PF vport in mlx5_esw_vports_init().
With host functions disabled for non PF, its e-switch is the expected
manager + uplink only.
Signed-off-by: Shay Drory <shayd@xxxxxxxxxx>
Reviewed-by: Moshe Shemesh <moshe@xxxxxxxxxx>
Reviewed-by: Akiva Goldberger <agoldberger@xxxxxxxxxx>
Signed-off-by: Tariq Toukan <tariqt@xxxxxxxxxx>
---
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
index 6f3676c86d3d..2d289fb1353b 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
@@ -1241,6 +1241,11 @@ static int mlx5_esw_host_functions_enabled_query(struct mlx5_eswitch *esw)
struct mlx5_esw_pf_info host_pf_info;
const u32 *query_host_out;
+ if (!mlx5_core_is_pf(esw->dev)) {
+ esw->esw_funcs.host_funcs_disabled = true;
+ return 0;
+ }
+
if (!mlx5_core_is_ecpf_esw_manager(esw->dev))
return 0;
--
2.44.0