[PATCHv2 7/7] nvme: export controller reconnect event count via sysfs

Nilay Shroff nilay at linux.ibm.com
Mon Feb 9 04:00:08 PST 2026



On 2/7/26 7:07 PM, Sagi Grimberg wrote:
> 
> 
> 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.

Yes, that’s correct. The current patch simply exposes an existing counter via
sysfs, and that counter is reset to zero once a reconnect attempt succeeds. 
However, agreed, for consistency with the other sysfs entries, it would make
sense for this value to behave as an accumulator rather than a transient counter.

We can introduce a new counter that accumulates the total number of reconnect
attempts over time and export that through sysfs instead. 

Thanks,
--Nilay



More information about the Linux-nvme mailing list