Page MenuHomeFreeBSD

ctld: Refactor ioctl port handling
ClosedPublic

Authored by jhb on May 19 2026, 3:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jun 19, 2:22 PM
Unknown Object (File)
Wed, Jun 17, 12:32 PM
Unknown Object (File)
Tue, Jun 16, 12:26 PM
Unknown Object (File)
Tue, Jun 16, 10:02 AM
Unknown Object (File)
Mon, Jun 8, 10:08 AM
Unknown Object (File)
Mon, Jun 8, 9:17 AM
Unknown Object (File)
Sat, Jun 6, 5:21 AM
Unknown Object (File)
Fri, Jun 5, 11:03 PM
Subscribers

Details

Summary
  • Normalize ioctl port names when the port name is first added to the configuration. This can catch potential duplicate port names sooner and helps with other parts of this change.
  • When recognizing existing ioctl ports, always expand the name to include the physical and virtual port numbers. This permits binding ioctl/0/0 or ioctl/1/0 to a target, for example.
  • When adding physical ports to a target, first check for an existing kernel port to reuse. This handles both ioctl and non-ioctl ports and removes the need for the conf::add_port method for ioctl ports to check in kports.
  • If an existing kport isn't found when adding physical ports, check to see if the port name is an ioctl port. If so, call conf::add_port to add an ioctl port. This add_port method overload is now simpler as it always creates a new port.

NB: The kernel_port class handles CTL ports that already existed
before ctld started including existing ioctl ports, whereas the
ioctl_port class handles ioctl ports that are created and completely
managed by ctld. This was true before this change but is perhaps more
obvious after this change.

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.May 19 2026, 3:14 PM

I was able to test this directly today playing around with ioctl ports.

This revision was not accepted when it landed; it landed in state Needs Review.Wed, May 27, 9:00 PM
This revision was automatically updated to reflect the committed changes.