Mike Christie [Wed, 16 Feb 2011 21:04:37 +0000 (15:04 -0600)]
[SCSI] iscsi class: add callout to get iscsi_endpoint values
For drivers using the ep callbacks the addr and port
are attached to the endpoint instead of the conn.
This adds a callout to the iscsi_transport to get
ep values. It also adds locking around the get
param call to make sure that ep_disconnect does
not free the LLD's ep interconnect structs from
under us (the ep has a refcount so it will not
go away but the LLD may have structs from other
subsystems that are not allocated in the ep so
we need to protect them from getting freed).
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Mike Christie [Wed, 16 Feb 2011 21:04:36 +0000 (15:04 -0600)]
[SCSI] iscsi_tcp: use iscsi_conn_get_addr_param libiscsi function
This has iscsi_tcp use the iscsi_conn_get_addr_param
libiscsi function. It also drops the use of the libiscsi
session portal buffers, so they can be removed in
the next patches. Instead of copying the values
at bind time we get them during get() time. If we are
not connected userspace will now get -ENOTCONN,
so it knows that connection is disconnected instead
of a possible stale value.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Mike Christie [Wed, 16 Feb 2011 21:04:33 +0000 (15:04 -0600)]
[SCSI] iscsi: fix iscsi_endpoint leak
When iscsid restarts it does not know the connection's
endpoint, so it is getting leaked. This fixes the problem
by having the iscsi class force a disconnect before a
new connection is bound.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Eddie Wai [Wed, 16 Feb 2011 21:04:31 +0000 (15:04 -0600)]
[SCSI] bnx2i: Updated to version 2.6.2.3
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Eddie Wai [Wed, 16 Feb 2011 21:04:30 +0000 (15:04 -0600)]
[SCSI] bnx2i: Added iSCSI text pdu support for iSCSI offload
This is part of an effort to support send target discovery via
the iSCSI offload path.
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Eddie Wai [Wed, 16 Feb 2011 21:04:29 +0000 (15:04 -0600)]
[SCSI] bnx2i: Added jumbo MTU support for the no shost case
For scenarios where the shost is not being passed to bnx2i for the
iSCSI offload connection request, the code would consult the routing
table to select the CNIC device.
This code path will erroneously error out if the corresponding L2
interface's MTU has been setup to > 1500.
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Eddie Wai [Wed, 16 Feb 2011 21:04:28 +0000 (15:04 -0600)]
[SCSI] bnx2i: Added support for the 57712(E) devices
Moved all PCI_DEVICE_ID_NX2_57712(E) definitions to pci_ids.h
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Acked-by: Michael Chan <mchan@broadcom.com> Acked-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Eddie Wai [Wed, 16 Feb 2011 21:04:27 +0000 (15:04 -0600)]
[SCSI] bnx2i: Added handling for unsupported iSCSI offload hba
The hba will now be unregistered and freed when iSCSI offload
is not supported by the NIC.
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Eddie Wai [Wed, 16 Feb 2011 21:04:26 +0000 (15:04 -0600)]
[SCSI] bnx2i: Fixed the 32-bit swapping of the LUN field for nopouts for 5771X
Fixed a bug where the 64-bit LUN field for nopouts were 32-bit swapped.
This only pertains to 5771X devices.
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Eddie Wai [Wed, 16 Feb 2011 21:04:25 +0000 (15:04 -0600)]
[SCSI] bnx2i: Allow ep CONNECT_FAILED condition to go through proper cleanup
Allow CNIC to go through the proper cleanup procedure for an endpoint
which failed to connect. Proper cleanup is necessary for the chip
to reset back to the initial state for the offloaded endpoint.
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
James Smart [Wed, 16 Feb 2011 17:40:15 +0000 (12:40 -0500)]
[SCSI] lpfc 8.3.21: Change lpfc driver version to 8.3.21
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, 16 Feb 2011 17:40:06 +0000 (12:40 -0500)]
[SCSI] lpfc 8.3.21: Debugfs additions
- Add the driver debugfs framework for supporting debugfs read and write
operations, and iDiag command structure.
- Add read and write to SLI4 device PCI config space registers.
- Add the driver support of debugfs PCI config space register bits set/clear
methods to the provided bitmask.
- Add iDiag driver support for SLI4 device queue diagnostic.
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, 16 Feb 2011 17:39:57 +0000 (12:39 -0500)]
[SCSI] lpfc 8.3.21: Initialization and user interface changes
- Make link speed not supported by port message an error message.
- Add support for new SLI failure codes add sysfs parameter to reflect the
security setting and current state.
- Add all lpfc module parameters to the /sys/modules/lpfc/parameters directory.
[jejb: fix up compile failure] 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, 16 Feb 2011 17:39:44 +0000 (12:39 -0500)]
[SCSI] lpfc 8.3.21: FC Discovery changes
FC Discovery changes
- Treat received PLOGI while logged in as a relogin (unregister and reregister).
- Added a timer to delay Nport discovery when clean bit is cleared and Fabric
portname/nodename/FCID is changed.
- Invalidate Port's DID when receiving PLOGI from p2p port with CONFIG_PORT
mailbox command.
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, 16 Feb 2011 17:39:35 +0000 (12:39 -0500)]
[SCSI] lpfc 8.3.21: RRQ Implementation fixes
RRQ Implementation fixes
- Added checks to prevent a call to findnode_did in clr_active_rrq
- Added the del_sync_timer call for the rrq_tmr to the stop_hba_timers routine.
- Added a check in __lpfc_set_active_rrq for the driver unloading to prevent
adding an rrq when the driver is being removed.
- Add code to scsi_iocb_cmpl to check for the remote stop and add the rrq.
- Added the same check to els retry.
- Added code to compare the source did in the els rrq to the vports did and
chose the right exchange ID.
- Initialize the start_cmd pointer to indicate when we have looped through
all of the scsi buffers.
- Remove the need for the lock around the clearing of the active bit in the
rrq.
- Added code to clean the els and fcp xri aborted list and remove the all of
the RRQs for a deleted vport.
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, 16 Feb 2011 17:39:24 +0000 (12:39 -0500)]
[SCSI] lpfc 8.3.21: Critical Errors and Bug Fixes
Critical Errors:
- Correctly handle non-zero return lpfc_workq_post_event and return ENOMEM
- Save the irq level when locking the host_lock in lpfc_findnode_did
Bug Fixes:
- Adjust payload_length and request_length for sli4_config mailbox commands.
- Add the freed sgl/XRI to the tail of the list rather than to the head.
- Set the FC_VPORT_NEEDS_INIT_VPI on vport deletes and check it before
issuing a fdisc on an els retry.
- Only call lpfc_hba_init_link() if phba->cfg_suppress_link_up
is LPFC_INITIALIZE_LINK.
- Add support for SLI-4 Performance Hints
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>
Dan Carpenter [Tue, 15 Feb 2011 21:33:13 +0000 (15:33 -0600)]
[SCSI] hpsa: fix bad comparison
'!' has higher precedence than '&'. CFGTBL_ChangeReq is 0x1 so the
original code is equivelent to if (!doorbell_value) {...
Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
[SCSI] hpsa: Do not attempt kdump if we detect resetting controller failed.
We can get completions left over from before the attempted reset which
will interfere with the kdump. Better to just not make the attempt in
that case.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
[SCSI] hpsa: Inform controller we are using 32-bit tags.
Controller will transfer only 32-bits on completion if it
knows we are only using 32-bit tags. Also, some newer controllers
apparently (and erroneously) require that we only use 32-bit tags,
and that we inform the controller of this.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
[SCSI] hpsa: make hpsa.hpsa_simple_mode=1 module parameter actually work
It's not enough to simple avoid putting the board into performant
mode, as we have to set up the interrupts differently, etc. When
I originally tested this module parameter, I tested it incorrectly
without realizing it, and the driver was running in performant mode
the whole time unbeknownst to me.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
[SCSI] ipr: Fix a race on multiple configuration changes
In a multiple configuration change scenario a remove notification can be
followed by an immediate add notification for the same device, which
will cause the device to be removed but never added back. This patch
fixes the problem by ensuring that in such situations the device will be
added back.
Signed-off-by: Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com> Acked-by: Brian King <brking@linux.vnet.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
James Bottomley [Sun, 23 Jan 2011 15:44:12 +0000 (09:44 -0600)]
[SCSI] libsas: convert to libata new error handler
The conversion is quite complex given that the libata new error
handler has to be hooked into the current libsas timeout and error
handling. The way this is done is to process all the failed commands
via libsas first, but if they have no underlying sas task (and they're
on a sata device) assume they are destined for the libata error
handler and send them accordingly.
Finally, activate the port recovery of the libata error handler for
each port known to the host. This is somewhat suboptimal, since that
port may not need recovering, but given the current architecture of
the libata error handler, it's the only way; and the spurious
activation is harmless.
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
James Bottomley [Sun, 23 Jan 2011 15:42:50 +0000 (09:42 -0600)]
[SCSI] libata: separate error handler into usable components
Right at the moment, the libata error handler is incredibly
monolithic. This makes it impossible to use from composite drivers
like libsas and ipr which have to handle error themselves in the first
instance.
The essence of the change is to split the monolithic error handler
into two components: one which handles a queue of ata commands for
processing and the other which handles the back end of readying a
port. This allows the upper error handler fine grained control in
calling libsas functions (and making sure they only get called for ATA
commands whose lower errors have been fixed up).
Cc: Tejun Heo <tj@kernel.org> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
James Bottomley [Sun, 23 Jan 2011 14:31:14 +0000 (08:31 -0600)]
[SCSI] libata: fix eh locking
The SCSI host eh_cmd_q should be protected by the host lock (not the
port lock). This probably doesn't matter that much at the moment,
since we try to serialise the add and eh pieces, but it might matter
in future for more convenient error handling. Plus this switches
libata to the standard eh pattern where you lock, remove from the cmd
queue to a local list and unlock and then operate on the local list.
Cc: Tejun Heo <tj@kernel.org> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
James Bottomley [Sun, 23 Jan 2011 14:30:00 +0000 (08:30 -0600)]
[SCSI] libata: fix locking for sas paths
For historical reasons, libsas uses the scsi host lock as the ata port
lock, and libata always uses the ata host. For the old eh, this was
largely irrelevant since the two locks were never mixed inside the
code. However, the new eh has a case where it nests acquisition of
the host lock inside the port lock (this does look rather deadlock
prone). Obviously this would be an instant deadlock if the port lock
were the host lock, so switch the libsas paths to use the ata host
lock as well.
Cc: Tejun Heo <tj@kernel.org> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
James Bottomley [Sun, 23 Jan 2011 14:28:33 +0000 (08:28 -0600)]
[SCSI] libata: plumb sas port scan into standard libata paths
The function ata_sas_port_init() has always really done its own thing.
However, as a precursor to moving to the libata new eh, it has to be
properly using the standard libata scan paths. This means separating
the current libata scan paths into pieces which can be shared with
libsas and pieces which cant (really just the async call and the host
scan).
Cc: Tejun Heo <tj@kernel.org> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Moger, Babu [Fri, 11 Feb 2011 22:14:08 +0000 (15:14 -0700)]
[SCSI] scsi_dh_rdac: fix for lun_table update for rdac device handler
During one of our testing, we noticed that mode select command sent
from the host did not have the lun_table updated.
Problem is root caused to the way lun table is updated. Lun table
update was done after the call to blk_rq_map_kern is made. This was
causing problem because kernel uses bounce buffer(bio_copy_kern) if
the address is not aligned. The command buffer updated after the
call(blk_rq_map_kern) was not going on the wire. Moved the code to
update the lun_table before the call to fix the problem.
Kashyap, Desai [Thu, 10 Feb 2011 06:21:24 +0000 (11:51 +0530)]
[SCSI] mptfusion: Remove bus reset for mptsas module
Bus reset is not required for SAS Controller. It is valid for mptspi
and mptfc, but for mptsas it is not required. It is an extra work for
Error handling escallation for mptsas. Removing bus reset from error
handling will eventually speedup Error handling for SAS controller.
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Kashyap, Desai [Thu, 10 Feb 2011 06:20:39 +0000 (11:50 +0530)]
[SCSI] mptfusion: Support SAS2.0 Devices with SAS1.0 Controllers
SAS1.0 Controller was not able to detect SAS2.0 Expanders due to Link
RATE detection was limited to 1.5 Gbps and 3.0 Gbps for SAS1
controllers. Added detection for 6.0 Gbps link. Now, user can mix-up
6.0 Gpbs links with SAS1.0 controller.
[SCSI] libfcoe: Move common code from fcoe to libfcoe module
To facilitate LLDDs to reuse the code, skb queue related functions are moved to
libfcoe, so that both fcoe and bnx2fc drivers can use them. The common structures
fcoe_port, fcoe_percpu_s are moved to libfcoe. fcoe_port will now have an
opaque pointer that points to corresponding driver's interface structure.
Also, fcoe_start_io and fcoe_fc_crc are moved to libfcoe.
As part of this change, fixed fcoe_start_io to return ENOMEM if
skb_clone fails.
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>
Tejun Heo [Sat, 29 Jan 2011 00:05:32 +0000 (16:05 -0800)]
[SCSI] fcoe: use dedicated workqueue instead of system_wq
fcoe uses the system_wq to destroy ports and the work items need to be
flushed before the driver is unloaded. As the work items free the
containing data structure, they can't be flushed directly. The
workqueue should be flushed instead.
Also, the destruction works can be chained - ie. destruction of a port
may lead to destruction of another port where the work item for the
former queues the work for the latter. Currently, the depth of chain
can be at most two and fcoe_exit() makes sure everything is complete
by calling flush_scheduled_work() twice.
With commit c8efcc25 (workqueue: allow chained queueing during
destruction), destroy_workqueue() can take care of chained works on
workqueue destruction. Add and use fcoe_wq instead. Simply
destroying fcoe_wq on driver unload takes care of flushing.
Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
This patch enables LLD to listen to rport events and perform LLD
specific operations based on the rport event. This patch also stores
sp_features and spp_type in rdata for further reference by LLD.
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>
Kiran Patil [Sat, 29 Jan 2011 00:05:22 +0000 (16:05 -0800)]
[SCSI] libfc: Extending lport's roles for target if there is a registered target.
Problem:
From initaitor machine, when queried role of target (other end of connection),
it is "initiator", hence SCSI-ml doesn't send any LUN Inquiry commands.
Fix:
If there is a registered target for FC_TYPE_FCP, extend lport's params
(capability) to be target as well, By default lport params are
INITIATOR only. Having this fix, caused initiator to send SCSI LUN
inquiry command to target.
Signed-off-by: Kiran Patil <kiran.patil@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Yi Zou [Sat, 29 Jan 2011 00:05:16 +0000 (16:05 -0800)]
[SCSI] fcoe: convert fcoe.ko to become an fcoe transport provider driver
Remove the existing sysfs entry points of the fcoe.ko module parameters that
are used to create/destroy/enable/disable an FCoE instance, rather, use the
newly added fcoe transport code to attach itself as an FCoE transport provider
when fcoe.ko gets loaded. There is no functionality change on the logic of
fcoe interacts with upper libfc and lower netdev. The fcoe transport only acts
as thin layer to provide a unified interface for all fcoe transport providers
so all FCoE instances on any network interfaces from all vendors can be
managed through the same Open-FCoE.org's user space tool package, which also
has full DCB support.
Signed-off-by: Yi Zou <yi.zou@intel.com> 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>
Yi Zou [Sat, 29 Jan 2011 00:05:11 +0000 (16:05 -0800)]
[SCSI] fcoe: prepare fcoe for using fcoe transport
Prepare the fcoe to convert it to use the newly added fcoe transport, making
it as the default fcoe transport provider for libfcoe. This patch is to rename
some of the variables to avoid any confusing names later as now there are
several transports in the same file.
Signed-off-by: Yi Zou <yi.zou@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Yi Zou [Sat, 29 Jan 2011 00:05:06 +0000 (16:05 -0800)]
[SCSI] libfcoe: include fcoe_transport.c into kernel libfcoe module
Now we can include the fcoe_transport.c to the build of the kernel libfcoe
module. Move the module information to fcoe_transport, and it will have
all the module parameters later for the create/destroy/enable/disable of an
FCoE instance.
Signed-off-by: Yi Zou <yi.zou@intel.com> 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>
Yi Zou [Sat, 29 Jan 2011 00:05:00 +0000 (16:05 -0800)]
[SCSI] libfcoe: rename libfcoe.c to fcoe_cltr.c for the coming fcoe_transport.c
The existing libfcoe.c is mostly for FIP support, rename it to reflect that
fact and so we can add fcoe_transport.c to the make file to include both
into the libfcoe kernel module.
[ Minor modifications by Robert Love converting a few
"__attribute__((packed))" modifiers to "__packed" to remove new
checkpatch.pl WARNINGS ]
Signed-off-by: Yi Zou <yi.zou@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Yi Zou [Sat, 29 Jan 2011 00:04:55 +0000 (16:04 -0800)]
[SCSI] libfcoe: add implementation to support fcoe transport
Add the new fcoe_transport.c file that implements basic fcoe transport
interface. Eventually, the sysfs entries to create/destroy/enable/disable
an FCoE instance will be coming to the fcoe transport layer, who does a
look-up to find the corresponding transport provide and pass the corresponding
action over to the identified provider.
The fcoe.ko will become the default fcoe transport provider that can support
FCoE on any given netdev interfaces, as the Open-FCoE.org's default software
FCoE HBA solution. Any vendor specific FCoE HBA driver that is built on top
of Open-FCoE's kernel stack of libfc & libfcoe as well as the user land tool
of fcoe-utils can easily plug-in and start running FCoE on their network
interfaces. The fcoe.ko will be converted to act as the default provider if
no vendor specific transport provider is found, as it is always added to the
very end of the list of attached transports.
Signed-off-by: Yi Zou <yi.zou@intel.com> 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>
Yi Zou [Sat, 29 Jan 2011 00:04:50 +0000 (16:04 -0800)]
[SCSI] libfcoe: add fcoe_transport structure defines to include/scsi/libfcoe.h
add the fcoe_transport struct to the common libfcoe.h header so all fcoe
transport provides can use it to attach itself as an fcoe transport. This
is the header part, and the next patch will be the transport code itself.
Signed-off-by: Yi Zou <yi.zou@intel.com> 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>
Kiran Patil [Sat, 29 Jan 2011 00:04:39 +0000 (16:04 -0800)]
[SCSI] libfc: Enhanced exchange ID selection mechanism and fix related EMA selection logic.
Problem:
In case of exchange responder case, EMA selection was defaulted to the
last EMA from EMA list (lport.ema_list). If exchange ID is selected
from offload pool and not setup DDP, resulting into incorrect
selection of EMA, and eventually dropping the packet because unable to
find exchange.
Fix:
Enhanced the exchange ID selection (depending upon request type and
exchange responder) Made necessary enhancement in EMA selection
algorithm.
Signed-off-by: Kiran Patil <kiran.patil@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Robert Love [Sat, 29 Jan 2011 00:04:29 +0000 (16:04 -0800)]
[SCSI] libfc: Remove usage of the Scsi_Host's host_lock
This patch removes the use of the Scsi_Host's host_lock
within fc_queuecommand. It also removes the DEF_SCSI_QCMD
usage so that libfc has fully moved on to the new
queuecommand interface.
Signed-off-by: Robert Love <robert.w.love@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Reviewed-by: Nicholas A. Bellinger <nab@linux-iscsi.org> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Joe Eykholt [Sat, 29 Jan 2011 00:04:23 +0000 (16:04 -0800)]
[SCSI] libfc: use PRLI hook to get parameters when sending outgoing PRLI
When sending an outgoing PRLI as an initiator, get the parameters
from registered providers so that they all get a chance to decide
on roles.
The passive provider is called last, and could override the
initiator role.
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 [Sat, 29 Jan 2011 00:04:18 +0000 (16:04 -0800)]
[SCSI] libfc: add hook to notify providers of local port changes
When an SCST provider is registered, it needs to know what
local ports are available for configuration as targets.
Add a notifier chain that is invoked when any local port
that is added or deleted.
Maintain a global list of local ports and add an
interator function that calls a given function for
every existing local port. This is used when first
loading a provider.
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 [Sat, 29 Jan 2011 00:04:13 +0000 (16:04 -0800)]
[SCSI] libfc: add local port hook for provider session lookup
The target provider needs a per-instance lookup table
or other way to lookup sessions quickly without going through
a linear list or serializing too much.
Add a simple void * array indexed by FC-4 type to the fc_lport.
Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Committed-by: Nicholas A. Bellinger <nab@linux-iscsi.org> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Joe Eykholt [Sat, 29 Jan 2011 00:04:08 +0000 (16:04 -0800)]
[SCSI] libfc: add method for setting handler for incoming exchange
Add a method for setting handler for incoming exchange.
For multi-sequence exchanges, this allows the target driver
to add a response handler for handling subsequent sequences,
and exchange manager resets.
The new function is called fc_seq_set_resp().
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 [Sat, 29 Jan 2011 00:04:02 +0000 (16:04 -0800)]
[SCSI] libfc: add hook for FC-4 provider registration
Allow FC-4 provider modules to hook into libfc, mostly for targets.
This should allow any FC-4 module to handle PRLI requests and maintain
process-association states.
Each provider registers its ops with libfc and then will be called for
any incoming PRLI for that FC-4 type on any instance. The provider
can decide whether to handle that particular instance using any method
it likes, such as ACLs or other configuration information.
A count is kept of the number of successful PRLIs from the remote port.
Providers are called back with an implicit PRLO when the remote port
is about to be deleted or has been reset.
fc_lport_recv_req() now sends incoming FC-4 requests to FC-4 providers,
and there is a built-in provider always registered for handling
incoming ELS requests.
The call to provider recv() routines uses rcu_read_lock()
so that providers aren't removed during the call. That lock is very
cheap and shouldn't affect any performance on ELS requests.
Providers can rely on the RCU lock to protect a session lookup as well.
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>
Randy Dunlap [Sat, 29 Jan 2011 00:03:57 +0000 (16:03 -0800)]
[SCSI] libfc: fix sparse static and non-ANSI warnings
Fix sparse warning for non-ANSI function declaration.
Declare workqueue structs as static.
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Robert Love <robert.w.love@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Vasu Dev [Sat, 29 Jan 2011 00:03:52 +0000 (16:03 -0800)]
[SCSI] fcoe: drop FCoE LOGO in FIP mode
Allowing FCoE LOGO followed by CVL in this case prevents
FIP login back to the FCF and then keeps lport offline,
only FIP LOGO and CLV needs to be processed while in
FIP mode, therefore this patch drops FCoE LOGO in FIP mode.
Added fcoe_filter_frames() to filter out above mentioned LOGO
in fcoe rx path along with other existing filtering in code
for bad CRC frames. Adding separate fcoe_filter_frames function
helped with better code indentations and if needed then same
will allow adding more filters at one place in future.
This LOGO drop is added after FCP frames passed up to avoid
any additional checks on fast path for this.
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>
Robert Love [Sat, 29 Jan 2011 00:03:47 +0000 (16:03 -0800)]
[SCSI] fcoe: Fix module reference count for vports
vports are not grabbing module references but are
releasing them. This causes the module reference count
to decrement too many times and it wraps around past 0.
The solution is to do a module_put() in
fcoe_interface_release() so that the reference is only
released when the fcoe_interface is released. There is a
one-to-one relationship between the N_Port and the
fcoe_interface, so the module reference will only be
dropped when the N_Port is destroyed
To create symetry in the code this patch moves the
try_module_get() call into fcoe_interface_create(). This
means that only the N_Port will grab a reference to the
module when its corresponding fcoe_interface is created.
This patch also makes it so that the fcoe_interface_create()
routine encodes any error codes in the fcoe_interface
pointer returned. This way its caller, fcoe_create(), can
return an accurate error code.
Signed-off-by: Robert Love <robert.w.love@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
[SCSI] fnic: Bumping up fnic version from 1.4.0.145 to 1.5.0.1.
Signed-off-by: Venkata Siva Vijayendra Bhamidipati <vbhamidi@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Dan Carpenter [Sat, 29 Jan 2011 00:03:31 +0000 (16:03 -0800)]
[SCSI] libfc:prevent dereferencing ERR_PTR in fc_tm_done()
If we goto out, then it tries to call kfree_skb() on an ERR_PTR which
will oops. Just return directly.
Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Hillf Danton [Sat, 29 Jan 2011 00:03:26 +0000 (16:03 -0800)]
[SCSI] libfc: Cleanup return paths in fc_rport_error_retry
This patch makes it so that we only have one call to
fc_rport_error. This patch does not completely
consolidate return statements, there is still one return
used when not calling fc_rport_error, but alternative
solutions made the code more confusing.
[ Patch modified by Robert Love ]
[ Patch title and commit message edited by Robert Love
to make it more relevant ]
Signed-off-by: Hillf Danton <dhillf@gmail.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Hillf Danton [Sat, 29 Jan 2011 00:03:21 +0000 (16:03 -0800)]
[SCSI] libfc: Return a valid return code in fc_fcp_pkt_abort()
Here ticks_left is added to record the result of
wait_for_completion_timeout().
[ Patch title and description edited by Robert Love
to make it more descriptive ]
Signed-off-by: Hillf Danton <dhillf@gmail.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Yi Zou [Sat, 29 Jan 2011 00:03:15 +0000 (16:03 -0800)]
[SCSI] libfc: always initialize the FCoE DDP exchange id for fsp as FC_XID_UNKNOWN
The fsp's xfer_ddp is used as indication of the exchange id for the DDPed
I/O. We should always initialize it as FC_XID_UNKNOWN for a newly allocated
fsp, otherwise the fsp allocated in fc_fcp, i.e., not from queuecommand like
LUN RESET that is not doing DDP may still think DDP is setup for it since xid
0 is valid and goes on to call fc_fcp_ddp_done() in fc_fcp_resp() from
fc_tm_done(). So, set xfer_ddp as FC_XID_UNKNOWN in fc_fcp_pkt_alloc() now.
Also removes the setting of fsp->lp as it's already done when fsp is allocated.
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>
DM now has more information about the nature of the underlying storage
failure. Path failure is avoided if a request failed due to a target
error. Instead the target error is immediately passed up the stack.
Discard requests that fail due to non-target errors may now be retried.
Errors restricted to the path will be retried or returned if no
paths are available, irregarding the no_path_retry setting.
Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Hannes Reinecke <hare@suse.de> Acked-by: Alasdair G Kergon <agk@redhat.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Hannes Reinecke [Tue, 18 Jan 2011 09:13:11 +0000 (10:13 +0100)]
[SCSI] Add detailed SCSI I/O errors
Instead of just passing 'EIO' for any I/O error we should be
notifying the upper layers with more details about the cause
of this error.
Update the possible I/O errors to:
- ENOLINK: Link failure between host and target
- EIO: Retryable I/O error
- EREMOTEIO: Non-retryable I/O error
- EBADE: I/O error restricted to the I_T_L nexus
'Retryable' in this context means that an I/O error _might_ be
restricted to the I_T_L nexus (vulgo: path), so retrying on another
nexus / path might succeed.
'Non-retryable' in general refers to a target failure, so this
error will always be generated regardless of the I_T_L nexus
it was send on.
I/O errors restricted to the I_T_L nexus might be retried
on another nexus / path, but they should _not_ be queued
if no paths are available.
Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Mike Snitzer [Tue, 25 Jan 2011 16:52:17 +0000 (11:52 -0500)]
[SCSI] scsi_dh_hp_sw: fix deadlock in start_stop_endio
The use of blk_execute_rq_nowait() implies __blk_put_request() is needed
in start_stop_endio() rather than blk_put_request() --
blk_finish_request() is called with queue lock already held.
Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Tejun Heo [Mon, 24 Jan 2011 13:57:29 +0000 (14:57 +0100)]
[SCSI] pm8001: simplify workqueue usage
pm8001 manages its own list of pending works and cancel them on device
free. It is unnecessarily complex and has a race condition - the
works are canceled but not synced, so the work could still be running
during and after the data structures are freed.
This patch simplifies workqueue usage.
* A driver specific workqueue pm8001_wq is created to serve these
work items.
* To avoid confusion, the "queue" suffixes are dropped from work items
and functions.
* Delayed queueing was never used. pm8001_work now uses work_struct
instead.
* The driver no longer keeps track of pending works. All pm8001_works
are queued to pm8001_wq and the workqueue is flushed as necessary.
flush_scheduled_work() usage is removed during conversion.
Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Jack Wang <jack_wang@usish.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Douglas Gilbert [Fri, 24 Dec 2010 02:40:37 +0000 (21:40 -0500)]
[SCSI] scsi_mid_low_api.txt recommend resid usage
As discussed in a thread on this list titled:
"RFC: short reads on block devices"
this patch adds recommendations for LLDs to set resid
when there might be uncertainty about how much data
has been returned by a device.
This patch inline and attached] is against scsi-misc-2.6.git
Signed-off-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Boaz Harrosh [Sun, 23 Jan 2011 15:53:24 +0000 (17:53 +0200)]
[SCSI] libosd: osd_req_read_sg, optimize the single entry case
Since sg-read is a bidi operation, it is a gain to convert
a single sg entry into a regular read. Better do this in the
generic layer then force each caller to do so.
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
James Bottomley [Sun, 23 Jan 2011 14:34:25 +0000 (08:34 -0600)]
[SCSI] libsas: remove spurious sata control register read/write
Originally, libata required the illusion that it could access the sata
control register. Now, however, it can run perfectly well without
them, so remove the dummy routines from libsas which tried to emulate
them (but only ended up causing confusion).
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
ATAPI check condition needs to be treated the same as a success or
protocol return. The register returns from the PACKET command are all
correctly positioned in the device to host register FIS and so we
should collect them properly. Right at the moment this doesn't matter
because libata sends a request sense always for ATAPI errors, but if
it ever checked the registers, we should have the correct contents
just in case.
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Peter Jones [Thu, 6 Jan 2011 20:38:24 +0000 (15:38 -0500)]
[SCSI] scsi_dh: Use scsi_devinfo functions to do matching of device_handler tables.
Previously we were using strncmp in order to avoid having to include
whitespace in the devlist, but this means "HSV1000" matches a device
list entry that says "HSV100", which is wrong. This patch changes
scsi_dh.c to use scsi_devinfo's matching functions instead, since they
handle these cases correctly.
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Eddie Wai [Sun, 9 Jan 2011 02:00:24 +0000 (18:00 -0800)]
[SCSI] bnx2i: Added reconnect fix connecting against Lefthand targets
The nopout's reserved field was not being initialized to zero
before being reused. Stale CDB values from previous SCSI cmds
of the same BHS offset was the cause of the disconnection
initiated by the Lefthand target.
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Vasiliy Kulikov [Fri, 7 Jan 2011 16:55:53 +0000 (10:55 -0600)]
[SCSI] hpsa: avoid leaking stack contents to userland
memset arg64 to zero in the passthrough ioctls to avoid leaking contents
of kernel stack memory to userland via uninitialized padding fields
inserted by the compiler for alignment reasons.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
[SCSI] hpsa: Use kernel provided PCI state save and restore functions
and use the doorbell reset method if available (which doesn't
lock up the controller if you properly save and restore all
the PCI registers that you're supposed to.)
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
After a reset, we should first wait for the board to become "not ready",
and then wait for it to become "ready", instead of immediately
waiting for it to become "ready", and do this waiting *after*
restoring PCI config space registers. Also, only wait 10 secs
for board to become "not ready" after a reset (it should quickly
become not ready.)
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Mike Snitzer [Wed, 5 Jan 2011 21:00:24 +0000 (16:00 -0500)]
[SCSI] scsi_dh_alua: add scalable ONTAP lun to dev list
Currently NetApp's VID/PID details in the INQUIRY response shows up as
'NETAPP' and 'LUN'. With upcoming scalable SAN ONTAP version on NetApp
controllers, the PID entry alone is being modified to 'LUN C-Mode' (to
distinguish current ONTAP LUNs from scalable ONTAP LUNs).
'LUN' would still suffice for matching 'LUN C-Mode' but best to
explicitly add these new NetApp LUNs to the device list.
Reported-by: Martin George <marting@netapp.com> Acked-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Ilgu Hong [Wed, 5 Jan 2011 21:00:23 +0000 (16:00 -0500)]
[SCSI] scsi_dh_alua: Add Promise VTrak to dev list
Adds Promise VTrak devices to the ALUA device handler.
Signed-off-by: Ilgu Hong <ilgu.hong@promise.com> Signed-off-by: Joseph Gruher <joseph.r.gruher@intel.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>