diff mbox

[1/3] mlx5: Fix signature handover operation for interleaved buffers

Message ID 1400427160-11314-2-git-send-email-sagig@mellanox.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Sagi Grimberg May 18, 2014, 3:32 p.m. UTC
When the data and protection are interleaved in the memory
domain, no need to expand the mkey total length.

At the moment no Linux user works (iSER initiator & target) in interleaved
mode. This may change in the future as for SCSI pass-through devices there
is no real point in target performing de-interleaving and re-interleaving
of the protection data in the PT stage. Regardless, signature verbs support
this mode.

Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
---
 drivers/infiniband/hw/mlx5/qp.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index ae788d2..410d3a0 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -2263,7 +2263,10 @@  static int set_sig_umr_wr(struct ib_send_wr *wr, struct mlx5_ib_qp *qp,
 
 	/* length of the protected region, data + protection */
 	region_len = wr->sg_list->length;
-	if (wr->wr.sig_handover.prot)
+	if (wr->wr.sig_handover.prot &&
+	    (wr->wr.sig_handover.prot->lkey != wr->sg_list->lkey  ||
+	     wr->wr.sig_handover.prot->addr != wr->sg_list->addr  ||
+	     wr->wr.sig_handover.prot->length != wr->sg_list->length))
 		region_len += wr->wr.sig_handover.prot->length;
 
 	/**