Re: [PATCH v3 03/20] PCI/P2PDMA: make pci_p2pdma_map_type() non-static

From: Jason Gunthorpe
Date: Tue Sep 28 2021 - 14:48:54 EST


On Thu, Sep 16, 2021 at 05:40:43PM -0600, Logan Gunthorpe wrote:
> +enum pci_p2pdma_map_type {
> + /*
> + * PCI_P2PDMA_MAP_UNKNOWN: Used internally for indicating the mapping
> + * type hasn't been calculated yet. Functions that return this enum
> + * never return this value.
> + */
> + PCI_P2PDMA_MAP_UNKNOWN = 0,
> +
> + /*
> + * PCI_P2PDMA_MAP_NOT_SUPPORTED: Indicates the transaction will
> + * traverse the host bridge and the host bridge is not in the
> + * whitelist. DMA Mapping routines should return an error when

I gather we are supposed to type allowlist now

> + * this is returned.
> + */
> + PCI_P2PDMA_MAP_NOT_SUPPORTED,
> +
> + /*
> + * PCI_P2PDMA_BUS_ADDR: Indicates that two devices can talk to
> + * eachother directly through a PCI switch and the transaction will

'each other'

> + * not traverse the host bridge. Such a mapping should program
> + * the DMA engine with PCI bus addresses.
> + */
> + PCI_P2PDMA_MAP_BUS_ADDR,
> +
> + /*
> + * PCI_P2PDMA_MAP_THRU_HOST_BRIDGE: Indicates two devices can talk
> + * to eachother, but the transaction traverses a host bridge on the

'each other'

> + * whitelist. In this case, a normal mapping either with CPU physical
> + * addresses (in the case of dma-direct) or IOVA addresses (in the
> + * case of IOMMUs) should be used to program the DMA engine.
> + */
> + PCI_P2PDMA_MAP_THRU_HOST_BRIDGE,
> +};

Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx>

Jason