diff mbox

[resend] RDMA/iser: don't send an rkey if all data is written as immadiate-data

Message ID 1499325696-18310-1-git-send-email-sagi@grimberg.me (mailing list archive)
State Accepted
Headers show

Commit Message

Sagi Grimberg July 6, 2017, 7:21 a.m. UTC
We might get some bogus error completions in case the target will
remotely invalidate the rkey and the HCA will need to retransmit
from this buffer.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
---
 drivers/infiniband/ulp/iser/iser_initiator.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Doug Ledford July 22, 2017, 5:55 p.m. UTC | #1
On 7/6/2017 3:21 AM, Sagi Grimberg wrote:
> We might get some bogus error completions in case the target will
> remotely invalidate the rkey and the HCA will need to retransmit
> from this buffer.
> 
> Signed-off-by: Sagi Grimberg <sagi@grimberg.me>

This was accepted into 4.13-rc, thanks.
diff mbox

Patch

diff --git a/drivers/infiniband/ulp/iser/iser_initiator.c b/drivers/infiniband/ulp/iser/iser_initiator.c
index 12ed62ce9ff7..2a07692007bd 100644
--- a/drivers/infiniband/ulp/iser/iser_initiator.c
+++ b/drivers/infiniband/ulp/iser/iser_initiator.c
@@ -137,8 +137,10 @@  iser_prepare_write_cmd(struct iscsi_task *task,
 
 	if (unsol_sz < edtl) {
 		hdr->flags     |= ISER_WSV;
-		hdr->write_stag = cpu_to_be32(mem_reg->rkey);
-		hdr->write_va   = cpu_to_be64(mem_reg->sge.addr + unsol_sz);
+		if (buf_out->data_len > imm_sz) {
+			hdr->write_stag = cpu_to_be32(mem_reg->rkey);
+			hdr->write_va = cpu_to_be64(mem_reg->sge.addr + unsol_sz);
+		}
 
 		iser_dbg("Cmd itt:%d, WRITE tags, RKEY:%#.4X "
 			 "VA:%#llX + unsol:%d\n",