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:23 AM, 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)) {

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.


Note: I'm aware that this is just semantics since isert exposes TARGET_PROT_ALL anyway.

+
+            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");

+ 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