]> git.karo-electronics.de Git - linux-beck.git/log
linux-beck.git
15 years ago[SCSI] qla2xxx: Add asynchronous-login support.
Andrew Vasquez [Thu, 20 Aug 2009 18:06:05 +0000 (11:06 -0700)]
[SCSI] qla2xxx: Add asynchronous-login support.

ISPs which support this feature include 23xx and above.

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>
15 years ago[SCSI] qla2xxx: Generalize srb structure usage.
Andrew Vasquez [Thu, 20 Aug 2009 18:06:04 +0000 (11:06 -0700)]
[SCSI] qla2xxx: Generalize srb structure usage.

Lay groundwork for adding alternative asynchronous operations by
generalize and extending the SRB structure.  This allows for
follow-on patches to add support for:

- Asynchronous logins.
- ELS/CT passthru requests.
- Loopback requests.
- Non-blocking mailbox commands (ABTS, Task Management, etc).

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>
15 years ago[SCSI] mpt2sas: Bump driver version 01.100.06.00
Kashyap, Desai [Thu, 20 Aug 2009 07:55:03 +0000 (13:25 +0530)]
[SCSI] mpt2sas: Bump driver version 01.100.06.00

Bump version to 01.100.06.00

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Reviewed-by:: Eric Moore <Eric.moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] mpt2sas: cleanup interrupt routine and config_request optimization
Kashyap, Desai [Thu, 20 Aug 2009 07:54:31 +0000 (13:24 +0530)]
[SCSI] mpt2sas: cleanup interrupt routine and config_request optimization

Cleaned up base_interrupt routine to be more effiecent.

Deleted about a third of the config page API by moving redundant code from all
the calling functions to _config_request.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Reviewed-by: Eric Moore <Eric.moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] mpt2sas: Raid 10 Volume is showing as Raid 1E in dmesg
Kashyap, Desai [Thu, 20 Aug 2009 07:53:49 +0000 (13:23 +0530)]
[SCSI] mpt2sas: Raid 10 Volume is showing as Raid 1E in dmesg

This patch modifies the slave_configure callback so the messages that get sent
to system log for RAID1E volumes contain the string "RAID10" instead of
"RAID1E". These messages contain information regarding what kind of scsi device
is being added. Certain OEMS can enable displaying the RAID10 string instead of
RAID1E via manufacturing page 10.   The driver will read this config page at
driver load time, then determine from the GenericFlags0 bits whether display
the RAID10 or RAID1E string, also even drive count is taken into consideration.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Reviewed-by: Eric Moore <Eric.moore@lsi.com>
Cc: Stable Tree <stable@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] mpt2sas: setting SDEV into RUNNING state from Interrupt context
Kashyap, Desai [Thu, 20 Aug 2009 07:53:19 +0000 (13:23 +0530)]
[SCSI] mpt2sas: setting SDEV into RUNNING state from Interrupt context

Changing SDEV Running state from interrupt context. Previously It was
handle in work queue thread. With this change It will not wait for work
queue thread to execute scsih_ublock_io_device to put SDEV into Running
state. This will reduce delay for Device becoming RUNNING.

Modified this patch considering James comment "Not to change SDEV state
using  scsi_device_set_state API, instead use scsi_internal_device_unblock
scsi_internal_device_block API"

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Reviewed-by: Eric Moore <Eric.moore@lsi.com>
Cc: Stable Tree <stable@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] mpt2sas: Removed wrapper funtions _scsih_link_change.
Kashyap, Desai [Thu, 20 Aug 2009 07:52:39 +0000 (13:22 +0530)]
[SCSI] mpt2sas: Removed wrapper funtions _scsih_link_change.

Deleted the wrapper function called _scsih_link_change. This function was
implemented for compatibility reasons only, between different kernel versions.
Currently this function is no longer needed.  The calling function are
converted to calling mpt2sas_transport_update_phy_link_change directly in the
transport layer.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Reviewed-by: Eric Moore <Eric.moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] mpt2sas: Prevent sending command to FW while Host Reset
Kashyap, Desai [Thu, 20 Aug 2009 07:52:00 +0000 (13:22 +0530)]
[SCSI] mpt2sas: Prevent sending command to FW while Host Reset

This patch renames the flag for indicating host reset from
ioc_reset_in_progress to shost_recovery. It also removes the spin locks
surrounding the setting of this flag, which are unnecessary.   Sanity checks on
the shost_recovery flag were added thru out the code so as to prevent sending
firmware commands during host reset.  Also, the setting of the shost state to
SHOST_RECOVERY was removed to prevent deadlocks, this is actually better
handled by the shost_recovery flag.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Reviewed-by: Eric Moore <Eric.moore@lsi.com>
Cc: Stable Tree <stable@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] mpt2sas : Rescan topology from Interrupt context instead of work thread
Kashyap, Desai [Thu, 20 Aug 2009 07:50:54 +0000 (13:20 +0530)]
[SCSI] mpt2sas : Rescan topology from Interrupt context instead of work thread

Following host reset its possible that the controller firmware could
assign new handles for devices, as well as adding or deleting devices. There is
code in the driver that will rescan the topology folowing host reset; updating
device handles, and remove devices that are no longer responding. This patch
will improve the responsivness by moving this rescaning from the delayed hotplug
worker thread to immediately following the host reset.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Reviewed-by: Eric Moore <Eric.moore@lsi.com>
Cc: Stable Tree <stable@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] stex: Add reset code for st_yel (v2)
Ed Lin [Tue, 18 Aug 2009 19:15:14 +0000 (12:15 -0700)]
[SCSI] stex: Add reset code for st_yel (v2)

Add reset related code for st_yel.
1. Set the SS_H2I_INT_RESET bit.
2. Wait for the SS_MU_OPERATIONAL flag. This is also part of
   normal handshake process so move it to handshake routine.
3. Continue handshake with the firmware.

Signed-off-by: Ed Lin <ed.lin@promise.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] zfcp: optimize zfcp_qdio_account
Heiko Carstens [Tue, 18 Aug 2009 13:43:32 +0000 (15:43 +0200)]
[SCSI] zfcp: optimize zfcp_qdio_account

Remove expensive ktime_get()/ktime_us_delta() functions from the hot
path and use get_clock_monotonic() instead. This elimates seven
function calls and avoids a lot of unnecessary calculations.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] zfcp: Remove duplicated code for debug timestamps
Christof Schmitt [Tue, 18 Aug 2009 13:43:31 +0000 (15:43 +0200)]
[SCSI] zfcp: Remove duplicated code for debug timestamps

The timestamp calculation used for s390dbf output is the same in a
private zfcp function and in debug.c. Replace both with a common
inline function.

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>
15 years ago[SCSI] zfcp: Handle failures during device allocation correctly
Christof Schmitt [Tue, 18 Aug 2009 13:43:30 +0000 (15:43 +0200)]
[SCSI] zfcp: Handle failures during device allocation correctly

dev_set_name tries to allocate memory, so check the return value for
allocation failures. After dev_set_name succeeds, call device_register
as next step to be able to use put_device during error handling.

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>
15 years ago[SCSI] zfcp: proper use of device register
Sebastian Ott [Tue, 18 Aug 2009 13:43:29 +0000 (15:43 +0200)]
[SCSI] zfcp: proper use of device register

Don't use kfree directly after device registration started.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] zfcp: Replace config semaphore with mutex
Christof Schmitt [Tue, 18 Aug 2009 13:43:28 +0000 (15:43 +0200)]
[SCSI] zfcp: Replace config semaphore with mutex

The config semaphore is only used as a mutex, so replace it with a
simple mutex.

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>
15 years ago[SCSI] zfcp: Defer resource allocation to first ccw_set_online call
Christof Schmitt [Tue, 18 Aug 2009 13:43:27 +0000 (15:43 +0200)]
[SCSI] zfcp: Defer resource allocation to first ccw_set_online call

So far, zfcp allocated all resources required for FCP
adapters/subchannels when the device was discovered in the ccw_probe
callback. If there are lots of unused FCP subchannels attached to a
system, this is a waste of resources. To alleviate this, defer the
resource allocation to the first call to ccw_set_online. To avoid
disruptions during possible following calls to ccw_set_offline and
then ccw_set_online, keep the adapter resources until the device is
finally being removed via ccw_remove. While doing this, also manage
the zfcp erp thread together with all other adapter resources in
zfcp_adapter_enqueue/dequeue.

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>
15 years ago[SCSI] zfcp: Simplify and update ct/gs and els timeout handling
Christof Schmitt [Tue, 18 Aug 2009 13:43:26 +0000 (15:43 +0200)]
[SCSI] zfcp: Simplify and update ct/gs and els timeout handling

The recommendation for a timeout of 2 * R_A_TOV is the same for ct/gs
and els requests, so set it in the common function used for
initializing both request types. Besides, the timer inside zfcp should
only run longer than the timeout set for the channel, so 10 seconds
more should be enough (instead of 60 seconds).

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>
15 years ago[SCSI] zfcp: Use kthread API for zfcp erp thread
Christof Schmitt [Tue, 18 Aug 2009 13:43:25 +0000 (15:43 +0200)]
[SCSI] zfcp: Use kthread API for zfcp erp thread

Switch the creation of the zfcp erp thread from the deprecated
kernel_thread API to the kthread API. This allows also the removal of
some flags in zfcp since the kthread API handles thread creation and
shutdown internally. To allow the usage of the kthread_stop function,
replace the erp ready semaphore with a waitqueue for waiting until erp
actions arrive on the ready queue.

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>
15 years ago[SCSI] zfcp: resolve false usage of dd_data in fc_rport
Swen Schillig [Tue, 18 Aug 2009 13:43:24 +0000 (15:43 +0200)]
[SCSI] zfcp: resolve false usage of dd_data in fc_rport

The fc_rport structure reserves a reference where a LLD can put
information required in a situation where the fc transport class is
triggering LLD callbacks. The zfcp driver was using this variable
directly which is discouraged. This patch solves this issue by making
this reference unnecessary.  In addition the dev_loss_tmo callback is
removed, it is not required: zfcp does not access the fc_rport after
calling fc_remote_port_delete.

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>
15 years ago[SCSI] zfcp: Apply common naming conventions to zfcp_fc
Swen Schillig [Tue, 18 Aug 2009 13:43:23 +0000 (15:43 +0200)]
[SCSI] zfcp: Apply common naming conventions to zfcp_fc

Update the Fibre Channel related code to use the zfcp_fc prefix.

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>
15 years ago[SCSI] zfcp: introduce _setup, _destroy for qdio and FC
Swen Schillig [Tue, 18 Aug 2009 13:43:22 +0000 (15:43 +0200)]
[SCSI] zfcp: introduce _setup, _destroy for qdio and FC

Extract independent data structures and introduce common _setup and
_destroy routines for QDIO and Fibre Channel related data structures

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>
15 years ago[SCSI] zfcp: Update dbf calls
Swen Schillig [Tue, 18 Aug 2009 13:43:21 +0000 (15:43 +0200)]
[SCSI] zfcp: Update dbf calls

Change the dbf data and functions to use the zfcp_dbf prefix
throughout the code. Also change the calls to dbf to use zfcp_dbf
instead of zfcp_adapter.

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>
15 years ago[SCSI] zfcp: Decouple gid_pn requests from erp
Christof Schmitt [Tue, 18 Aug 2009 13:43:20 +0000 (15:43 +0200)]
[SCSI] zfcp: Decouple gid_pn requests from erp

Don't let the erp wait for gid_pn requests to complete. Instead, queue
the gid_pn work, exit erp and let the finished gid_pn work trigger a
new port reopen.

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>
15 years ago[SCSI] zfcp: Move qdio related data out of zfcp_adapter
Swen Schillig [Tue, 18 Aug 2009 13:43:19 +0000 (15:43 +0200)]
[SCSI] zfcp: Move qdio related data out of zfcp_adapter

The zfcp_adapter structure was growing over time to a size of almost
one memory page. To reduce the size of the data structure and to
seperate different layers, put all qdio related data in the new
zfcp_qdio data structure.

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>
15 years ago[SCSI] zfcp: Separate qdio attributes from zfcp_fsf_req
Swen Schillig [Tue, 18 Aug 2009 13:43:18 +0000 (15:43 +0200)]
[SCSI] zfcp: Separate qdio attributes from zfcp_fsf_req

Split all qdio related attributes out of zfcp_fsf_req and put it in
new structure.

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>
15 years ago[SCSI] zfcp: Move workqueue to adapter struct
Swen Schillig [Tue, 18 Aug 2009 13:43:17 +0000 (15:43 +0200)]
[SCSI] zfcp: Move workqueue to adapter struct

