On 10/22/24 07:19, Bjorn Helgaas wrote: > On Sat, Oct 12, 2024 at 08:32:40PM +0900, Damien Le Moal wrote: >> This series introduces the new functions pci_epc_mem_map() and >> pci_epc_mem_unmap() to improve handling of the PCI address mapping >> alignment constraints of endpoint controllers in a controller >> independent manner. > > Hi Damien, I know this is obvious to everybody except me, but who uses > this mapping? A driver running on the endpoint that does MMIO? DMA > (Memory Reads or Writes that target an endpoint BAR)? I'm still > trying to wrap my head around the whole endpoint driver model. The mapping API is for mmio or DMA using enpoint controller memory mapped to a host PCI address range. It is not for BARs. BARs setup does not use the same API and has not changed with these patches. BARs can still be accessed on the enpoint (within the EPF driver) with regular READ_ONCE()/WRITE_ONCE() once they are set. But any data transfer between the PCI RC host and the EPF driver on the EP host that use mmio or DMA generic channel (memory copy offload channel) needs the new mapping API. DMA transfers that can be done using dedicated DMA rx/tx channels associated with the endpoint controller do not need to use this API as the mapping to the host PCI address space is automatically handled by the DMA driver. -- Damien Le Moal Western Digital Research