[openib-general] [PATCH v2 2/7] IB/ipath - Implement new verbs DMA mapping functions

Or Gerlitz ogerlitz at voltaire.com
Sun Dec 3 00:42:55 PST 2006


Ralph Campbell wrote:
> This patch implements the interposing DMA mapping functions to allow
> support for IOMMUs and remove the dependence on phys_to_virt().

> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> +++ b/drivers/infiniband/hw/ipath/ipath_dma.c	Wed Nov 29 13:55:07 2006 -0800
> +/**
> + * ipath_dma_map_single - Map a kernel virtual address to DMA address
> + * @device: The device for which the dma_addr is to be created
> + * @cpu_addr: The kernel virtual address
> + * @size: The size of the region in bytes
> + * @direction: The direction of the DMA
> + */
> +static u64 ipath_dma_map_single(struct ib_device *dev,
> +			        void *cpu_addr, size_t size,
> +			        enum dma_data_direction direction)
> +{
> +	BUG_ON(!valid_dma_direction(direction));
> +	return (u64) cpu_addr;
> +}

if ipath_dma_map_single is a NO OP

> +/**
> + * ipath_sync_single_for_cpu - Prepare DMA region to be accessed by CPU
> + * @device: The device for which the DMA address was created
> + * @addr: The DMA address
> + * @size: The size of the region in bytes
> + * @dir: The direction of the DMA
> + */
> +static void ipath_sync_single_for_cpu(struct ib_device *dev,
> +				      u64 addr,
> +				      size_t size,
> +				      enum dma_data_direction dir)
> +{
> +	dma_sync_single_for_cpu(dev->dma_device, addr, size, dir);
> +}

then why ipath_sync_single_for_cpu does something? am i just pointing on 
a cleanup or there's something more deep here?

Or.





More information about the general mailing list