[PATCHv2 7/7] nvme: export controller reconnect event count via sysfs
Sagi Grimberg
sagi at grimberg.me
Sat Feb 7 05:37:04 PST 2026
On 05/02/2026 14:48, Nilay Shroff wrote:
> When an NVMe-oF link goes down, the driver attempts to recover the
> connection by repeatedly reconnecting to the remote controller at
> configured intervals. A maximum number of reconnect attempts is also
> configured, after which recovery stops and the controller is removed
> if the connection cannot be re-established.
>
> The driver maintains a counter, nr_reconnects, which is incremented on
> each reconnect attempt. Currently, this counter is only reported via
> kernel log messages and is not exposed to userspace. Since dmesg is a
> circular buffer, this information may be lost over time.
>
> Expose the nr_reconnects counter via a new sysfs attribute, reconnect_
> events, to provide persistent visibility into the number of reconnect
> attempts made by the host. This information can help users diagnose
> unstable links or connectivity issues.
This unlike the other is zeroed once the controller successfully reconnects.
I think it is better to have consistency across these sysfs entries.
More information about the Linux-nvme
mailing list