net/mlx5: FW tracer, Enable tracing
Add the tracer file to the makefile and add the init function to the load one flow. Signed-off-by: Feras Daoud <ferasda@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
This commit is contained in:
parent
70dd6fdb89
commit
244069532f
|
@ -6,7 +6,7 @@ mlx5_core-y := main.o cmd.o debugfs.o fw.o eq.o uar.o pagealloc.o \
|
|||
health.o mcg.o cq.o srq.o alloc.o qp.o port.o mr.o pd.o \
|
||||
mad.o transobj.o vport.o sriov.o fs_cmd.o fs_core.o \
|
||||
fs_counters.o rl.o lag.o dev.o wq.o lib/gid.o lib/clock.o \
|
||||
diag/fs_tracepoint.o
|
||||
diag/fs_tracepoint.o diag/fw_tracer.o
|
||||
|
||||
mlx5_core-$(CONFIG_MLX5_ACCEL) += accel/ipsec.o accel/tls.o
|
||||
|
||||
|
|
|
@ -170,6 +170,6 @@ struct mlx5_fw_tracer *mlx5_fw_tracer_create(struct mlx5_core_dev *dev);
|
|||
int mlx5_fw_tracer_init(struct mlx5_fw_tracer *tracer);
|
||||
void mlx5_fw_tracer_cleanup(struct mlx5_fw_tracer *tracer);
|
||||
void mlx5_fw_tracer_destroy(struct mlx5_fw_tracer *tracer);
|
||||
void mlx5_fw_tracer_event(struct mlx5_core_dev *dev, struct mlx5_eqe *eqe) { return; }
|
||||
void mlx5_fw_tracer_event(struct mlx5_core_dev *dev, struct mlx5_eqe *eqe);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -62,6 +62,7 @@
|
|||
#include "accel/ipsec.h"
|
||||
#include "accel/tls.h"
|
||||
#include "lib/clock.h"
|
||||
#include "diag/fw_tracer.h"
|
||||
|
||||
MODULE_AUTHOR("Eli Cohen <eli@mellanox.com>");
|
||||
MODULE_DESCRIPTION("Mellanox 5th generation network adapters (ConnectX series) core driver");
|
||||
|
@ -990,6 +991,8 @@ static int mlx5_init_once(struct mlx5_core_dev *dev, struct mlx5_priv *priv)
|
|||
goto err_sriov_cleanup;
|
||||
}
|
||||
|
||||
dev->tracer = mlx5_fw_tracer_create(dev);
|
||||
|
||||
return 0;
|
||||
|
||||
err_sriov_cleanup:
|
||||
|
@ -1015,6 +1018,7 @@ out:
|
|||
|
||||
static void mlx5_cleanup_once(struct mlx5_core_dev *dev)
|
||||
{
|
||||
mlx5_fw_tracer_destroy(dev->tracer);
|
||||
mlx5_fpga_cleanup(dev);
|
||||
mlx5_sriov_cleanup(dev);
|
||||
mlx5_eswitch_cleanup(dev->priv.eswitch);
|
||||
|
@ -1167,10 +1171,16 @@ static int mlx5_load_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv,
|
|||
goto err_put_uars;
|
||||
}
|
||||
|
||||
err = mlx5_fw_tracer_init(dev->tracer);
|
||||
if (err) {
|
||||
dev_err(&pdev->dev, "Failed to init FW tracer\n");
|
||||
goto err_fw_tracer;
|
||||
}
|
||||
|
||||
err = alloc_comp_eqs(dev);
|
||||
if (err) {
|
||||
dev_err(&pdev->dev, "Failed to alloc completion EQs\n");
|
||||
goto err_stop_eqs;
|
||||
goto err_comp_eqs;
|
||||
}
|
||||
|
||||
err = mlx5_irq_set_affinity_hints(dev);
|
||||
|
@ -1252,7 +1262,10 @@ err_fpga_start:
|
|||
err_affinity_hints:
|
||||
free_comp_eqs(dev);
|
||||
|
||||
err_stop_eqs:
|
||||
err_comp_eqs:
|
||||
mlx5_fw_tracer_cleanup(dev->tracer);
|
||||
|
||||
err_fw_tracer:
|
||||
mlx5_stop_eqs(dev);
|
||||
|
||||
err_put_uars:
|
||||
|
@ -1320,6 +1333,7 @@ static int mlx5_unload_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv,
|
|||
mlx5_fpga_device_stop(dev);
|
||||
mlx5_irq_clear_affinity_hints(dev);
|
||||
free_comp_eqs(dev);
|
||||
mlx5_fw_tracer_cleanup(dev->tracer);
|
||||
mlx5_stop_eqs(dev);
|
||||
mlx5_put_uars_page(dev, priv->uar);
|
||||
mlx5_free_irq_vectors(dev);
|
||||
|
|
Loading…
Reference in a new issue