Page MenuHomeFreeBSD

ctld: Add abstractions to support multiple target protocols
Needs ReviewPublic

Authored by jhb on Jan 31 2025, 8:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Mar 4, 1:21 PM
Unknown Object (File)
Wed, Feb 19, 10:30 PM
Unknown Object (File)
Tue, Feb 18, 4:24 PM
Unknown Object (File)
Fri, Feb 14, 7:30 PM
Unknown Object (File)
Sun, Feb 9, 7:02 PM
Unknown Object (File)
Sun, Feb 9, 6:19 PM
Unknown Object (File)
Sat, Feb 8, 2:38 AM
Unknown Object (File)
Tue, Feb 4, 8:50 AM
Subscribers

Details

Reviewers
asomers
mav
trasz
Summary

This is a prerequisite for adding NVMe over Fabrics support.

A new target-level protocol type is associated with a 'struct
target_ops' which contains methods for various protocol-specific
options such as populating requests to add and remove ctl(4) ports.

While here, move some iSCSI-only functions out of ctld.c and kernel.c
into iscsi.c and make discovery.c, iscsi.c, and login.c which are all
iSCSI-specific conditional on MK_ISCSI.

Sponsored by: Chelsio Communications

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 62639
Build 59523: arc lint + arc unit

Event Timeline

jhb requested review of this revision.Jan 31 2025, 8:16 PM

Rebase after fixing previous patch

usr.sbin/ctld/ctld.h
116

Is there any reason why this couldn't be an enum?

139

Since it's actually allocating and returning a different string, this function isn't really a validator. How about "normalize_target_name" instead?

usr.sbin/ctld/kernel.c
568–569

Frankly, I think that all of these commented-out sections should just be deleted. It's highly likely that they don't all compile anymore.

jhb marked 2 inline comments as done.Fri, Feb 7, 1:00 AM
jhb added inline comments.
usr.sbin/ctld/ctld.h
116

I guess it could be. I was just following the existing convention.

Rebase after C++ prep commits