diff mbox series

RDMA/siw: Fix page address mapping in TX path

Message ID 20190906084544.26103-1-bmt@zurich.ibm.com (mailing list archive)
State Superseded
Headers show
Series RDMA/siw: Fix page address mapping in TX path | expand

Commit Message

Bernard Metzler Sept. 6, 2019, 8:45 a.m. UTC
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.

Reported-by: Krishnamraju Eraparaju <krishna2@chelsio.com>
Fixes: b9be6f18cf9e rdma/siw: transmit path
Signed-off-by: Bernard Metzler <bmt@zurich.ibm.com>
---
 drivers/infiniband/sw/siw/siw_qp_tx.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

Comments

Gal Pressman Sept. 6, 2019, 2:04 p.m. UTC | #1
On 06/09/2019 11:45, Bernard Metzler wrote:
> 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.
> 
> Reported-by: Krishnamraju Eraparaju <krishna2@chelsio.com>
> Fixes: b9be6f18cf9e rdma/siw: transmit path

Hi Bernard,
The format of the fixes line should be:
Fixes: b9be6f18cf9e ("rdma/siw: transmit path")
Bernard Metzler Sept. 6, 2019, 2:20 p.m. UTC | #2
-----"Gal Pressman" <galpress@amazon.com> wrote: -----

>To: "Bernard Metzler" <bmt@zurich.ibm.com>
>From: "Gal Pressman" <galpress@amazon.com>
>Date: 09/06/2019 04:04PM
>Cc: <linux-rdma@vger.kernel.org>, <krishna2@chelsio.com>,
><dledford@redhat.com>
>Subject: [EXTERNAL] Re: [PATCH] RDMA/siw: Fix page address mapping in
>TX path
>
>On 06/09/2019 11:45, Bernard Metzler wrote:
>> 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.
>> 
>> Reported-by: Krishnamraju Eraparaju <krishna2@chelsio.com>
>> Fixes: b9be6f18cf9e rdma/siw: transmit path
>
>Hi Bernard,
>The format of the fixes line should be:
>Fixes: b9be6f18cf9e ("rdma/siw: transmit path")
>
>
I knew it!! Thanks Gal. I'll resend...
diff mbox series

Patch

diff --git a/drivers/infiniband/sw/siw/siw_qp_tx.c b/drivers/infiniband/sw/siw/siw_qp_tx.c
index 438a2917a47c..8e72f955921d 100644
--- a/drivers/infiniband/sw/siw/siw_qp_tx.c
+++ b/drivers/infiniband/sw/siw/siw_qp_tx.c
@@ -518,11 +518,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 va = sge->laddr + sge_off;