Remove the global driver work queue and replace it with a workqueue
local to the adapter. The usage of this workqueue makes this the
correct place for the structure. In addition multiple adapters won't
block each other due to the serialization of the queued work.

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>
15 years ago[SCSI] zfcp: Remove the useless ZFCP_REQ_AUTO_CLEANUP flag
Swen Schillig [Tue, 18 Aug 2009 13:43:16 +0000 (15:43 +0200)]
[SCSI] zfcp: Remove the useless ZFCP_REQ_AUTO_CLEANUP flag

The flag ZFCP_REQ_AUTO_CLEANUP was useless as the
ZFCP_STATUS_FSFREQ_CLEANUP flag is there for exactly the same purpose.

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>
15 years ago[SCSI] zfcp: Improve request allocation through mempools
Swen Schillig [Tue, 18 Aug 2009 13:43:15 +0000 (15:43 +0200)]
[SCSI] zfcp: Improve request allocation through mempools

Remove the special case for NO_QTCB requests and optimize the
mempool and cache processing for fsfreqs. Especially use seperate
mempools for the zfcp_fsf_req and zfcp_qtcb structs.

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>
15 years ago[SCSI] zfcp: Replace fsf_req wait_queue with completion
Swen Schillig [Tue, 18 Aug 2009 13:43:14 +0000 (15:43 +0200)]
[SCSI] zfcp: Replace fsf_req wait_queue with completion

The combination wait_queue/wakeup in conjunction with the flag
ZFCP_STATUS_FSFREQ_COMPLETED to signal the completion of an fsfreq
was not race-safe and can be better solved by a completion.

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>
15 years ago[SCSI] zfcp: fix layering oddities between zfcp_fsf and zfcp_qdio
Swen Schillig [Tue, 18 Aug 2009 13:43:13 +0000 (15:43 +0200)]
[SCSI] zfcp: fix layering oddities between zfcp_fsf and zfcp_qdio

There is no need for the QDIO layer to have knowledge or do things
wich are done better by the FSF layer and vice versa.  Straighten a
few things to improve vividness.

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>
15 years ago[SCSI] zfcp: Implicitly close all wka ports
Christof Schmitt [Tue, 18 Aug 2009 13:43:12 +0000 (15:43 +0200)]
[SCSI] zfcp: Implicitly close all wka ports

An adapter shutdown implicitly closes all open ports. Make sure to
mark all WKA ports as offline, not only the directory server. Also
make sure that no pending wka port work is running when the adapter is
being removed.

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>
15 years ago[SCSI] zfcp: Only issue one test link command per port
Christof Schmitt [Tue, 18 Aug 2009 13:43:11 +0000 (15:43 +0200)]
[SCSI] zfcp: Only issue one test link command per port

When the FCP channel returns a series of commands with the error
status "test link", zfcp will send a series of ELS ADISC commands.
This is technically no problem, but it is enough to only issue one
test command per remote port. So, track whether a ELS ADISC command is
already pending, and do not send a new one if there is already a
pending command.

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>
15 years ago[SCSI] zfcp: Remove useless assignment
Christof Schmitt [Tue, 18 Aug 2009 13:43:10 +0000 (15:43 +0200)]
[SCSI] zfcp: Remove useless assignment

Using a bitwise OR to not set anything at all is pointless so remove
the useless statement.

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>
15 years ago[SCSI] zfcp: Only collect FSF/HBA debug data for matching trace levels
Christof Schmitt [Tue, 18 Aug 2009 13:43:09 +0000 (15:43 +0200)]
[SCSI] zfcp: Only collect FSF/HBA debug data for matching trace levels

The default trace level is to only trace failed FSF commands. Thus it
is not necessary to collect trace data for most FSF commands, since
it will be thrown away later. Restructure the FSF/HBA trace
infrastructure to first check the trace level in a inline function and
only do the expensive data collection for matching trace levels.

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>
15 years ago[SCSI] zfcp: Only collect SCSI debug data for matching trace levels
Christof Schmitt [Tue, 18 Aug 2009 13:43:08 +0000 (15:43 +0200)]
[SCSI] zfcp: Only collect SCSI debug data for matching trace levels

The default trace level is to only trace failed SCSI commands. Thus it
is not necessary to collect trace data for most SCSI commands since it
will be thrown away later. Restructure the SCSI trace infrastructure
to first check the trace level in a inline function and only do the
expensive data collection for matching trace levels.

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>
15 years ago[SCSI] zfcp: Move debug data from zfcp_data to own data structure
Christof Schmitt [Tue, 18 Aug 2009 13:43:07 +0000 (15:43 +0200)]
[SCSI] zfcp: Move debug data from zfcp_data to own data structure

The struct zfcp_adapter includes everything related to the debug
traces. This introduces dependences between the definitions in
zfcp_def.h and zfcp_dbf.h. Move all debug related data structures to a
new data structure to break those dependencies and manage the debug
data in zfcp_dbf.[hc].

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>
15 years ago[SCSI] zfcp: invalid usage after free of port resources
Swen Schillig [Tue, 18 Aug 2009 13:43:06 +0000 (15:43 +0200)]
[SCSI] zfcp: invalid usage after free of port resources

In certain error scenarios ports, rports are getting attached,
validated and removed from the systems environment. Depending on the
layer this occurs asynchronously. This patch fixes the few races
which existed and ensures all references and cross references are
cleared at the time they're invalid. In addition fc transports
actions are only scheduled when required.

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>
15 years ago[SCSI] scsi_dh_rdac: add support for next generation of Dell PV array
Yanqing_Liu@Dell.com [Mon, 17 Aug 2009 19:31:42 +0000 (14:31 -0500)]
[SCSI] scsi_dh_rdac: add support for next generation of Dell PV array

This patch is to add DM support for next generation of Dell PowerVault
storage array.

Signed-off-by: Yanqing Liu <Yanqing_Liu@Dell.com>
Acked-by: Chandra Seetharaman <sekharan@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] update MAINTAINERS with new email
James Bottomley [Thu, 13 Aug 2009 19:23:12 +0000 (19:23 +0000)]
[SCSI] update MAINTAINERS with new email

Novell is now funding SCSI work, so the MAINTAINERS file should reflect
this.

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] mptsas : Bump version to 3.04.11
Kashyap, Desai [Wed, 5 Aug 2009 07:24:32 +0000 (12:54 +0530)]
[SCSI] mptsas : Bump version to 3.04.11

