mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
mlx5: Fix mlx5_ib_map_mr_sg mr length
commit0a49f2c31cupstream. In case we got an initial sg_offset, we need to account for it in the mr length. Fixes:ff2ba99365("IB/core: Add passing an offset into the SG to ib_map_mr_sg") Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Tested-by: Israel Rukshin <israelr@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
cca9c04ad4
commit
3992c93b74
@@ -1782,7 +1782,7 @@ mlx5_ib_sg_to_klms(struct mlx5_ib_mr *mr,
|
||||
klms[i].va = cpu_to_be64(sg_dma_address(sg) + sg_offset);
|
||||
klms[i].bcount = cpu_to_be32(sg_dma_len(sg) - sg_offset);
|
||||
klms[i].key = cpu_to_be32(lkey);
|
||||
mr->ibmr.length += sg_dma_len(sg);
|
||||
mr->ibmr.length += sg_dma_len(sg) - sg_offset;
|
||||
|
||||
sg_offset = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user