]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/rtrs-srv: Pass the correct number of entries for dma mapped SGL
authorJack Wang <jinpu.wang@ionos.com>
Thu, 18 Aug 2022 10:53:55 +0000 (12:53 +0200)
committerLeon Romanovsky <leonro@nvidia.com>
Sun, 21 Aug 2022 09:25:13 +0000 (12:25 +0300)
commit356f1a6face4dc183f30fbbd4fa2233ced8c9b58
tree0b1300ff630ce80a9212f3b7e32156e358be2f4b
parent21110a63a20c0300fae85317d07f36831decae57
RDMA/rtrs-srv: Pass the correct number of entries for dma mapped SGL

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().

We should use the return count from ib_dma_map_sg for futher usage.

Fixes: b5ef0cd050eed ("RDMA/rtrs: server: main functionality")
Link: https://lore.kernel.org/r/20220818105355.110344-4-haris.iqbal@ionos.com
Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
Reviewed-by: Aleksei Marov <aleksei.marov@ionos.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/ulp/rtrs/rtrs-srv.c