Bump version to 3.04.11

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] mptsas : Code cleanup of host page alloc and diag reset.
Kashyap, Desai [Wed, 5 Aug 2009 07:23:51 +0000 (12:53 +0530)]
[SCSI] mptsas : Code cleanup of host page alloc and diag reset.

Code cleanup of host page alloc and diag reset.

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] mptsas : set max_id to infinite value.
Kashyap, Desai [Wed, 5 Aug 2009 07:22:58 +0000 (12:52 +0530)]
[SCSI] mptsas : set max_id to infinite value.

Do not set max_id value received from FW. Once SAS transport layer is
introduced max_id value is missleading to SCSI mid layer. Use max_id to
infinite value.

logic of can queue of scsi host is changed.

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] mptsas : Change config request timeout value to 30 seconds.
Kashyap, Desai [Wed, 5 Aug 2009 07:22:03 +0000 (12:52 +0530)]
[SCSI] mptsas : Change config request timeout value to 30 seconds.

Change config request timeout value to 30 seconds.

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] mptsas : Handle INSUFFICIENT resources status as similar to IOC BUSY status
Kashyap, Desai [Wed, 5 Aug 2009 07:21:25 +0000 (12:51 +0530)]
[SCSI] mptsas : Handle INSUFFICIENT resources status as similar to IOC BUSY status

Handle insufficient resources status as similar to busy status.

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] mptsas : Removed mptscsih_timer_expired.
Kashyap, Desai [Wed, 5 Aug 2009 07:20:02 +0000 (12:50 +0530)]
[SCSI] mptsas : Removed mptscsih_timer_expired.

Removed mptscsih_timer_expired. This timer is no more use.

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] mptsas : Change DEFINED value of can queue for FC and SAS devices.
Kashyap, Desai [Wed, 5 Aug 2009 07:18:44 +0000 (12:48 +0530)]
[SCSI] mptsas : Change DEFINED value of can queue for FC and SAS devices.

Change DEFINED value of can queue for FC and SAS devices.

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] scsi_dh: add two SUN devices to the list of devices supported by default
Chandra Seetharaman [Wed, 12 Aug 2009 19:43:20 +0000 (12:43 -0700)]
[SCSI] scsi_dh: add two SUN devices to the list of devices supported by default

Reported-by: Rice Brown <rick.brown@oit.gatech.edu>
Signed-Off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] fix bugs in scsi_vpd_inquiry()
James Bottomley [Tue, 11 Aug 2009 15:59:09 +0000 (10:59 -0500)]
[SCSI] fix bugs in scsi_vpd_inquiry()

Universally, SCSI functions assume the lengths fed in are those of the buffer
to DMA data to, not the lengths of the data minus the header.
scsi_vpd_inquiry() assumed the latter and got it wrong, so fix up all the
functions to use the correct assumption (and fix a bug where INQUIRY in SCSI-2
dcannot go over 255).

[jejb: Matthew posted an identical version of this at the same time I did]
Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] reservation conflict after timeout causes device to be taken offline
Michael Reed [Mon, 10 Aug 2009 16:59:28 +0000 (11:59 -0500)]
[SCSI] reservation conflict after timeout causes device to be taken offline

An IBM tape drive failed to complete a PERSISTENT RESERVE IN within the scsi
cmd timeout.  Error recovery was initiated and it sequenced from abort through
taking the tape drive offline.

The device was taken offline because it repeatedly responded to the TUR command
issued by error recovery with a RESERVATION CONFLICT status.  The tape drive
was reserved to another system.  This is perfectly legitimate response to TUR,
and is one that an escalation of recovery is unlikely to clear.  Further,
escalation of recovery can have undesirable side effects on the operation of
tape drives shared with other initiators.

Instead of escalating recovery, error recovery should treat the RESERVATION
CONFLICT response to the TUR as a good status, giving the issuer of the
command the opportunity to handle the timeout and reservation conflict.

Signed-off-by: Michael reed <mdr@sgi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] nsp_cs: fix buf overflow
Jiri Slaby [Sat, 8 Aug 2009 09:36:06 +0000 (11:36 +0200)]
[SCSI] nsp_cs: fix buf overflow

In nsp_cs_config there is a wrong struct nsp_cs_configdata allocation.
It allocates only sizeof(pointer to nsp_cs_configdata) for a whole
structure. Add a dereference to the sizeof to allocate
sizeof(nsp_cs_configdata).

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] ch: Check NULL for kmalloc() return
Davidlohr Bueso A [Fri, 7 Aug 2009 20:42:21 +0000 (16:42 -0400)]
[SCSI] ch: Check NULL for kmalloc() return

Verify that ch->dt is not NULL before using it.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] ibmvscsi: avoid unnecessary use of kzalloc_pool
Sage Weil [Mon, 3 Aug 2009 20:54:47 +0000 (13:54 -0700)]
[SCSI] ibmvscsi: avoid unnecessary use of kzalloc_pool

The allocated struct is manually zeroed after allocation, so avoid using
the (broken) kzalloc mempool (which does not re-zero previously used items
when they are returned to the pool).

Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Sage Weil <sage@newdream.net>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] qla2xxx: Update version number to 8.03.01-k5
Giridhar Malavali [Fri, 31 Jul 2009 22:09:34 +0000 (15:09 -0700)]
[SCSI] qla2xxx: Update version number to 8.03.01-k5

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] qla2xxx: Fix to ensure driver works in sinlge queue mode if multiqueue fails
Anirban Chakraborty [Wed, 5 Aug 2009 16:18:40 +0000 (09:18 -0700)]
[SCSI] qla2xxx: Fix to ensure driver works in sinlge queue mode if multiqueue fails

When the multiqueue mode fails to work, the driver falls back on single
queue mode. This ensures that the firmware is reinitialized with single
queue options and all the resources are readjusted accordingly.

Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] qla2xxx: Correct display of vp_count in debug printk.
Andrew Vasquez [Wed, 5 Aug 2009 06:38:21 +0000 (23:38 -0700)]
[SCSI] qla2xxx: Correct display of vp_count in debug printk.

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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] qla2xxx: Fix a bug that clears the interrupt status register for the base...
Anirban Chakraborty [Tue, 4 Aug 2009 23:12:13 +0000 (16:12 -0700)]
[SCSI] qla2xxx: Fix a bug that clears the interrupt status register for the base queue

The interrupt handler clears the interrupt status register for response
updates in the base queue while working in the multique mode. This could lead
to missing interrupt for async events, mail box completions etc. as these are
also handled in the base queue.  The fix ensures that the interrupt bit is not
cleared for response updates in the ISR when the driver is working in
multiqueue mode.

Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] qla2xxx: ISP21xx/22xx do not support FDMI registrations.
Andrew Vasquez [Fri, 31 Jul 2009 22:09:33 +0000 (15:09 -0700)]
[SCSI] qla2xxx: ISP21xx/22xx do not support FDMI registrations.

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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] qla2xxx: Pad IOCB structure for size requirements.
Shyam Sundar [Fri, 31 Jul 2009 22:09:30 +0000 (15:09 -0700)]
[SCSI] qla2xxx: Pad IOCB structure for size requirements.

One byte added to make the IOCB structure satisfy
size requirements.

Signed-off-by: Shyam Sundar <shyam.sundar@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] qla2xxx: Handle RSCN's per master/slave vn-port basis.
Santosh Vernekar [Fri, 31 Jul 2009 22:09:29 +0000 (15:09 -0700)]
[SCSI] qla2xxx: Handle RSCN's per master/slave vn-port basis.

Signed-off-by: Santosh Vernekar <santosh.vernekar@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] qla2xxx: Process DPC requests within valid Fabric topologies.
Lalit Chandivade [Fri, 31 Jul 2009 22:09:27 +0000 (15:09 -0700)]
[SCSI] qla2xxx: Process DPC requests within valid Fabric topologies.

If vports are created and topology is changed to Loop only, the
driver continuously gets a LIP reset occurred and keeps trying to
enable the vport.  Only manage requests during F_Port.

Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] qla2xxx: Mark all devices lost on loss of fc port.
Santosh Vernekar [Fri, 31 Jul 2009 22:09:26 +0000 (15:09 -0700)]
[SCSI] qla2xxx: Mark all devices lost on loss of fc port.

Signed-off-by: Santosh Vernekar <santosh.vernekar@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] qla2xxx: Skip RSCN processing on vha if event is global.
Santosh Vernekar [Fri, 31 Jul 2009 22:09:25 +0000 (15:09 -0700)]
[SCSI] qla2xxx: Skip RSCN processing on vha if event is global.

The RSCN processing is skipped if the event received is global and vha is not recipient.

Signed-off-by: Santosh Vernekar <santosh.vernekar@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] qla2xxx: Correctly handle 'global port-unavailable' AEN.
Andrew Vasquez [Fri, 31 Jul 2009 22:09:24 +0000 (15:09 -0700)]
[SCSI] qla2xxx: Correctly handle 'global port-unavailable' AEN.

Treat a global port-unavailable PORT_UPDATE (8014h) AEN as a
loop-down event.  For this case, within the FCoE domain, the
'logical' interface has been terminated, but the driver will
not receive the classic LOOP_DOWN AEN.

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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] qla2xxx: Pass the command's data residual to upper-layer callers.
Ravi Anand [Fri, 31 Jul 2009 22:09:23 +0000 (15:09 -0700)]
[SCSI] qla2xxx: Pass the command's data residual to upper-layer callers.

Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] scsi_dh: Use scsi_dh_set_params() in multipath.
Chandra Seetharaman [Mon, 3 Aug 2009 19:42:45 +0000 (12:42 -0700)]
[SCSI] scsi_dh: Use scsi_dh_set_params() in multipath.

Use scsi_dh_set_params() set parameters provided. Save the parameters in
parse_hw_handler() and use it in parse_path().

Reported-by: Eddie Williams <Eddie.Williams@steeleye.com>
Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Tested-by: Eddie Williams <Eddie.Williams@steeleye.com>
Cc: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] scsi_dh: Provide set_params interface in emc device handler
Chandra Seetharaman [Mon, 3 Aug 2009 19:42:39 +0000 (12:42 -0700)]
[SCSI] scsi_dh: Provide set_params interface in emc device handler

Handle the parameters provided by user thru multipath.

This handler expects only 2 parameters and their value can either be 0 or 1.

This code originates from the old dm-emc.c file. Appropriate changes have
been made to make it work in the new design.

Reported-by: Eddie Williams <Eddie.Williams@steeleye.com>
Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Tested-by: Eddie Williams <Eddie.Williams@steeleye.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] scsi_dh: add the interface scsi_dh_set_params()
Chandra Seetharaman [Mon, 3 Aug 2009 19:42:33 +0000 (12:42 -0700)]
[SCSI] scsi_dh: add the interface scsi_dh_set_params()

When we moved the device handler functionality from dm layer to SCSI layer
we dropped the parameter functionality.

This path adds an interface to scsi dh layer to set device handler
parameters.

Basically, multipath layer need to create a string with all the parameters
and call scsi_dh_set_params() after it called scsi_dh_attach() on a
device.

If a device handler provides such an interface it will handle the parameters
as it expects them.

Reported-by: Eddie Williams <Eddie.Williams@steeleye.com>
Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Tested-by: Eddie Williams <Eddie.Williams@steeleye.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] ses: update enclosure data on hot add
James Bottomley [Sat, 1 Aug 2009 00:43:59 +0000 (00:43 +0000)]
[SCSI] ses: update enclosure data on hot add

Now that hot add works correctly, if a new device is added, we're still
operating on stale enclosure data, so fix that by updating the enclosure
diagnostic pages when we get notified of a device hot add

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] ses: add support for enclosure component hot removal
James Bottomley [Sat, 1 Aug 2009 00:41:22 +0000 (00:41 +0000)]
[SCSI] ses: add support for enclosure component hot removal

Right at the moment, hot removal of a device within an enclosure does
nothing (because the intf_remove only copes with enclosure removal not
with component removal). Fix this by adding a function to remove the
component.  Also needed to fix the prototype of
enclosure_remove_device, since we know the device we've removed but
not the internal component number

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] ses: fix hotplug with multiple devices and expanders
James Bottomley [Sat, 1 Aug 2009 00:39:36 +0000 (00:39 +0000)]
[SCSI] ses: fix hotplug with multiple devices and expanders

In a situation either with expanders or with multiple enclosure
devices, hot add doesn't always work.  This is because we try to find
a single enclosure device attached to the host.  Fix this by looping
over all enclosure devices attached to the host and also by making the
find loop recognise that the enclosure devices may be expander remote
(i.e. not parented by the host).

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] ipr: fix buffer overflow
Brian King [Thu, 30 Jul 2009 15:58:51 +0000 (10:58 -0500)]
[SCSI] ipr: fix buffer overflow

