adam radford [Wed, 15 Dec 2010 02:56:07 +0000 (18:56 -0800)]
[SCSI] megaraid_sas: Use lowest memory bar for SR-IOV VF support
The following patch modifies the megaraid_sas driver to select the
lowest memory bar available so the driver will work in SR-IOV VF
environments where the memory bar mapping changes.
Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
FUJITA Tomonori [Mon, 20 Dec 2010 16:44:45 +0000 (18:44 +0200)]
[SCSI] st: Increase success probability in driver buffer allocation
Modify allocation to try the minimum possible page order allowed by the HBA
scatter/gather segment limit in allocation of the driver's internal
buffer. This increases the probability of successful allocation. The
allocation may still fail if this minimum order is > 0.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Kai Makisara <kai.makisara@kolumbus.fi> Reported-by: Lukas Kolbe <lkolbe@techfak.uni-bielefeld.de> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Kai Makisara [Mon, 20 Dec 2010 16:43:39 +0000 (18:43 +0200)]
[SCSI] st: Store page order before driver buffer allocation
The order of the pages allocated for the driver buffer must be stored before
allocation because it is used in freeing already allocated pages if
allocation fails.
Signed-off-by: Kai Makisara <kai.makisara@kolumbus.fi> Reported-by: Lukas Kolbe <lkolbe@techfak.uni-bielefeld.de> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
James Bottomley [Fri, 17 Dec 2010 20:36:34 +0000 (15:36 -0500)]
[SCSI] fix medium error problems with some arrays which can cause data corruption
Our current handling of medium error assumes that data is returned up
to the bad sector. This assumption holds good for all disk devices,
all DIF arrays and most ordinary arrays. However, an LSI array engine
was recently discovered which reports a medium error without returning
any data. This means that when we report good data up to the medium
error, we've reported junk originally in the buffer as good. Worse,
if the read consists of requested data plus a readahead, and the error
occurs in readahead, we'll just strip off the readahead and report
junk up to userspace as good data with no error.
The fix for this is to have the error position computation take into
account the amount of data returned by the driver using the scsi
residual data. Unfortunately, not every driver fills in this data,
but for those who don't, it's set to zero, which means we'll think a
full set of data was transferred and the behaviour will be identical
to the prior behaviour of the code (believe the buffer up to the error
sector). All modern drivers seem to set the residual, so that should
fix up the LSI failure/corruption case.
Reported-by: Douglas Gilbert <dgilbert@interlog.com> Cc: Stable Tree <stable@kernel.org> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
[SCSI] Add missing SPC-4 CDB and MAINTENANCE_[IN,OUT] service action definitions
This patch adds a handful of missing CDBs defs that are used by TCM
persistent reservation logic in the SPC-4 defined CDB exclusion table for
registrations and reservations.
This includes a number of missing MI_* and MO_* prefixed service actions defs
for MAINTENANCE_IN and MAINTENANCE_OUT that are mentioned wrt to persistent
registration and reservation status for the SCSI Initiator Port.
Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Menny Hamburger [Thu, 16 Dec 2010 19:57:07 +0000 (14:57 -0500)]
[SCSI] scsi_dh: propagate SCSI device deletion
Currently, when scsi_dh_activate() returns with an error
(e.g. SCSI_DH_NOSYS) the activate_complete callback is not called and
the error is not propagated to DM mpath.
When a SCSI device attached to a device handler is deleted, userland
processes currently performing I/O on the device will have their I/O
hang forever.
- Set SCSI_DH_NOSYS error when the handler is in the process of being
deleted (e.g. the SCSI device is in a SDEV_CANCEL or SDEV_DEL state).
- Set SCSI_DH_DEV_OFFLINED error when device is in SDEV_OFFLINE state.
- Call the activate_complete callback function directly from
scsi_dh_activate if an error has been set (when either the scsi_dh
internal data has already been deleted or is in the process of being
deleted).
The patch was tested in an iSCSI environment, RDAC H/W handler and
multipath. In the following reproduction process, dd will I/O hang
forever and the only way to release it will be to reboot the machine:
1) Perform I/O on a multipath device:
dd if=/dev/dm-0 of=/dev/zero bs=8k count=1000000 &
2) Delete all slave SCSI devices contained in the mpath device:
I) In an iSCSI environment, the easiest way to do this is by
stopping iSCSI:
/etc/init.d/iscsi stop
II) Another way to delete the devices is by applying the following
bash scriptlet:
dm_devs=$(ls /sys/block/ | grep dm- | xargs)
for dm_dev in $dm_devs; do
devices=$(ls /sys/block/$dm_dev/slaves)
for device in $devices; do
echo 1 > /sys/block/$device/device/delete
done
done
NOTE: when DM mpath's fail_path uses blk_abort_queue this scsi_dh change
isn't strictly required. However, DM mpath's call to blk_abort_queue
will soon be reverted because it has proven to be unsafe due to a race
(between blk_abort_queue and scsi_request_fn) that can lead to list
corruption. Therefore we cannot rely on blk_abort_queue via fail_path,
but even if we could this scsi_dh change is still preferrable.
Signed-off-by: Menny Hamburger <Menny_Hamburger@Dell.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Reviewed-by: Babu Moger <babu.moger@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
[SCSI] hpsa: do not consider firmware revision when looking for device changes.
The firmware may have been updated, in which case, it's the same device,
and in that case, we do not want to remove and add the device, we want to
let it continue as is.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
James Smart [Wed, 15 Dec 2010 22:58:20 +0000 (17:58 -0500)]
[SCSI] lpfc 8.3.20: Update lpfc driver version to 8.3.20
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
James Smart [Wed, 15 Dec 2010 22:58:10 +0000 (17:58 -0500)]
[SCSI] lpfc 8.3.20: Updates to FC discovery commands
Updated commands used for ELS to utilize VPI
Allocate RPI at node creation time and pass in ELS commnads.
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
James Smart [Wed, 15 Dec 2010 22:57:46 +0000 (17:57 -0500)]
[SCSI] lpfc 8.3.20: Implement new SLI4 init procedures based on if_type
Implement new SLI4 init procedures based on if_type:
- Add structure changes for new SLIPORT registers and BAR changes.
- Update register names to be consistent with inteface spec terms.
- Added union to encapsulate Hardward error registers.
- Rework lpfc_sli4_post_status_check() around SLI-4's SLI_INTF type
- Removed the lpfc_sli4_fw_cfg_check routine
- Segmented driver logic to include evaluation of the if_type to
engage different behaviors.
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
James Smart [Wed, 15 Dec 2010 22:57:33 +0000 (17:57 -0500)]
[SCSI] lpfc 8.3.20: Implement the FC and SLI async event handlers
Implement the FC and SLI async event handlers:
- Updated MQ_CREATE_EXT mailbox structure to include fc and SLI async events.
- Added the SLI trailer code.
- Split physical field into type and number to reflect latest SLI spec.
- Changed lpfc_acqe_fcoe to lpfc_acqe_fip to reflect latest Spec changes.
- Added lpfc_acqe_fc_la structure for FC link attention async events.
- Added lpfc_acqe_sli structure for sli async events.
- Added lpfc_sli4_async_fc_evt routine to handle fc la async events.
- Added lpfc_sli4_async_sli routine to handle sli async events.
- Moved LPFC_TRAILER_CODE_FC to be handled by its own handler function.
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
James Smart [Wed, 15 Dec 2010 22:57:20 +0000 (17:57 -0500)]
[SCSI] lpfc 8.3.20: Critical fixes
- Use for iocbq->context1 to hold the ndlp pointer.
- Set ndlp in all iocbs generated from ioctl functions.
- Turn parity and serr bits back on after performing sli4 board reset.
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Krishna Gudipati [Tue, 14 Dec 2010 00:23:27 +0000 (16:23 -0800)]
[SCSI] bfa: io tag handling and minor bug fix.
Fix iotag handling:
1) Update and check io tag for retry case.
2) Clearing upper 3 bits in io tag when an IO completes.
The 3 upper bits in io tags are used for counting FCP exchange retry.
Un-cleared bits will cause firmware to access invalid memory when the
same io tag is used for an IO to a target that doesn't support FCP
exchange retry.
3) Only check the effective bits when validating an iotag.
Other minor fixes:
1) Added trace to get FC header type with assert of unhandled packet received.
Ignore the type FC_TYPE_FC_FSS (FC_XS).
2) Fixed the adapter info display check - to check for fcmode flag even.
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Krishna Gudipati [Tue, 14 Dec 2010 00:17:11 +0000 (16:17 -0800)]
[SCSI] bfa: IOC auto recovery fix.
- Made IOC auto_recovery synchronized and not timer based.
- Only one PCI function will attempt to recover and reinitialize
the ASIC on a failure, after all the active PCI fns
acknowledge the IOC failure.
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Krishna Gudipati [Tue, 14 Dec 2010 00:16:50 +0000 (16:16 -0800)]
[SCSI] bfa: Store port configuration in flash for persistency.
When the bfa driver is loaded a flogi is sent without the knowledge of
trunking configuration. This normal flogi causes the switch ports
which had trunking enabled to go to persistent offline. Solution is
to store the port configuration (which has trunking info) in the flash
for persistency. The firmware will read this configuration when the
very first fcport enable is received.
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Krishna Gudipati [Tue, 14 Dec 2010 00:16:09 +0000 (16:16 -0800)]
[SCSI] bfa: IOC fwtrace save logic & state machine fixes.
- Move fw trace save logic to bfa_ioc_sm_fail_entry(),
so that fw trace is saved irrespective of the cause of the failure.
- Make bfa_ioc_sm_fail() a failure parking state.
- Rename bfa_ioc_sm_initfail() to a more appropriate bfa_ioc_sm_fail_retry()
as it is no longer a parking state.
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Maggie Zhang [Fri, 10 Dec 2010 03:10:27 +0000 (19:10 -0800)]
[SCSI] bfa: scatter gather processing change
Modified scatter gather processing to use the kernel provided
scsi_for_each_sg() macro.
1) Instead of allocating and setting up sgpg in bfa_ioim_sge_setup(),
we only do allocation. As a result, we remove
bfa_ioim_sgpg_setup() and rename bfa_ioim_sge_setup() to
bfa_ioim_sgpg_alloc().
2) bfa_ioim_send_ioreq() call scsi_for_each_sg() to handle both inline
and sgpg setup.
By changing field ordering we can avoid a couple of memory holes in
the tables that use the ibmvfc_async_desc structure.
Signed-off-by: Robert Jennings <rcj@linux.vnet.ibm.com> Acked-by: Brian King <brking@linux.vnet.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Since iscsi transport can be built as a module and uses netlink socket
to communicate. The module should have an alias to autoload when socket
of NETLINK_ISCSI type is requested.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Acked-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
The zfcpdump tool requires a method to attach exactly one LUN. The
easiest way to achieve this is to add a new zfcp module parameter.
When allow_lun_scan is set to "false", zfcp only accepts LUNs that
have been configured through the unit_add sysfs interface.
[SCSI] zfcp: Move qdio setup from erp to zfcp_qdio.c
Initialization of the qdio waitqueue should happen when the qdio data
is initialized and the QDIOUP flag should be handled in the qdio code
as well. Adjust the code accordingly and remove the superfluos
function zfcp_erp_adapter_strategy_open_qdio.
Swen Schillig [Thu, 2 Dec 2010 14:16:16 +0000 (15:16 +0100)]
[SCSI] zfcp: Redesign of the debug tracing final cleanup.
This patch is the final cleanup of the redesign from the zfcp tracing.
Structures and elements which were used by multiple areas of the
former debug tracing are now changed to the new scheme.
Swen Schillig [Thu, 2 Dec 2010 14:16:12 +0000 (15:16 +0100)]
[SCSI] zfcp: Redesign of the debug tracing for recovery actions.
The tracing environment of the zfcp LLD has become very bulky and hard
to maintain. Small changes involve a large modification process which
is error-prone and not effective. This patch is the first of a set to
redesign the zfcp tracing to a more straight-forward and easy to
extend scheme. It removes all interpretation and visualization parts
and focuses on bare logging of the information.
This patch deals with all trace records of the zfcp error recovery.
Prasanna Mumbai [Fri, 3 Dec 2010 06:12:43 +0000 (22:12 -0800)]
[SCSI] qla4xxx: cache new IP address acquired via DHCP
Prior to firmware state change from ACQUIRING to READY, an
0x8029 AEN is received. Added code to check previous state
being ACQUIRING in order to update the ip address in the driver.
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Signed-off-by: Prasanna Mumbai <prasanna.mumbai@qlogic.com> Signed-off-by: Ravi Anand <ravi.anand@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Joe Eykholt [Wed, 1 Dec 2010 00:20:18 +0000 (16:20 -0800)]
[SCSI] libfc: fix statistics for FCP input/output megabytes
The statistics for InputMegabytes and OutputMegabytes are
misnamed. They're accumulating bytes, not megabytes.
The statistic returned via /sys must be in megabytes, however,
which is what the HBA-API wants. The FCP code needs to accumulate
it in bytes and then divide by 1,000,000 (not 2^20) before it
presented via sysfs.
This affects fcoe.ko only, not fnic. The fnic driver
correctly by accumulating bytes and then converts to megabytes.
I checked that libhbalinux is using the /sys file directly without
conversion.
BTW, qla2xxx does divide by 2^20, which I'm not fixing here.
Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Joe Eykholt [Wed, 1 Dec 2010 00:20:12 +0000 (16:20 -0800)]
[SCSI] libfcoe: change fip_select to return new FCF
Neaten several calls to fip_select() by having it return the
pointer to the new FCF.
Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Joe Eykholt [Wed, 1 Dec 2010 00:20:07 +0000 (16:20 -0800)]
[SCSI] libfcoe: reorder FCF list to put latest advertiser first
When there are several FCFs to choose from, the one most likely
to accept a FLOGI on certian switches is the one that last
answered a multicast solicit.
So, when receiving an advertisement, move the FCF to the front
of the list so that it gets chosen first among those with the
same priority.
Without this, more FLOGIs need to be sent in a test with
multiple FCFs and a switch in NPV mode, but it still
eventually finds one that accepts the FLOGI.
Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Joe Eykholt [Wed, 1 Dec 2010 00:20:02 +0000 (16:20 -0800)]
[SCSI] libfcoe: add debug message for FCF destination MAC
When multiple FCFs to the same fabric exist, the debug messages
all look alike. Change the message to include the MAC address.
Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Joe Eykholt [Wed, 1 Dec 2010 00:19:56 +0000 (16:19 -0800)]
[SCSI] libfcoe: retry rejected FLOGI to another FCF if possible
Switches using multiple-FCFs may reject FLOGI in order to
balance the load between multiple FCFs. Even though the FCF
was available, it may have more load at the point we actually
send the FLOGI.
If the FLOGI fails, select a different FCF
if possible, among those with the same priority. If no other
FCF is available, just deliver the reject to libfc for retry.
Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Joe Eykholt [Wed, 1 Dec 2010 00:19:51 +0000 (16:19 -0800)]
[SCSI] libfcoe: fix checking of conflicting fabrics in fcoe_ctlr_select()
The check for conflicting fabrics in fcoe_ctlr_select()
ignores any FCFs that aren't usable. This is a minor
problem now but becomes more pronounced after later patches.
Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Joe Eykholt [Wed, 1 Dec 2010 00:19:46 +0000 (16:19 -0800)]
[SCSI] libfcoe: move some timer code to make it reusable.
Move some of the code in fcoe_ctlr_timer_work() to
fcoe_ctlr_select() so that it can be shared
with another function in a forthcoming patch.
Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Joe Eykholt [Wed, 1 Dec 2010 00:19:40 +0000 (16:19 -0800)]
[SCSI] libfcoe: update FIP FCF announcements
Move the announcement code to a separate function for reuse in
a forthcoming patch.
For messages regarding FCF timeout and selection, use the
previously-announced FCF MAC address (dest_addr) in the fcoe_ctlr struct.
Only print (announce) the FCF if it is new. Print MAC for
timed-out or deselected FCFs.
Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Yi Zou [Wed, 1 Dec 2010 00:19:35 +0000 (16:19 -0800)]
[SCSI] libfc: fix fc_tm_done not freeing the allocated fsp pkt
Frame should be freed in fc_tm_done, this is an updated patch on the one
initially submitted by Hillf Danton.
Signed-off-by: Hillf Danton <dhillf@gmail.com> Signed-off-by: Yi Zou <yi.zou@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Yi Zou [Wed, 1 Dec 2010 00:19:25 +0000 (16:19 -0800)]
[SCSI] libfc: fix exchange being deleted when the abort itself is timed out
Should not continue when the abort itself is being timeout since in that case
the exchange will be deleted and relesased. We still want to call the
associated response handler to let the layer, e.g., fcp, know the exchange
itself is being timed out.
Signed-off-by: Yi Zou <yi.zou@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Yi Zou [Wed, 1 Dec 2010 00:19:20 +0000 (16:19 -0800)]
[SCSI] libfc: do not fc_io_compl on fsp w/o any scsi_cmnd associated
Do not call fc_io_compl() on fsp w/o any scsi_cmnd, e.g., lun reset is built
inside fc_fcp, not from a scsi command from queuecommnd from scsi-ml, so in
in case target is buggy that is invalid flags in the FCP_RSP, as we have seen
in some SAN Blaze target where all bits in flags are 0, we do not want to call
io_compl on this fsp.
[ Comment block added by Robert Love ]
Signed-off-by: Yi Zou <yi.zou@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Yi Zou [Wed, 1 Dec 2010 00:19:15 +0000 (16:19 -0800)]
[SCSI] libfc: add print of exchange id for debugging fc_fcp
This is very helpful to match up the corresponding exchange to the actual I/O
described by the fsp, particularly when you do a side-by-side comparison of
the syslog with your trace.
Signed-off-by: Yi Zou <yi.zou@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Joe Perches [Wed, 1 Dec 2010 00:19:09 +0000 (16:19 -0800)]
[SCSI] drivers/scsi/fcoe: Update WARN uses
Add missing newlines.
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Hillf Danton [Wed, 1 Dec 2010 00:19:04 +0000 (16:19 -0800)]
[SCSI] libfc: fix memory leakage in remote port
There seems rdata should get put before return.
Signed-off-by: Hillf Danton <dhillf@gmail.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Hillf Danton [Wed, 1 Dec 2010 00:18:59 +0000 (16:18 -0800)]
[SCSI] libfc: fix memory leakage in local port
There seems info should get freed when error encountered.
Signed-off-by: Hillf Danton <dhillf@gmail.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Hillf Danton [Wed, 1 Dec 2010 00:18:54 +0000 (16:18 -0800)]
[SCSI] libfc: fix memory leakage in local port
There seems info should get freed when error encountered.
Signed-off-by: Hillf Danton <dhillf@gmail.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
john fastabend [Wed, 1 Dec 2010 00:18:49 +0000 (16:18 -0800)]
[SCSI] libfc: remove tgt_flags from fc_fcp_pkt struct
We can easily remove the tgt_flags from fc_fcp_pkt struct
and use rpriv->tgt_flags directly where needed.
Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
john fastabend [Wed, 1 Dec 2010 00:18:44 +0000 (16:18 -0800)]
[SCSI] libfc: use rport timeout values for fcp recovery
Use the rport value for rec_tov for timeout values when
sending fcp commands. Currently, defaults are being used
which may or may not match the advertised values.
The default may cause i/o to timeout on networks that
set this value larger then the default value. To make
the timeout more configurable in the non-REC mode we
remove the FC_SCSI_ER_TIMEOUT completely allowing the
scsi-ml to do the timeout. This removes an unneeded
timer and allows the i/o timeout to be configured
using the scsi-ml knobs.
Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
john fastabend [Wed, 1 Dec 2010 00:18:39 +0000 (16:18 -0800)]
[SCSI] libfc: incorrect scsi host byte codes returned to scsi-ml
The fcp packet recovery handler fc_fcp_recover() is called
when errors occurr in a fcp session. Currently it is
generically setting the status code to FC_CMD_RECOVERY for
all error types. This results in DID_BUS_BUSY errors
being returned to the scsi-ml.
DID_BUS_BUSY errors indicate "BUS stayed busy through time
out period" according to scsi.h. Many of the error reported
by fc_rcp_recovery() are pkt errors. Here we update
fc_fcp_recovery to use better host byte codes.
With certain FAST FAIL flags set DID_BUS_BUSY and DID_ERROR
will have different behaviors this was causing dm multipath
to fail quickly in some cases where a retry would be a
better action.
Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Hillf Danton [Wed, 1 Dec 2010 00:18:33 +0000 (16:18 -0800)]
[SCSI] libfc: fix stats computation in fc_queuecommand()
There seems accumulation needed.
Signed-off-by: Hillf Danton <dhillf@gmail.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Hillf Danton [Wed, 1 Dec 2010 00:18:28 +0000 (16:18 -0800)]
[SCSI] libfc: fix mem leak in fc_seq_assign()
There is a typo cleaned, which triggers memory leakage.
Signed-off-by: Hillf Danton <dhillf@gmail.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Robert Love [Wed, 1 Dec 2010 00:18:23 +0000 (16:18 -0800)]
[SCSI] libfc: Fix incorrect locking and unlocking in FCP
The error handler grabs the si->scsi_queue_lock, but
in the case where the fsp pointer is NULL it releases
the scsi_host lock. This can lead to a variety of
system hangs depending on which is used first- the
scsi_host lock or the scsi_queue_lock.
This patch simply unlocks the correct lock when fcp
is NULL.
Signed-off-by: Robert Love <robert.w.love@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Hillf Danton [Wed, 1 Dec 2010 00:18:17 +0000 (16:18 -0800)]
[SCSI] libfc: tune fc_exch_em_alloc() to be O(2)
For allocating new exch from pool, scanning for free slot in exch
array fluctuates when exch pool is close to exhaustion.
The fluctuation is smoothed, and the scan looks to be O(2).
Signed-off-by: Hillf Danton <dhillf@gmail.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Hillf Danton [Wed, 1 Dec 2010 00:18:12 +0000 (16:18 -0800)]
[SCSI] libfc: fix mem leak in fc_exch_recv_seq_resp()
There seems that ep should get released, or it will no longer get freed.
Signed-off-by: Hillf Danton <dhillf@gmail.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Yi Zou [Wed, 1 Dec 2010 00:18:07 +0000 (16:18 -0800)]
[SCSI] libfc: fix NULL pointer dereference bug in fc_fcp_pkt_release
This happens when then tearing down the fcoe interface with active I/O.
The back trace shows dead000000200200 in RAX, i.e., LIST_POISON2, indicating
that the fsp is already being dequeued, which is probably why no complaining
was seen in fc_fcp_destroy() about outstanding fsp not freed, since we dequeue
it in the end of fc_io_compl() before releasing it. The bug is due to the
fact that we have already destroyed lport's scsi_pkt_pool while on-going i/o
is still accessing it through fc_fcp_pkt_release(), like this trace or the
similar code path from scsi-ml to fc_eh_abort, etc. This is fixed by moving
the fc_fcp_destroy() after lport is detached from scsi-ml since fc_fcp_destroy
is supposed to called only once where no lport lock is taken, otherwise the
fc_fcp_pkt_release() would have to grab the lport lock.
Hillf Danton [Wed, 1 Dec 2010 00:18:01 +0000 (16:18 -0800)]
[SCSI] libfc: remove define of fc_seq_exch in fc_exch.c
The define for fc_seq_exch is unnecessary, since it also appears in scsi/libfc.h
Signed-off-by: Hillf Danton <dhillf@gmail.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Eddie Wai [Tue, 23 Nov 2010 23:29:30 +0000 (15:29 -0800)]
[SCSI] bnx2i: Cleaned up various error conditions in ep_connect/disconnect
Various error conditions inside ep_connect and ep_disconnect were
either not being handled or not being handled correctly. This patch
fixes all those issues.
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Acked-by: Anil Veerabhadrappa <anilgv@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Added the handling for cases when a chip request is made to the
CNIC module but the hardware is not ready to accept. This would
lead to many unnecessary wait timeouts.
This code adds check in the connect establishment and destruction
path.
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Eddie Wai [Tue, 23 Nov 2010 23:29:28 +0000 (15:29 -0800)]
[SCSI] bnx2i: Modified the bnx2i stop path to compensate for in progress ops
The stop path has been augmented to wait a max of 10s for all in
progress offload and destroy activities to complete before proceeding
to terminate all active connections (via iscsid or forcefully).
Note that any new offload and destroy requests are now blocked and
return to the caller immediately.
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Acked-by: Anil Veerabhadrappa <anilgv@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Eddie Wai [Tue, 23 Nov 2010 23:29:27 +0000 (15:29 -0800)]
[SCSI] bnx2i: Removed the dynamic registration of CNIC
The code no longer needs to dynamically register and unregister
the CNIC device. The CNIC device will be kept registered until
module unload.
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Eddie Wai [Tue, 23 Nov 2010 23:29:26 +0000 (15:29 -0800)]
[SCSI] bnx2i: Added mutex lock protection to conn_get_param
Added net_dev mutex lock protection before accessing the csk
parameters.
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Eddie Wai [Tue, 23 Nov 2010 23:29:25 +0000 (15:29 -0800)]
[SCSI] bnx2i: Allow to abort the connection if connect request times out
In the situation where the connect completion response arrives after
the connect request has already timed out, the connection was not being
aborted but only the resource was being freed. This creates a problem
for 5771X (10g) as the chip flags this with an assertion.
This change will properly aborts the connection before freeing the
resource.
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Eddie Wai [Tue, 23 Nov 2010 23:29:24 +0000 (15:29 -0800)]
[SCSI] bnx2i: Fixed the remote TCP RST handling for the 570X (1g)
Modified the handling of the remote TCP RST code so the chip can now
flush the tx pipe accordingly upon a remote TCP RST reception.
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Eddie Wai [Tue, 23 Nov 2010 23:29:23 +0000 (15:29 -0800)]
[SCSI] bnx2i: Fixed a cid leak issue for 5771X (10g)
A cid leak issue was found when the connect destroy request exceeded
the driver's disconnection timeout. This will lead to a cid resource
leak issue.
The fix is to allow the cid cleanup even when this happens.
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Acked-by: Anil Veerabhadrappa <anilgv@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Eddie Wai [Tue, 23 Nov 2010 23:29:22 +0000 (15:29 -0800)]
[SCSI] bnx2i: Fixed the endian bug in the TMF LUN cmd send
Added a be32_to_cpu call for the TMF LUN wqe.
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Eddie Wai [Tue, 23 Nov 2010 23:29:21 +0000 (15:29 -0800)]
[SCSI] bnx2i: Added fix for NOP-Out response panic from unsolicited NOP-In
The patch fixes the following situations where NOP-Out pkt is called for:
- local unsolicited NOP-Out requests (requesting no NOP-In response)
- local NOP-Out responses to unsolicited NOP-In requests
kernel panic is observed due to double session spin_lock requests; one in the
bnx2i_process_nopin_local_cmpl routine in bnx2i_hwi.c and the other in the
iscsi_put_task routine in libiscsi.c
The proposed fix is to export the currently static __iscsi_put_task() routine
and have bnx2i call it directly instead of the iscsi_put_task() routine which
holds the session spin lock.
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Anil Veerabhadrappa <anilgv@broadcom.com> Acked-by: Benjamin Li <benli@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Eddie Wai [Tue, 23 Nov 2010 23:29:20 +0000 (15:29 -0800)]
[SCSI] bnx2i: Fixed bugs in the handling of unsolicited NOP-Ins
Unsolicited NOP-Ins are placed in the receive queue of the hardware
which requires to be read out regardless if the receive pipe is suspended
or not. This patch adds the disposal of this RQ element under this
condition.
Also fixed the bug in the unsolicited NOP-In handling routine which
checks for the RESERVED_ITT.
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Kashyap, Desai [Fri, 12 Nov 2010 23:10:51 +0000 (04:40 +0530)]
[SCSI] mpt2sas: Sanity check for phy count is added using max phy count
Fix oops loading driver when there is direct attached
SEP device
The driver set max phys count to the value reported in sas iounit page
zero. However this page doesn't take into account additional virutal
phys. When sas topology event arrives, the phy count is larger than
expected, and the driver accesses memory array beyond the end of
allocated space, then oops. Manufacturing page 8 contains the info
on direct attached phys.
For this fix will making sure that sas topology event is not
processing phys greater than the expected phy count.
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>