The branch main has been updated by kib:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=8391db038df87e0fa5519617e3bb35a2cf78b41e

commit 8391db038df87e0fa5519617e3bb35a2cf78b41e
Author:     Konstantin Belousov <[email protected]>
AuthorDate: 2021-07-05 07:55:19 +0000
Commit:     Konstantin Belousov <[email protected]>
CommitDate: 2021-07-12 09:34:40 +0000

    mlx5: add a knob to administratively disable mlx5 fw dump setup
    
    MFC after:      1 week
    Reviewed by:    hselasky
    Sponsored by:   Mellanox Technologies // NVIDIA Networking
---
 sys/dev/mlx5/mlx5_core/mlx5_fwdump.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

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. */
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main
To unsubscribe, send any mail to "[email protected]"

Reply via email to