From: Damien Le Moal <dlemoal@kernel.org>
To: linux-nvme@lists.infradead.org, "Keith Busch" <kbusch@kernel.org>,
"Christoph Hellwig" <hch@lst.de>,
"Sagi Grimberg" <sagi@grimberg.me>,
"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
"Krzysztof Wilczyński" <kw@linux.com>,
"Kishon Vijay Abraham I" <kishon@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
linux-pci@vger.kernel.org
Cc: Rick Wertenbroek <rick.wertenbroek@gmail.com>,
Niklas Cassel <cassel@kernel.org>
Subject: [PATCH v2 2/5] nvmef: export nvmef_create_ctrl()
Date: Fri, 11 Oct 2024 21:19:48 +0900 [thread overview]
Message-ID: <20241011121951.90019-3-dlemoal@kernel.org> (raw)
In-Reply-To: <20241011121951.90019-1-dlemoal@kernel.org>
Export nvmef_create_ctrl() to allow drivers to directly call this
function instead of forcing the creation of a fabrics host controller
with a write to /dev/nvmef. The export is restricted to the NVME_FABRICS
namespace.
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
---
drivers/nvme/host/fabrics.c | 4 ++--
drivers/nvme/host/fabrics.h | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
index 432efcbf9e2f..e3c990d50704 100644
--- a/drivers/nvme/host/fabrics.c
+++ b/drivers/nvme/host/fabrics.c
@@ -1276,8 +1276,7 @@ EXPORT_SYMBOL_GPL(nvmf_free_options);
NVMF_OPT_FAIL_FAST_TMO | NVMF_OPT_DHCHAP_SECRET |\
NVMF_OPT_DHCHAP_CTRL_SECRET)
-static struct nvme_ctrl *
-nvmf_create_ctrl(struct device *dev, const char *buf)
+struct nvme_ctrl *nvmf_create_ctrl(struct device *dev, const char *buf)
{
struct nvmf_ctrl_options *opts;
struct nvmf_transport_ops *ops;
@@ -1346,6 +1345,7 @@ nvmf_create_ctrl(struct device *dev, const char *buf)
nvmf_free_options(opts);
return ERR_PTR(ret);
}
+EXPORT_SYMBOL_NS_GPL(nvmf_create_ctrl, NVME_FABRICS);
static const struct class nvmf_class = {
.name = "nvme-fabrics",
diff --git a/drivers/nvme/host/fabrics.h b/drivers/nvme/host/fabrics.h
index 21d75dc4a3a0..2dd3aeb8c53a 100644
--- a/drivers/nvme/host/fabrics.h
+++ b/drivers/nvme/host/fabrics.h
@@ -214,6 +214,7 @@ static inline unsigned int nvmf_nr_io_queues(struct nvmf_ctrl_options *opts)
min(opts->nr_poll_queues, num_online_cpus());
}
+struct nvme_ctrl *nvmf_create_ctrl(struct device *dev, const char *buf);
int nvmf_reg_read32(struct nvme_ctrl *ctrl, u32 off, u32 *val);
int nvmf_reg_read64(struct nvme_ctrl *ctrl, u32 off, u64 *val);
int nvmf_reg_write32(struct nvme_ctrl *ctrl, u32 off, u32 val);
--
2.47.0
next prev parent reply other threads:[~2024-10-11 12:31 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-11 12:19 [PATCH v2 0/5] NVMe PCI endpoint function driver Damien Le Moal
2024-10-11 12:19 ` [PATCH v2 1/5] nvmet: rename and move nvmet_get_log_page_len() Damien Le Moal
2024-10-14 6:24 ` Chaitanya Kulkarni
2024-10-11 12:19 ` Damien Le Moal [this message]
2024-10-14 6:32 ` [PATCH v2 2/5] nvmef: export nvmef_create_ctrl() Chaitanya Kulkarni
2024-10-14 8:42 ` Christoph Hellwig
2024-10-14 9:10 ` Damien Le Moal
2024-10-14 11:45 ` Christoph Hellwig
2024-10-11 12:19 ` [PATCH v2 3/5] nvmef: Introduce the NVME_OPT_HIDDEN_NS option Damien Le Moal
2024-10-14 8:42 ` Christoph Hellwig
2024-10-14 9:12 ` Damien Le Moal
2024-10-11 12:19 ` [PATCH v2 4/5] PCI: endpoint: Add NVMe endpoint function driver Damien Le Moal
2024-10-14 8:44 ` Christoph Hellwig
2024-10-14 10:41 ` Damien Le Moal
2024-10-14 11:38 ` Christoph Hellwig
2024-10-11 12:19 ` [PATCH v2 5/5] PCI: endpoint: Document the " Damien Le Moal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241011121951.90019-3-dlemoal@kernel.org \
--to=dlemoal@kernel.org \
--cc=bhelgaas@google.com \
--cc=cassel@kernel.org \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=kishon@kernel.org \
--cc=kw@linux.com \
--cc=linux-nvme@lists.infradead.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=rick.wertenbroek@gmail.com \
--cc=sagi@grimberg.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.