ipr_cmd_label[] isn't big enough for an eight byte string plus terminator.
Fix by shortening the string to seven bytes.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] bnx2i : Fix "cid #n not valid" issue
Anil Veerabhadrappa [Thu, 30 Jul 2009 04:50:11 +0000 (21:50 -0700)]
[SCSI] bnx2i : Fix "cid #n not valid" issue

When bnx2i_adapter_ready() fails, connection handle(cid) = 0 is wrongly freed
because 'cid' is not yet allocated for the endpoint.  Fix is to initialize
bnx2i_ep->ep_iscsi_cid to '-1' in bnx2i_alloc_ep() and not in
bnx2i_ep_connect() to avoid releasing invalid 'cid'.  There is already a check
in bnx2i_free_iscsi_cid() not to free invalid iscsi connection handle (-1)

Signed-off-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] bnx2i : Fix command session number jump issue seen during cable pull test
Anil Veerabhadrappa [Thu, 30 Jul 2009 04:49:48 +0000 (21:49 -0700)]
[SCSI] bnx2i : Fix command session number jump issue seen during cable pull test

Without the fix bnx2i would fail tt->xmit_task() when link is down and
libiscsi would have already incremented session->cmdsn before calling bnx2i's
xmit_task() entry point and will just return the command to SCSI-ML when
xmit_task() fails. libiscsi does not retract the session->cmdsn as the command
was never sent on wire.  It is generally good idea for LLD, bnx2i to accept
the scsi cmnd/nopout and let upper layer timeout and go though normal session
recovery process.  When link is down, unsolicited nopout will not be accepted
by bnx2i and connection will never enter recovery state. This fix is required
for MPIO to work corectly

Signed-off-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] fcoe: removes phys_dev and renames real_dev to netdev.
Vasu Dev [Thu, 30 Jul 2009 00:05:45 +0000 (17:05 -0700)]
[SCSI] fcoe: removes phys_dev and renames real_dev to netdev.

The phys_dev was used only to locate common offload EM instance for all
FCoE instances on a eth devices in function fcoe_em_config, so just updated
fcoe_em_config to look for actual real eth device in locating common offload
EM instance and then no need to store phys_dev in fcoe_softc, so removes
phys_dev from fcoe_softc also.

Renames fcoe_softc real_dev to netdev and updates all its uses to use netdev.

So effectively no functional change, use of single netdev instead phys_dev
and real_dev saves one pointer memory in fcoe_softc, also real_dev used here
was confusing with vlan driver terminology since real_dev in vlan driver is
referred to physical eth device.

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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] libfc: Remove page flags check for sglist
Yi Zou [Thu, 30 Jul 2009 00:05:40 +0000 (17:05 -0700)]
[SCSI] libfc: Remove page flags check for sglist

I don't believe this check is needed any more in the current kernel, which,
if I understand correctly, is for compound page where only the first page
is supposed to get ref-counted.

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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] libfc: Remove FC_FRAME_SG_LEN in fc_fcp_send_data
Yi Zou [Thu, 30 Jul 2009 00:05:32 +0000 (17:05 -0700)]
[SCSI] libfc: Remove FC_FRAME_SG_LEN in fc_fcp_send_data

FC_FRAME_SG_LEN is 4 which is too small when offload is enabled. Actually, the
WARN_ON() in fc_fcp_send_data() should be:

WARN_ON(skb_shinfo(fp_skb(fp))->nr_frags > MAX_SKB_FRAGS);

But since we will not get anything more than 64K anyway, so there is no need
to do this anyway here. Therefore, I am getting rid of FC_FRAME_SG_LEN here
and the WARN_ON here.

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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] fcoe: Remove ifdef for NETIF_F_FCOE_CRC and NETIF_F_FSO
Yi Zou [Thu, 30 Jul 2009 00:05:26 +0000 (17:05 -0700)]
[SCSI] fcoe: Remove ifdef for NETIF_F_FCOE_CRC and NETIF_F_FSO

Remove the extra ifdef for NETIF_F_FSO and NETIF_F_FCOE_CRC since they are
already defined in the current kernel as in include/linux/netdevice.h.

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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] fcoe, libfc: adds offload EM per eth device with only single xid range per EM
Vasu Dev [Thu, 30 Jul 2009 00:05:21 +0000 (17:05 -0700)]
[SCSI] fcoe, libfc: adds offload EM per eth device with only single xid range per EM

Updates fcoe_em_config to allocate a single instance of sharable offload
EM for supported lp->lro_xid per eth device, and then share this EM
for subsequently more lports creation on same eth device (e.g when using
VLAN).

Adds tiny fcoe_oem_match function for offload EM to return true for read
types IO to have read IO exchanges allocated from offload shared EM.

Removes fc_em_alloc_xid function completely which was needed to manage
two xid ranges within a EM, this is not needed any more with allocation
of separate sharable offload EM per eth device. Instead this patch adds
simple xid allocation logic to manage single xid range.

Adds fc_exch_em_alloc with mp->next_xid as cursor to allocate new xid
from single xid range of EM, uses mp->next_xid instead removed mp->last_xid
which slightly increase probability of finding empty xid on exch allocation.

Removes restriction of not allowing use of xid zero along with changing
two xid range change to single xid range.

Makes fc_fcp_ddp_setup calling conditional to only xid allocated from
shared offload EM.

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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] fcoe: modifies fcoe_hostlist_lock uses as prep work to add shared offload EM
Vasu Dev [Thu, 30 Jul 2009 00:05:15 +0000 (17:05 -0700)]
[SCSI] fcoe: modifies fcoe_hostlist_lock uses as prep work to add shared offload EM

Modifies fcoe_hostlist_lock uses such that a new EM allocation in
fcoe_em_config and adding new fcoe_softc using fcoe_hostlist_add
are atomic, this is to ensure that a shared offload EM gets allocated
only once per eth device for its all lports.

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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] fcoe, fnic, libfc: modifies current code paths to use EM anchor list
Vasu Dev [Thu, 30 Jul 2009 00:05:10 +0000 (17:05 -0700)]
[SCSI] fcoe, fnic, libfc: modifies current code paths to use EM anchor list

