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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Sep 2022 09:30:03 +0000 (11:30 +0200)
commitae8e70e31763634be736c928eaf7719295a70ab9
tree779af0c27139f40af9d34d17414c159be916d348
parentad69caa4786181f1b2078b832a964c4eaefbea13
RDMA/rtrs-srv: Pass the correct number of entries for dma mapped SGL

[ Upstream commit 56c310de0b4b3aca1c4fdd9c1093fc48372a7335 ]

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: 9cb837480424e ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/ulp/rtrs/rtrs-srv.c