Re: [PATCH rdma-next] IB/mlx5: Use ib_dma APIs instead of open access to parent device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 23, 2020 at 10:24:00AM +0200, Leon Romanovsky wrote:
> From: Parav Pandit <parav@xxxxxxxxxx>
> 
> DMA operation of the IB device is done using ib_device->dma_device.
> This is well abstracted using ib_dma APIs.
> 
> Hence, instead of doing open access to parent device, use IB core
> provided dma mapping APIs.

Why?

The ib DMA APIs are for people using verbs, they are only needed to
pack things into the ib_sge

If you are inside a driver, not using the verbs API, or not using
ib_sge, then you should not be using the ib_dma API

It is an abberation, we should minimize its use.

>  /*
> - * We can't use an array for xlt_emergency_page because dma_map_single doesn't
> + * We can't use an array for xlt_emergency_page because ib_dma_map_single doesn't
>   * work on kernel modules memory
>   */
>  void *xlt_emergency_page;
> @@ -1081,7 +1081,6 @@ static void *mlx5_ib_create_xlt_wr(struct mlx5_ib_mr *mr,
>  				   unsigned int flags)
>  {
>  	struct mlx5_ib_dev *dev = mr->dev;
> -	struct device *ddev = dev->ib_dev.dev.parent;

Though this looks wrong, it should be dev->mdev->pdev.dev

ie it is always OK to use a PCI device with the normal DMA API

Jason




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux