Skip to content
Commit b66905e0 authored by Jack Wang's avatar Jack Wang Committed by Leon Romanovsky
Browse files

RDMA/rtrs-clt: Use the right sg_cnt after ib_dma_map_sg

When iommu is enabled, we hit warnings like this:
WARNING: at rtrs/rtrs.c:178 rtrs_iu_post_rdma_write_imm+0x9b/0x110

rtrs warn on one sge entry length is 0, which is unexpected.

The problem is ib_dma_map_sg augments the SGL into a 'dma mapped SGL'.
This process may change the number of entries and the lengths of each
entry.

Code that touches dma_address is iterating over the 'dma mapped SGL'
and must use dma_nents which returned from ib_dma_map_sg().
So pass the count return from ib_dma_map_sg.

Fixes: 6a98d71d

 ("RDMA/rtrs: client: main functionality")
Link: https://lore.kernel.org/r/20220818105355.110344-3-haris.iqbal@ionos.com
Signed-off-by: default avatarJack Wang <jinpu.wang@ionos.com>
Reviewed-by: default avatarAleksei Marov <aleksei.marov@ionos.com>
Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
parent b16de8b9
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment