[PATCH v2 2/5] nvmef: export nvmef_create_ctrl()

Damien Le Moal dlemoal at kernel.org
Mon Oct 14 02:10:36 PDT 2024


On 10/14/24 17:42, Christoph Hellwig wrote:
> s/nvmef_create_ctrl/nvmf_create_ctrl/
> 
> But evem looking at the code later using it I fail how this could
> work.
> 
> nvmf_create_ctrl is used to implement writes to the /dev/nvme-fabrics
> control device to create a fabrics controller out of thin air. The
> biggest part of it is parsing the options provided as a string,
> which most importantly includes the actual transport used.
> 
> But you really need to force a pcie transport type here, which
> as far as I can tell isn't even added anywhere.

Nope, the PCIe "transport" is the front-end of the endpoint driver.
What this patch does is to allow this driver to be created by passing it a
string that is normally used for "nvme connect" command, which calls
nvmf_create_ctrl().

The entire thing was created to not add a PCIe host transport but rather to use
a locally created fabric host controller which connect to whatever the user
wants. That is: the PCI endpoint driver can implement a PCI interface which uses
a loop nvme device, or a tcp nvme device (and if you have a board that can do
rdma or fc, that can also be used as the backend nvme device used from the pci
endpoint driver).

I only need this function exported so that I can call it from the configfs
writes of the pci endpoint when the user sets up the endpoint.


-- 
Damien Le Moal
Western Digital Research



More information about the Linux-nvme mailing list