[PATCH 0/7] nvme: export additional diagnostic counters via sysfs

Nilay Shroff
2026-01-30T18:21:41Z

Hi,

The NVMe driver encounters various events and conditions during normal
operation that are either not tracked today or not exposed to userspace
via sysfs. Lack of visibility into these events can make it difficult to
diagnose subtle issues related to controller behavior, multipath
stability, and I/O reliability.

This patchset adds several diagnostic counters that provide improved
observability into NVMe behavior. These counters are intended to help
users understand events such as transient path unavailability,
controller retries/reconnect/reset, failovers, and I/O failures. They
can also be consumed by monitoring tools such as nvme-top.

Specifically, this series proposes to export the following counters via
sysfs:
- Command retry count
- Multipath failover count
- Command error count
- I/O requeue count
- I/O failure count
- Controller reset event counts
- Controller reconnect counts

The patchset consists of seven patches:
Patch 1: Export command retry count
Patch 2: Export multipath failover count
Patch 3: Export command error count
Patch 4: Export I/O requeue count
Patch 5: Export I/O failure count
Patch 6: Export controller reset event counts
Patch 7: Export controller reconnect event count

Please note that this patchset doesn't make any functional change but
rather export relevant counters to user space via sysfs.

As usual, feedback/comments/suggestions are welcome!

Nilay Shroff (7):
nvme: export command retry count via sysfs
nvme: export multipath failover count via sysfs
nvme: export command error counters via sysfs
nvme: export I/O requeue count when no path is available via sysfs
nvme: export I/O failure count when no path is available via sysfs
nvme: export controller reset event count via sysfs
nvme: export controller reconnect event count via sysfs

drivers/nvme/host/core.c | 23 ++++++++-
drivers/nvme/host/multipath.c | 32 +++++++++++++
drivers/nvme/host/nvme.h | 12 ++++-
drivers/nvme/host/sysfs.c | 90 +++++++++++++++++++++++++++++++++++
4 files changed, 154 insertions(+), 3 deletions(-)

--
2.52.0