Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F160756130
D57283.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D57283.diff
View Options
diff --git a/usr.sbin/ctld/kernel.cc b/usr.sbin/ctld/kernel.cc
--- a/usr.sbin/ctld/kernel.cc
+++ b/usr.sbin/ctld/kernel.cc
@@ -441,19 +441,13 @@
return (true);
}
-void
-add_iscsi_port(struct kports &kports, struct conf *conf,
- const struct cctl_port &port, std::string &name)
+static void
+add_iscsi_port(struct conf *conf, const struct cctl_port &port,
+ std::string &name)
{
if (port.cfiscsi_target.empty()) {
log_debugx("CTL iSCSI port %u \"%s\" is not managed by ctld; "
"ignoring", 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;
}
if (port.cfiscsi_state != 1) {
@@ -493,7 +487,7 @@
}
}
-void
+static void
add_nvmf_port(struct conf *conf, const struct cctl_port &port,
std::string &name)
{
@@ -532,6 +526,22 @@
}
}
+static void
+add_kernel_port(struct kports &kports, const struct cctl_port &port,
+ std::string &name)
+{
+ log_debugx("CTL kernel port %u \"%s\"", port.port_id, name.c_str());
+ if (kports.has_port(name)) {
+ log_warnx("Ignoring duplicate kernel port \"%s\"",
+ name.c_str());
+ return;
+ }
+
+ if (!kports.add_port(name, port.port_id)) {
+ log_warnx("kports::add_port failed");
+ }
+}
+
conf_up
conf_new_from_kernel(struct kports &kports)
{
@@ -559,12 +569,11 @@
}
if (port.port_frontend == "iscsi") {
- add_iscsi_port(kports, conf.get(), port, name);
+ add_iscsi_port(conf.get(), port, name);
} else if (port.port_frontend == "nvmf") {
add_nvmf_port(conf.get(), port, name);
} else {
- /* XXX: Treat all unknown ports as iSCSI? */
- add_iscsi_port(kports, conf.get(), port, name);
+ add_kernel_port(kports, port, name);
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jun 28, 12:41 PM (29 m, 10 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34293297
Default Alt Text
D57283.diff (1 KB)
Attached To
Mode
D57283: ctld: Simplify handling of non-iSCSI and non-NVMe kernel ports
Attached
Detach File
Event Timeline
Log In to Comment