History

net/mlx5: add debugfs stats for doorbell dma pools

Add a debugfs file exposing per-node DMA pool usage for doorbell allocations. # cat /sys/kernel/debug/mlx5/<dev>/db_dma_pools node block_size used_blocks allocated_blocks 0 64 0 0 1 64 0 0

Nimrod Oren committed 3 months ago

Commit b7cfcc91 parent c2923562 files · +28 −0Browse files

Unified · Split

2 files
  1. drivers/net/ethernet/mellanox/mlx5/core/alloc.c +27 −0
  2. include/linux/mlx5/driver.h +1 −0
drivers/net/ethernet/mellanox/mlx5/core/alloc.c+27−0
@@ -437,11 +437,34 @@ void mlx5_frag_buf_free(struct mlx5_core_dev *dev, struct mlx5_frag_buf *buf) · 436 unmodified lines
437437 }
438438 EXPORT_SYMBOL_GPL(mlx5_frag_buf_free);
439439
440+static int mlx5_db_dma_pools_debugfs_show(struct seq_file *file, void *priv)
441+{
442+ struct mlx5_core_dev *dev = file->private;
443+ int node;
444+
445+ mlx5_dma_pools_debugfs_print_header(file);
446+
447+ for_each_node_state(node, N_POSSIBLE) {
448+ struct mlx5_dma_pool *pool = dev->priv.db_node_pools[node];
449+
450+ if (!pool)
451+ continue;
452+
453+ mlx5_dma_pool_debugfs_stats_print(file, pool);
454+ }
455+
456+ return 0;
457+}
458+DEFINE_SHOW_ATTRIBUTE(mlx5_db_dma_pools_debugfs);
459+
440460 void mlx5_db_pools_cleanup(struct mlx5_core_dev *dev)
441461 {
442462 struct mlx5_priv *priv = &dev->priv;
443463 int node;
444464
465+ debugfs_remove(priv->dbg.db_dma_pools_debugfs);
466+ priv->dbg.db_dma_pools_debugfs = NULL;
467+
445468 for_each_node_state(node, N_POSSIBLE)
446469 if (priv->db_node_pools[node])
447470 mlx5_dma_pool_destroy(priv->db_node_pools[node]);
@@ -471,6 +494,10 @@ int mlx5_db_pools_init(struct mlx5_core_dev *dev) · 23 unmodified lines
471494 priv->db_node_pools[node] = pool;
472495 }
473496
497+ priv->dbg.db_dma_pools_debugfs =
498+ debugfs_create_file("db_dma_pools", 0444, priv->dbg.dbg_root,
499+ dev, &mlx5_db_dma_pools_debugfs_fops);
500+
474501 return 0;
475502 }
476503
include/linux/mlx5/driver.h+1−0
@@ -548,6 +548,7 @@ struct mlx5_debugfs_entries { · 547 unmodified lines
548548 struct dentry *cq_debugfs;
549549 struct dentry *cmdif_debugfs;
550550 struct dentry *frag_buf_dma_pools_debugfs;
551+ struct dentry *db_dma_pools_debugfs;
551552 struct dentry *pages_debugfs;
552553 struct dentry *lag_debugfs;
553554 };

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t