scsi: zfcp: make DIX experimental, disabled, and independent of DIF
authorFedor Loshakov <loshakov@linux.ibm.com>
Thu, 29 Nov 2018 12:09:56 +0000 (13:09 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sat, 8 Dec 2018 02:36:40 +0000 (21:36 -0500)
Introduce separate zfcp module parameters to individually select support
for: DIF which should work (zfcp.dif, which used to be DIF+DIX, disabled)
or DIX+DIF which can cause trouble (zfcp.dix, new, disabled).

If DIX is enabled, we warn on zfcp driver initialization.  As before, this
also reduces the maximum I/O request size to half, to support the worst
case of merged single sector requests with one protection data scatter
gather element per sector. This can impact the maximum throughput.

In DIF-only mode (zfcp.dif=1 zfcp.dix=0), we can use the full maximum I/O
request size as there is no protection data for zfcp.

Signed-off-by: Steffen Maier <maier@linux.ibm.com>
Signed-off-by: Fedor Loshakov <loshakov@linux.ibm.com>
Reviewed-by: Jens Remus <jremus@linux.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/s390/scsi/zfcp_aux.c
drivers/s390/scsi/zfcp_ext.h
drivers/s390/scsi/zfcp_scsi.c

index 89657146f83272808ae7990e7844e6806f021e75..df10f4e07a4a1838aa7eaa777131dad8a5fe2469 100644 (file)
@@ -124,6 +124,9 @@ static int __init zfcp_module_init(void)
 {
        int retval = -ENOMEM;
 
+       if (zfcp_experimental_dix)
+               pr_warn("DIX is enabled. It is experimental and might cause problems\n");
+
        zfcp_fsf_qtcb_cache = zfcp_cache_hw_align("zfcp_fsf_qtcb",
                                                  sizeof(struct fsf_qtcb));
        if (!zfcp_fsf_qtcb_cache)
index d74dd8bb175cc093d24d95440b3e02504eca99fe..3fce47b0b21b55142a64bb3b838bf28168ddd89e 100644 (file)
@@ -146,6 +146,7 @@ extern void zfcp_qdio_close(struct zfcp_qdio *);
 extern void zfcp_qdio_siosl(struct zfcp_adapter *);
 
 /* zfcp_scsi.c */
+extern bool zfcp_experimental_dix;
 extern struct scsi_transport_template *zfcp_scsi_transport_template;
 extern int zfcp_scsi_adapter_register(struct zfcp_adapter *);
 extern void zfcp_scsi_adapter_unregister(struct zfcp_adapter *);
index 82dbe2677fc15891deb655fce7537c008c11ba3c..a8b53ed61c1ee471d13eb37949815462a32f9e3b 100644 (file)
@@ -27,7 +27,11 @@ MODULE_PARM_DESC(queue_depth, "Default queue depth for new SCSI devices");
 
 static bool enable_dif;
 module_param_named(dif, enable_dif, bool, 0400);
-MODULE_PARM_DESC(dif, "Enable DIF/DIX data integrity support");
+MODULE_PARM_DESC(dif, "Enable DIF data integrity support (default off)");
+
+bool zfcp_experimental_dix;
+module_param_named(dix, zfcp_experimental_dix, bool, 0400);
+MODULE_PARM_DESC(dix, "Enable experimental DIX (data integrity extension) support which implies DIF support (default off)");
 
 static bool allow_lun_scan = true;
 module_param(allow_lun_scan, bool, 0600);
@@ -790,11 +794,11 @@ void zfcp_scsi_set_prot(struct zfcp_adapter *adapter)
        data_div = atomic_read(&adapter->status) &
                   ZFCP_STATUS_ADAPTER_DATA_DIV_ENABLED;
 
-       if (enable_dif &&
+       if ((enable_dif || zfcp_experimental_dix) &&
            adapter->adapter_features & FSF_FEATURE_DIF_PROT_TYPE1)
                mask |= SHOST_DIF_TYPE1_PROTECTION;
 
-       if (enable_dif && data_div &&
+       if (zfcp_experimental_dix && data_div &&
            adapter->adapter_features & FSF_FEATURE_DIX_PROT_TCPIP) {
                mask |= SHOST_DIX_TYPE1_PROTECTION;
                scsi_host_set_guard(shost, SHOST_DIX_GUARD_IP);