linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bernard Metzler <bmt@zurich.ibm.com>
To: linux-rdma@vger.kernel.org
Cc: krishna2@chelsio.com, dledford@redhat.com,
	Bernard Metzler <bmt@zurich.ibm.com>
Subject: [PATCH v1 for-rc] RDMA/siw: Fix page address mapping in TX path
Date: Mon,  9 Sep 2019 15:24:27 +0200	[thread overview]
Message-ID: <20190909132427.30264-1-bmt@zurich.ibm.com> (raw)

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(-)

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;
 
-- 
2.17.2


             reply	other threads:[~2019-09-09 13:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-09 13:24 Bernard Metzler [this message]
2019-09-12 14:50 ` [PATCH v1 for-rc] RDMA/siw: Fix page address mapping in TX path Jason Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190909132427.30264-1-bmt@zurich.ibm.com \
    --to=bmt@zurich.ibm.com \
    --cc=dledford@redhat.com \
    --cc=krishna2@chelsio.com \
    --cc=linux-rdma@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).