On 2/16/2014 7:38 PM, Sagi Grimberg wrote:
User may enable T10-PI support per network portal group. any connection
established on top of it, will be required to serve protected transactions.
Hey Nic,
So about this patch I'm not so sure about a couple of things and I would
like to here your comments:
1. I added this explicit set because iSER must know about DIF during
connection establishment and not after.
This is because iSER needs to INIT DIF related resources (allocate
signature MRs and signature enabled QP).
2. I figured that user should ask for t10_pi support per tpgt if he
exports t10_pi supporting LUNs.
But I'm thinking maybe this should be implicit once user exports a
LUN supporting DIF.
Moreover, the user must *NOT* export DIF supporting LUNs over a
tpgt with active connections that didn't INIT DIF related stuff.
If this happens, we are in a bad situation. Maybe some restrictions
should be done here on exporting LUNs.
The alternative here is to always INIT DIF extra resources which is
expensive but will resolve the issue as iSER "DIF connections" have no
problem carrying non-DIF transactions.
3. Another restriction we talked about in the past was the dependency of
RDMA DIF support in ImmediateData and UnsolDataOuts.
Since iSER must prepare the memory region with DIF (Signature)
attributes using REG_SIG_MR work request *before* doing data
transfer. iSER can't handle data that may or may not come as
happens in ImmediateData and UnsolDataOuts. I can start cracking my
head to try and hack around this issue in SW (really rather not
to...) but at the moment it's just not supported. I think that perhaps
some explicit enforcement need to be made here: DIF=yes ==>
ImmediateData=No, InitialR2T=yes.
Whats your take on this?
Sagi.
Signed-off-by: Sagi Grimberg <sagig@xxxxxxxxxxxx>
---
drivers/target/iscsi/iscsi_target_configfs.c | 6 ++++++
drivers/target/iscsi/iscsi_target_tpg.c | 19 +++++++++++++++++++
drivers/target/iscsi/iscsi_target_tpg.h | 1 +
3 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/drivers/target/iscsi/iscsi_target_configfs.c b/drivers/target/iscsi/iscsi_target_configfs.c
index 1c0088f..fe35dcb 100644
--- a/drivers/target/iscsi/iscsi_target_configfs.c
+++ b/drivers/target/iscsi/iscsi_target_configfs.c
@@ -1052,6 +1052,11 @@ TPG_ATTR(demo_mode_discovery, S_IRUGO | S_IWUSR);
*/
DEF_TPG_ATTRIB(default_erl);
TPG_ATTR(default_erl, S_IRUGO | S_IWUSR);
+/*
+ * Define iscsi_tpg_attrib_s_t10_pi
+ */
+DEF_TPG_ATTRIB(t10_pi);
+TPG_ATTR(t10_pi, S_IRUGO | S_IWUSR);
static struct configfs_attribute *lio_target_tpg_attrib_attrs[] = {
&iscsi_tpg_attrib_authentication.attr,
@@ -1064,6 +1069,7 @@ static struct configfs_attribute *lio_target_tpg_attrib_attrs[] = {
&iscsi_tpg_attrib_prod_mode_write_protect.attr,
&iscsi_tpg_attrib_demo_mode_discovery.attr,
&iscsi_tpg_attrib_default_erl.attr,
+ &iscsi_tpg_attrib_t10_pi.attr,
NULL,
};
diff --git a/drivers/target/iscsi/iscsi_target_tpg.c b/drivers/target/iscsi/iscsi_target_tpg.c
index 80ae14c..d95a5f2 100644
--- a/drivers/target/iscsi/iscsi_target_tpg.c
+++ b/drivers/target/iscsi/iscsi_target_tpg.c
@@ -860,3 +860,22 @@ int iscsit_ta_default_erl(
return 0;
}
+
+int iscsit_ta_t10_pi(
+ struct iscsi_portal_group *tpg,
+ u32 flag)
+{
+ struct iscsi_tpg_attrib *a = &tpg->tpg_attrib;
+
+ if ((flag != 0) && (flag != 1)) {
+ pr_err("Illegal value %d\n", flag);
+ return -EINVAL;
+ }
+
+ a->t10_pi = flag;
+ pr_debug("iSCSI_TPG[%hu] - T10 Protection information bit:"
+ " %s\n", tpg->tpgt, (a->t10_pi) ?
+ "ON" : "OFF");
+
+ return 0;
+}
diff --git a/drivers/target/iscsi/iscsi_target_tpg.h b/drivers/target/iscsi/iscsi_target_tpg.h
index 213c0fc..0a182f2 100644
--- a/drivers/target/iscsi/iscsi_target_tpg.h
+++ b/drivers/target/iscsi/iscsi_target_tpg.h
@@ -39,5 +39,6 @@ extern int iscsit_ta_demo_mode_write_protect(struct iscsi_portal_group *, u32);
extern int iscsit_ta_prod_mode_write_protect(struct iscsi_portal_group *, u32);
extern int iscsit_ta_demo_mode_discovery(struct iscsi_portal_group *, u32);
extern int iscsit_ta_default_erl(struct iscsi_portal_group *, u32);
+extern int iscsit_ta_t10_pi(struct iscsi_portal_group *, u32);
#endif /* ISCSI_TARGET_TPG_H */
--
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