Page MenuHomeFreeBSD

nvmecontrol devlist: Handle disconnected Fabrics hosts
Needs ReviewPublic

Authored by jhb on Fri, Dec 27, 8:29 PM.
Tags
None
Referenced Files
F106693828: D48220.diff
Fri, Jan 3, 10:56 PM
Unknown Object (File)
Tue, Dec 31, 5:53 PM
Subscribers

Details

Reviewers
imp
chuck
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 61359
Build 58243: arc lint + arc unit

Event Timeline

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

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
133

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
133

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.Tue, Dec 31, 7:07 PM
jhb edited the summary of this revision. (Show Details)
jhb marked 2 inline comments as done.Tue, Dec 31, 7:09 PM
jhb added inline comments.
sbin/nvmecontrol/devlist.c
133

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.