summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/device_handler/scsi_dh_alua.c
AgeCommit message (Collapse)Author
2016-02-23scsi_dh_alua: Make stpg synchronousHannes Reinecke
The 'activate_complete' function needs to be executed after stpg has finished, so we can as well execute stpg synchronously and call the function directly. Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23scsi_dh_alua: separate out alua_stpg()Hannes Reinecke
Separate out SET TARGET PORT GROUP functionality into a separate function alua_stpg(). Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23scsi_dh_alua: Pass buffer as function argumentHannes Reinecke
Pass in the buffer as a function argument for submit_rtpg(). Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-12-07scsi_dh_alua: Remove stale variablesHannes Reinecke
With commit 83ea0e5e3501 ("scsi_dh_alua: use scsi_vpd_tpg_id()") these variables became obsolete, but weren't removed. [mkp: Fixed checkpatch warning] Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-12-02scsi_dh_alua: use scsi_vpd_tpg_id()Hannes Reinecke
Use the common function 'scsi_vpd_tpg_id()' instead of open-coding it in scsi_dh_alua. [mkp: Applied by hand] Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-12-02scsi_dh_alua: simplify sense code handlingHannes Reinecke
Most sense code is already handled in the generic code, so we shouldn't be adding special cases here. However, when doing so we need to check for unit attention whenever we're sending an internal command. Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Ewan Milne <emilne@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-12-02scsi_dh_alua: rework alua_check_tpgs() to return the tpgs modeHannes Reinecke
Instead of returning an error code in alua_check_tpgs() we should rather return the tpgs mode directly and have a cleaner syntax. Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-12-02scsi_dh_alua: use unaligned access macrosHannes Reinecke
Use 'get_unaligned_XX' and 'put_unaligned_XX' instead of open-coding it. Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-12-02scsi_dh_alua: use flag for RTPG extended headerHannes Reinecke
We should be using a flag when RTPG extended header is not supported, that saves us sending RTPG twice for older arrays. Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-12-02scsi_dh_alua: fixup description of stpg_endio()Hannes Reinecke
Fixup copy-and-paste error in the description of stpg_endio(). Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-12-02scsi_dh_alua: return standard SCSI return codes in submit_rtpgHannes Reinecke
Fixup submit_rtpg() to always return a standard SCSI return code. Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Ewan Milne <emilne@redhat.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-12-02scsi_dh_alua: use standard logging functionsHannes Reinecke
Use standard logging functions instead of hand-crafted ones. Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Ewan Milne <emilne@redhat.com> Reviewed-by: Bart Van Assche <bvanassche@sandisk.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-12-02scsi_dh_alua: sanitze sense code handlingHannes Reinecke
The only check for a valid sense code is calling scsi_normalize_sense() and check the return value. So drop the pointless checks and rely on scsi_normalize_sense() to figure out if the sense code is valid. With that we can also remove the 'senselen' field. Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.com> Reviewed-by: Bart van Assche <bvanassche@sandisk.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-12-02scsi_dh_alua: improved loggingHannes Reinecke
Issue different logging messages if ALUA is not supported or the TPGS setting is invalid. Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-12-02scsi_dh_alua: Use vpd_pg83 informationHannes Reinecke
The SCSI device now has the VPD page 0x83 information attached, so there is no need to query it again. [mkp: Fixed a checkpatch warning] Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-12-02scsi_dh_alua: Disable ALUA handling for non-disk devicesHannes Reinecke
Non-disk devices might support ALUA, but the firmware implementation is untested and frequently broken. As we're don't actually need it disable ALUA support for non-disk device for now. Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-08-28scsi_dh: kill struct scsi_dh_dataChristoph Hellwig
Add a ->handler and a ->handler_data field to struct scsi_device and kill this indirection. Also move struct scsi_device_handler to scsi_dh.h so that changes to it don't require rebuilding every SCSI LLDD. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-08-28scsi_dh: move device matching to the core codeChristoph Hellwig
Add a single list of devices that need non-ALUA device handlers to the core scsi_dh code so that we can autoload the modules for them at probe time. While this is a little ugly in terms of architecture it actually significantly simplifies the code in addition to the new autoloading functionality. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Acked-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
2014-11-12scsi: handle more device handler setup/teardown in common codeChristoph Hellwig
Move all code to set up and tear down sdev->scsi_dh_data to common code. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Reviewed-by: Hannes Reinecke <hare@suse.de>
2014-11-12scsi: use container_of to get at device handler private dataChristoph Hellwig
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Reviewed-by: Hannes Reinecke <hare@suse.de>
2014-11-12scsi_dh: get module reference outside of device handlerChristoph Hellwig
We need to grab a reference to the module before calling the attach routines to avoid a small race vs module removal. It also cleans up the code significantly as a side effect. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Reviewed-by: Hannes Reinecke <hare@suse.de>
2014-11-10scsi: TUR path is down after adapter gets reset with multipathwenxiong@linux.vnet.ibm.com
This patch fixes an issue with multipath ipr SAS devices which require a start unit command to be issued following an adapter reset. Without this patch, paths get marked failed following an adapter reset and since the error handler never gets invoked to issue the start unit, the paths are never recovered. Returning FAILED for this case ensures the error handler wakes up to issue the start unit. Signed-off-by: Brian King <brking@linux.vnet.ibm.com> Tested-by: Wen Xiong <wenxiong@linux.vnet.ibm.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-08-28block,scsi: fixup blk_get_request dead queue scenariosJoe Lawrence
The blk_get_request function may fail in low-memory conditions or during device removal (even if __GFP_WAIT is set). To distinguish between these errors, modify the blk_get_request call stack to return the appropriate ERR_PTR. Verify that all callers check the return status and consider IS_ERR instead of a simple NULL pointer check. For consistency, make a similar change to the blk_mq_alloc_request leg of blk_get_request. It may fail if the queue is dead, or the caller was unwilling to wait. Signed-off-by: Joe Lawrence <joe.lawrence@stratus.com> Acked-by: Jiri Kosina <jkosina@suse.cz> [for pktdvd] Acked-by: Boaz Harrosh <bharrosh@panasas.com> [for osd] Reviewed-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Jens Axboe <axboe@fb.com>
2014-06-06block: add blk_rq_set_block_pc()Jens Axboe
With the optimizations around not clearing the full request at alloc time, we are leaving some of the needed init for REQ_TYPE_BLOCK_PC up to the user allocating the request. Add a blk_rq_set_block_pc() that sets the command type to REQ_TYPE_BLOCK_PC, and properly initializes the members associated with this type of request. Update callers to use this function instead of manipulating rq->cmd_type directly. Includes fixes from Christoph Hellwig <hch@lst.de> for my half-assed attempt. Signed-off-by: Jens Axboe <axboe@fb.com>
2013-10-25[SCSI] scsi_dh_alua: ALUA handler attach should succeed while TPG is ↵Stewart, Sean
transitioning During testing, it was discovered that when a device tries to attach to the alua handler while in TPG state of transitioning, the alua_rtpg function will wait for it to exit the state before allowing it to continue. As a result, if the 60 second timeout expires, the alua handler will not attach to the device. To fix this, I have introduced an input argument to alua_rtpg called wait_for_transition. The idea is that it will wait for the transition to complete before an activation (because the current TPG state has some bearing in that case), but during a discovery if it is transitioning, it will not wait, and will store the state as standby for the time being. I believe the precedent exists for this from commit c0d289b3e59577532c45ee9110ef81bd7b341272 Since if the device reports a state of transitioning, it can transition to other more valid states, and it has been established TPGS is supported on the device, if it is attaching. Signed-off-by: Sean Stewart <Sean.Stewart@netapp.com> Acked-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-10-25[SCSI] scsi_dh_alua: ALUA check sense should retry device internal reset ↵Stewart, Sean
unit attention When the scsi_dh_alua handler issues an RTPG during initialization, if it gets 0x06/0x29/0x04 as the sense, it will fail to attach the handler. NetApp E-Series returns 0x29/0x00 for power on, and 0x29/0x04 for conditions that cause the controller to reboot again. These conditions should be treated identically within the handler. Signed-off-by: Sean Stewart <Sean.Stewart@netapp.com> Acked-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-04-11[SCSI] scsi_dh_alua: Add module parameter to allow failover to non preferred ↵Stewart, Sean
path without STPG Resending with requested rewording of the parameter description. 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'. [jejb: fix up whitespace and other issues] Signed-off-by: Vijay Chauhan <vijay.chauhan@netapp.com> Signed-off-by: Sean Stewart <Sean.Stewart@netapp.com> Acked-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-04-09[SCSI] scsi_dh_alua: fix stpg sense handlingMike Christie
For the stpg_endio path we are not evaluating the sense. The bug is that 1. The error value is set to -EIO when there is sense, so we hit the first error check and always return SCSI_DH_IO. 2. h->senselen is set to zero in submit_stpg. It is not later set to req->sense_len like in the synchrounous exection paths, so we must check the req->sense_len field. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24[SCSI] scsi_dh_alua: Enable STPG for unavailable portsBart Van Assche
A quote from SPC-4: "While in the unavailable primary target port asymmetric access state, the device server shall support those of the following commands that it supports while in the active/optimized state: [ ... ] d) SET TARGET PORT GROUPS; [ ... ]". Hence enable sending STPG to a target port group that is in the unavailable state. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Acked-by: Hannes Reinecke <hare@suse.de> Cc: <stable@vger.kernel.org> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-07-20[SCSI] scsi_dh_alua: Re-enable STPG for unavailable portsBart Van Assche
A quote from SPC-4: "While in the unavailable primary target port asymmetric access state, the device server shall support those of the following commands that it supports while in the active/optimized state: [ ... ] d) SET TARGET PORT GROUPS; [ ... ]". Hence re-enable sending STPG to a target port group that is in the unavailable state. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Babu Moger <babu.moger@netapp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-07-20[SCSI] scsi_dh_alua: backoff alua rtpg retry linearly vs. geometricallyRob Evers
Currently the backoff algorithm for when to retry alua rtpg requests progresses geometrically as so: 2, 4, 8, 16, 32, 64... seconds. This progression can lead to un-needed delay in retrying alua rtpg requests when the rtpgs are delayed. A less aggressive backoff algorithm that is additive would not lead to such large jumps when delays start getting long, but would backoff linearly: 2, 4, 6, 8, 10... seconds. Signed-off-by: Martin George <marting@netapp.com> Signed-off-by: Rob Evers <revers@redhat.com> Reviewed-by: Babu Moger <babu.moger@netapp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-07-20[SCSI] scsi_dh_alua: retry alua rtpg extended header for illegal request ↵Rob Evers
response Some storage arrays are known to return 'illegal request' when an rtpg extended header request is made. T10 says the array should ignore the bit, and return the non-extended rtpg as the array doesn't support the request. Working around this by retrying the rtpg request without the extended header bit set when the extended rtpg request results in illegal request. Signed-off-by: Rob Evers <revers@redhat.com> Reviewed-by: Babu Moger <babu.moger@netapp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-07-20[SCSI] scsi_dh_alua: implement 'implied transition timeout'Rob Evers
During alua transitions, an array can return transitioning status in response to rtpg requests. These requests get retried for a maximum of 60 seconds by default before timing out. Sometimes this timeout isn't sufficient to allow the array to complete the transition. T10-spc4 addresses this under 'Report Target Port Groups' command. This update retrieves the timeout value from the storage array if available and retries the transitioning rtpgs for up to the 'implied transitioning timeout' value Signed-off-by: Rob Evers <revers@redhat.com> Reviewed-by: Babu Moger <babu.moger@netapp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-04-23[SCSI] scsi_dh_alua: Optimize the STPG commandMoger, Babu
This patch optimizes the set target port group(STPG) command. During our testing, we found that it is not optimal to send stpg command every time the path group switch happens. This patch uses PREF (preferred target port) bit with combination of flags passed by multipath user level tool to optimize this behaviour. If PREF bit is set then it issues a STPG command, otherwise it will let implicit transfer take place. By default there is no change in the behaviour. User tool needs to pass the parameter to make this change take effect. Patch has been tested on NetApp E series storage. Signed-off-by: Babu Moger <babu.moger@netapp.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-04-23[SCSI] scsi_dh_alua: Store the PREF bit from RTPGMoger, Babu
PREF bit indicates preferred target port group for accessing a logical unit. This bit is used to optimize the STPG command handling. Signed-off-by: Babu Moger <babu.moger@netapp.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-04-23[SCSI] scsi_dh_alua: Inroduce the set_params interface scsi_dh_alua handlerMoger, Babu
Handler expects only one parameter to set the flag ALUA_OPTIMIZE_STPG. This flag is used to optimize the STPG behaviour. There is no change in behaviour by default. For example, to set the flag pass the following parameters from multipath.conf hardware_handler "2 alua 1" Signed-off-by: Babu Moger <babu.moger@netapp.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-01-10[SCSI] scsi_dh_alua: Retry the check-condition in case Mode Parameters ChangedMoger, Babu
This patch adds a check-condition in scsi_dh_alua handler for a retry. Sometimes, I have seen attach failing due to this check-condition with following error messages on NetApp E series storage. Dec 7 15:31:01 nilgiris kernel: [102979.696673] scsi 3:0:2:9: alua: port group 00 rel port 01 Dec 7 15:31:01 nilgiris kernel: [102979.697082] scsi 3:0:2:9: alua: rtpg failed with 8000002 Dec 7 15:31:01 nilgiris kernel: [102979.697086] scsi 3:0:2:9: alua: rtpg sense code 06/2a/01 Dec 7 15:31:01 nilgiris kernel: [102979.697088] scsi 3:0:2:9: alua: not attached Signed-off-by: Babu Moger <babu.moger@netapp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-11-06Merge branch 'modsplit-Oct31_2011' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux * 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits) Revert "tracing: Include module.h in define_trace.h" irq: don't put module.h into irq.h for tracking irqgen modules. bluetooth: macroize two small inlines to avoid module.h ip_vs.h: fix implicit use of module_get/module_put from module.h nf_conntrack.h: fix up fallout from implicit moduleparam.h presence include: replace linux/module.h with "struct module" wherever possible include: convert various register fcns to macros to avoid include chaining crypto.h: remove unused crypto_tfm_alg_modname() inline uwb.h: fix implicit use of asm/page.h for PAGE_SIZE pm_runtime.h: explicitly requires notifier.h linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h miscdevice.h: fix up implicit use of lists and types stop_machine.h: fix implicit use of smp.h for smp_processor_id of: fix implicit use of errno.h in include/linux/of.h of_platform.h: delete needless include <linux/module.h> acpi: remove module.h include from platform/aclinux.h miscdevice.h: delete unnecessary inclusion of module.h device_cgroup.h: delete needless include <linux/module.h> net: sch_generic remove redundant use of <linux/module.h> net: inet_timewait_sock doesnt need <linux/module.h> ... Fix up trivial conflicts (other header files, and removal of the ab3550 mfd driver) in - drivers/media/dvb/frontends/dibx000_common.c - drivers/media/video/{mt9m111.c,ov6650.c} - drivers/mfd/ab3550-core.c - include/linux/dmaengine.h
2011-11-03[SCSI] scsi_dh_alua: Fix the time inteval for alua rtpg commandsMoger, Babu
This patch corrects the retry interval for alua rtpg command. Purpose was to retry the commands in seconds. But that was not happening. Reason is msleep takes argument in milliseconds. Also added minor text after successful attach. Signed-off-by: Babu Moger <babu.moger@netapp.com> Acked-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-10-31scsi: Fix up files implicitly depending on module.h inclusionPaul Gortmaker
The module.h header was implicitly present everywhere, so files with no explicit include of the module infrastructure would build anyway. We are now removing the implicit include, and so we need to call out the module.h file that we need explicitly. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-16[SCSI] scsi_dh_alua: Add one more check-condition for alua handlerMoger, Babu
This patch adds one more check-condition for scsi_dh_alua handler. Without this, the handler attach fails sometimes during the discovery. I have noticed this with NetApp E-Series storage with alua mode. Also removed some unnecessary brackets {} for consistency. Signed-off-by: Babu Moger <babu.moger@netapp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-08-30[SCSI] scsi_dh_alua: Decrease retry intervalHannes Reinecke
The alua device handler starts the first retry after 10 seconds, and increases it times 10 for each round. This leads to an unnecessary delay. This patch modifies it to start after one second, and increase by a factor of two. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-08-30[SCSI] scsi_dh_alua: Fix Erroneous TPG ID checkHannes Reinecke
For Target Portal Group IDs occupying the full 2 bytes in the RTPG response, the following group_id check in the alua_rtpg routine always fails in scsi_dh_alua.c: if (h->group_id == (ucp[2] << 8) + ucp[3]) { This causes the ALUA handler to wrongly identify the AAS of a specified device as well as incorrectly interpreting the supported AAS of the target as seen by the following entries in the /var/log/messages: "alua: port group 3ea state A supports tousna" "alua: port group 3e9 state A supports tousna" This is because 'ucp' is wrongly declared in alua_rtpg as a character pointer instead of an unsigned character pointer. Signed-off-by: Martin George <marting@netapp.com> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-08-30[SCSI] scsi_dh_alua: always update TPGS status on activateHannes Reinecke
When activating a patch we should always update the TPGS state as it might have changed in between. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-08-30[SCSI] scsi_dh: Implement match callback functionHannes Reinecke
Some device handler types are not tied to the vendor/model but rather to a specific capability. Eg ALUA is supported if the 'TPGS' setting in the standard inquiry is set. This patch implements a 'match' callback for device handler which supersedes the original vendor/model lookup and implements the callback for the ALUA handler. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-08-30[SCSI] scsi_dh_alua: Evaluate TPGS setting from inquiry dataHannes Reinecke
Instead of issuing a standard inquiry from within the alua device handler we can evaluate the TPGS setting from the existing inquiry data of the sdev and save us the I/O. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-05-01[SCSI] scsi_dh_alua: Attach to UNAVAILABLE/OFFLINE AAS devicesMartin George
The SCSI ALUA handler currently fails to attach to devices reporting an UNAVAILABLE/OFFLINE AAS. But given that an UNAVAILABLE/OFFLINE AAS can transition to other states like ACTIVE/OPTIMIZED, ACTIVE/NON-OPTIMIZED, etc. as per SPC4, this ALUA handler behavior should be rectified so as to attach to devices which also report an UNAVAILABLE/OFFLINE AAS. Signed-off-by: Martin George <marting@netapp.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-03-31Fix common misspellingsLucas De Marchi
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-02-12[SCSI] scsi_dh: cosmetic change to sizeof()Hillf Danton
instead of doing sizeof(struct X) it's better to do sizeof(*v) where v is the variable pointing to struct X. Signed-off-by: Hillf Danton <dhillf@gmail.com> Signed-off-by: Babu Moger <babu.moger@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24[SCSI] scsi_dh_alua: add scalable ONTAP lun to dev listMike Snitzer
Currently NetApp's VID/PID details in the INQUIRY response shows up as 'NETAPP' and 'LUN'. With upcoming scalable SAN ONTAP version on NetApp controllers, the PID entry alone is being modified to 'LUN C-Mode' (to distinguish current ONTAP LUNs from scalable ONTAP LUNs). 'LUN' would still suffice for matching 'LUN C-Mode' but best to explicitly add these new NetApp LUNs to the device list. Reported-by: Martin George <marting@netapp.com> Acked-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>