Currently ALUA device handler sends STPG command during failover and failback.
Failover can be optimized by implicit failover (by not to sending STPG command),
when 1 is passed as hwhandler parameter in multipath.conf. ex "2 alua 1". We may
need to pass the parameter through module param for alua device handler to 
optimize
failover if incase retain_attached_hwhandler set in multipath.conf and hwhandler
is set with non-tpgs device handler ex: '1 rdac'.

Signed-off-by: Vijay Chauhan <[email protected]>
Signed-off-by: Sean Stewart <[email protected]>

---
--- a/drivers/scsi/device_handler/scsi_dh_alua.c.orig   2013-03-27 
12:18:35.000000000 +0530
+++ b/drivers/scsi/device_handler/scsi_dh_alua.c        2013-03-27 
13:23:16.000000000 +0530
@@ -710,6 +710,10 @@ static int alua_set_params(struct scsi_d
        return result;
 }
 
+static uint optimize_stpg;
+module_param(optimize_stpg, uint, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(optimize_stpg, "Send STPG command for Failover on 
non-preferred path(0=Yes,1=No). Default is 0.");
+
 /*
  * alua_activate - activate a path
  * @sdev: device on the path to be activated
@@ -731,6 +735,9 @@ static int alua_activate(struct scsi_dev
        if (err != SCSI_DH_OK)
                goto out;
 
+       if (optimize_stpg)
+               h->flags |= ALUA_OPTIMIZE_STPG;
+
        if (h->tpgs & TPGS_MODE_EXPLICIT) {
                switch (h->state) {
                case TPGS_STATE_NONOPTIMIZED:
--
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to