Lines Matching +full:in +full:- +full:memory
1 .. SPDX-License-Identifier: GPL-2.0
4 PCI Peer-to-Peer DMA Support
9 called Peer-to-Peer (or P2P). However, there are a number of issues that
10 make P2P transactions tricky to do in a perfectly safe way.
13 transactions between hierarchy domains, and in PCIe, each Root Port
18 same PCI bridge, as such devices are all in the same PCI hierarchy
23 The second issue is that to make use of existing interfaces in Linux,
24 memory that is used for P2P transactions needs to be backed by struct
33 In a given P2P implementation there may be three or more different
34 types of kernel drivers in play:
36 * Provider - A driver which provides or publishes P2P resources like
37 memory or doorbell registers to other drivers.
38 * Client - A driver which makes use of a resource by setting up a
40 * Orchestrator - A driver which orchestrates the flow of data between
43 In many cases there could be overlap between these three types (i.e.,
46 For example, in the NVMe Target Copy Offload implementation:
49 in that it exposes any CMB (Controller Memory Buffer) as a P2P memory
50 resource (provider), it accepts P2P memory pages as buffers in requests
53 * The RDMA driver is a client in this arrangement so that an RNIC
54 can DMA directly to the memory exposed by the NVMe device.
56 to the P2P memory (CMB) and then to the NVMe device (and vice versa).
61 memory behind it, its driver could add support as a P2P provider and
62 then the NVMe Target could use the RNIC's memory instead of the CMB
63 in cases where the NVMe cards in use do not have CMB support.
67 ----------------
71 This will register struct pages for all the specified memory.
74 P2P memory using :c:func:`pci_p2pmem_publish()`. This will allow
75 any orchestrator drivers to find and use the memory. When marked in
76 this way, the resource must be regular memory with no side effects.
78 For the time being this is fairly rudimentary in that all resources
79 are typically going to be P2P memory. Future work will likely expand
84 --------------
88 of the usual :c:func:`dma_map_sg()` function. Memory mapped in this
93 functions and when to use the regular mapping functions. In some
95 given request is P2P memory and map appropriately. It is important to
96 ensure that struct pages that back P2P memory stay out of code that
98 regular memory which may not be appropriate.
102 --------------------
105 all client devices that will be involved in a given transaction. For
107 block device and the RNIC in use. If the orchestrator has access to
109 :c:func:`pci_p2pdma_distance()` otherwise it may find a memory provider
120 allocate P2P memory from the provider. :c:func:`pci_p2pmem_alloc_sgl()`
122 allocating scatter-gather lists with P2P memory.
125 -------------------
132 P2P memory is also technically IO memory but should never have any side
140 .. kernel-doc:: drivers/pci/p2pdma.c