[Bug 293076] ctld regression in FreeBSD 15: multiple physical ports per target rejected and ports not enabled automatically
[email protected] Wed, 11 Mar 2026 16:38:05 +0000
| Newsgroups | gmane.os.freebsd.devel.scsi |
|---|---|
| Message-ID | <[email protected]/bugzilla/> |
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D293076 --- Comment #5 from John Baldwin <[email protected]> --- Just to help clarify, how are the physical ports being created? Is the dri= ver adding them directly, are you using ctladm to create them? In particular, I assume the ports are already present before you start ctld the first time? ctld reload should be ok as the ports should in theory already be "up" so there's no need to do anything. Restarting ctld entirely won't remove/readd these ports though it seems, instead it seems like it just wants to do a disable/enable. My understanding of the code flow is that for these physical ports, conf_new_from_kernel() should add the port to `kports` without adding a corresponding port in the configuration returned by conf_new_from_kernel().= =20 And we are seeing this log message: void add_iscsi_port(struct kports &kports, struct conf *conf, const struct cctl_port &port, std::string &name) { if (port.cfiscsi_target.empty()) { log_debugx("CTL port %u \"%s\" wasn't managed by ctld; ", port.port_id, name.c_str()); if (!kports.has_port(name)) { if (!kports.add_port(name, port.port_id)) { log_warnx("kports::add_port failed"); return; } } return; } Back in main(), this call should add ports to the `newconf`: if (!newconf->add_pports(kports)) log_errx(1, "Error associating physical ports; exiting"); Can you either use stepping with gdb/lldb or add some tracing to see if conf::add_pports() is actually adding ports? Something like: diff --git a/usr.sbin/ctld/ctld.cc b/usr.sbin/ctld/ctld.cc index 551a70b3fa8f..96e3885e92fe 100644 --- a/usr.sbin/ctld/ctld.cc +++ b/usr.sbin/ctld/ctld.cc @@ -2140,6 +2140,7 @@ conf::apply(struct conf *oldconf) port *newport =3D it->second.get(); if (newport->is_dummy()) { + log_debugx("skipping dummy port \"%s\"", name.c_str= ()); it++; continue; } @@ -2630,6 +2631,8 @@ conf::add_pports(struct kports &kports) "for %s", targ->label()); return (false); } + log_debugx("added ioctl port \"%s\" for %s", + pport.c_str(), targ->label()); continue; } @@ -2651,6 +2654,8 @@ conf::add_pports(struct kports &kports) pport.c_str(), targ->label()); return (false); } + log_debugx("added kernel port \"%s\" for %s", + pport.c_str(), targ->label()); } } return (true); --=20 You are receiving this mail because: You are the assignee for the bug.=