Page MenuHomeFreeBSD

iSCSI: per-session timeouts and rapid teardown of session on reconnect
ClosedPublic

Authored by rscheff on Feb 8 2022, 8:40 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 22, 8:31 AM
Unknown Object (File)
Mon, Apr 22, 5:16 AM
Unknown Object (File)
Sat, Apr 20, 5:34 PM
Unknown Object (File)
Tue, Apr 16, 5:40 AM
Unknown Object (File)
Mon, Apr 15, 3:11 AM
Unknown Object (File)
Sun, Mar 31, 5:59 PM
Unknown Object (File)
Feb 11 2024, 12:38 AM
Unknown Object (File)
Feb 11 2024, 12:38 AM
Subscribers
None

Details

Summary

Per-Session configurable ping (SCSI NOP) and login timeouts.
These are configured similar to what is supported in the Linux iSCSI initiator configuration file.

Once the decision is made to tear down and reconnect an iSCSI session,
make sure that the old TCP session is removed quickly to not have any
issue with the number of parallel held TCP session to the iSCSI port (TIMEWAIT).

This is a split off from D32540.

Diff Detail

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

Event Timeline

rscheff created this revision.
usr.sbin/iscsid/iscsid.c
464

It's been a while since I've last touched that code, but... why are you passing this back via idh? This makes sense with, say, idh_max_recv_data_segment_length, because iscsid(8) needs to negotiate this, but for ping and login timeouts the kernel can directly use isc_ping_timeout instead.

usr.bin/iscsictl/iscsi.conf.5
168

Perhaps mention kern.iscsi.ping_timeout, as that's where the '5' comes from? Similar with LoginTimeout (kern.iscsi.login_timeout).

usr.sbin/iscsid/iscsid.c
396

LoginTimeout perhaps, just like in the config warning? (I know, I'm annoying, but consistency can save users a lot of time when trying to understand what's happening.)

  • fix panic with NULL socket
  • directly access isc_ struct instead of handoff
  • update manual entry to reference sysctls
  • nicify outputs to match .conf token
rscheff added inline comments.
usr.sbin/iscsid/iscsid.c
396

Thanks for the good feedback!

Manual page language change LGTM.

share/man/man4/iscsi.4
25 โ†—(On Diff #102492)

Since you're not otherwise changing share/man/man4/iscsi.4 in this diff, you don't need to bump Dd here - and in fact don't need this file at all in here, as long as you remember to bump it in D32540 with the rest of the changes to this file there.

rscheff added inline comments.
share/man/man4/iscsi.4
25 โ†—(On Diff #102492)

I created this diff on top of the changes of D32540. arcanist sometimes creates funny diffs when doing 2nd / 3rd level stuff. But noted, should I need to apply the patches in a different order.

  • fix panic with NULL socket
  • update man timestamp
  • don't forget on is_login_timeout
This revision is now accepted and ready to land.Feb 15 2022, 7:28 PM
lib/libiscsiutil/libiscsiutil.h
57

Since initiator and target are quite symmetric and this structure is now used in both, I think whether it would have sense to make ping timeout configurable in ctl.conf for target.

usr.sbin/iscsid/iscsid.c
403

If the conn_conf comes here from kernel, why not apply the global timeout value there and pass here exact one? iscsid supposed to have minimal capabilities.

rscheff added inline comments.
lib/libiscsiutil/libiscsiutil.h
57

Only the initiator is actively sending SCSI IOs; the ctl.conf timeout appears to only be relevant for the login. As ctld is using "timeout" only for the login, there the new "login_timeout" could be used instead of the login variable though.

usr.sbin/iscsid/iscsid.c
403

That would loose the info, if the system global default, or a per-session timeout is in use.