Add MLX5_SPF to enum mlx5_func_type so SPFs get their own page counter,
and add the corresponding WARN check at page cleanup. Wait for SPF pages
to be reclaimed during ECPF teardown, alongside the existing host PF and
VF page waits.
SPF page requests are always identified by vhca_id, so the legacy
func_id_to_type() path is not reached for satellite PFs.
Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20260521110843.367329-13-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
&dev->priv.page_counters[MLX5_SF]);
debugfs_create_u32("fw_pages_host_pf", 0400, pages,
&dev->priv.page_counters[MLX5_HOST_PF]);
+ debugfs_create_u32("fw_pages_spfs", 0400, pages,
+ &dev->priv.page_counters[MLX5_SPF]);
}
void mlx5_pages_by_func_type_debugfs_cleanup(struct mlx5_core_dev *dev)
debugfs_lookup_and_remove("fw_pages_ec_vfs", pages);
debugfs_lookup_and_remove("fw_pages_sfs", pages);
debugfs_lookup_and_remove("fw_pages_host_pf", pages);
+ debugfs_lookup_and_remove("fw_pages_spfs", pages);
}
static u64 qp_read_field(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp,
if (err)
mlx5_core_warn(dev, "Timeout reclaiming external host PF pages err(%d)\n", err);
+ err = mlx5_wait_for_pages(dev, &dev->priv.page_counters[MLX5_SPF]);
+ if (err)
+ mlx5_core_warn(dev, "Timeout reclaiming SPF pages err(%d)\n",
+ err);
+
err = mlx5_wait_for_pages(dev, &dev->priv.page_counters[MLX5_VF]);
if (err)
mlx5_core_warn(dev, "Timeout reclaiming external host VFs pages err(%d)\n", err);
return MLX5_SF;
if (xa_get_mark(&esw->vports, vport_num, MLX5_ESW_VPT_VF))
return MLX5_VF;
+ if (mlx5_esw_is_spf_vport(esw, vport_num))
+ return MLX5_SPF;
return MLX5_EC_VF;
}
WARN(dev->priv.page_counters[MLX5_HOST_PF],
"External host PF FW pages counter is %d after reclaiming all pages\n",
dev->priv.page_counters[MLX5_HOST_PF]);
+ WARN(dev->priv.page_counters[MLX5_SPF],
+ "SPFs FW pages counter is %d after reclaiming all pages\n",
+ dev->priv.page_counters[MLX5_SPF]);
WARN(dev->priv.page_counters[MLX5_EC_VF],
"EC VFs FW pages counter is %d after reclaiming all pages\n",
dev->priv.page_counters[MLX5_EC_VF]);
MLX5_VF,
MLX5_SF,
MLX5_HOST_PF,
+ MLX5_SPF,
MLX5_EC_VF,
MLX5_FUNC_TYPE_NUM,
MLX5_FUNC_TYPE_NONE = MLX5_FUNC_TYPE_NUM,