diff options
author | Konstantin Belousov <konstantinb@nvidia.com> | 2021-07-05 07:55:19 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2021-07-26 13:51:12 +0000 |
commit | f2e512d09bbe6f28b48a5df246b495c3f62eb0c6 (patch) | |
tree | 2f88129579d923b1090c88b7897b4daa89706a54 /sys/dev/mlx5/mlx5_core/mlx5_fwdump.c | |
parent | 180c45c1b4d33a6d2c185e9a9bef30e8a35dd8c1 (diff) | |
download | src-f2e512d09bbe6f28b48a5df246b495c3f62eb0c6.tar.gz src-f2e512d09bbe6f28b48a5df246b495c3f62eb0c6.zip |
mlx5: add a knob to administratively disable mlx5 fw dump setup
(cherry picked from commit 8391db038df87e0fa5519617e3bb35a2cf78b41e)
Diffstat (limited to 'sys/dev/mlx5/mlx5_core/mlx5_fwdump.c')
-rw-r--r-- | sys/dev/mlx5/mlx5_core/mlx5_fwdump.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c b/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c index 09e8f9f7660a..7bb563846144 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c @@ -59,6 +59,11 @@ mlx5_fwdump_destroy_dd(struct mlx5_core_dev *mdev) mdev->dump_data = NULL; } +static int mlx5_fw_dump_enable = 1; +SYSCTL_INT(_hw_mlx5, OID_AUTO, fw_dump_enable, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, + &mlx5_fw_dump_enable, 0, + "Enable fw dump setup and op"); + void mlx5_fwdump_prep(struct mlx5_core_dev *mdev) { @@ -68,6 +73,14 @@ mlx5_fwdump_prep(struct mlx5_core_dev *mdev) u32 addr, in, out, next_addr; mdev->dump_data = NULL; + + TUNABLE_INT_FETCH("hw.mlx5.fw_dump_enable", &mlx5_fw_dump_enable); + if (!mlx5_fw_dump_enable) { + mlx5_core_warn(mdev, + "Firmware dump administratively prohibited\n"); + return; + } + error = mlx5_vsc_find_cap(mdev); if (error != 0) { /* Inability to create a firmware dump is not fatal. */ |