Re: [PATCH] iscsi-target: Disable Immediate + Unsolicited Data with ISER Protection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/15/2014 10:31 AM, Or Gerlitz wrote:
On 15/05/2014 10:23, Sagi Grimberg wrote:
On 5/14/2014 11:35 PM, Nicholas A. Bellinger wrote:
From: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>

This patch explicitly disables Immediate + Unsolicited Data for ISER
connections during login in iscsi_login_zero_tsih_s2() when protection
has been enabled for the session by the underlying hardware.

This is currently required because protection / signature memory regions
(MRs) expect T10 PI to occur on RDMA READs + RDMA WRITEs transfers, and
not on a immediate data payload associated with ISCSI_OP_SCSI_CMD, or
unsolicited data-out associated with a ISCSI_OP_SCSI_DATA_OUT.

Hey Nic,

Thanks for this one. see comments below.

Cc: Sagi Grimberg <sagig@xxxxxxxxxxxx>
Cc: Or Gerlitz <ogerlitz@xxxxxxxxxxxx>
Signed-off-by: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>
---
drivers/target/iscsi/iscsi_target_login.c | 21 +++++++++++++++++++++
  1 file changed, 21 insertions(+)

diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c
index b72d855..9e99b63 100644
--- a/drivers/target/iscsi/iscsi_target_login.c
+++ b/drivers/target/iscsi/iscsi_target_login.c
@@ -452,6 +452,27 @@ static int iscsi_login_zero_tsih_s2(
                  ISCSI_LOGIN_STATUS_NO_RESOURCES);
              return -1;
          }
+        /*
+         * ISER currently requires that ImmediateData + Unsolicited
+ * Data be disabled when protection / signature MRs are enabled.
+         */
+        if (sess->se_sess->sup_prot_ops &
+           (TARGET_PROT_DOUT_STRIP | TARGET_PROT_DOUT_PASS)) {


just to make sure, this snippet branches on whether T10 is activated on this session or we don't currently have
a way to realize that upfront?


The user may activate T10-PI on his transport at any given moment. We can do it here or alternatively we
can try to do it on the configfs _store_ routine. I'm fine with either.

We should condition with TARGET_PROT_DOUT_INSERT as well. when working in T10-PI mode (expose a T10-PI backstore) against legacy initiators we want the HBA to offload T10-PI generation. In this case the prot_op will be
TARGET_PROT_DOUT_INSERT and we need RDMA transfer for that.

+
+            sprintf(buf, "ImmediateData=No");

I think a debug/warning print is appropriate in this case.
something of the following:
pr_warn("T10-PI mode is active, Setting ImmediateData=No, InitialR2T=Yes\n");

to me pr_debug seems more in place.

I'm fine with pr_debug - just wanted the user to be notified.



+ if (iscsi_change_param_value(buf, conn->param_list, 0) < 0) {
+                iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR,
+                            ISCSI_LOGIN_STATUS_NO_RESOURCES);
+                return -1;
+            }
+
+            sprintf(buf, "InitialR2T=Yes");
+ if (iscsi_change_param_value(buf, conn->param_list, 0) < 0) {
+                iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR,
+                            ISCSI_LOGIN_STATUS_NO_RESOURCES);
+                return -1;
+            }
+        }
      }
        return 0;



--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux