Loading
RDMA/hns: Fix incorrect iteration number of DCA umem sg entries
driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9FAYN ------------------------------------ RDMA uses sg list to describe umem buffer. While mapping IOVA in IOMMU, an sg entry may be concatenated with the previous entry if certain length and boundary conditions are met. IOMMU will always return the number of sg entries after the concatenation, and the dma address of a concatenated entry defaults to DMA_MAPPING_ERROR (0xFFFFFFFFFFFFFFFF). But currently in DCA mode, hns RoCE driver still use the originally allocated number of the sg entries to iterate sg list. This causes that the driver may access the concatenated sg entries and fill DMA_MAPPING_ERROR to HW, triggering SMMU translation fault and RAS. Use the entry number returned by IOMMU to set the maximum iteration number of DCA umem sg entries to fix this problem, instead of the originally allocated number. Fixes: 12aa71f8 ("RDMA/hns: Add DCA support for kernel space") Fixes: f44a2f97 ("RDMA/hns: Introduce DCA for RC QP") Signed-off-by:Junxian Huang <huangjunxian6@hisilicon.com> Signed-off-by:
Zihao Xue <xuezihao@huawei.com>