Swen Schillig [Fri, 16 Jul 2010 13:37:40 +0000 (15:37 +0200)]
[SCSI] zfcp: Prevent access on uninitialized memory.
Initialize allocated memory to zero to prevent access on error. This
prevents a possible error in the error handling path.
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Sven Schuetz [Fri, 16 Jul 2010 13:37:39 +0000 (15:37 +0200)]
[SCSI] zfcp: Post events through FC transport class
Post FC transport class netlink events for usage in the userspace,
e.g. for HBAAPI. Supported events are those required for the
polled events in HBAAPI.
- link up
- link down
- incoming RSCN
(events related to FC-AL are not supported, as zfcp has no support for FC-AL)
Signed-off-by: Sven Schuetz <sven@linux.vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Swen Schillig [Fri, 16 Jul 2010 13:37:38 +0000 (15:37 +0200)]
[SCSI] zfcp: Cleanup QDIO attachment and improve processing.
Some definitions and structures in the zfcp QDIO processing are
improved by the removal of not required variables and processing steps.
I addition the naming of some variables is changed to make their purpose
more clear.
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Swen Schillig [Fri, 16 Jul 2010 13:37:37 +0000 (15:37 +0200)]
[SCSI] zfcp: Cleanup function parameters for sbal value.
A lot of functions require the amount of SBALs as one of their
parameter which is most times invariable. Therefore remove this
parameter and set the SBAL value explicitly if a non standard value is
required. In addition the warning message "oversized data" is
replaced with a BUG_ON() statement assuring the limits defined and
requested by zfcp.
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Christof Schmitt [Fri, 16 Jul 2010 13:37:36 +0000 (15:37 +0200)]
[SCSI] zfcp: Use correct width for timer_interval field
The timer_interval is 14 bits in width. Introduce a define for
properly masking the value.
Reviewed-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Christof Schmitt [Fri, 16 Jul 2010 13:37:35 +0000 (15:37 +0200)]
[SCSI] zfcp: Remove SCSI device when removing unit
Configuring a LUN in zfcp, also creates a SCSI device. For
consistency, it makes sense to remove the SCSI device when the LUN is
deconfigured. Replace the flush_work with the call to
scsi_remove_device: scsi_remove_device also takes the scan_mutex that
synchronizes itself with any long running device discovery.
Reviewed-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Christof Schmitt [Fri, 16 Jul 2010 13:37:34 +0000 (15:37 +0200)]
[SCSI] zfcp: Use memdup_user and kstrdup
Use the functions memdup_user and kstrdup to allocate memory and copy
the data in one step, saving some lines of code.
Reviewed-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Christof Schmitt [Thu, 8 Jul 2010 07:53:10 +0000 (09:53 +0200)]
[SCSI] zfcp: Fix retry after failed "open port" erp action
Trying to enqueue a port erp action from the port erp strategy will
fail in zfcp_erp_required_act. To try the same action again, return
ZFCP_ERP_FAILED.
Reviewed-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Christof Schmitt [Thu, 8 Jul 2010 07:53:09 +0000 (09:53 +0200)]
[SCSI] zfcp: Fail erp after timeout
After a timeout notification, do not try to run the erp strategy.
Return from the erp with "failed" to possibly trigger a retry.
Reviewed-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Christof Schmitt [Thu, 8 Jul 2010 07:53:08 +0000 (09:53 +0200)]
[SCSI] zfcp: Use forced_reopen in terminate_rport_io callback
When running in non-NPIV mode, the port_reopen in terminate_rport_io
might succeed even though the remote port is not available. If the
same port connection is held open from another operating system, the
reopen is only a virtual operation and might not hit the SAN. Fix this
by changing the call to forced_reopen that forces a logout/login
operation in the SAN.
Reviewed-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Christof Schmitt [Thu, 8 Jul 2010 07:53:07 +0000 (09:53 +0200)]
[SCSI] zfcp: Register SCSI devices after successful fc_remote_port_add
When the successful return of an adisc is the final step to set the
port online, the registration of SCSI devices might be omitted. SCSI
devices that have been removed before (due to a short dev_loss_tmo
setting) might not be attached again.
The problem is that the registration of SCSI devices is done only
after erp has finished. The correct place would be after the call to
fc_remote_port_add to mimick the scan in the FC transport class.
Change the registration of SCSI devices to be triggered after the
fc_remote_port_add call. For the initial inquiry command to succeed,
the unit must also be open. If the unit reopen is still pending, the
inquiry command to the LUN will be deferred with DID_IMM_RETRY, so
there is no harm from this approach.
Reviewed-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Christof Schmitt [Thu, 8 Jul 2010 07:53:06 +0000 (09:53 +0200)]
[SCSI] zfcp: Do not try "forced close" when port is already closed
When the port is already "physically closed" try the reopen instead.
There is no way to send a "physically close" to an already closed
port.
Reviewed-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Christof Schmitt [Thu, 8 Jul 2010 07:53:05 +0000 (09:53 +0200)]
[SCSI] zfcp: Do not unblock rport from REOPEN_PORT_FORCED
When the REOPEN_PORT_FORCED erp action succeeds, the port has been
closed. A REOPEN_PORT will try to open the port after the
REPORT_PORT_FORCED. The rport should only be unblocked after the
successful completion of the reopen port.
Reviewed-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Alan Stern [Wed, 16 Jun 2010 18:52:17 +0000 (14:52 -0400)]
[SCSI] sd: add support for runtime PM
This patch (as1399) adds runtime-PM support to the sd driver. The
support is unsophisticated: If a SCSI disk device is mounted, or if
its device file is held open, then the device will not be
runtime-suspended; otherwise it will (provided userspace gives
permission by writing "auto" to the sysfs power/control attribute).
In order to make this work, a dev_set_drvdata() call had to be moved
from sd_probe_async() to sd_probe(). Also, a few lines of code were
changed to use a local variable instead of recalculating the address
of an embedded struct device.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Alan Stern [Thu, 17 Jun 2010 14:41:42 +0000 (10:41 -0400)]
[SCSI] implement runtime Power Management
This patch (as1398b) adds runtime PM support to the SCSI layer. Only
the machanism is provided; use of it is up to the various high-level
drivers, and the patch doesn't change any of them. Except for sg --
the patch expicitly prevents a device from being runtime-suspended
while its sg device file is open.
The implementation is simplistic. In general, hosts and targets are
automatically suspended when all their children are asleep, but for
them the runtime-suspend code doesn't actually do anything. (A host's
runtime PM status is propagated up the device tree, though, so a
runtime-PM-aware lower-level driver could power down the host adapter
hardware at the appropriate times.) There are comments indicating
where a transport class might be notified or some other hooks added.
LUNs are runtime-suspended by calling the drivers' existing suspend
handlers (and likewise for runtime-resume). Somewhat arbitrarily, the
implementation delays for 100 ms before suspending an eligible LUN.
This is because there typically are occasions during bootup when the
same device file is opened and closed several times in quick
succession.
The way this all works is that the SCSI core increments a device's
PM-usage count when it is registered. If a high-level driver does
nothing then the device will not be eligible for runtime-suspend
because of the elevated usage count. If a high-level driver wants to
use runtime PM then it can call scsi_autopm_put_device() in its probe
routine to decrement the usage count and scsi_autopm_get_device() in
its remove routine to restore the original count.
Hosts, targets, and LUNs are not suspended while they are being probed
or removed, or while the error handler is running. In fact, a fairly
large part of the patch consists of code to make sure that things
aren't suspended at such times.
[jejb: fix up compile issues in PM config variations]
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Alan Stern [Thu, 17 Jun 2010 14:36:49 +0000 (10:36 -0400)]
[SCSI] convert to the new PM framework
This patch (as1397b) converts the SCSI midlayer to use the new PM
callbacks (struct dev_pm_ops). A new source file, scsi_pm.c, is
created to hold the new callback routines, and the existing
suspend/resume code is moved there.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
James Bottomley [Tue, 27 Jul 2010 20:51:13 +0000 (15:51 -0500)]
[SCSI] Unify SAM_ and SAM_STAT_ macros
We have two separate definitions for identical constants with nearly the
same name. One comes from the generic headers in scsi.h; the other is
an enum in libsas.h ... it's causing confusion about which one is
correct (fortunately they both are).
Fix this by eliminating the libsas.h duplicate
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Tomas Henzl [Mon, 26 Jul 2010 14:41:13 +0000 (16:41 +0200)]
[SCSI] mptfusion: release resources in error return path
We should release the resources in error return code path.
The requested pci bars should be released under an error condition,
when mpt_mapresources fails.
Signed-off-by: Tomas Henzl <thenzl@redhat.com>
Acked-by: "Desai, Kashyap" <Kashyap.Desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Kashyap, Desai [Mon, 26 Jul 2010 13:28:44 +0000 (18:58 +0530)]
[SCSI] mptfusion: Bump version 03.04.17
Version upgrade patch.
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Kashyap, Desai [Mon, 26 Jul 2010 13:27:36 +0000 (18:57 +0530)]
[SCSI] mptfusion: Extra debug prints added relavent to Device missing delay error handling
Adding function name in original debug prints and few more debug prints are
added.
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Cc: Stable Tree <stable@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Kashyap, Desai [Mon, 26 Jul 2010 13:26:21 +0000 (18:56 +0530)]
[SCSI] mptfusion: Block Error handling for deleting devices or Device in DMD
Issue description:
In multipath topology, when device deletion is in transient state,
multipath driver can call blk_flush_queue() as part of path failure.
Before device get deleted from OS, Device may go OFFLINE as part of error
handling kicked off triggered from multipathing driver. Above condition hits
more frequently if device missing delay timer (which is LSI specific firmware
parameter) is non zero value.
root cause of this issue is Error handling thread is getting kicked off for
device which is not really present(in transient state of deleting).
This patch has solution for this issue. driver is now using eh_timed_out
callback. See below.
mptsas_transport_template->eh_timed_out = mptsas_eh_timed_out
Using mptsas_eh_timed_out function, driver can decide weather vdevice is
under Device missing delay or deleting state.
for either of those cases, there is BLK_EH_RESET_TIMER return to scsi mid
and error handling thread will not be kicked off for that particular scsi
command.
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Cc: Stable Tree <stable@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Peter Huewe [Tue, 20 Jul 2010 22:28:41 +0000 (15:28 -0700)]
[SCSI] ibmvstgt: add __init/__exit macros
Add the __init and __exit macros to the module_init / module_exit
functions from drivers/scsi/ibmvscsi/ibmvstgt.c
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Rolf Eike Beer [Wed, 1 Jul 2009 20:43:39 +0000 (22:43 +0200)]
[SCSI] aacraid: Do not set DMA mask to 32 bit first if adapter only supports 31
Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
Acked-by: Achim Leubner <Achim_Leubner@pmc-sierra.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Arun Easi [Fri, 23 Jul 2010 10:28:38 +0000 (15:28 +0500)]
[SCSI] qla2xxx: T10 DIF Type 2 support
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Andrew Vasquez [Fri, 23 Jul 2010 10:28:37 +0000 (15:28 +0500)]
[SCSI] qla2xxx: Cleanup some dead-code and make some functions static.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Giridhar Malavali [Fri, 23 Jul 2010 10:28:36 +0000 (15:28 +0500)]
[SCSI] qla2xxx: Update copyright banner.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Giridhar Malavali [Fri, 23 Jul 2010 10:28:35 +0000 (15:28 +0500)]
[SCSI] qla2xxx: Rearranged and cleaned up the code for processing the pending commands.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Giridhar Malavali [Fri, 23 Jul 2010 10:28:34 +0000 (15:28 +0500)]
[SCSI] qla2xxx: Updates for ISP82xx.
Re-organized and cleaned up the ISP82xx specific code.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Harish Zunjarrao [Fri, 23 Jul 2010 10:28:33 +0000 (15:28 +0500)]
[SCSI] qla2xxx: Do not allow ELS Passthru commands for ISP23xx adapters
Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Harish Zunjarrao [Fri, 23 Jul 2010 10:28:32 +0000 (15:28 +0500)]
[SCSI] qla2xxx: Add CT passthru support for ISP23xx adapters
Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Madhuranath Iyengar [Fri, 23 Jul 2010 10:28:31 +0000 (15:28 +0500)]
[SCSI] qla2xxx: Don't issue set or get port param MBC if remote port is not logged in
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Chad Dupuis [Fri, 23 Jul 2010 10:28:30 +0000 (15:28 +0500)]
[SCSI] qla2xxx: Add qla2x00_free_fcports() function
This function was added to encapsulate freeing the memory for all the fcports
associated with a particular vha. Also added a call to qla2x00_free_fcports()
to qla2x00_free_device() to free the memory for all the fcports associated with
a vha during device removal.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Andrew Vasquez [Fri, 23 Jul 2010 10:28:29 +0000 (15:28 +0500)]
[SCSI] qla2xxx: Stop firmware before doing init firmware.
If BIOS is enabled then drivers init firmware fails since
BIOS has done the init once.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Duane Grigsby [Fri, 23 Jul 2010 10:28:28 +0000 (15:28 +0500)]
[SCSI] qla2xxx: Propogate transport disrupted status for cable pull conditions for faster failover.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Andrew Vasquez [Fri, 23 Jul 2010 10:28:27 +0000 (15:28 +0500)]
[SCSI] qla2xxx: Correct extended sense-data handling.
Earlier implementation did not take into account the varying
sizes of data buffers returned from structures sts_entry_t and
sts_entry_24xx. Sense-data after the 20th byte could be
incorrect.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Madhuranath Iyengar [Fri, 23 Jul 2010 10:28:26 +0000 (15:28 +0500)]
[SCSI] qla2xxx: Check for golden firmware and show version if available
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Chad Dupuis [Fri, 23 Jul 2010 10:28:25 +0000 (15:28 +0500)]
[SCSI] qla2xxx: Use GFF_ID to check FCP-SCSI FC4 type before logging into Nx_Ports
The default method that qla2xxx uses is the GID_PT nameserver command to
get a list of Nx_Ports. This patch adds a GFF_ID call for each port
returned by GID_PT to get the FC4 type. If the FC4 type is not FCP SCSI
then the qla2xxx driver will not record that port in it's port database.
For switches that do not support the GFF_ID command, the behavior will be
for qla2xxx to store that port anyways.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Madhuranath Iyengar [Fri, 23 Jul 2010 10:28:24 +0000 (15:28 +0500)]
[SCSI] qla2xxx: Appropriately log FCP priority data messages
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Giridhar Malavali [Fri, 23 Jul 2010 10:28:23 +0000 (15:28 +0500)]
[SCSI] qla2xxx: Removed dependency for SRB structure for Marker processing
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Madhuranath Iyengar [Fri, 23 Jul 2010 10:28:22 +0000 (15:28 +0500)]
[SCSI] qla2xxx: Don't issue set or get port param MBC if invalid port loop id
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Mike Christie [Thu, 22 Jul 2010 11:29:49 +0000 (16:59 +0530)]
[SCSI] iscsi_transport: wait on session in error handler path
wait for session to come online in eh_device_reset_handler
and eh_target_reset_handler
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Vikas Chaudhary [Thu, 22 Jul 2010 11:27:43 +0000 (16:57 +0530)]
[SCSI] iscsi_transport: Modidify recovery_tmo from sysfs
Added support to modify session->recovery_tmo from sysfs
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Acked-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
FUJITA Tomonori [Thu, 22 Jul 2010 00:36:51 +0000 (09:36 +0900)]
[SCSI] sg: fix bio leak with a detached device
After blk_rq_map_user is successful, if we find that a device is
unavailable (was detached), we must call blk_end_request_all to free
bio(s) before blk_rq_unmap_user and blk_put_request.
Reported-by: "Dailey, Nate" <Nate.Dailey@stratus.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Tested-by: "Dailey, Nate" <Nate.Dailey@stratus.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Vasu Dev [Tue, 20 Jul 2010 22:21:33 +0000 (15:21 -0700)]
[SCSI] fcoe: remove check for zero fabric name
This check prevents FCF selection in NPV mode due to zero fabric name
in that case and in turn flogi fails. Though NPV mode should not have
this zero and should be fixed there also but spec also does not require
initiator to ensure that fabric name must be non-zero, therefore dropping
this check to get flogi working in NPV mode.
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Bhanu Prakash Gollapudi [Tue, 20 Jul 2010 22:21:27 +0000 (15:21 -0700)]
[SCSI] libfc: Add retry logic to lport state machine when receiving LS_RJT
Call fc_lport_error to retry upto max retry count when
FLOGI/SCR/NS gets rejected.
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Vasu Dev [Tue, 20 Jul 2010 22:21:22 +0000 (15:21 -0700)]
[SCSI] Revert "[SCSI] fcoe: Fix using VLAN ID in creating lport's WWWN/WWPN"
This reverts commit
cc0136c2e9c10e889cb36e39710c0eb10707b396.
That commit introduced vlan id info to WWPN but WWPN needs to
remain static as an unique port identifier in the fabric, therefore
variable fabric vlan id info doesn't need to be coded inside WWPN.
After this revert, port arg to fcoe_wwn_from_mac is always zero
but still leaving it as-is okay to later allow users to use NAA 2
scheme with this additional port arg.
Note with this patch, existing zoning using WWPN would require
re-zoning this time only and later no more re-zoning due to any
vlan id changes.
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Yi Zou [Tue, 20 Jul 2010 22:21:17 +0000 (15:21 -0700)]
[SCSI] fcoe: fix offload feature flag change from netdev
Currently, when FCoE netdev feature flags are toggled by the LLD, lport's
corresponding flags are not updated. This causes the fc_fcp to still try to
offload the I/O. This patch adds support of NETDEV_FEAT_CHANGE event in fcoe
netdev device notification callback so we can update the lport offload flags
appropriately.
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 Eykholt [Tue, 20 Jul 2010 22:21:12 +0000 (15:21 -0700)]
[SCSI] libfc: don't require a local exchange for incoming requests
Incoming requests shouldn't require a local exchange if we're
just going to reply with one or two frames and don't expect
anything further. Don't allocate exchanges for such requests
until requested by the upper-layer protocol.
The sequence is always NULL for new requests, so remove
that as an argument to request handlers.
Also change the first argument to lport->tt.seq_els_rsp_send
from the sequence pointer to the received frame pointer, to
supply the exchange IDs and destination ID info.
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 [Tue, 20 Jul 2010 22:21:07 +0000 (15:21 -0700)]
[SCSI] libfc: add interface to allocate a sequence for incoming requests
For incoming ELS and FCP requests, we often don't require an
exchange and sequence, however, sometimes we do. For those cases,
(primarily FCP requests for targets) add a function to set up
the exchange and sequence.
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 [Tue, 20 Jul 2010 22:21:01 +0000 (15:21 -0700)]
[SCSI] libfc: add fc_fill_reply_hdr() and fc_fill_hdr()
Add functions to fill in an FC header given a request header.
These reduces code lines in fc_lport and fc_rport and works
without an exchange/sequence assigned.
fc_fill_reply_hdr() fills a header for a final reply frame.
fc_fill_hdr() which is similar but allows specifying the
f_ctl parameter.
Add defines for F_CTL values FC_FCTL_REQ and FC_FCTL_RESP.
These can be used for most request and response sequences.
v2 of patch adds a line to copy the frame encapsulation
info from the received frame.
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 [Tue, 20 Jul 2010 22:20:56 +0000 (15:20 -0700)]
[SCSI] libfc: add fc_frame_sid() and fc_frame_did() functions
To pave the way for eliminating exchanges from incoming requests,
add simple inline fc_frame_sid() and fc_frame_did() functions
which get the FC_IDs from the frame header. This can be almost
as efficient as getting them from the sequence/exchange.
Move ntohll, htonll, ntoh24 and hton24 to <scsi/fc_frame.h>
since we need them there and that's included by <scsi/libfc.h>
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 [Tue, 20 Jul 2010 22:20:51 +0000 (15:20 -0700)]
[SCSI] libfc: eliminate rport LOGO state
The LOGO state hasn't been used in a while, except in a brief
transition to DELETE state while holding the rport mutex.
All port LOGO responses have been ignored as well as any timeout
if we don't get a response.
So this patch just removes LOGO state and simplifies the response handler.
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 [Tue, 20 Jul 2010 22:20:46 +0000 (15:20 -0700)]
[SCSI] fcoe: config via separate create_vn2vn module parameter
Add module parameter create_vn2vn that behaves like the create
parameter except that the new instance is created in FIP vn2vn mode.
This can be replaced once we change create to allow modifying
per-instance attributes before starting the instance.
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 [Tue, 20 Jul 2010 22:20:40 +0000 (15:20 -0700)]
[SCSI] fcoe libfcoe: use correct FC-MAP for VN2VN mode
In VN2VN mode, map_dest means to use the default VN2VN OUI.
Change code that uses the default FCoE OUI to use the one
set in the fcoe_ctlr struct.
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 [Tue, 20 Jul 2010 22:20:35 +0000 (15:20 -0700)]
[SCSI] libfcoe: Fix FIP ELS encapsulation details for FLOGI responses
When sending a FLOGI LS_ACC, which we only do in point-to-multipoint
mode, the MAC descriptor should have the granted MAC set to
0x0efd00 || D_ID.
When sending an LS_RJT, there should be no MAC descriptor.
When sending either an LS_ACC or LS_RJT, the subcode should indicate
an reply, not a request.
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 [Tue, 20 Jul 2010 22:20:30 +0000 (15:20 -0700)]
[SCSI] libfcoe: fcoe: fnic: add FIP VN2VN point-to-multipoint support
The FC-BB-6 committee is proposing a new FIP usage model called
VN_port to VN_port mode. It allows VN_ports to discover each other
over a loss-free L2 Ethernet without any FCF or Fibre-channel fabric
services. This is point-to-multipoint. There is also a variant
of this called point-to-point which provides for making sure there
is just one pair of ports operating over the Ethernet fabric.
We add these new states: VNMP_START, _PROBE1, _PROBE2, _CLAIM, and _UP.
These usually go quickly in that sequence. After waiting a random
amount of time up to 100 ms in START, we select a pseudo-random
proposed locally-unique port ID and send out probes in states PROBE1
and PROBE2, 100 ms apart. If no probe responses are heard, we
proceed to CLAIM state 400 ms later and send a claim notification.
We wait another 400 ms to receive claim responses, which give us
a list of the other nodes on the network, including their FC-4
capabilities. After another 400 ms we go to VNMP_UP state and
should start interoperating with any of the nodes for whic we
receivec claim responses. More details are in the spec.j
Add the new mode as FIP_MODE_VN2VN. The driver must specify
explicitly that it wants to operate in this mode. There is
no automatic detection between point-to-multipoint and fabric
mode, and the local port initialization is affected, so it isn't
anticipated that there will ever be any such automatic switchover.
It may eventually be possible to have both fabric and VN2VN
modes on the same L2 network, which may be done by two separate
local VN_ports (lports).
When in VN2VN mode, FIP replaces libfc's fabric-oriented discovery
module with its own simple code that adds remote ports as they
are discovered from incoming claim notifications and responses.
These hooks are placed by fcoe_disc_init().
A linear list of discovered vn_ports is maintained under the
fcoe_ctlr struct. It is expected to be short for now, and
accessed infrequently. It is kept under RCU for lock-ordering
reasons. The lport and/or rport mutexes may be held when we
need to lookup a fcoe_vnport during an ELS send.
Change fcoe_ctlr_encaps() to lookup the destination vn_port in
the list of peers for the destination MAC address of the
FIP-encapsulated frame.
Add a new function fcoe_disc_init() to initialize just the
discovery portion of libfcoe for VN2VN mode.
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 [Tue, 20 Jul 2010 22:20:24 +0000 (15:20 -0700)]
[SCSI] libfcoe: add state change debugging
Enhancement: add debug messages at all state transitions.
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 [Tue, 20 Jul 2010 22:20:19 +0000 (15:20 -0700)]
[SCSI] libfcoe: add protocol description of FIP VN2VN mode
The FC-BB-6 committee is proposing a new FIP usage model called
VN_port to VN_port mode. It allows VN_ports to discover each other
over a loss-free L2 Ethernet without any FCF or Fibre-channel fabric
services. This is point-to-multipoint. There is also a variant
of this called point-to-point which provides for making sure there
is just one pair of ports operating over the Ethernet fabric.
This patch defines the new message type and subtypes as well as
one new descriptor type used by VN2VN mode.
These are all still at the proposed stage and subject to change.
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 [Tue, 20 Jul 2010 22:20:14 +0000 (15:20 -0700)]
[SCSI] libfc: track FIP exchanges
When an exchange is received with a FIP encapsulation, we need
to know that the response must be sent via FIP and what the original
ELS opcode was. This becomes important for VN2VN mode, where we may
receive FLOGI or LOGO from several peer VN_ports, and the LS_ACC or
LS_RJT must be sent FIP-encapsulated with the correct sub-type.
Add a field to the struct fc_frame, fr_encaps, to indicate the
encapsulation values. That term is chosen to be neutral and
LLD-agnostic in case non-FCoE/FIP LLDs might find it useful.
The frame fr_encaps is transferred from the ingress frame to the
exchange by fc_exch_recv_req(), and back to the outgoing frame
by fc_seq_send().
This is taking the last byte in the skb->cb array. If needed,
we could combine the info in sof, eof, flags, and encaps
together into one field, but it'd be better to do that if
and when its needed.
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 [Tue, 20 Jul 2010 22:20:08 +0000 (15:20 -0700)]
[SCSI] libfc: add FLOGI state to rport for VN2VN
The FIP proposal for VN_port to VN_port point-to-multipoint
operation requires a FLOGI be sent to each remote port.
The FLOGI is sent with the assigned S_ID and D_IDs of the
local and remote ports. This and the response get
FIP-encapsulated for Ethernet.
Add FLOGI state to the remote port state machine.
This will be skipped if not in point-to-multipoint mode.
To reduce a little duplication between PLOGI and FLOGI
response handling, added fc_rport_login_complete(), which
handles the parameters for the rdata struct.
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 [Tue, 20 Jul 2010 22:20:03 +0000 (15:20 -0700)]
[SCSI] libfc: Add local port point-to-multipoint flag
For VN_port to VN_port mode, the transport sets the port_id and
there's no lport FLOGI. This is similar to FC loop mode.
Add a point_to_multipoint flag that indicates the local port is in
point-to-multipoint mode. This skips FLOGI and discovery.
It also skips resetting the port_id on resets other than link down.
Add function fc_lport_set_local_id() that sets the local port_id.
This is called by libfcoe on behalf of the low-level driver
to set the port_id when the link comes up.
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 [Tue, 20 Jul 2010 22:19:58 +0000 (15:19 -0700)]
[SCSI] libfcoe: fcoe: fnic: change fcoe_ctlr_init interface to specify mode
There are three modes that libfcoe currently supports, and a new one
is coming. Change the fcoe_ctlr_init() interface to add the mode
desired. This should not change any functionality.
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 [Tue, 20 Jul 2010 22:19:53 +0000 (15:19 -0700)]
[SCSI] libfc: add discovery-private pointer for LLD
For VN_port to VN_port mode, FIP will do discovery and needs a
way to find its state from the local port or discovery structure.
It seems that any other LLD that implements its own discovery
would also need something like this.
Replace disc->lport with disc->priv, and use container_of to
find the lport. We could use disc->priv for that, but
container_of is smaller and faster.
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 [Tue, 20 Jul 2010 22:19:47 +0000 (15:19 -0700)]
[SCSI] libfcoe: convert FIP to lock with mutex instead of spin lock
It turns out most of the FIP work is now done from worker threads
or process context now, so there's no need to use a spin lock.
Change to use mutex instead of spin lock and delayed_work instead
of a timer.
This will make it nicer for the VN_port to VN_port feature that
will interact more with the libfc layers requiring that
spinlocks not be held.
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 [Tue, 20 Jul 2010 22:19:42 +0000 (15:19 -0700)]
[SCSI] libfc: provide space for LLD after remote port structure
Add pre-zeroed space after the allocation for fc_rport_priv
for use by the lower-level driver.
This is primarily for VN2VN FIP mode, but could be used in
other ways someday.
The space required is specified in lport->rport_priv_size.
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 [Tue, 20 Jul 2010 22:19:37 +0000 (15:19 -0700)]
[SCSI] libfc: convert rport lookup to be RCU safe
To allow LLD to do lookups on rports without grabbing a mutex,
make them RCU-safe. The caller of lport->tt.rport_lookup will
have the choice of holding disc_mutex or the rcu_read_lock().
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>
Vasu Dev [Tue, 20 Jul 2010 22:19:32 +0000 (15:19 -0700)]
[SCSI] fcoe: adds src and dest mac address checking for fcoe frames
This is per FC-BB-5 Annex-D recommendation and per that
if address checking fails then drop the frame.
FIP code paths are already doing this so only needed for fcoe
frames.
The src address checking is limited to only fip mode since
this might break non-fip mode used in p2p due to used OUI
based addressing in some p2p code paths, going forward FIP
will be the only mode, therefore limited this to only FIP
mode so that it won't break non-fip p2p mode for now.
-v2
Removes FCOE packet type checking since fcoe_rcv is
registered to receive only FCoE type packets from netdev
and it is already checked by netdev.
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Vasu Dev [Tue, 20 Jul 2010 22:19:26 +0000 (15:19 -0700)]
[SCSI] fcoe: cleans up fcoe_disable and fcoe_enable
The fc_fabric_logoff and fc_fabric_login are redundant
here after recently added fcoe_ctlr_link_down/up to
these functions, therefore this patch removes logoff
and login to only use link down and up here. This works
best for their current usages with fcoe DCB link down or up.
This also works well to avoid EIO errors when fcoe DCB link
goes down as lport state moves out of ready quickly from
fcoe_ctlr_link_down and that allows re-queuing timed out IOs
for this case also.
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Vasu Dev [Tue, 20 Jul 2010 22:19:20 +0000 (15:19 -0700)]
[SCSI] libfc: IO errors on link down due to cable unplug
In this case, sync IO fails with EIO(5) errors as:-
"Thread:1 System call error:5 - Input/output error (::pwrite() failed)".
This is due to IO time out while libfc doing link down processing
to block all rports and if timed out IO was at last retry
attempt then it fails to user with EIO error followed by
these log messages.
[77848.612169] host2: rport bf0015: Delete port
[77848.612221] host2: rport e10aef: work delete
[77848.612232] host2: rport e10002: work event 3
[77848.612422] sd 2:0:1:1: [sdi] Unhandled error code
[77848.612426] sd 2:0:1:1: [sdi] Result: hostbyte=DID_ERROR
driverbyte=DRIVER_OK
[77848.612431] sd 2:0:1:1: [sdi] CDB: Write(10): 2a 00 00 00 11 20 00 00 20 00
[77848.612445] end_request: I/O error, dev sdi, sector 4384
[77848.612553] sd 2:0:1:2: [sdj] Unhandled error code
To fix these EIO errors, such timed out incomplete IOs needs
to be re-queued without counting retry attempt and this patch
does that using DID_REQUEUE scsi code.
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Bart Van Assche [Tue, 20 Jul 2010 22:19:15 +0000 (15:19 -0700)]
[SCSI] fcoe: make it possible to verify fcoe with sparse
Analyzing fcoe with sparse currently fails. This is because struct
fcoe_rcv_info contains two enum members that have been declared with
__attribute__((packed)). Apparently gcc honors this attribute while sparse
ignores it. The result is that sizeof(struct fcoe_rcv_info)
== sizeof(struct sk_buff::cb) == 48 on a 64-bit system according to gcc, but
not according to sparse. The patch below modifies the definition of
struct fcoe_rcv_info such that gcc and sparse interpret this structure
definition in the same way. The current sparse output is as follows:
$ cd linux-2.6.34
$ make C=2 M=drivers/scsi/fcoe modules
CHECK drivers/scsi/fcoe/fcoe.c
include/scsi/fc_frame.h:81:9: error: invalid bitfield width, -1.
CC [M] drivers/scsi/fcoe/fcoe.o
CHECK drivers/scsi/fcoe/libfcoe.c
include/scsi/fc_frame.h:81:9: error: invalid bitfield width, -1.
drivers/scsi/fcoe/libfcoe.c:56:37: error: invalid initializer
Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
Cc: jeykholt@cisco.com
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Yi Zou [Tue, 20 Jul 2010 22:19:10 +0000 (15:19 -0700)]
[SCSI] libfc: fix slowpath error from WARN_ON in fc_fcp_send_data
This is exposed by a mpio test using EMC CLARiiON targets when LUN
tresspassing happens, the burst length from the XFER_READY for the
MODE SELECT(10) is 19 bytes, much smaller than FC_MIN_MAX_PAYLOAD as
256 bytes. This patch removes the related two WARN_ON()s.
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>
Yanqing_Liu@Dell.com [Wed, 19 May 2010 17:31:36 +0000 (12:31 -0500)]
[SCSI] scsi_dh_rdac: Add Dell MD36xxi controller into RDAC device list
This patch is to add next generation of Dell iSCSI PowerVault
controller MD36xxi into RDAC device list.
Signed-off-by: Yanqing Liu <Yanqing_Liu@Dell.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Dan Carpenter [Thu, 15 Jul 2010 08:20:19 +0000 (10:20 +0200)]
[SCSI] dpt_i2o: move range check forward
The check to test that "bus_no" was valid came after we had already used
it as an array offset. This patch moves it forward.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
James Smart [Wed, 14 Jul 2010 19:32:40 +0000 (15:32 -0400)]
[SCSI] lpfc 8.3.15: Update driver version 8.3.15
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, 14 Jul 2010 19:32:10 +0000 (15:32 -0400)]
[SCSI] lpfc 8.3.15: Add target queue depth throttling
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, 14 Jul 2010 19:31:37 +0000 (15:31 -0400)]
[SCSI] lpfc 8.3.15: FCoE Related Fixes
FCoE Related Fixes
- Correct find-next-FCF routine so that it searches at next FCF rather
than current one.
- Enhanced round-robin FCF failover algorithm to re-start on "New FCF"
async event
- Update the manner in which we look at FCFs while they may be in
their discovery state.
- Use LPFC_FCOE_NULL_VID macro when checkinf for valid vlan_id for FCF
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, 14 Jul 2010 19:30:54 +0000 (15:30 -0400)]
[SCSI] lpfc 8.3.15: BSG, Discovery, and Misc fixes
- BSG interface related:
- Fix node reference count if node is active
- Warn if we're overwriting an active CT context
- Discovery related:
- Clear "Ignore Reg Login" flag when purging mailbox queue
- Pay attention to return code for fc_block_scsi_eh()
- Stall device loss code if we're almost done when it fires
(we're logged in, but PRLI is outstanding)
- Bugs
- Correct DIF code for endianness issues
- Correct where we had missed points to check txq on i/o
completion/cleanup
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>
Wayne Boyer [Wed, 14 Jul 2010 17:50:14 +0000 (10:50 -0700)]
[SCSI] ipr: fix resource type update and add sdev and shost attributes
Setting the resource type in the ipr_update_res_entry function was incorrect in
that the top 4 bits were masked off. The assignment has been updated to no
longer mask those bits.
Then, two new attributes were added to allow the user space utilities to more
easily get information. The resource_type sdev attribute is set for all devices
in the adapter's configuration table and indicates the type of device. The
fw_type shost attribute indicates the firmware type supported by the adapter.
Finally, the resource_path attribute was changed to be mode S_IRUGO.
Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Wayne Boyer [Wed, 14 Jul 2010 17:49:43 +0000 (10:49 -0700)]
[SCSI] ipr: fix transition to operational for new adapters
The method of transitioning to operational for new adapters includes using
initialization stages. The current stage is indicated via a register read.
The final good stage in the sequence is "operational" but does not necessarily
indicate that the driver can proceed. There is another bit that gets set in the
adapter->host interrupt register when the adapter has completed enough of its
bringup such that it can accept commands. The driver was not checking that
bit before proceeding which led to intermittent errors and adapter resets.
The fix is to check the "transition to operational" bit in the interrupt
register after detecting that the initialization stage is "operational" and
only proceed if both are set.
Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Randy Dunlap [Tue, 4 May 2010 17:29:52 +0000 (10:29 -0700)]
[SCSI] scsi: add Kconfig dependency on NET
be2iscsi driver should #include linux/if_ether.h since it uses
sysfs_format_mac().
It should also depend on NET since it selects SCSI_ISCSI_ATTRS,
which depends on NET.
These changes fix a build error when CONFIG_NET is not enabled:
ERROR: "sysfs_format_mac" [drivers/scsi/be2iscsi/be2iscsi.ko] undefined!
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Jayamohan Kallickal <jayamohank@serverengines.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Jayamohan Kallickal [Wed, 21 Jul 2010 22:58:13 +0000 (04:28 +0530)]
[SCSI] be2iscsi: The extended shift must be 16
Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Jayamohan Kallickal [Wed, 21 Jul 2010 22:57:47 +0000 (04:27 +0530)]
[SCSI] be2iscsi: Fix for premature buffer free
This patch fixes a bug where the buffer was being freed as soon as
submission to HW is done.
Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Jayamohan Kallickal [Wed, 21 Jul 2010 22:57:16 +0000 (04:27 +0530)]
[SCSI] be2iscsi: Remove debug print in IO path
This patch removes a Debug Print in the IO path
Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Jayamohan Kallickal [Wed, 21 Jul 2010 22:56:45 +0000 (04:26 +0530)]
[SCSI] be2iscsi: Limit max_xmit_length
This patch limits max_xmit_length to 64K incase older
utilities are used
Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Jayamohan Kallickal [Wed, 21 Jul 2010 22:55:40 +0000 (04:25 +0530)]
[SCSI] be2iscsi: Maintain same ITT across login
This patch ensures that the same ITT is maintained across
all login pdu's
Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Jayamohan Kallickal [Wed, 21 Jul 2010 22:54:53 +0000 (04:24 +0530)]
[SCSI] be2iscsi: Adding crashdump support
These changes allow the driver to support crashdump. We need to reset the
chip incase of a crashdump
Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Jayamohan Kallickal [Wed, 21 Jul 2010 22:54:22 +0000 (04:24 +0530)]
[SCSI] be2iscsi: Free tags allocated
This patch frees tags that are already allocated in case of
failure
Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Jayamohan Kallickal [Wed, 21 Jul 2010 22:53:55 +0000 (04:23 +0530)]
[SCSI] be2iscsi: Fix to handle request_irq failure
This patch handles request_irq failures by properly cleaning up
Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Jayamohan Kallickal [Wed, 21 Jul 2010 22:53:22 +0000 (04:23 +0530)]
[SCSI] be2iscsi: No return value for hwi_enable_intr
hwi_enable_intr need not return any value. This patch fixes the
that and removes code designed to handle a failure return value
Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Jayamohan Kallickal [Wed, 21 Jul 2010 22:52:27 +0000 (04:22 +0530)]
[SCSI] be2iscsi: Fix for freeing cid
This patch frees up the allocated cid and returns error if allocation
of tag fails.
Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Jayamohan Kallickal [Wed, 21 Jul 2010 22:48:01 +0000 (04:18 +0530)]
[SCSI] be2iscsi: pass the return from beiscsi_open_conn
This patch passes on the value returned by
beiscsi_open_conn
Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Jayamohan Kallickal [Wed, 21 Jul 2010 22:47:16 +0000 (04:17 +0530)]
[SCSI] be2iscsi: Fixing the return type of functions
Fixing some functions return values that did not match with
the possible return values
Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Jayamohan Kallickal [Wed, 21 Jul 2010 22:46:38 +0000 (04:16 +0530)]
[SCSI] be2iscsi: Fixing return values
This patch fixes the return values as per comment from Mike Christie
Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Jayamohan Kallickal [Wed, 21 Jul 2010 22:46:00 +0000 (04:16 +0530)]
[SCSI] be2iscsi: Fix warnings from new checkpatch.pl
The latest checkpatch.pl throws some new warnings. Fixing it
to get rid of a bunch of warnings
Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
James Bottomley [Tue, 27 Jul 2010 17:30:24 +0000 (12:30 -0500)]
[SCSI] arcmsr: fix up bin_attr functions
Commit
commit
2c3c8bea608866d8bd9dcf92657d57fdcac011c5
Author: Chris Wright <chrisw@sous-sol.org>
Date: Wed May 12 18:28:57 2010 -0700
sysfs: add struct file* to bin_attr callbacks
Added an extra struct file * parameter at the beginning, which the
arcmsr binary attribute additions didn't have. Fix this to prevent
nasty crashes.
Cc: Nick Cheng <nick.cheng@areca.com.tw>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Pekka Enberg [Wed, 14 Jul 2010 10:12:57 +0000 (13:12 +0300)]
[SCSI] aic7xxx: Remove OS utility wrappers
This patch removes malloc(), free(), and printf() wrappers from the aic7xxx
SCSI driver. I didn't use pr_debug for printf because of some 'clever' uses of
printf don't compile with the pr_debug. I didn't fix the overeager uses of
GFP_ATOMIC either because I wanted to keep this patch as simple as possible.
[jejb:fixed up checkpatch errors and fixed up missed conversion]
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Cyril Jayaprakash [Sun, 11 Jul 2010 19:12:00 +0000 (00:42 +0530)]
[SCSI] pmcraid : Remove unnecessary casts for void * pointers
Signed-off-by: Cyril Jayaprakash <cyril.jayaprakash@gmail.com>
Acked-by: Anil Ravindranath <anil_ravindranath@pmc-sierra.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Vikas Chaudhary [Sat, 10 Jul 2010 09:21:47 +0000 (14:51 +0530)]
[SCSI] qla4xxx: Update driver version to 5.02.00-k2
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Vikas Chaudhary [Sat, 10 Jul 2010 09:21:30 +0000 (14:51 +0530)]
[SCSI] iscsi_transport: added new iscsi_param to display target alias in sysfs
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Karen Higgins [Sat, 10 Jul 2010 09:21:17 +0000 (14:51 +0530)]
[SCSI] qla4xxx: wait for device_ready before device discovery
Signed-off-by: Karen Higgins <karen.higgins@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>