Lines Matching +full:protocol +full:- +full:id
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
37 portal_protocol protocol, freebsd::addrinfo_up ai) : in nvmf_io_portal()
38 nvmf_portal(pg, listen, protocol, std::move(ai)) {} in nvmf_io_portal()
49 { return "transport-group"; } in keyword()
52 bool add_portal(const char *value, portal_protocol protocol)
88 bool add_namespace(u_int id, const char *lun_name) override;
91 struct lun *start_namespace(u_int id) override;
147 freebsd::nvlist_up nvl = portal_group()->options(); in prepare()
159 switch (protocol()) { in prepare()
211 nvmf_transport_group::add_portal(const char *value, portal_protocol protocol) in add_portal() argument
215 switch (protocol) { in add_portal()
223 log_warnx("unsupported transport protocol for %s", value); in add_portal()
238 if (protocol == portal_protocol::NVME_DISCOVERY_TCP) { in add_portal()
240 protocol, std::move(ai)); in add_portal()
243 protocol, std::move(ai)); in add_portal()
269 } else if (strcmp(str, "address-name") == 0) { in set_filter()
272 log_warnx("invalid discovery-filter \"%s\" for transport-group " in set_filter()
274 "and \"address-name\"", in set_filter()
281 log_warnx("cannot set discovery-filter to \"%s\" for " in set_filter()
282 "transport-group \"%s\"; already has a different " in set_filter()
312 if (modfind("nvmft") == -1 && kldload("nvmft") == -1) in load_kernel_modules()
316 if (modfind("nvmf/tcp") == -1 && kldload("nvmf_tcp") == -1) in load_kernel_modules()
332 freebsd::nvlist_up nvl = pg->options(); in kernel_create_port()
333 nvlist_add_string(nvl.get(), "subnqn", targ->name()); in kernel_create_port()
335 pg->name()); in kernel_create_port()
336 nvlist_add_stringf(nvl.get(), "portid", "%u", pg->tag()); in kernel_create_port()
348 nvlist_add_string(nvl.get(), "subnqn", p_target->name()); in kernel_remove_port()
356 if (!use_private_auth("host-nqn")) in add_host_nqn()
358 return t_auth_group->add_host_nqn(name); in add_host_nqn()
364 if (!use_private_auth("host-address")) in add_host_address()
366 return t_auth_group->add_host_address(addr); in add_host_address()
370 nvmf_controller::add_namespace(u_int id, const char *lun_name) in add_namespace() argument
372 if (id == 0) { in add_namespace()
373 log_warnx("namespace ID cannot be 0 for %s", label()); in add_namespace()
377 std::string lun_label = "namespace ID " + std::to_string(id - 1); in add_namespace()
378 return target::add_lun(id, lun_label.c_str(), lun_name); in add_namespace()
387 pg = t_conf->find_transport_group(pg_name); in add_portal_group()
389 log_warnx("unknown transport-group \"%s\" for %s", pg_name, in add_portal_group()
395 ag = t_conf->find_auth_group(ag_name); in add_portal_group()
397 log_warnx("unknown auth-group \"%s\" for %s", ag_name, in add_portal_group()
403 if (!t_conf->add_port(this, pg, std::move(ag))) { in add_portal_group()
404 log_warnx("can't link transport-group \"%s\" to %s", pg_name, in add_portal_group()
412 nvmf_controller::start_namespace(u_int id) in start_namespace() argument
414 if (id == 0) { in start_namespace()
415 log_warnx("namespace ID cannot be 0 for %s", label()); in start_namespace()
419 std::string lun_label = "namespace ID " + std::to_string(id - 1); in start_namespace()
420 std::string lun_name = freebsd::stringf("%s,nsid,%u", name(), id); in start_namespace()
421 return target::start_lun(id, lun_label.c_str(), lun_name.c_str()); in start_namespace()
427 return t_conf->find_transport_group("default"); in default_portal_group()