Modifies current code to use EM anchor list in EM allocation, EM free,
EM reset, exch allocation and exch lookup code paths.

 1. Modifies fc_exch_mgr_alloc to accept EM match function and then
    have allocated EM added to the lport using fc_exch_mgr_add API
    while also updating EM kref for newly added EM.

 2. Updates fc_exch_mgr_free API to accept only lport pointer instead
    EM and then have this API free all EMs of the lport from EM anchor
    list.

 3. Removes single lport pointer link from the EM, which was used in
    associating lport pointer in newly allocated exchange. Instead have
    lport pointer passed along new exchange allocation call path and
    then store passed lport pointer in newly allocated exchange, this
    will allow a single EM instance to be used across more than one
    lport and used in EM reset to reset only lport specific exchanges.

 4. Modifies fc_exch_mgr_reset to reset all EMs from the EM anchor list
    of the lport, adds additional exch lport pointer (ep->lp) check for
    shared EM case to reset exchange specific to a lport requested reset.

 5. Updates exch allocation API fc_exch_alloc to use EM anchor list and
    its anchor match func pointer. The fc_exch_alloc will walk the list
    of EMs until it finds a match, a match will be either null match
    func pointer or call to match function returning true value.

 6. Updates fc_exch_recv to accept incoming frame on local port using
    only lport pointer and frame pointer without specifying EM instance
    of incoming frame. Instead modified fc_exch_recv to locate EM for the
    incoming frame by matching xid of incoming frame against a EM xid range.
    This change was required to use EM list in libfc Rx path and after this
    change the lport fc_exch_mgr pointer emp is not needed anymore, so
    removed emp pointer.

 7. Updates fnic for removed lport emp pointer and above modified libfc APIs
    fc_exch_recv, fc_exch_mgr_alloc and fc_exch_mgr_free.

 8. Removes exch_get and exch_put from libfc_function_template as these
    are no longer needed with EM anchor list and its match function use.
    Also removes its default function fc_exch_get.

A defect this patch introduced regarding the libfc initialization order in
the fnic driver was fixed by Joe Eykholt <jeykholt@cisco.com>.

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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] libfc: Remove the FC_EM_DBG macro
Robert Love [Thu, 30 Jul 2009 00:05:05 +0000 (17:05 -0700)]
[SCSI] libfc: Remove the FC_EM_DBG macro

Currently there is a 1:1 relationship between the lport
and exchange manager. This macro takes an EM as an argument
and determines the lport from it. However, later patches
will use an EM list per lport, so we will no longer have
this 1:1 relationship- this macro must change.

The FC_EM_DBG macro is rarely used. There are four callers,
two can use FC_LPORT_DBG instead and two can be removed
since they're not necessary. This patch makes those changes
and removes the macro.

Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] fcoe, libfc: adds exchange manager(EM) anchor list per lport and related APIs
Vasu Dev [Thu, 30 Jul 2009 00:05:00 +0000 (17:05 -0700)]
[SCSI] fcoe, libfc: adds exchange manager(EM) anchor list per lport and related APIs

Adds EM list using a anchor struct fc_exch_mgr_anchor, anchor is used
to allow same EM instance sharing across more than one lport on a eth
device, this implementation is per discussed design posted at
http://www.open-fcoe.org/pipermail/devel/2009-June/002566.html.

The shared EM is required for multiple lports on eth device when
using multiple VLANs or NPIV.

Adds fc_exch_mgr_add API to add a EM to the lport and fc_exch_mgr_del
API to delete previously added EM.

Also adds function fc_exch_mgr_destroy() to destroy allocated EM.
The kref is added to the EM to keep track of EM usage count, the EM is
destroyed when no longer in use upon kref reaching to zero.

The caller can specify match function to fc_exch_mgr_add, this
will be used in determining exchange allocation from its EM or not.

Moved calling of fcoe_em_config below fcoe_libfc_config calling,
so that list head lp->ema_list is initialized before configuring
EM.

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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] libfc: fix: cancel rport retry timer
Joe Eykholt [Thu, 30 Jul 2009 00:04:54 +0000 (17:04 -0700)]
[SCSI] libfc: fix: cancel rport retry timer

The timer for rport retries wasn't getting canceled, and
would occasionally go off after the module was unloaded.

Add logic to cancel the timer in fc_rport_work().

Since we cancel the timer before deleting the rdata,
it is no longer necessary to do a get_device() for the pending timer.

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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] libfc: fc_rport_logoff should not drop the lock
Joe Eykholt [Thu, 30 Jul 2009 00:04:49 +0000 (17:04 -0700)]
[SCSI] libfc: fc_rport_logoff should not drop the lock

fc_rport_logoff drops the rport lock in order to cancel work
that may be pending.  This is undesirable as the state can
completely change, and the caller may not expect that the
lock could've been dropped.

If there is work pending, it will acquire the rdata mutex and
so we're protected and can change the event from READY to DELETE.
Queue the work only if there is no event already pending.

There were a couple other cases where the state was set to
DELETE and work queued, even though the state may have already
been DELETE.  Fix these using a common function fc_rport_enter_delete().

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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] libfc: rename rport state "NONE" to "DELETE".
Joe Eykholt [Thu, 30 Jul 2009 00:04:43 +0000 (17:04 -0700)]
[SCSI] libfc: rename rport state "NONE" to "DELETE".

State RPORT_ST_NONE was intented to be an invalid state (0), never used.
This was a misguided attempt to be sure it was always initialized.
Having an extra state meaning nothing requires switch statements to
have a case covering that state.

State NONE has been used instead to mean the remote port is being deleted.
Changing the name to RPORT_ST_DELETE.

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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] libfc: fix WARNING from fc_seq_start_next on closed exchanges
Joe Eykholt [Thu, 30 Jul 2009 00:04:38 +0000 (17:04 -0700)]
[SCSI] libfc: fix WARNING from fc_seq_start_next on closed exchanges

We saw periodic messages like:

WARNING: at drivers/scsi/libfc/fc_exch.c:825 fc_seq_start_next+0x30/0x4b

This was due to trying to allocate a sequence in a request handler
when the exchange had been reset.

Delete the WARN_ON.

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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] libfc: in fc_lport_destroy, flush rports after turning off link
Joe Eykholt [Thu, 30 Jul 2009 00:04:33 +0000 (17:04 -0700)]
[SCSI] libfc: in fc_lport_destroy, flush rports after turning off link

