Skip to contentSkip to conversation

RDMA/siw: Fix page address mapping in TX path

PATCH In review Bernard Metzler 2 participants 3 messages Sep 6, 2019 – Sep 9, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 drivers/infiniband/sw/siw/siw_qp_tx.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/infiniband/sw/siw/siw_qp_tx.c +6 -5
index 438a2917a47c..8e72f955921d 100644
@@ -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;
 
Signature · 1 line
2.17.2
#1 lore raw
Quoted 10 lines · Bernard Metzler

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")
---
 drivers/infiniband/sw/siw/siw_qp_tx.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

Bernard,

You need to write version and target in your title [PATCH v100 rdma-next] ... And changelog.

Thanks

#2 lore raw

-----"Leon Romanovsky" <[email protected]> wrote: -----

Quoted 20 lines

To: "Bernard Metzler" <[email protected]>
From: "Leon Romanovsky" <[email protected]>
Date: 09/09/2019 12:03PM
Cc: [email protected], [email protected], [email protected]
Subject: [EXTERNAL] Re: [PATCH] RDMA/siw: Fix page address mapping in TX path

Quoted 10 lines · Bernard Metzler

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")
---
 drivers/infiniband/sw/siw/siw_qp_tx.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
Quoted 5 lines

Bernard,

You need to write version and target in your title [PATCH v100 rdma-next] ...
And changelog.

Thanks Leon,
will do. I'd like to have that accepted asap, since it is a code fix. The driver would crash if it tries CRC on data in highmem. So let me mark it 'for-rc'. Or would 'rdma-rc' be better? Just see these two variants on the list...

Thanks!
Bernard.

Quoted 4 lines

Thanks