Page MenuHomeFreeBSD

nvmecontrol devlist: Handle disconnected Fabrics hosts
ClosedPublic

Authored by jhb on Dec 27 2024, 8:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Feb 16, 10:56 PM
Unknown Object (File)
Thu, Feb 13, 6:10 PM
Unknown Object (File)
Feb 8 2025, 4:10 AM
Unknown Object (File)
Jan 31 2025, 10:52 PM
Unknown Object (File)
Jan 31 2025, 10:40 PM
Unknown Object (File)
Jan 18 2025, 1:44 AM
Unknown Object (File)
Jan 17 2025, 3:12 AM
Unknown Object (File)
Jan 14 2025, 3:44 AM
Subscribers

Details

Summary

If a Fabrics host is disconnected, use the cached controller data
instead of reading the cdata via a pass-through command. In addition,
annotate disconnected hosts including the amount of time since the
connection was lost.

Sponsored by: Chelsio Communications

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb requested review of this revision.Dec 27 2024, 8:29 PM
sbin/nvmecontrol/devlist.c
134

Why _FAST? It's called once.

Also, you could base this on the tv_sec field being != 0. That can Never happen for CLOCK_REALTIME.

sbin/nvmecontrol/devlist.c
134

Just that there's no reason for any real precision here given we only care about seconds granularity. I was assuming that we should use _FAST by default unless more precision is required?

sbin/nvmecontrol/devlist.c
134

In a loop, definitely optimize for fast. For a one-off call, optimizing for fast is harder to read, imho, so I use the standard form. It saves hitting the hardware once to get the latest TC, which is super cheap on modern time counters, and not that expensive on the exotics.

But where does last_disconnect get populated from? The kernel sets it, I know, but how/where is that set?

jhb retitled this revision from nvmecontrol devlist: Annotate disconnected fabrics controllers to nvmecontrol devlist: Handle disconnected Fabrics hosts.Dec 31 2024, 7:07 PM
jhb edited the summary of this revision. (Show Details)
jhb marked 2 inline comments as done.Dec 31 2024, 7:09 PM
jhb added inline comments.
sbin/nvmecontrol/devlist.c
134

last_disconnect is updated via nanotime() in the softc each time a host disconnects. That field and the call to nanotime() are in the previous review in this stack (D48219) adding the connection status ioctl.

Sample output:

root@sam:~ # nvmecontrol devlist
 nvme0: FreeBSD (disconnected for 3 seconds)
This revision is now accepted and ready to land.Jan 31 2025, 12:11 AM