From: Leon Romanovsky Date: Thu, 4 May 2017 12:36:07 +0000 (+0300) Subject: IB/rxe: Update caller's CRC for RXE_MEM_TYPE_DMA memory type X-Git-Tag: v4.14-rc1~960^3~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=af5df5fb59ee01e78fd334c3d6202d9e7bcfddd3;p=platform%2Fkernel%2Flinux-rpi.git IB/rxe: Update caller's CRC for RXE_MEM_TYPE_DMA memory type Callers of rxe_mem_copy() provide pointer to store updated CRC value. That pointer was supposed to be updated, but the commit cee2688e3cd6 ("IB/rxe: Offload CRC calculation when possible") mistakenly removed that assignment for RXE_MEM_TYPE_DMA memory type. The code worked because there are no actual callers with RXE_MEM_TYPE_DMA, who are interested in returned value of crcp. The one caller in read_reply(), who uses the returned crcp didn't set RXE_MEM_TYPE_DMA as mem->type. Fixes: cee2688e3cd6 ("IB/rxe: Offload CRC calculation when possible") Reported-by: Andrew Boyer Signed-off-by: Leon Romanovsky Acked-by: Moni Shoua Reviewed-by: Andrew Boyer Reviewed-by: Sagi Grimberg Signed-off-by: Doug Ledford --- diff --git a/drivers/infiniband/sw/rxe/rxe_mr.c b/drivers/infiniband/sw/rxe/rxe_mr.c index ced15c4..e37cc89 100644 --- a/drivers/infiniband/sw/rxe/rxe_mr.c +++ b/drivers/infiniband/sw/rxe/rxe_mr.c @@ -368,7 +368,7 @@ int rxe_mem_copy(struct rxe_mem *mem, u64 iova, void *addr, int length, ((void *)(uintptr_t)iova) : addr; if (crcp) - crc = rxe_crc32(to_rdev(mem->pd->ibpd.device), + *crcp = rxe_crc32(to_rdev(mem->pd->ibpd.device), *crcp, src, length); memcpy(dest, src, length);