diff options
author | Bernard Metzler | 2019-09-09 15:24:27 +0200 |
---|---|---|
committer | Jason Gunthorpe | 2019-09-13 16:55:55 -0300 |
commit | 0404bd629fd4d05e7ab815e6e1ecd81e728678d3 (patch) | |
tree | 63e2002f0256438bac98d87ed3862eeffed3f85b /drivers/infiniband | |
parent | 4a9d46a9fe14401f21df69cea97c62396d5fb053 (diff) |
RDMA/siw: Fix page address mapping in TX path
Use the correct kmap()/kunmap() flow to determine page address used for
CRC computation. Using page_address() is wrong, since page might be in
highmem.
Fixes: b9be6f18cf9e ("rdma/siw: transmit path")
Link: https://lore.kernel.org/r/20190909132427.30264-1-bmt@zurich.ibm.com
Reported-by: Krishnamraju Eraparaju <krishna2@chelsio.com>
Signed-off-by: Bernard Metzler <bmt@zurich.ibm.com>
Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/sw/siw/siw_qp_tx.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/infiniband/sw/siw/siw_qp_tx.c b/drivers/infiniband/sw/siw/siw_qp_tx.c index 43020d2040fc..eb83fe183318 100644 --- a/drivers/infiniband/sw/siw/siw_qp_tx.c +++ b/drivers/infiniband/sw/siw/siw_qp_tx.c @@ -520,11 +520,12 @@ static int siw_tx_hdt(struct siw_iwarp_tx *c_tx, struct socket *s) c_tx->mpa_crc_hd, iov[seg].iov_base, plen); - } else if (do_crc) - crypto_shash_update( - c_tx->mpa_crc_hd, - page_address(p) + fp_off, - plen); + } else if (do_crc) { + crypto_shash_update(c_tx->mpa_crc_hd, + kmap(p) + fp_off, + plen); + kunmap(p); + } } else { u64 pa = ((sge->laddr + sge_off) & PAGE_MASK); |