Commit f405787a authored by Vlad Buslov's avatar Vlad Buslov Committed by Saeed Mahameed

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: default avatarVlad Buslov <vladbu@nvidia.com>
Reviewed-by: default avatarGal Pressman <gal@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent 7a9770f1
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
*/ */
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/debugfs.h>
#include <linux/mlx5/driver.h> #include <linux/mlx5/driver.h>
#include <linux/mlx5/mlx5_ifc.h> #include <linux/mlx5/mlx5_ifc.h>
#include <linux/mlx5/vport.h> #include <linux/mlx5/vport.h>
...@@ -1765,6 +1766,7 @@ int mlx5_eswitch_init(struct mlx5_core_dev *dev) ...@@ -1765,6 +1766,7 @@ int mlx5_eswitch_init(struct mlx5_core_dev *dev)
esw->manager_vport = mlx5_eswitch_manager_vport(dev); esw->manager_vport = mlx5_eswitch_manager_vport(dev);
esw->first_host_vport = mlx5_eswitch_first_host_vport_num(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"); esw->work_queue = create_singlethread_workqueue("mlx5_esw_wq");
if (!esw->work_queue) { if (!esw->work_queue) {
err = -ENOMEM; err = -ENOMEM;
...@@ -1818,6 +1820,7 @@ int mlx5_eswitch_init(struct mlx5_core_dev *dev) ...@@ -1818,6 +1820,7 @@ int mlx5_eswitch_init(struct mlx5_core_dev *dev)
abort: abort:
if (esw->work_queue) if (esw->work_queue)
destroy_workqueue(esw->work_queue); destroy_workqueue(esw->work_queue);
debugfs_remove_recursive(esw->debugfs_root);
kfree(esw); kfree(esw);
unregister_param: unregister_param:
devl_params_unregister(priv_to_devlink(dev), mlx5_eswitch_params, devl_params_unregister(priv_to_devlink(dev), mlx5_eswitch_params,
...@@ -1844,6 +1847,7 @@ void mlx5_eswitch_cleanup(struct mlx5_eswitch *esw) ...@@ -1844,6 +1847,7 @@ void mlx5_eswitch_cleanup(struct mlx5_eswitch *esw)
mutex_destroy(&esw->offloads.decap_tbl_lock); mutex_destroy(&esw->offloads.decap_tbl_lock);
esw_offloads_cleanup(esw); esw_offloads_cleanup(esw);
mlx5_esw_vports_cleanup(esw); mlx5_esw_vports_cleanup(esw);
debugfs_remove_recursive(esw->debugfs_root);
kfree(esw); kfree(esw);
devl_params_unregister(priv_to_devlink(esw->dev), mlx5_eswitch_params, devl_params_unregister(priv_to_devlink(esw->dev), mlx5_eswitch_params,
ARRAY_SIZE(mlx5_eswitch_params)); ARRAY_SIZE(mlx5_eswitch_params));
......
...@@ -304,6 +304,8 @@ enum { ...@@ -304,6 +304,8 @@ enum {
MLX5_ESW_FDB_CREATED = BIT(0), MLX5_ESW_FDB_CREATED = BIT(0),
}; };
struct dentry;
struct mlx5_eswitch { struct mlx5_eswitch {
struct mlx5_core_dev *dev; struct mlx5_core_dev *dev;
struct mlx5_nb nb; struct mlx5_nb nb;
...@@ -312,6 +314,7 @@ struct mlx5_eswitch { ...@@ -312,6 +314,7 @@ struct mlx5_eswitch {
struct hlist_head mc_table[MLX5_L2_ADDR_HASH_SIZE]; struct hlist_head mc_table[MLX5_L2_ADDR_HASH_SIZE];
struct esw_mc_addr mc_promisc; struct esw_mc_addr mc_promisc;
/* end of legacy */ /* end of legacy */
struct dentry *debugfs_root;
struct workqueue_struct *work_queue; struct workqueue_struct *work_queue;
struct xarray vports; struct xarray vports;
u32 flags; u32 flags;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment