Commit 0404bd62 authored by Bernard Metzler's avatar Bernard Metzler Committed by Jason Gunthorpe

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: b9be6f18 ("rdma/siw: transmit path")
Link: https://lore.kernel.org/r/20190909132427.30264-1-bmt@zurich.ibm.comReported-by: default avatarKrishnamraju Eraparaju <krishna2@chelsio.com>
Signed-off-by: default avatarBernard Metzler <bmt@zurich.ibm.com>
Reviewed-by: default avatarJason Gunthorpe <jgg@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 4a9d46a9
...@@ -520,11 +520,12 @@ static int siw_tx_hdt(struct siw_iwarp_tx *c_tx, struct socket *s) ...@@ -520,11 +520,12 @@ static int siw_tx_hdt(struct siw_iwarp_tx *c_tx, struct socket *s)
c_tx->mpa_crc_hd, c_tx->mpa_crc_hd,
iov[seg].iov_base, iov[seg].iov_base,
plen); plen);
} else if (do_crc) } else if (do_crc) {
crypto_shash_update( crypto_shash_update(c_tx->mpa_crc_hd,
c_tx->mpa_crc_hd, kmap(p) + fp_off,
page_address(p) + fp_off, plen);
plen); kunmap(p);
}
} else { } else {
u64 pa = ((sge->laddr + sge_off) & PAGE_MASK); u64 pa = ((sge->laddr + sge_off) & PAGE_MASK);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment