Lines Matching +full:endpoint +full:- +full:config

1 .. SPDX-License-Identifier: GPL-2.0
4 NVMe PCI Endpoint Function Target
9 The NVMe PCI endpoint function target driver implements a NVMe PCIe controller
15 The NVMe PCI endpoint function target driver allows exposing a NVMe target
25 The NVMe PCI endpoint function target driver relies as much as possible on the
27 host. However, using the PCI endpoint framework API and DMA API, the driver is
29 implies that the NVMe PCI endpoint function target driver implements several
42 PCI endpoint framework API to raise an interrupt to the host to signal the
45 3) For any command that has a data buffer, the NVMe PCI endpoint target driver
57 -----------------------
63 1) The NVMe PCI endpoint target driver always sets the controller capability
69 3) Since the PCI endpoint framework does not provide a way to handle PCI level
78 ------------------
80 The NVMe PCI endpoint target driver implements support for both PRPs and SGLs.
90 ------------------------------------------------------
92 Most PCI endpoint controllers provide a limited number of mapping windows for
94 endpoint target controllers uses mapping windows for the following.
96 1) One memory window for raising MSI or MSI-X interrupts
100 Given the highly asynchronous nature of the NVMe PCI endpoint target driver
104 windows of the PCI endpoint controller minus two. E.g. for an endpoint PCI
110 -----------------------------
112 Upon binding of the NVMe PCI endpoint target driver to the PCI endpoint
120 the number of MSI-X or MSI vectors available.
124 The NVMe endpoint function driver allows configuring the maximum number of
127 Limitations and NVMe Specification Non-Compliance
128 -------------------------------------------------
130 Similar to the NVMe target core code, the NVMe PCI endpoint target driver does
139 endpoint target device.
142 -------------------
149 In addition to this, at least one PCI endpoint controller driver should be
150 available for the endpoint hardware used.
152 To facilitate testing, enabling the null-blk driver (CONFIG_BLK_DEV_NULL_BLK)
157 ---------------------
159 To use the NVMe PCI endpoint target driver, at least one endpoint controller
162 To find the list of endpoint controller devices in the system::
165 a40000000.pcie-ep
169 # ls /sys/kernel/config/pci_ep/controllers
170 a40000000.pcie-ep
172 The endpoint board must of course also be connected to a host with a PCI cable
173 with RX-TX signal swapped. If the host PCI slot used does not have
174 plug-and-play capabilities, the host should be powered off when the NVMe PCI
175 endpoint device is configured.
177 NVMe Endpoint Device
178 --------------------
180 Creating an NVMe endpoint device is a two step process. First, an NVMe target
181 subsystem and port must be defined. Second, the NVMe PCI endpoint device must
185 ----------------------------------
193 # mount -t configfs none /sys/kernel/config
202 The NVMe PCI endpoint function target driver must be loaded::
211 controller when setting up the NVMe PCI endpoint target device. In this
214 # cd /sys/kernel/config/nvmet/subsystems
216 # echo -n "Linux-pci-epf" > nvmepf.0.nqn/attr_model
226 # echo -n "/dev/nullb0" > nvmepf.0.nqn/namespaces/1/device_path
231 # cd /sys/kernel/config/nvmet/ports
233 # echo -n "pci" > 1/addr_trtype
234 # ln -s /sys/kernel/config/nvmet/subsystems/nvmepf.0.nqn \
235 /sys/kernel/config/nvmet/ports/1/subsystems/nvmepf.0.nqn
237 Creating a NVMe PCI Endpoint Device
238 -----------------------------------
240 With the NVMe target subsystem and port ready for use, the NVMe PCI endpoint
241 device can now be created and enabled. The NVMe PCI endpoint target driver
244 # ls /sys/kernel/config/pci_ep/functions
249 # cd /sys/kernel/config/pci_ep/functions/nvmet_pci_epf
262 # cd /sys/kernel/config/pci_ep/functions/nvmet_pci_epf
266 If the PCI endpoint controller used does not support MSI-X, MSI can be
271 Next, let's bind our endpoint device with the target subsystem and port that we
277 The endpoint function can then be bound to the endpoint controller and the
280 # cd /sys/kernel/config/pci_ep
281 # ln -s functions/nvmet_pci_epf/nvmepf.0 controllers/a40000000.pcie-ep/
282 # echo 1 > controllers/a40000000.pcie-ep/start
284 On the endpoint machine, kernel messages will show information as the NVMe
285 target device and endpoint device are created and connected.
287 .. code-block:: text
292 nvmet_pci_epf nvmet_pci_epf.0: PCI endpoint controller supports MSI-X, 32 vectors
293 …roller 1 for subsystem nvmepf.0.nqn for NQN nqn.2014-08.org.nvmexpress:uuid:2ab90791-2246-4fbb-961…
296 PCI Root-Complex Host
297 ---------------------
300 may be signaled by the PCI endpoint driver with a kernel message). A kernel
301 message on the endpoint will also signal when the host NVMe driver enables the
306 On the host side, the NVMe PCI endpoint function target device will is
309 # lspci -n
318 The NVMe endpoint block device can then be used as any other regular NVMe
320 detailed information about the endpoint device::
322 # nvme id-ctrl /dev/nvme0
327 mn : Linux-pci-epf
328 fr : 6.13.0-r
338 Endpoint Bindings
341 The NVMe PCI endpoint target driver uses the PCI endpoint configfs device
350 subclass_code Must be 0x08 (Non-Volatile Memory controller)
357 interrupt_pin Interrupt PIN to use if MSI and MSI-X are not supported
360 The NVMe PCI endpoint target function also has some specific configurable