Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148039511
D48775.1785189164.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D48775.1785189164.diff
View Options
diff --git a/sys/dev/nvmf/controller/ctl_frontend_nvmf.c b/sys/dev/nvmf/controller/ctl_frontend_nvmf.c
--- a/sys/dev/nvmf/controller/ctl_frontend_nvmf.c
+++ b/sys/dev/nvmf/controller/ctl_frontend_nvmf.c
@@ -95,6 +95,30 @@
sx_xunlock(&np->lock);
}
+static int
+nvmft_info(void *arg, struct sbuf *sb)
+{
+ struct nvmft_port *np = arg;
+ struct nvmft_controller *ctrlr;
+ int retval;
+
+ sx_slock(&np->lock);
+ retval = sbuf_printf(sb, "\t<port>%s,p,%u</port>\n", np->cdata.subnqn,
+ np->portid);
+ if (retval != 0)
+ goto out;
+
+ TAILQ_FOREACH(ctrlr, &np->controllers, link) {
+ retval = sbuf_printf(sb, "\t<host id=\"%u\">%s</host>\n",
+ ctrlr->cntlid, ctrlr->hostnqn);
+ if (retval != 0)
+ break;
+ }
+out:
+ sx_sunlock(&np->lock);
+ return (retval);
+}
+
static int
nvmft_lun_enable(void *arg, int lun_id)
{
@@ -795,6 +819,7 @@
np = malloc(sizeof(*np), M_NVMFT, M_WAITOK | M_ZERO);
refcount_init(&np->refs, 1);
+ np->portid = portid;
np->max_io_qsize = max_io_qsize;
np->cap = _nvmf_controller_cap(max_io_qsize, enable_timeout / 500);
sx_init(&np->lock, "nvmft port");
@@ -826,6 +851,7 @@
port->virtual_port = 0;
port->port_online = nvmft_online;
port->port_offline = nvmft_offline;
+ port->port_info = nvmft_info;
port->onoff_arg = np;
port->lun_enable = nvmft_lun_enable;
port->lun_disable = nvmft_lun_disable;
diff --git a/sys/dev/nvmf/controller/nvmft_var.h b/sys/dev/nvmf/controller/nvmft_var.h
--- a/sys/dev/nvmf/controller/nvmft_var.h
+++ b/sys/dev/nvmf/controller/nvmft_var.h
@@ -33,6 +33,7 @@
struct nvme_firmware_page fp;
uint64_t cap;
uint32_t max_io_qsize;
+ uint16_t portid;
bool online;
struct sx lock;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jul 27, 9:52 PM (15 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29282331
Default Alt Text
D48775.1785189164.diff (1 KB)
Attached To
Mode
D48775: nvmft: Export more info for a ctl port for use by ctladm
Attached
Detach File
Event Timeline
Log In to Comment