diff options
author | Logan Gunthorpe <logang@deltatee.com> | 2018-10-04 15:27:37 -0600 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2018-10-17 12:18:16 -0500 |
commit | 977196b8c5b20b901acb0042579e30d7fa55790a (patch) | |
tree | ef3a0c1ee710fc331eb1fdfc0fcaccdca0308776 /include/linux/memremap.h | |
parent | cbb8ca69fcbb2c82f70abcbb75b6ea8579236210 (diff) | |
download | lwn-977196b8c5b20b901acb0042579e30d7fa55790a.tar.gz lwn-977196b8c5b20b901acb0042579e30d7fa55790a.zip |
PCI/P2PDMA: Add PCI p2pmem DMA mappings to adjust the bus offset
The DMA address used when mapping PCI P2P memory must be the PCI bus
address. Thus, introduce pci_p2pmem_map_sg() to map the correct addresses
when using P2P memory.
Memory mapped in this way does not need to be unmapped and thus if we
provided pci_p2pmem_unmap_sg() it would be empty. This breaks the expected
balance between map/unmap but was left out as an empty function doesn't
really provide any benefit. In the future, if this call becomes necessary
it can be added without much difficulty.
For this, we assume that an SGL passed to these functions contain all P2P
memory or no P2P memory.
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'include/linux/memremap.h')
-rw-r--r-- | include/linux/memremap.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/memremap.h b/include/linux/memremap.h index 9553370ebdad..0ac69ddf5fc4 100644 --- a/include/linux/memremap.h +++ b/include/linux/memremap.h @@ -125,6 +125,7 @@ struct dev_pagemap { struct device *dev; void *data; enum memory_type type; + u64 pci_p2pdma_bus_offset; }; #ifdef CONFIG_ZONE_DEVICE |