Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

RDMA/mlx5: Avoid direct access to DMA device pointer

The dma_device field is marked as internal and must not be accessed by
drivers or ULPs. Remove all direct mlx5 references to this field.

Link: https://patch.msgid.link/20260104-ib-core-misc-v1-4-00367f77f3a8@nvidia.com
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>

authored by

Leon Romanovsky and committed by
Leon Romanovsky
522a5c1c 6dc78c53

+6 -5
+6 -5
drivers/infiniband/hw/mlx5/mr.c
··· 1646 1646 offset, length, fd, 1647 1647 access_flags, 1648 1648 &mlx5_ib_dmabuf_attach_ops); 1649 - else 1649 + else if (dma_device) 1650 1650 umem_dmabuf = ib_umem_dmabuf_get_pinned_with_dma_device(&dev->ib_dev, 1651 1651 dma_device, offset, length, 1652 1652 fd, access_flags); 1653 + else 1654 + umem_dmabuf = ib_umem_dmabuf_get_pinned( 1655 + &dev->ib_dev, offset, length, fd, access_flags); 1653 1656 1654 1657 if (IS_ERR(umem_dmabuf)) { 1655 1658 mlx5_ib_dbg(dev, "umem_dmabuf get failed (%pe)\n", umem_dmabuf); ··· 1785 1782 return reg_user_mr_dmabuf_by_data_direct(pd, offset, length, virt_addr, 1786 1783 fd, access_flags); 1787 1784 1788 - return reg_user_mr_dmabuf(pd, pd->device->dma_device, 1789 - offset, length, virt_addr, 1790 - fd, access_flags, MLX5_MKC_ACCESS_MODE_MTT, 1791 - dmah); 1785 + return reg_user_mr_dmabuf(pd, NULL, offset, length, virt_addr, fd, 1786 + access_flags, MLX5_MKC_ACCESS_MODE_MTT, dmah); 1792 1787 } 1793 1788 1794 1789 /*