pages = dev->priv.dbg.pages_debugfs;
debugfs_create_u32("fw_pages_total", 0400, pages, &dev->priv.fw_pages);
- debugfs_create_u32("fw_pages_vfs", 0400, pages, &dev->priv.page_counters[MLX5_VF]);
- debugfs_create_u32("fw_pages_ec_vfs", 0400, pages, &dev->priv.page_counters[MLX5_EC_VF]);
- debugfs_create_u32("fw_pages_sfs", 0400, pages, &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_alloc_failed", 0400, pages, &dev->priv.fw_pages_alloc_failed);
debugfs_create_u32("fw_pages_give_dropped", 0400, pages, &dev->priv.give_pages_dropped);
debugfs_create_u32("fw_pages_reclaim_discard", 0400, pages,
debugfs_remove_recursive(dev->priv.dbg.pages_debugfs);
}
+void mlx5_pages_by_func_type_debugfs_init(struct mlx5_core_dev *dev)
+{
+ struct dentry *pages = dev->priv.dbg.pages_debugfs;
+
+ if (!pages)
+ return;
+
+ if (!dev->priv.eswitch &&
+ MLX5_CAP_GEN(dev, icm_mng_function_id_mode) ==
+ MLX5_ID_MODE_FUNCTION_VHCA_ID)
+ return;
+
+ debugfs_create_u32("fw_pages_vfs", 0400, pages,
+ &dev->priv.page_counters[MLX5_VF]);
+ debugfs_create_u32("fw_pages_ec_vfs", 0400, pages,
+ &dev->priv.page_counters[MLX5_EC_VF]);
+ debugfs_create_u32("fw_pages_sfs", 0400, pages,
+ &dev->priv.page_counters[MLX5_SF]);
+ debugfs_create_u32("fw_pages_host_pf", 0400, pages,
+ &dev->priv.page_counters[MLX5_HOST_PF]);
+}
+
+void mlx5_pages_by_func_type_debugfs_cleanup(struct mlx5_core_dev *dev)
+{
+ struct dentry *pages = dev->priv.dbg.pages_debugfs;
+
+ if (!pages)
+ return;
+
+ debugfs_lookup_and_remove("fw_pages_vfs", pages);
+ 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);
+}
+
static u64 qp_read_field(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp,
int index, int *is_str)
{
mlx5_core_err(dev, "Failed to init eswitch %d\n", err);
goto err_sriov_cleanup;
}
+ mlx5_pages_by_func_type_debugfs_init(dev);
err = mlx5_fpga_init(dev);
if (err) {
mlx5_core_err(dev, "Failed to init fpga device %d\n", err);
- goto err_eswitch_cleanup;
+ goto err_page_debugfs_cleanup;
}
err = mlx5_vhca_event_init(dev);
mlx5_vhca_event_cleanup(dev);
err_fpga_cleanup:
mlx5_fpga_cleanup(dev);
-err_eswitch_cleanup:
+err_page_debugfs_cleanup:
+ mlx5_pages_by_func_type_debugfs_cleanup(dev);
mlx5_eswitch_cleanup(dev->priv.eswitch);
err_sriov_cleanup:
mlx5_sriov_cleanup(dev);
mlx5_sf_hw_table_cleanup(dev);
mlx5_vhca_event_cleanup(dev);
mlx5_fpga_cleanup(dev);
+ mlx5_pages_by_func_type_debugfs_cleanup(dev);
mlx5_eswitch_cleanup(dev->priv.eswitch);
mlx5_sriov_cleanup(dev);
mlx5_mpfs_cleanup(dev);
void mlx5_pagealloc_stop(struct mlx5_core_dev *dev);
void mlx5_pages_debugfs_init(struct mlx5_core_dev *dev);
void mlx5_pages_debugfs_cleanup(struct mlx5_core_dev *dev);
+void mlx5_pages_by_func_type_debugfs_init(struct mlx5_core_dev *dev);
+void mlx5_pages_by_func_type_debugfs_cleanup(struct mlx5_core_dev *dev);
int mlx5_satisfy_startup_pages(struct mlx5_core_dev *dev, int boot);
int mlx5_reclaim_startup_pages(struct mlx5_core_dev *dev);
void mlx5_register_debugfs(void);