Page MenuHomeFreeBSD

ctld: Use freebsd::fd_up to manage the lifecycle of accepted sockets
ClosedPublic

Authored by jhb on Mon, Aug 4, 7:58 PM.
Tags
None
Referenced Files
F126994297: D51729.diff
Tue, Aug 26, 10:19 AM
F126993415: D51729.diff
Tue, Aug 26, 10:06 AM
F126974035: D51729.id159725.diff
Tue, Aug 26, 5:15 AM
F126935646: D51729.diff
Mon, Aug 25, 7:42 PM
F126935014: D51729.diff
Mon, Aug 25, 7:33 PM
F126928704: D51729.diff
Mon, Aug 25, 6:01 PM
F126926662: D51729.diff
Mon, Aug 25, 5:33 PM
Unknown Object (File)
Sat, Aug 23, 6:16 AM
Subscribers

Details

Summary

Explicitly hand off ownership of accepted sockets to the
portal::handle_connection method.

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.Mon, Aug 4, 7:58 PM
asomers added inline comments.
usr.sbin/ctld/iscsi.cc
419

The existence of lines like this one almost defeats the purpose of the patch. But I suppose the patch still represents incremental progress, and this part could be improved in the future.

This revision is now accepted and ready to land.Tue, Aug 5, 2:38 PM
usr.sbin/ctld/iscsi.cc
419

The conn structure is something from libiscsiutil that is shared with iscsid and iscsictl for the initiator side. conn_fd still retains "ownership" of the fd and auto-closes on destruction at least. If the other consumers switch to C++ in some form (or at least libiscsiutil uses a C++ class for its connection object), then the fd could be moved into this, yes. And probably conn_fd would not even be needed in that case.

This pattern is realized a bit better on the NVMe side, though even there it is somewhat imperfect as libnvmf still works with C structures.