git: 82c96fef52c1 - main - nvme: Export recovery state

From: Warner Losh <imp_at_FreeBSD.org>
Date: Tue, 15 Oct 2024 22:21:57 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=82c96fef52c11b50c3effaa5d3bbe78a692dfd27

commit 82c96fef52c11b50c3effaa5d3bbe78a692dfd27
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2024-10-15 22:19:30 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-10-15 22:19:30 +0000

    nvme: Export recovery state
    
    Export recovery state as a sysctl. This helps, sometimes, diagnose
    what's going on.
    
    Sponsored by:           Netflix
---
 sys/dev/nvme/nvme_sysctl.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys/dev/nvme/nvme_sysctl.c b/sys/dev/nvme/nvme_sysctl.c
index c66f1ed51c9c..edd1f3e40997 100644
--- a/sys/dev/nvme/nvme_sysctl.c
+++ b/sys/dev/nvme/nvme_sysctl.c
@@ -333,6 +333,10 @@ nvme_sysctl_initialize_queue(struct nvme_qpair *qpair,
 	    CTLFLAG_RD, &qpair->num_recovery_nolock,
 	    "Number of times that we failed to lock recovery in the ISR");
 
+	SYSCTL_ADD_UINT(ctrlr_ctx, que_list, OID_AUTO, "recovery",
+	    CTLFLAG_RW, &qpair->recovery_state, 0,
+	    "Current recovery state of the queue");
+
 	SYSCTL_ADD_PROC(ctrlr_ctx, que_list, OID_AUTO,
 	    "dump_debug", CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE,
 	    qpair, 0, nvme_sysctl_dump_debug, "IU", "Dump debug data");