sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget)/translations/zh_CN/driver-api/pci/p2pdmamodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget)/translations/zh_TW/driver-api/pci/p2pdmamodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget)/translations/it_IT/driver-api/pci/p2pdmamodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget)/translations/ja_JP/driver-api/pci/p2pdmamodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget)/translations/ko_KR/driver-api/pci/p2pdmamodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget)/translations/sp_SP/driver-api/pci/p2pdmamodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhhC/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma.rsthKubhsection)}(hhh](htitle)}(hPCI Peer-to-Peer DMA Supporth]hPCI Peer-to-Peer DMA Support}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hXThe PCI bus has pretty decent support for performing DMA transfers between two devices on the bus. This type of transaction is henceforth called Peer-to-Peer (or P2P). However, there are a number of issues that make P2P transactions tricky to do in a perfectly safe way.h]hXThe PCI bus has pretty decent support for performing DMA transfers between two devices on the bus. This type of transaction is henceforth called Peer-to-Peer (or P2P). However, there are a number of issues that make P2P transactions tricky to do in a perfectly safe way.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hXtFor PCIe the routing of Transaction Layer Packets (TLPs) is well-defined up until they reach a host bridge or root port. If the path includes PCIe switches then based on the ACS settings the transaction can route entirely within the PCIe hierarchy and never reach the root port. The kernel will evaluate the PCIe topology and always permit P2P in these well-defined cases.h]hXtFor PCIe the routing of Transaction Layer Packets (TLPs) is well-defined up until they reach a host bridge or root port. If the path includes PCIe switches then based on the ACS settings the transaction can route entirely within the PCIe hierarchy and never reach the root port. The kernel will evaluate the PCIe topology and always permit P2P in these well-defined cases.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hHowever, if the P2P transaction reaches the host bridge then it might have to hairpin back out the same root port, be routed inside the CPU SOC to another PCIe root port, or routed internally to the SOC.h]hHowever, if the P2P transaction reaches the host bridge then it might have to hairpin back out the same root port, be routed inside the CPU SOC to another PCIe root port, or routed internally to the SOC.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hXThe PCIe specification doesn't define the forwarding of transactions between hierarchy domains and kernel defaults to blocking such routing. There is an allow list to allow detecting known-good HW, in which case P2P between any two PCIe devices will be permitted.h]hX The PCIe specification doesn’t define the forwarding of transactions between hierarchy domains and kernel defaults to blocking such routing. There is an allow list to allow detecting known-good HW, in which case P2P between any two PCIe devices will be permitted.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hXSince P2P inherently is doing transactions between two devices it requires two drivers to be co-operating inside the kernel. The providing driver has to convey its MMIO to the consuming driver. To meet the driver model lifecycle rules the MMIO must have all DMA mapping removed, all CPU accesses prevented, all page table mappings undone before the providing driver completes remove().h]hXSince P2P inherently is doing transactions between two devices it requires two drivers to be co-operating inside the kernel. The providing driver has to convey its MMIO to the consuming driver. To meet the driver model lifecycle rules the MMIO must have all DMA mapping removed, all CPU accesses prevented, all page table mappings undone before the providing driver completes remove().}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hXThis requires the providing and consuming driver to actively work together to guarantee that the consuming driver has stopped using the MMIO during a removal cycle. This is done by either a synchronous invalidation shutdown or waiting for all usage refcounts to reach zero.h]hXThis requires the providing and consuming driver to actively work together to guarantee that the consuming driver has stopped using the MMIO during a removal cycle. This is done by either a synchronous invalidation shutdown or waiting for all usage refcounts to reach zero.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK!hhhhubh)}(hXAt the lowest level the P2P subsystem offers a naked struct p2p_provider that delegates lifecycle management to the providing driver. It is expected that drivers using this option will wrap their MMIO memory in DMABUF and use DMABUF to provide an invalidation shutdown. These MMIO addresess have no struct page, and if used with mmap() must create special PTEs. As such there are very few kernel uAPIs that can accept pointers to them; in particular they cannot be used with read()/write(), including O_DIRECT.h]hXAt the lowest level the P2P subsystem offers a naked struct p2p_provider that delegates lifecycle management to the providing driver. It is expected that drivers using this option will wrap their MMIO memory in DMABUF and use DMABUF to provide an invalidation shutdown. These MMIO addresess have no struct page, and if used with mmap() must create special PTEs. As such there are very few kernel uAPIs that can accept pointers to them; in particular they cannot be used with read()/write(), including O_DIRECT.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK&hhhhubh)}(hX(Building on this, the subsystem offers a layer to wrap the MMIO in a ZONE_DEVICE pgmap of MEMORY_DEVICE_PCI_P2PDMA to create struct pages. The lifecycle of pgmap ensures that when the pgmap is destroyed all other drivers have stopped using the MMIO. This option works with O_DIRECT flows, in some cases, if the underlying subsystem supports handling MEMORY_DEVICE_PCI_P2PDMA through FOLL_PCI_P2PDMA. The use of FOLL_LONGTERM is prevented. As this relies on pgmap it also relies on architecture support along with alignment and minimum size limitations.h]hX(Building on this, the subsystem offers a layer to wrap the MMIO in a ZONE_DEVICE pgmap of MEMORY_DEVICE_PCI_P2PDMA to create struct pages. The lifecycle of pgmap ensures that when the pgmap is destroyed all other drivers have stopped using the MMIO. This option works with O_DIRECT flows, in some cases, if the underlying subsystem supports handling MEMORY_DEVICE_PCI_P2PDMA through FOLL_PCI_P2PDMA. The use of FOLL_LONGTERM is prevented. As this relies on pgmap it also relies on architecture support along with alignment and minimum size limitations.}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK.hhhhubh)}(hhh](h)}(hDriver Writer's Guideh]hDriver Writer’s Guide}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj;hhhhhK9ubh)}(hcIn a given P2P implementation there may be three or more different types of kernel drivers in play:h]hcIn a given P2P implementation there may be three or more different types of kernel drivers in play:}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK;hj;hhubh bullet_list)}(hhh](h list_item)}(hqProvider - A driver which provides or publishes P2P resources like memory or doorbell registers to other drivers.h]h)}(hqProvider - A driver which provides or publishes P2P resources like memory or doorbell registers to other drivers.h]hqProvider - A driver which provides or publishes P2P resources like memory or doorbell registers to other drivers.}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK>hjaubah}(h]h ]h"]h$]h&]uh1j_hj\hhhhhNubj`)}(h^Client - A driver which makes use of a resource by setting up a DMA transaction to or from it.h]h)}(h^Client - A driver which makes use of a resource by setting up a DMA transaction to or from it.h]h^Client - A driver which makes use of a resource by setting up a DMA transaction to or from it.}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK@hjyubah}(h]h ]h"]h$]h&]uh1j_hj\hhhhhNubj`)}(h[Orchestrator - A driver which orchestrates the flow of data between clients and providers. h]h)}(hZOrchestrator - A driver which orchestrates the flow of data between clients and providers.h]hZOrchestrator - A driver which orchestrates the flow of data between clients and providers.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKBhjubah}(h]h ]h"]h$]h&]uh1j_hj\hhhhhNubeh}(h]h ]h"]h$]h&]bullet*uh1jZhhhK>hj;hhubh)}(hIn many cases there could be overlap between these three types (i.e., it may be typical for a driver to be both a provider and a client).h]hIn many cases there could be overlap between these three types (i.e., it may be typical for a driver to be both a provider and a client).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKEhj;hhubh)}(h hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj- ubh)}(hhh]j()}(hpci_devh]hpci_dev}(hjO hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjL ubah}(h]h ]h"]h$]h&] refdomainjVreftypej reftargetjQ modnameN classnameNjj)}j]j)}jj sbc.pci_p2pdma_add_resourceasbuh1hhj- ubj)}(h h]h }(hjo hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj- ubj)}(hjh]h*}(hj} hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj- ubj()}(hpdevh]hpdev}(hj hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hj- ubeh}(h]h ]h"]h$]h&]noemphhhuh1jFhj) ubjG)}(hint barh](j)}(hinth]hint}(hj hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj()}(hbarh]hbar}(hj hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hj ubeh}(h]h ]h"]h$]h&]noemphhhuh1jFhj) ubjG)}(h size_t sizeh](h)}(hhh]j()}(hsize_th]hsize_t}(hj hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hj ubah}(h]h ]h"]h$]h&] refdomainjVreftypej reftargetj modnameN classnameNjj)}j]jk c.pci_p2pdma_add_resourceasbuh1hhj ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj()}(hsizeh]hsize}(hj hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hj ubeh}(h]h ]h"]h$]h&]noemphhhuh1jFhj) ubjG)}(h u64 offseth](h)}(hhh]j()}(hu64h]hu64}(hj# hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hj ubah}(h]h ]h"]h$]h&] refdomainjVreftypej reftargetj% modnameN classnameNjj)}j]jk c.pci_p2pdma_add_resourceasbuh1hhj ubj)}(h h]h }(hjA hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj()}(hoffseth]hoffset}(hjO hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hj ubeh}(h]h ]h"]h$]h&]noemphhhuh1jFhj) ubeh}(h]h ]h"]h$]h&]hhuh1j@hjhhhj hMnubeh}(h]h ]h"]h$]h&]hhjuh1jjjhjhhhj hMnubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1jhj hMnhjhhubj)}(hhh]h)}(h add memory for use as p2p memoryh]h add memory for use as p2p memory}(hjy hhhNhNubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMnhjv hhubah}(h]h ]h"]h$]h&]uh1jhjhhhj hMnubeh}(h]h ](jVfunctioneh"]h$]h&]jjVjj jj jjj uh1jhhhjhNhNubj )}(hXR**Parameters** ``struct pci_dev *pdev`` the device to add the memory to ``int bar`` PCI BAR to add ``size_t size`` size of the memory to add, may be zero to use the whole BAR ``u64 offset`` offset into the PCI BAR **Description** The memory will be given ZONE_DEVICE struct pages so that it may be used with any DMA request.h](h)}(h**Parameters**h]j)}(hj h]h Parameters}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMrhj ubj+)}(hhh](j0)}(h9``struct pci_dev *pdev`` the device to add the memory to h](j6)}(h``struct pci_dev *pdev``h]jJ)}(hj h]hstruct pci_dev *pdev}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jIhj ubah}(h]h ]h"]h$]h&]uh1j5h[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMohj ubjP)}(hhh]h)}(hthe device to add the memory toh]hthe device to add the memory to}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hMohj ubah}(h]h ]h"]h$]h&]uh1jOhj ubeh}(h]h ]h"]h$]h&]uh1j/hj hMohj ubj0)}(h``int bar`` PCI BAR to add h](j6)}(h ``int bar``h]jJ)}(hj h]hint bar}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jIhj ubah}(h]h ]h"]h$]h&]uh1j5h[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMphj ubjP)}(hhh]h)}(hPCI BAR to addh]hPCI BAR to add}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hMphj ubah}(h]h ]h"]h$]h&]uh1jOhj ubeh}(h]h ]h"]h$]h&]uh1j/hj hMphj ubj0)}(hL``size_t size`` size of the memory to add, may be zero to use the whole BAR h](j6)}(h``size_t size``h]jJ)}(hj, h]h size_t size}(hj. hhhNhNubah}(h]h ]h"]h$]h&]uh1jIhj* ubah}(h]h ]h"]h$]h&]uh1j5h[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMqhj& ubjP)}(hhh]h)}(h;size of the memory to add, may be zero to use the whole BARh]h;size of the memory to add, may be zero to use the whole BAR}(hjE hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjA hMqhjB ubah}(h]h ]h"]h$]h&]uh1jOhj& ubeh}(h]h ]h"]h$]h&]uh1j/hjA hMqhj ubj0)}(h'``u64 offset`` offset into the PCI BAR h](j6)}(h``u64 offset``h]jJ)}(hje h]h u64 offset}(hjg hhhNhNubah}(h]h ]h"]h$]h&]uh1jIhjc ubah}(h]h ]h"]h$]h&]uh1j5h[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMrhj_ ubjP)}(hhh]h)}(hoffset into the PCI BARh]hoffset into the PCI BAR}(hj~ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjz hMrhj{ ubah}(h]h ]h"]h$]h&]uh1jOhj_ ubeh}(h]h ]h"]h$]h&]uh1j/hjz hMrhj ubeh}(h]h ]h"]h$]h&]uh1j*hj ubh)}(h**Description**h]j)}(hj h]h Description}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMthj ubh)}(h^The memory will be given ZONE_DEVICE struct pages so that it may be used with any DMA request.h]h^The memory will be given ZONE_DEVICE struct pages so that it may be used with any DMA request.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMshj ubeh}(h]h ] kernelindentah"]h$]h&]uh1j hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j%pci_p2pdma_distance_many (C function)c.pci_p2pdma_distance_manyhNtauh1jhjhhhNhNubj)}(hhh](j)}(hoint pci_p2pdma_distance_many (struct pci_dev *provider, struct device **clients, int num_clients, bool verbose)h]j)}(hnint pci_p2pdma_distance_many(struct pci_dev *provider, struct device **clients, int num_clients, bool verbose)h](j)}(hinth]hint}(hj hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj hhh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj hhhj hMubj")}(hpci_p2pdma_distance_manyh]j()}(hpci_p2pdma_distance_manyh]hpci_p2pdma_distance_many}(hj hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hj ubah}(h]h ](j;j<eh"]h$]h&]hhuh1j!hj hhhj hMubjA)}(hR(struct pci_dev *provider, struct device **clients, int num_clients, bool verbose)h](jG)}(hstruct pci_dev *providerh](jM)}(hjPh]hstruct}(hj" hhhNhNubah}(h]h ]jYah"]h$]h&]uh1jLhj ubj)}(h h]h }(hj/ hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubh)}(hhh]j()}(hpci_devh]hpci_dev}(hj@ hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hj= ubah}(h]h ]h"]h$]h&] refdomainjVreftypej reftargetjB modnameN classnameNjj)}j]j)}jj sbc.pci_p2pdma_distance_manyasbuh1hhj ubj)}(h h]h }(hj` hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(hjh]h*}(hjn hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj()}(hproviderh]hprovider}(hj{ hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hj ubeh}(h]h ]h"]h$]h&]noemphhhuh1jFhj ubjG)}(hstruct device **clientsh](jM)}(hjPh]hstruct}(hj hhhNhNubah}(h]h ]jYah"]h$]h&]uh1jLhj ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubh)}(hhh]j()}(hdeviceh]hdevice}(hj hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hj ubah}(h]h ]h"]h$]h&] refdomainjVreftypej reftargetj modnameN classnameNjj)}j]j\ c.pci_p2pdma_distance_manyasbuh1hhj ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(hjh]h*}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(hjh]h*}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj()}(hclientsh]hclients}(hj hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hj ubeh}(h]h ]h"]h$]h&]noemphhhuh1jFhj ubjG)}(hint num_clientsh](j)}(hinth]hint}(hj hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj()}(h num_clientsh]h num_clients}(hj- hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hj ubeh}(h]h ]h"]h$]h&]noemphhhuh1jFhj ubjG)}(h bool verboseh](j)}(hboolh]hbool}(hjF hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjB ubj)}(h h]h }(hjT hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjB ubj()}(hverboseh]hverbose}(hjb hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjB ubeh}(h]h ]h"]h$]h&]noemphhhuh1jFhj ubeh}(h]h ]h"]h$]h&]hhuh1j@hj hhhj hMubeh}(h]h ]h"]h$]h&]hhjuh1jjjhj hhhj hMubah}(h]j ah ](jjeh"]h$]h&]jj)jhuh1jhj hMhj hhubj)}(hhh]h)}(hSDetermine the cumulative distance between a p2pdma provider and the clients in use.h]hSDetermine the cumulative distance between a p2pdma provider and the clients in use.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhj hhubah}(h]h ]h"]h$]h&]uh1jhj hhhj hMubeh}(h]h ](jVfunctioneh"]h$]h&]jjVjj jj jjj uh1jhhhjhNhNubj )}(hX**Parameters** ``struct pci_dev *provider`` p2pdma provider to check against the client list ``struct device **clients`` array of devices to check (NULL-terminated) ``int num_clients`` number of clients in the array ``bool verbose`` if true, print warnings for devices when we return -1 **Description** Returns -1 if any of the clients are not compatible, otherwise returns a positive number where a lower number is the preferable choice. (If there's one client that's the same as the provider it will return 0, which is best choice). "compatible" means the provider and the clients are either all behind the same PCI root port or the host bridges connected to each of the devices are listed in the 'pci_p2pdma_whitelist'.h](h)}(h**Parameters**h]j)}(hj h]h Parameters}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhj ubj+)}(hhh](j0)}(hN``struct pci_dev *provider`` p2pdma provider to check against the client list h](j6)}(h``struct pci_dev *provider``h]jJ)}(hj h]hstruct pci_dev *provider}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jIhj ubah}(h]h ]h"]h$]h&]uh1j5h[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhj ubjP)}(hhh]h)}(h0p2pdma provider to check against the client listh]h0p2pdma provider to check against the client list}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hMhj ubah}(h]h ]h"]h$]h&]uh1jOhj ubeh}(h]h ]h"]h$]h&]uh1j/hj hMhj ubj0)}(hH``struct device **clients`` array of devices to check (NULL-terminated) h](j6)}(h``struct device **clients``h]jJ)}(hjh]hstruct device **clients}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jIhjubah}(h]h ]h"]h$]h&]uh1j5h[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhjubjP)}(hhh]h)}(h+array of devices to check (NULL-terminated)h]h+array of devices to check (NULL-terminated)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jOhjubeh}(h]h ]h"]h$]h&]uh1j/hjhMhj ubj0)}(h3``int num_clients`` number of clients in the array h](j6)}(h``int num_clients``h]jJ)}(hj?h]hint num_clients}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1jIhj=ubah}(h]h ]h"]h$]h&]uh1j5h[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhj9ubjP)}(hhh]h)}(hnumber of clients in the arrayh]hnumber of clients in the array}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjThMhjUubah}(h]h ]h"]h$]h&]uh1jOhj9ubeh}(h]h ]h"]h$]h&]uh1j/hjThMhj ubj0)}(hG``bool verbose`` if true, print warnings for devices when we return -1 h](j6)}(h``bool verbose``h]jJ)}(hjxh]h bool verbose}(hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1jIhjvubah}(h]h ]h"]h$]h&]uh1j5h[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhjrubjP)}(hhh]h)}(h5if true, print warnings for devices when we return -1h]h5if true, print warnings for devices when we return -1}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jOhjrubeh}(h]h ]h"]h$]h&]uh1j/hjhMhj ubeh}(h]h ]h"]h$]h&]uh1j*hj ubh)}(h**Description**h]j)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhj ubh)}(hReturns -1 if any of the clients are not compatible, otherwise returns a positive number where a lower number is the preferable choice. (If there's one client that's the same as the provider it will return 0, which is best choice).h]hReturns -1 if any of the clients are not compatible, otherwise returns a positive number where a lower number is the preferable choice. (If there’s one client that’s the same as the provider it will return 0, which is best choice).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhj ubh)}(h"compatible" means the provider and the clients are either all behind the same PCI root port or the host bridges connected to each of the devices are listed in the 'pci_p2pdma_whitelist'.h]h“compatible” means the provider and the clients are either all behind the same PCI root port or the host bridges connected to each of the devices are listed in the ‘pci_p2pdma_whitelist’.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chM hj ubeh}(h]h ] kernelindentah"]h$]h&]uh1j hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j!pci_p2pmem_find_many (C function)c.pci_p2pmem_find_manyhNtauh1jhjhhhNhNubj)}(hhh](j)}(hPstruct pci_dev * pci_p2pmem_find_many (struct device **clients, int num_clients)h]j)}(hNstruct pci_dev *pci_p2pmem_find_many(struct device **clients, int num_clients)h](jM)}(hjPh]hstruct}(hjhhhNhNubah}(h]h ]jYah"]h$]h&]uh1jLhjhhh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMLubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhjhMLubh)}(hhh]j()}(hpci_devh]hpci_dev}(hj&hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hj#ubah}(h]h ]h"]h$]h&] refdomainjVreftypej reftargetj(modnameN classnameNjj)}j]j)}jpci_p2pmem_find_manysbc.pci_p2pmem_find_manyasbuh1hhjhhhjhMLubj)}(h h]h }(hjGhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhjhMLubj)}(hjh]h*}(hjUhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhjhMLubj")}(hpci_p2pmem_find_manyh]j()}(hjDh]hpci_p2pmem_find_many}(hjfhhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjbubah}(h]h ](j;j<eh"]h$]h&]hhuh1j!hjhhhjhMLubjA)}(h*(struct device **clients, int num_clients)h](jG)}(hstruct device **clientsh](jM)}(hjPh]hstruct}(hjhhhNhNubah}(h]h ]jYah"]h$]h&]uh1jLhj}ubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj}ubh)}(hhh]j()}(hdeviceh]hdevice}(hjhhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjubah}(h]h ]h"]h$]h&] refdomainjVreftypej reftargetjmodnameN classnameNjj)}j]jBc.pci_p2pmem_find_manyasbuh1hhj}ubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj}ubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj}ubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj}ubj()}(hclientsh]hclients}(hjhhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hj}ubeh}(h]h ]h"]h$]h&]noemphhhuh1jFhjyubjG)}(hint num_clientsh](j)}(hinth]hint}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj()}(h num_clientsh]h num_clients}(hjhhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjubeh}(h]h ]h"]h$]h&]noemphhhuh1jFhjyubeh}(h]h ]h"]h$]h&]hhuh1j@hjhhhjhMLubeh}(h]h ]h"]h$]h&]hhjuh1jjjhjhhhjhMLubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1jhjhMLhjhhubj)}(hhh]h)}(hifind a peer-to-peer DMA memory device compatible with the specified list of clients and shortest distanceh]hifind a peer-to-peer DMA memory device compatible with the specified list of clients and shortest distance}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMLhjAhhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhMLubeh}(h]h ](jVfunctioneh"]h$]h&]jjVjj\jj\jjj uh1jhhhjhNhNubj )}(hX**Parameters** ``struct device **clients`` array of devices to check (NULL-terminated) ``int num_clients`` number of client devices in the list **Description** If multiple devices are behind the same switch, the one "closest" to the client devices in use will be chosen first. (So if one of the providers is the same as one of the clients, that provider will be used ahead of any other providers that are unrelated). If multiple providers are an equal distance away, one will be chosen at random. Returns a pointer to the PCI device with a reference taken (use pci_dev_put to return the reference) or NULL if no compatible device is found. The found provider will also be assigned to the client list.h](h)}(h**Parameters**h]j)}(hjfh]h Parameters}(hjhhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjdubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMPhj`ubj+)}(hhh](j0)}(hH``struct device **clients`` array of devices to check (NULL-terminated) h](j6)}(h``struct device **clients``h]jJ)}(hjh]hstruct device **clients}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jIhjubah}(h]h ]h"]h$]h&]uh1j5h[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMNhjubjP)}(hhh]h)}(h+array of devices to check (NULL-terminated)h]h+array of devices to check (NULL-terminated)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMNhjubah}(h]h ]h"]h$]h&]uh1jOhjubeh}(h]h ]h"]h$]h&]uh1j/hjhMNhj|ubj0)}(h9``int num_clients`` number of client devices in the list h](j6)}(h``int num_clients``h]jJ)}(hjh]hint num_clients}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jIhjubah}(h]h ]h"]h$]h&]uh1j5h[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMOhjubjP)}(hhh]h)}(h$number of client devices in the listh]h$number of client devices in the list}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMOhjubah}(h]h ]h"]h$]h&]uh1jOhjubeh}(h]h ]h"]h$]h&]uh1j/hjhMOhj|ubeh}(h]h ]h"]h$]h&]uh1j*hj`ubh)}(h**Description**h]j)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h] h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMQhj`ubh)}(hXPIf multiple devices are behind the same switch, the one "closest" to the client devices in use will be chosen first. (So if one of the providers is the same as one of the clients, that provider will be used ahead of any other providers that are unrelated). If multiple providers are an equal distance away, one will be chosen at random.h]hXTIf multiple devices are behind the same switch, the one “closest” to the client devices in use will be chosen first. (So if one of the providers is the same as one of the clients, that provider will be used ahead of any other providers that are unrelated). If multiple providers are an equal distance away, one will be chosen at random.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMPhj`ubh)}(hReturns a pointer to the PCI device with a reference taken (use pci_dev_put to return the reference) or NULL if no compatible device is found. The found provider will also be assigned to the client list.h]hReturns a pointer to the PCI device with a reference taken (use pci_dev_put to return the reference) or NULL if no compatible device is found. The found provider will also be assigned to the client list.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMVhj`ubeh}(h]h ] kernelindentah"]h$]h&]uh1j hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jpci_alloc_p2pmem (C function)c.pci_alloc_p2pmemhNtauh1jhjhhhNhNubj)}(hhh](j)}(h;void * pci_alloc_p2pmem (struct pci_dev *pdev, size_t size)h]j)}(h9void *pci_alloc_p2pmem(struct pci_dev *pdev, size_t size)h](j)}(hvoidh]hvoid}(hjMhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjIhhh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMubj)}(h h]h }(hj\hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjIhhhj[hMubj)}(hjh]h*}(hjjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjIhhhj[hMubj")}(hpci_alloc_p2pmemh]j()}(hpci_alloc_p2pmemh]hpci_alloc_p2pmem}(hj{hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjwubah}(h]h ](j;j<eh"]h$]h&]hhuh1j!hjIhhhj[hMubjA)}(h#(struct pci_dev *pdev, size_t size)h](jG)}(hstruct pci_dev *pdevh](jM)}(hjPh]hstruct}(hjhhhNhNubah}(h]h ]jYah"]h$]h&]uh1jLhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubh)}(hhh]j()}(hpci_devh]hpci_dev}(hjhhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjubah}(h]h ]h"]h$]h&] refdomainjVreftypej reftargetjmodnameN classnameNjj)}j]j)}jj}sbc.pci_alloc_p2pmemasbuh1hhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj()}(hpdevh]hpdev}(hjhhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjubeh}(h]h ]h"]h$]h&]noemphhhuh1jFhjubjG)}(h size_t sizeh](h)}(hhh]j()}(hsize_th]hsize_t}(hj hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hj ubah}(h]h ]h"]h$]h&] refdomainjVreftypej reftargetjmodnameN classnameNjj)}j]jc.pci_alloc_p2pmemasbuh1hhjubj)}(h h]h }(hj*hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj()}(hsizeh]hsize}(hj8hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjubeh}(h]h ]h"]h$]h&]noemphhhuh1jFhjubeh}(h]h ]h"]h$]h&]hhuh1j@hjIhhhj[hMubeh}(h]h ]h"]h$]h&]hhjuh1jjjhjEhhhj[hMubah}(h]j@ah ](jjeh"]h$]h&]jj)jhuh1jhj[hMhjBhhubj)}(hhh]h)}(h allocate peer-to-peer DMA memoryh]h allocate peer-to-peer DMA memory}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhj_hhubah}(h]h ]h"]h$]h&]uh1jhjBhhhj[hMubeh}(h]h ](jVfunctioneh"]h$]h&]jjVjjzjjzjjj uh1jhhhjhNhNubj )}(h**Parameters** ``struct pci_dev *pdev`` the device to allocate memory from ``size_t size`` number of bytes to allocate **Description** Returns the allocated memory or NULL on error.h](h)}(h**Parameters**h]j)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhj~ubj+)}(hhh](j0)}(h<``struct pci_dev *pdev`` the device to allocate memory from h](j6)}(h``struct pci_dev *pdev``h]jJ)}(hjh]hstruct pci_dev *pdev}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jIhjubah}(h]h ]h"]h$]h&]uh1j5h[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhjubjP)}(hhh]h)}(h"the device to allocate memory fromh]h"the device to allocate memory from}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jOhjubeh}(h]h ]h"]h$]h&]uh1j/hjhMhjubj0)}(h,``size_t size`` number of bytes to allocate h](j6)}(h``size_t size``h]jJ)}(hjh]h size_t size}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jIhjubah}(h]h ]h"]h$]h&]uh1j5h[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhjubjP)}(hhh]h)}(hnumber of bytes to allocateh]hnumber of bytes to allocate}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jOhjubeh}(h]h ]h"]h$]h&]uh1j/hjhMhjubeh}(h]h ]h"]h$]h&]uh1j*hj~ubh)}(h**Description**h]j)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhj~ubh)}(h.Returns the allocated memory or NULL on error.h]h.Returns the allocated memory or NULL on error.}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhj~ubeh}(h]h ] kernelindentah"]h$]h&]uh1j hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jpci_free_p2pmem (C function)c.pci_free_p2pmemhNtauh1jhjhhhNhNubj)}(hhh](j)}(hDvoid pci_free_p2pmem (struct pci_dev *pdev, void *addr, size_t size)h]j)}(hCvoid pci_free_p2pmem(struct pci_dev *pdev, void *addr, size_t size)h](j)}(hvoidh]hvoid}(hj\hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjXhhh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMubj)}(h h]h }(hjkhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjXhhhjjhMubj")}(hpci_free_p2pmemh]j()}(hpci_free_p2pmemh]hpci_free_p2pmem}(hj}hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjyubah}(h]h ](j;j<eh"]h$]h&]hhuh1j!hjXhhhjjhMubjA)}(h/(struct pci_dev *pdev, void *addr, size_t size)h](jG)}(hstruct pci_dev *pdevh](jM)}(hjPh]hstruct}(hjhhhNhNubah}(h]h ]jYah"]h$]h&]uh1jLhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubh)}(hhh]j()}(hpci_devh]hpci_dev}(hjhhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjubah}(h]h ]h"]h$]h&] refdomainjVreftypej reftargetjmodnameN classnameNjj)}j]j)}jjsbc.pci_free_p2pmemasbuh1hhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj()}(hpdevh]hpdev}(hjhhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjubeh}(h]h ]h"]h$]h&]noemphhhuh1jFhjubjG)}(h void *addrh](j)}(hvoidh]hvoid}(hj hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hjh]h*}(hj'hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj()}(haddrh]haddr}(hj4hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjubeh}(h]h ]h"]h$]h&]noemphhhuh1jFhjubjG)}(h size_t sizeh](h)}(hhh]j()}(hsize_th]hsize_t}(hjPhhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjMubah}(h]h ]h"]h$]h&] refdomainjVreftypej reftargetjRmodnameN classnameNjj)}j]jc.pci_free_p2pmemasbuh1hhjIubj)}(h h]h }(hjnhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjIubj()}(hsizeh]hsize}(hj|hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjIubeh}(h]h ]h"]h$]h&]noemphhhuh1jFhjubeh}(h]h ]h"]h$]h&]hhuh1j@hjXhhhjjhMubeh}(h]h ]h"]h$]h&]hhjuh1jjjhjThhhjjhMubah}(h]jOah ](jjeh"]h$]h&]jj)jhuh1jhjjhMhjQhhubj)}(hhh]h)}(hfree peer-to-peer DMA memoryh]hfree peer-to-peer DMA memory}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhjhhubah}(h]h ]h"]h$]h&]uh1jhjQhhhjjhMubeh}(h]h ](jVfunctioneh"]h$]h&]jjVjjjjjjj uh1jhhhjhNhNubj )}(h**Parameters** ``struct pci_dev *pdev`` the device the memory was allocated from ``void *addr`` address of the memory that was allocated ``size_t size`` number of bytes that were allocatedh](h)}(h**Parameters**h]j)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhjubj+)}(hhh](j0)}(hB``struct pci_dev *pdev`` the device the memory was allocated from h](j6)}(h``struct pci_dev *pdev``h]jJ)}(hjh]hstruct pci_dev *pdev}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jIhjubah}(h]h ]h"]h$]h&]uh1j5h[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhjubjP)}(hhh]h)}(h(the device the memory was allocated fromh]h(the device the memory was allocated from}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jOhjubeh}(h]h ]h"]h$]h&]uh1j/hjhMhjubj0)}(h8``void *addr`` address of the memory that was allocated h](j6)}(h``void *addr``h]jJ)}(hj h]h void *addr}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1jIhjubah}(h]h ]h"]h$]h&]uh1j5h[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhjubjP)}(hhh]h)}(h(address of the memory that was allocatedh]h(address of the memory that was allocated}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj5hMhj6ubah}(h]h ]h"]h$]h&]uh1jOhjubeh}(h]h ]h"]h$]h&]uh1j/hj5hMhjubj0)}(h3``size_t size`` number of bytes that were allocatedh](j6)}(h``size_t size``h]jJ)}(hjYh]h size_t size}(hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1jIhjWubah}(h]h ]h"]h$]h&]uh1j5h[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhjSubjP)}(hhh]h)}(h#number of bytes that were allocatedh]h#number of bytes that were allocated}(hjrhhhNhNubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhjoubah}(h]h ]h"]h$]h&]uh1jOhjSubeh}(h]h ]h"]h$]h&]uh1j/hjnhMhjubeh}(h]h ]h"]h$]h&]uh1j*hjubeh}(h]h ] kernelindentah"]h$]h&]uh1j hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j#pci_p2pmem_virt_to_bus (C function)c.pci_p2pmem_virt_to_bushNtauh1jhjhhhNhNubj)}(hhh](j)}(hHpci_bus_addr_t pci_p2pmem_virt_to_bus (struct pci_dev *pdev, void *addr)h]j)}(hGpci_bus_addr_t pci_p2pmem_virt_to_bus(struct pci_dev *pdev, void *addr)h](h)}(hhh]j()}(hpci_bus_addr_th]hpci_bus_addr_t}(hjhhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjubah}(h]h ]h"]h$]h&] refdomainjVreftypej reftargetjmodnameN classnameNjj)}j]j)}jpci_p2pmem_virt_to_bussbc.pci_p2pmem_virt_to_busasbuh1hhjhhh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhjhMubj")}(hpci_p2pmem_virt_to_bush]j()}(hjh]hpci_p2pmem_virt_to_bus}(hjhhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjubah}(h]h ](j;j<eh"]h$]h&]hhuh1j!hjhhhjhMubjA)}(h"(struct pci_dev *pdev, void *addr)h](jG)}(hstruct pci_dev *pdevh](jM)}(hjPh]hstruct}(hjhhhNhNubah}(h]h ]jYah"]h$]h&]uh1jLhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubh)}(hhh]j()}(hpci_devh]hpci_dev}(hj#hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hj ubah}(h]h ]h"]h$]h&] refdomainjVreftypej reftargetj%modnameN classnameNjj)}j]jc.pci_p2pmem_virt_to_busasbuh1hhjubj)}(h h]h }(hjAhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hjh]h*}(hjOhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj()}(hpdevh]hpdev}(hj\hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjubeh}(h]h ]h"]h$]h&]noemphhhuh1jFhjubjG)}(h void *addrh](j)}(hvoidh]hvoid}(hjuhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjqubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjqubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjqubj()}(haddrh]haddr}(hjhhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjqubeh}(h]h ]h"]h$]h&]noemphhhuh1jFhjubeh}(h]h ]h"]h$]h&]hhuh1j@hjhhhjhMubeh}(h]h ]h"]h$]h&]hhjuh1jjjhjhhhjhMubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1jhjhMhjhhubj)}(hhh]h)}(hWreturn the PCI bus address for a given virtual address obtained with pci_alloc_p2pmem()h]hWreturn the PCI bus address for a given virtual address obtained with pci_alloc_p2pmem()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhjhhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhMubeh}(h]h ](jVfunctioneh"]h$]h&]jjVjjjjjjj uh1jhhhjhNhNubj )}(h**Parameters** ``struct pci_dev *pdev`` the device the memory was allocated from ``void *addr`` address of the memory that was allocatedh](h)}(h**Parameters**h]j)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhjubj+)}(hhh](j0)}(hB``struct pci_dev *pdev`` the device the memory was allocated from h](j6)}(h``struct pci_dev *pdev``h]jJ)}(hj h]hstruct pci_dev *pdev}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jIhjubah}(h]h ]h"]h$]h&]uh1j5h[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhjubjP)}(hhh]h)}(h(the device the memory was allocated fromh]h(the device the memory was allocated from}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jOhjubeh}(h]h ]h"]h$]h&]uh1j/hjhMhjubj0)}(h7``void *addr`` address of the memory that was allocatedh](j6)}(h``void *addr``h]jJ)}(hjBh]h void *addr}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1jIhj@ubah}(h]h ]h"]h$]h&]uh1j5h[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhj<ubjP)}(hhh]h)}(h(address of the memory that was allocatedh]h(address of the memory that was allocated}(hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhjXubah}(h]h ]h"]h$]h&]uh1jOhj<ubeh}(h]h ]h"]h$]h&]uh1j/hjWhMhjubeh}(h]h ]h"]h$]h&]uh1j*hjubeh}(h]h ] kernelindentah"]h$]h&]uh1j hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j!pci_p2pmem_alloc_sgl (C function)c.pci_p2pmem_alloc_sglhNtauh1jhjhhhNhNubj)}(hhh](j)}(hastruct scatterlist * pci_p2pmem_alloc_sgl (struct pci_dev *pdev, unsigned int *nents, u32 length)h]j)}(h_struct scatterlist *pci_p2pmem_alloc_sgl(struct pci_dev *pdev, unsigned int *nents, u32 length)h](jM)}(hjPh]hstruct}(hjhhhNhNubah}(h]h ]jYah"]h$]h&]uh1jLhjhhh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhjhMubh)}(hhh]j()}(h scatterlisth]h scatterlist}(hjhhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjubah}(h]h ]h"]h$]h&] refdomainjVreftypej reftargetjmodnameN classnameNjj)}j]j)}jpci_p2pmem_alloc_sglsbc.pci_p2pmem_alloc_sglasbuh1hhjhhhjhMubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhjhMubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhjhMubj")}(hpci_p2pmem_alloc_sglh]j()}(hjh]hpci_p2pmem_alloc_sgl}(hjhhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjubah}(h]h ](j;j<eh"]h$]h&]hhuh1j!hjhhhjhMubjA)}(h7(struct pci_dev *pdev, unsigned int *nents, u32 length)h](jG)}(hstruct pci_dev *pdevh](jM)}(hjPh]hstruct}(hjhhhNhNubah}(h]h ]jYah"]h$]h&]uh1jLhjubj)}(h h]h }(hj#hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubh)}(hhh]j()}(hpci_devh]hpci_dev}(hj4hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hj1ubah}(h]h ]h"]h$]h&] refdomainjVreftypej reftargetj6modnameN classnameNjj)}j]jc.pci_p2pmem_alloc_sglasbuh1hhjubj)}(h h]h }(hjRhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hjh]h*}(hj`hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj()}(hpdevh]hpdev}(hjmhhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjubeh}(h]h ]h"]h$]h&]noemphhhuh1jFhjubjG)}(hunsigned int *nentsh](j)}(hunsignedh]hunsigned}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hinth]hint}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj()}(hnentsh]hnents}(hjhhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjubeh}(h]h ]h"]h$]h&]noemphhhuh1jFhjubjG)}(h u32 lengthh](h)}(hhh]j()}(hu32h]hu32}(hjhhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjubah}(h]h ]h"]h$]h&] refdomainjVreftypej reftargetjmodnameN classnameNjj)}j]jc.pci_p2pmem_alloc_sglasbuh1hhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj()}(hlengthh]hlength}(hjhhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjubeh}(h]h ]h"]h$]h&]noemphhhuh1jFhjubeh}(h]h ]h"]h$]h&]hhuh1j@hjhhhjhMubeh}(h]h ]h"]h$]h&]hhjuh1jjjhjhhhjhMubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1jhjhMhjhhubj)}(hhh]h)}(h1allocate peer-to-peer DMA memory in a scatterlisth]h1allocate peer-to-peer DMA memory in a scatterlist}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhj:hhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhMubeh}(h]h ](jVfunctioneh"]h$]h&]jjVjjUjjUjjj uh1jhhhjhNhNubj )}(hX)**Parameters** ``struct pci_dev *pdev`` the device to allocate memory from ``unsigned int *nents`` the number of SG entries in the list ``u32 length`` number of bytes to allocate **Return** ``NULL`` on error or :c:type:`struct scatterlist ` pointer and **nents** on successh](h)}(h**Parameters**h]j)}(hj_h]h Parameters}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1jhj]ubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhjYubj+)}(hhh](j0)}(h<``struct pci_dev *pdev`` the device to allocate memory from h](j6)}(h``struct pci_dev *pdev``h]jJ)}(hj~h]hstruct pci_dev *pdev}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jIhj|ubah}(h]h ]h"]h$]h&]uh1j5h[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhjxubjP)}(hhh]h)}(h"the device to allocate memory fromh]h"the device to allocate memory from}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jOhjxubeh}(h]h ]h"]h$]h&]uh1j/hjhMhjuubj0)}(h=``unsigned int *nents`` the number of SG entries in the list h](j6)}(h``unsigned int *nents``h]jJ)}(hjh]hunsigned int *nents}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jIhjubah}(h]h ]h"]h$]h&]uh1j5h[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhjubjP)}(hhh]h)}(h$the number of SG entries in the listh]h$the number of SG entries in the list}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jOhjubeh}(h]h ]h"]h$]h&]uh1j/hjhMhjuubj0)}(h+``u32 length`` number of bytes to allocate h](j6)}(h``u32 length``h]jJ)}(hjh]h u32 length}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jIhjubah}(h]h ]h"]h$]h&]uh1j5h[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhjubjP)}(hhh]h)}(hnumber of bytes to allocateh]hnumber of bytes to allocate}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jOhjubeh}(h]h ]h"]h$]h&]uh1j/hjhMhjuubeh}(h]h ]h"]h$]h&]uh1j*hjYubh)}(h **Return**h]j)}(hj+h]hReturn}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj)ubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhjYubh)}(h```NULL`` on error or :c:type:`struct scatterlist ` pointer and **nents** on successh](jJ)}(h``NULL``h]hNULL}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1jIhjAubh on error or }(hjAhhhNhNubh)}(h*:c:type:`struct scatterlist `h]jJ)}(hjYh]hstruct scatterlist}(hj[hhhNhNubah}(h]h ](jUjVc-typeeh"]h$]h&]uh1jIhjWubah}(h]h ]h"]h$]h&]refdocjb refdomainjVreftypetype refexplicitrefwarnjj)}j]sbjh scatterlistuh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhjAubh pointer and }(hjAhhhNhNubj)}(h **nents**h]hnents}(hj~hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjAubh on success}(hjAhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjyhMhjYubeh}(h]h ] kernelindentah"]h$]h&]uh1j hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j pci_p2pmem_free_sgl (C function)c.pci_p2pmem_free_sglhNtauh1jhjhhhNhNubj)}(hhh](j)}(hHvoid pci_p2pmem_free_sgl (struct pci_dev *pdev, struct scatterlist *sgl)h]j)}(hGvoid pci_p2pmem_free_sgl(struct pci_dev *pdev, struct scatterlist *sgl)h](j)}(hvoidh]hvoid}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjhhh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhjhMubj")}(hpci_p2pmem_free_sglh]j()}(hpci_p2pmem_free_sglh]hpci_p2pmem_free_sgl}(hjhhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjubah}(h]h ](j;j<eh"]h$]h&]hhuh1j!hjhhhjhMubjA)}(h/(struct pci_dev *pdev, struct scatterlist *sgl)h](jG)}(hstruct pci_dev *pdevh](jM)}(hjPh]hstruct}(hjhhhNhNubah}(h]h ]jYah"]h$]h&]uh1jLhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubh)}(hhh]j()}(hpci_devh]hpci_dev}(hjhhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjubah}(h]h ]h"]h$]h&] refdomainjVreftypej reftargetjmodnameN classnameNjj)}j]j)}jjsbc.pci_p2pmem_free_sglasbuh1hhjubj)}(h h]h }(hj1hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hjh]h*}(hj?hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj()}(hpdevh]hpdev}(hjLhhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjubeh}(h]h ]h"]h$]h&]noemphhhuh1jFhjubjG)}(hstruct scatterlist *sglh](jM)}(hjPh]hstruct}(hjehhhNhNubah}(h]h ]jYah"]h$]h&]uh1jLhjaubj)}(h h]h }(hjrhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjaubh)}(hhh]j()}(h scatterlisth]h scatterlist}(hjhhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjubah}(h]h ]h"]h$]h&] refdomainjVreftypej reftargetjmodnameN classnameNjj)}j]j-c.pci_p2pmem_free_sglasbuh1hhjaubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjaubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjaubj()}(hsglh]hsgl}(hjhhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjaubeh}(h]h ]h"]h$]h&]noemphhhuh1jFhjubeh}(h]h ]h"]h$]h&]hhuh1j@hjhhhjhMubeh}(h]h ]h"]h$]h&]hhjuh1jjjhjhhhjhMubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1jhjhMhjhhubj)}(hhh]h)}(h6free a scatterlist allocated by pci_p2pmem_alloc_sgl()h]h6free a scatterlist allocated by pci_p2pmem_alloc_sgl()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhjhhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhMubeh}(h]h ](jVfunctioneh"]h$]h&]jjVjjjjjjj uh1jhhhjhNhNubj )}(h**Parameters** ``struct pci_dev *pdev`` the device to allocate memory from ``struct scatterlist *sgl`` the allocated scatterlisth](h)}(h**Parameters**h]j)}(hjh]h Parameters}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhjubj+)}(hhh](j0)}(h<``struct pci_dev *pdev`` the device to allocate memory from h](j6)}(h``struct pci_dev *pdev``h]jJ)}(hj'h]hstruct pci_dev *pdev}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1jIhj%ubah}(h]h ]h"]h$]h&]uh1j5h[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhj!ubjP)}(hhh]h)}(h"the device to allocate memory fromh]h"the device to allocate memory from}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj<hMhj=ubah}(h]h ]h"]h$]h&]uh1jOhj!ubeh}(h]h ]h"]h$]h&]uh1j/hj<hMhjubj0)}(h5``struct scatterlist *sgl`` the allocated scatterlisth](j6)}(h``struct scatterlist *sgl``h]jJ)}(hj`h]hstruct scatterlist *sgl}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1jIhj^ubah}(h]h ]h"]h$]h&]uh1j5h[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhjZubjP)}(hhh]h)}(hthe allocated scatterlisth]hthe allocated scatterlist}(hjyhhhNhNubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhjvubah}(h]h ]h"]h$]h&]uh1jOhjZubeh}(h]h ]h"]h$]h&]uh1j/hjuhMhjubeh}(h]h ]h"]h$]h&]uh1j*hjubeh}(h]h ] kernelindentah"]h$]h&]uh1j hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jpci_p2pmem_publish (C function)c.pci_p2pmem_publishhNtauh1jhjhhhNhNubj)}(hhh](j)}(hubah}(h]h ]h"]h$]h&]uh1jOhj"ubeh}(h]h ]h"]h$]h&]uh1j/hj=hMhjubeh}(h]h ]h"]h$]h&]uh1j*hjubh)}(h**Description**h]j)}(hjch]h Description}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1jhjaubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhjubh)}(hPublished memory can be used by other PCI device drivers for peer-2-peer DMA operations. Non-published memory is reserved for exclusive use of the device driver that registers the peer-to-peer memory.h]hPublished memory can be used by other PCI device drivers for peer-2-peer DMA operations. Non-published memory is reserved for exclusive use of the device driver that registers the peer-to-peer memory.}(hjyhhhNhNubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhjubeh}(h]h ] kernelindentah"]h$]h&]uh1j hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j$pci_p2pdma_enable_store (C function)c.pci_p2pdma_enable_storehNtauh1jhjhhhNhNubj)}(hhh](j)}(hZint pci_p2pdma_enable_store (const char *page, struct pci_dev **p2p_dev, bool *use_p2pdma)h]j)}(hYint pci_p2pdma_enable_store(const char *page, struct pci_dev **p2p_dev, bool *use_p2pdma)h](j)}(hinth]hint}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjhhh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chM^ubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhjhM^ubj")}(hpci_p2pdma_enable_storeh]j()}(hpci_p2pdma_enable_storeh]hpci_p2pdma_enable_store}(hjhhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjubah}(h]h ](j;j<eh"]h$]h&]hhuh1j!hjhhhjhM^ubjA)}(h>(const char *page, struct pci_dev **p2p_dev, bool *use_p2pdma)h](jG)}(hconst char *pageh](jM)}(hconsth]hconst}(hjhhhNhNubah}(h]h ]jYah"]h$]h&]uh1jLhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hcharh]hchar}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj()}(hpageh]hpage}(hj*hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjubeh}(h]h ]h"]h$]h&]noemphhhuh1jFhjubjG)}(hstruct pci_dev **p2p_devh](jM)}(hjPh]hstruct}(hjChhhNhNubah}(h]h ]jYah"]h$]h&]uh1jLhj?ubj)}(h h]h }(hjPhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj?ubh)}(hhh]j()}(hpci_devh]hpci_dev}(hjahhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hj^ubah}(h]h ]h"]h$]h&] refdomainjVreftypej reftargetjcmodnameN classnameNjj)}j]j)}jjsbc.pci_p2pdma_enable_storeasbuh1hhj?ubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj?ubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj?ubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj?ubj()}(hp2p_devh]hp2p_dev}(hjhhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hj?ubeh}(h]h ]h"]h$]h&]noemphhhuh1jFhjubjG)}(hbool *use_p2pdmah](j)}(hjH h]hbool}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj()}(h use_p2pdmah]h use_p2pdma}(hjhhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjubeh}(h]h ]h"]h$]h&]noemphhhuh1jFhjubeh}(h]h ]h"]h$]h&]hhuh1j@hjhhhjhM^ubeh}(h]h ]h"]h$]h&]hhjuh1jjjhjhhhjhM^ubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1jhjhM^hjhhubj)}(hhh]h)}(h7parse a configfs/sysfs attribute store to enable p2pdmah]h7parse a configfs/sysfs attribute store to enable p2pdma}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chM^hj hhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhM^ubeh}(h]h ](jVfunctioneh"]h$]h&]jjVjj, jj, jjj uh1jhhhjhNhNubj )}(hX**Parameters** ``const char *page`` contents of the value to be stored ``struct pci_dev **p2p_dev`` returns the PCI device that was selected to be used (if one was specified in the stored value) ``bool *use_p2pdma`` returns whether to enable p2pdma or not **Description** Parses an attribute value to decide whether to enable p2pdma. The value can select a PCI device (using its full BDF device name) or a boolean (in any format kstrtobool() accepts). A false value disables p2pdma, a true value expects the caller to automatically find a compatible device and specifying a PCI device expects the caller to use the specific provider. pci_p2pdma_enable_show() should be used as the show operation for the attribute. Returns 0 on successh](h)}(h**Parameters**h]j)}(hj6 h]h Parameters}(hj8 hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj4 ubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMbhj0 ubj+)}(hhh](j0)}(h8``const char *page`` contents of the value to be stored h](j6)}(h``const char *page``h]jJ)}(hjU h]hconst char *page}(hjW hhhNhNubah}(h]h ]h"]h$]h&]uh1jIhjS ubah}(h]h ]h"]h$]h&]uh1j5h[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chM`hjO ubjP)}(hhh]h)}(h"contents of the value to be storedh]h"contents of the value to be stored}(hjn hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjj hM`hjk ubah}(h]h ]h"]h$]h&]uh1jOhjO ubeh}(h]h ]h"]h$]h&]uh1j/hjj hM`hjL ubj0)}(h|``struct pci_dev **p2p_dev`` returns the PCI device that was selected to be used (if one was specified in the stored value) h](j6)}(h``struct pci_dev **p2p_dev``h]jJ)}(hj h]hstruct pci_dev **p2p_dev}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jIhj ubah}(h]h ]h"]h$]h&]uh1j5h[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMbhj ubjP)}(hhh]h)}(h^returns the PCI device that was selected to be used (if one was specified in the stored value)h]h^returns the PCI device that was selected to be used (if one was specified in the stored value)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMahj ubah}(h]h ]h"]h$]h&]uh1jOhj ubeh}(h]h ]h"]h$]h&]uh1j/hj hMbhjL ubj0)}(h=``bool *use_p2pdma`` returns whether to enable p2pdma or not h](j6)}(h``bool *use_p2pdma``h]jJ)}(hj h]hbool *use_p2pdma}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jIhj ubah}(h]h ]h"]h$]h&]uh1j5h[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMchj ubjP)}(hhh]h)}(h'returns whether to enable p2pdma or noth]h'returns whether to enable p2pdma or not}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hMchj ubah}(h]h ]h"]h$]h&]uh1jOhj ubeh}(h]h ]h"]h$]h&]uh1j/hj hMchjL ubeh}(h]h ]h"]h$]h&]uh1j*hj0 ubh)}(h**Description**h]j)}(hj!h]h Description}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj!ubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMehj0 ubh)}(hXiParses an attribute value to decide whether to enable p2pdma. The value can select a PCI device (using its full BDF device name) or a boolean (in any format kstrtobool() accepts). A false value disables p2pdma, a true value expects the caller to automatically find a compatible device and specifying a PCI device expects the caller to use the specific provider.h]hXiParses an attribute value to decide whether to enable p2pdma. The value can select a PCI device (using its full BDF device name) or a boolean (in any format kstrtobool() accepts). A false value disables p2pdma, a true value expects the caller to automatically find a compatible device and specifying a PCI device expects the caller to use the specific provider.}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMdhj0 ubh)}(hPpci_p2pdma_enable_show() should be used as the show operation for the attribute.h]hPpci_p2pdma_enable_show() should be used as the show operation for the attribute.}(hj(!hhhNhNubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMkhj0 ubh)}(hReturns 0 on successh]hReturns 0 on success}(hj7!hhhNhNubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMnhj0 ubeh}(h]h ] kernelindentah"]h$]h&]uh1j hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j#pci_p2pdma_enable_show (C function)c.pci_p2pdma_enable_showhNtauh1jhjhhhNhNubj)}(hhh](j)}(hUssize_t pci_p2pdma_enable_show (char *page, struct pci_dev *p2p_dev, bool use_p2pdma)h]j)}(hTssize_t pci_p2pdma_enable_show(char *page, struct pci_dev *p2p_dev, bool use_p2pdma)h](h)}(hhh]j()}(hssize_th]hssize_t}(hji!hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjf!ubah}(h]h ]h"]h$]h&] refdomainjVreftypej reftargetjk!modnameN classnameNjj)}j]j)}jpci_p2pdma_enable_showsbc.pci_p2pdma_enable_showasbuh1hhjb!hhh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMubj)}(h h]h }(hj!hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjb!hhhj!hMubj")}(hpci_p2pdma_enable_showh]j()}(hj!h]hpci_p2pdma_enable_show}(hj!hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hj!ubah}(h]h ](j;j<eh"]h$]h&]hhuh1j!hjb!hhhj!hMubjA)}(h6(char *page, struct pci_dev *p2p_dev, bool use_p2pdma)h](jG)}(h char *pageh](j)}(hcharh]hchar}(hj!hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj!ubj)}(h h]h }(hj!hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj!ubj)}(hjh]h*}(hj!hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj!ubj()}(hpageh]hpage}(hj!hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hj!ubeh}(h]h ]h"]h$]h&]noemphhhuh1jFhj!ubjG)}(hstruct pci_dev *p2p_devh](jM)}(hjPh]hstruct}(hj!hhhNhNubah}(h]h ]jYah"]h$]h&]uh1jLhj!ubj)}(h h]h }(hj"hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj!ubh)}(hhh]j()}(hpci_devh]hpci_dev}(hj"hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hj"ubah}(h]h ]h"]h$]h&] refdomainjVreftypej reftargetj"modnameN classnameNjj)}j]j!c.pci_p2pdma_enable_showasbuh1hhj!ubj)}(h h]h }(hj6"hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj!ubj)}(hjh]h*}(hjD"hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj!ubj()}(hp2p_devh]hp2p_dev}(hjQ"hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hj!ubeh}(h]h ]h"]h$]h&]noemphhhuh1jFhj!ubjG)}(hbool use_p2pdmah](j)}(hjH h]hbool}(hjj"hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjf"ubj)}(h h]h }(hjw"hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjf"ubj()}(h use_p2pdmah]h use_p2pdma}(hj"hhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hjf"ubeh}(h]h ]h"]h$]h&]noemphhhuh1jFhj!ubeh}(h]h ]h"]h$]h&]hhuh1j@hjb!hhhj!hMubeh}(h]h ]h"]h$]h&]hhjuh1jjjhj^!hhhj!hMubah}(h]jY!ah ](jjeh"]h$]h&]jj)jhuh1jhj!hMhj[!hhubj)}(hhh]h)}(hDshow a configfs/sysfs attribute indicating whether p2pdma is enabledh]hDshow a configfs/sysfs attribute indicating whether p2pdma is enabled}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhj"hhubah}(h]h ]h"]h$]h&]uh1jhj[!hhhj!hMubeh}(h]h ](jVfunctioneh"]h$]h&]jjVjj"jj"jjj uh1jhhhjhNhNubj )}(hX^**Parameters** ``char *page`` contents of the stored value ``struct pci_dev *p2p_dev`` the selected p2p device (NULL if no device is selected) ``bool use_p2pdma`` whether p2pdma has been enabled **Description** Attributes that use pci_p2pdma_enable_store() should use this function to show the value of the attribute. Returns 0 on successh](h)}(h**Parameters**h]j)}(hj"h]h Parameters}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj"ubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhj"ubj+)}(hhh](j0)}(h,``char *page`` contents of the stored value h](j6)}(h``char *page``h]jJ)}(hj"h]h char *page}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1jIhj"ubah}(h]h ]h"]h$]h&]uh1j5h[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhj"ubjP)}(hhh]h)}(hcontents of the stored valueh]hcontents of the stored value}(hj #hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj#hMhj#ubah}(h]h ]h"]h$]h&]uh1jOhj"ubeh}(h]h ]h"]h$]h&]uh1j/hj#hMhj"ubj0)}(hT``struct pci_dev *p2p_dev`` the selected p2p device (NULL if no device is selected) h](j6)}(h``struct pci_dev *p2p_dev``h]jJ)}(hj)#h]hstruct pci_dev *p2p_dev}(hj+#hhhNhNubah}(h]h ]h"]h$]h&]uh1jIhj'#ubah}(h]h ]h"]h$]h&]uh1j5h[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhj##ubjP)}(hhh]h)}(h7the selected p2p device (NULL if no device is selected)h]h7the selected p2p device (NULL if no device is selected)}(hjB#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj>#hMhj?#ubah}(h]h ]h"]h$]h&]uh1jOhj##ubeh}(h]h ]h"]h$]h&]uh1j/hj>#hMhj"ubj0)}(h4``bool use_p2pdma`` whether p2pdma has been enabled h](j6)}(h``bool use_p2pdma``h]jJ)}(hjb#h]hbool use_p2pdma}(hjd#hhhNhNubah}(h]h ]h"]h$]h&]uh1jIhj`#ubah}(h]h ]h"]h$]h&]uh1j5h[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhj\#ubjP)}(hhh]h)}(hwhether p2pdma has been enabledh]hwhether p2pdma has been enabled}(hj{#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjw#hMhjx#ubah}(h]h ]h"]h$]h&]uh1jOhj\#ubeh}(h]h ]h"]h$]h&]uh1j/hjw#hMhj"ubeh}(h]h ]h"]h$]h&]uh1j*hj"ubh)}(h**Description**h]j)}(hj#h]h Description}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj#ubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhj"ubh)}(hjAttributes that use pci_p2pdma_enable_store() should use this function to show the value of the attribute.h]hjAttributes that use pci_p2pdma_enable_store() should use this function to show the value of the attribute.}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhj"ubh)}(hReturns 0 on successh]hReturns 0 on success}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hh[/var/lib/git/docbuild/linux/Documentation/driver-api/pci/p2pdma:181: ./drivers/pci/p2pdma.chMhj"ubeh}(h]h ] kernelindentah"]h$]h&]uh1j hjhhhNhNubeh}(h]p2p-dma-support-libraryah ]h"]p2p dma support libraryah$]h&]uh1hhhhhhhhKubeh}(h]pci-peer-to-peer-dma-supportah ]h"]pci peer-to-peer dma supportah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerj $error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(j#j#jijfjjj%j"j,j)jaj^jjj#j#u nametypes}(j#jijj%j,jajj#uh}(j#hjfj;jj,j"jj)j(j^j/jjlj#jjjjjjjj j jjj@jEjOjTjjjjjjjjjjjY!j^!u footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.