During an fcoe module unload, we saw a problem where fc_rport_work()
finds the lport has been freed.  The rdata points to an area
containing 0x6b6b6b6b... the pool poison value from kmem_free().

In fcoe_if_destroy() we call fc_fabric_logoff() then fc_lport_destroy().
fc_fabric_logoff() flushes the remote port work, but we're still receiving
requests, and an RSCN or PLOGI arrives which creates more rports.

Note that although the LLD also checks link_up, it doesn't do it
under the lport mutex, so it can deliver frames to
fc_lport_recv_req() even after link_up is cleared.
So, re-check link_up there.

We need to flush the rports by calling disc_stop_final()
after we clear link_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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] libfc: stop login after fabric logoff
Joe Eykholt [Thu, 30 Jul 2009 00:04:27 +0000 (17:04 -0700)]
[SCSI] libfc: stop login after fabric logoff

When removing the fcoe module, several lports were being shut down
through fc_lport_fabric_logoff().

Occasionally, one would enter reset state before fc_lport_destroy()
was called, and since link_up was still true, it would log back in.

If we just clear link_up earlier, then we wouldn't be accepting LOGO
requests from other initiators while we are shutting down.

Fix by changing the LOGO response handler to enter DISABLED instead
of RESET.  Add an fc_lport_enter_disabled() function which does
what fc_lport_enter_reset() did, except it doesn't proceed to FLOGI state.

Move the code that was common between fc_lport_enter_reset() and
fc_lport_enter_disabled() into a new fc_lport_reset_locked() function.

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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] libfc: rename lport NONE state to DISABLED
Joe Eykholt [Thu, 30 Jul 2009 00:04:22 +0000 (17:04 -0700)]
[SCSI] libfc: rename lport NONE state to DISABLED

The state NONE was meant to be invalid, but has been used as
the initial state.  Rename it to be DISABLED, as more descriptive.
Further patches will make it the like the RESET state, except
it won't transition to FLOGI until fc_lport_fabric_login() is called.

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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] fcoe: stop delivery of received frames before doing lport_destroy()
Joe Eykholt [Thu, 30 Jul 2009 00:04:17 +0000 (17:04 -0700)]
[SCSI] fcoe: stop delivery of received frames before doing lport_destroy()

To be more sure that no more input arrives at the local port as
it is being destroyed, clean the queues in the per-cpu receive
threads.

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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] libfc: change debug messages to give host number.
Joe Eykholt [Thu, 30 Jul 2009 00:04:12 +0000 (17:04 -0700)]
[SCSI] libfc: change debug messages to give host number.

libfc debug messages currently show 'lport: <fc-id>:'
wher <fc-id> is the hex assigned port-id.  When the lport
is logged off, that will be zero, so its hard to distinguish
which instance is involved.  The FC-ID can change
if the port is re-patched or changes VSANs.

Two lports may even have the same FC-ID if connected to isolated SANs.

Change the debug messages to print the SCSI host number "hostN:",
which will not change for the life of the lport.
Still show the FC_ID on lport messages.

Also, add a macro to FC_RPORT_ID_DBG for rport debugging where there's
no rdata structure involved.  It takes the lport and port_id as parameters.
Use this in fc_rport_recv_plogi_req() and fc_rport_recv_logo_req().

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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] libfc: remove extra semicolons from debug macros
Joe Eykholt [Thu, 30 Jul 2009 00:04:06 +0000 (17:04 -0700)]
[SCSI] libfc: remove extra semicolons from debug macros

This is unlikely to cause any problems, but the libfc debug macros
introduce extra undesirable semicolons.

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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] fcoe: Call dev_ethtool_get_settings() in fcoe_link_ok
Yi Zou [Thu, 30 Jul 2009 00:04:01 +0000 (17:04 -0700)]
[SCSI] fcoe: Call dev_ethtool_get_settings() in fcoe_link_ok

No need to check phys_dev here, just call dev_ethtool_get_settings() directly
will take care of this.

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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] libfcoe: Set fip_flags according to fcf and lport's capability of SPMA support
Yi Zou [Thu, 30 Jul 2009 00:03:55 +0000 (17:03 -0700)]
[SCSI] libfcoe: Set fip_flags according to fcf and lport's capability of SPMA support

When encap the els for FIP, set the fip_flags according to the FCF and lport's
capability of supporting SPMA or FPMA or both.

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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] fcoe: Fix validation of mac address when checking for spma support
Yi Zou [Thu, 30 Jul 2009 00:03:50 +0000 (17:03 -0700)]
[SCSI] fcoe: Fix validation of mac address when checking for spma support

Fix this bug of validating the wrong mac address while checking for SAN MAC
address support from LLD as we should check ha->addr not ctlr.ctl_src_addr.

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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] ALUA: send STPG if explicit and implicit is supported
Mike Christie [Wed, 29 Jul 2009 04:08:06 +0000 (23:08 -0500)]
[SCSI] ALUA: send STPG if explicit and implicit is supported

alua_activate only sends a STPG if only explicit is suppored.
As a result, for EMC targets that support both we end up doing
a implicit failover when X commands are finally sent to
the other SP.

This patch does a AND on the h->tpgs, so we do a explicit failover
right away.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] scsi_transport_sas: fix incorrect duplicate setup of max_phys
James Bottomley [Tue, 28 Jul 2009 16:39:05 +0000 (16:39 +0000)]
[SCSI] scsi_transport_sas: fix incorrect duplicate setup of max_phys

There are two setup places for max_phys in scsi_transport_sas.c; one
incorrectly places a NULL into host_attrs instead of port_attrs.  Remove it.

Reported-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] fc_transport: Correct max fc_host attribute count
James Smart [Tue, 28 Jul 2009 16:30:01 +0000 (12:30 -0400)]
[SCSI] fc_transport: Correct max fc_host attribute count

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] lpfc 8.3.4: Update driver version to 8.3.4
James Smart [Sun, 19 Jul 2009 14:01:44 +0000 (10:01 -0400)]
[SCSI] lpfc 8.3.4: Update driver version to 8.3.4

Update driver version to 8.3.4

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
15 years ago[SCSI] lpfc 8.3.4: Remove spaces before newlines in several log messages
James Smart [Sun, 19 Jul 2009 14:01:38 +0000 (10:01 -0400)]
[SCSI] lpfc 8.3.4: Remove spaces before newlines in several log messages

Remove spaces before newlines in several log messages

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>