mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-11-01 01:03:52 +00:00
net/mlx5: Create eswitch debugfs root directory
Following patch in series uses the new directory for bridge FDB debugfs. The new directory is intended for all future eswitch-specific debugfs files. Signed-off-by: Vlad Buslov <vladbu@nvidia.com> Reviewed-by: Gal Pressman <gal@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
This commit is contained in:
parent
7a9770f1bf
commit
f405787a0a
2 changed files with 7 additions and 0 deletions
|
|
@ -31,6 +31,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/mlx5/driver.h>
|
||||
#include <linux/mlx5/mlx5_ifc.h>
|
||||
#include <linux/mlx5/vport.h>
|
||||
|
|
@ -1765,6 +1766,7 @@ int mlx5_eswitch_init(struct mlx5_core_dev *dev)
|
|||
esw->manager_vport = mlx5_eswitch_manager_vport(dev);
|
||||
esw->first_host_vport = mlx5_eswitch_first_host_vport_num(dev);
|
||||
|
||||
esw->debugfs_root = debugfs_create_dir("esw", mlx5_debugfs_get_dev_root(dev));
|
||||
esw->work_queue = create_singlethread_workqueue("mlx5_esw_wq");
|
||||
if (!esw->work_queue) {
|
||||
err = -ENOMEM;
|
||||
|
|
@ -1818,6 +1820,7 @@ reps_err:
|
|||
abort:
|
||||
if (esw->work_queue)
|
||||
destroy_workqueue(esw->work_queue);
|
||||
debugfs_remove_recursive(esw->debugfs_root);
|
||||
kfree(esw);
|
||||
unregister_param:
|
||||
devl_params_unregister(priv_to_devlink(dev), mlx5_eswitch_params,
|
||||
|
|
@ -1844,6 +1847,7 @@ void mlx5_eswitch_cleanup(struct mlx5_eswitch *esw)
|
|||
mutex_destroy(&esw->offloads.decap_tbl_lock);
|
||||
esw_offloads_cleanup(esw);
|
||||
mlx5_esw_vports_cleanup(esw);
|
||||
debugfs_remove_recursive(esw->debugfs_root);
|
||||
kfree(esw);
|
||||
devl_params_unregister(priv_to_devlink(esw->dev), mlx5_eswitch_params,
|
||||
ARRAY_SIZE(mlx5_eswitch_params));
|
||||
|
|
|
|||
|
|
@ -304,6 +304,8 @@ enum {
|
|||
MLX5_ESW_FDB_CREATED = BIT(0),
|
||||
};
|
||||
|
||||
struct dentry;
|
||||
|
||||
struct mlx5_eswitch {
|
||||
struct mlx5_core_dev *dev;
|
||||
struct mlx5_nb nb;
|
||||
|
|
@ -312,6 +314,7 @@ struct mlx5_eswitch {
|
|||
struct hlist_head mc_table[MLX5_L2_ADDR_HASH_SIZE];
|
||||
struct esw_mc_addr mc_promisc;
|
||||
/* end of legacy */
|
||||
struct dentry *debugfs_root;
|
||||
struct workqueue_struct *work_queue;
|
||||
struct xarray vports;
|
||||
u32 flags;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue