James Smart [Wed, 18 Nov 2009 20:41:10 +0000 (15:41 -0500)]
[SCSI] lpfc 8.3.6 : Hardware related fixes and changes
Hardware related Fixes and Changes.
- Added new Adapter IDs and update default Adapter names.
- Added PCI read after EQarm doorbell PCI write to flush the write
and avoid spurrious interrupts when in INTx mode.
- Phase out use of ONLINE registers.
- Fix for lost MSI interrupt
Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
James Smart [Wed, 18 Nov 2009 20:40:49 +0000 (15:40 -0500)]
[SCSI] lpfc 8.3.6 : Fix critical errors
Fix errors relating to crashes and hangs.
- Fix crash due to list corruption while unloading driver.
- Fix panic during pci-hot-plug testing.
- Fix panic when unmapping luns.
- Fixed total_scsi_bufs counting could cause exhausted memory.
- Fixed locking issue causing hang.
- Fixed the call from lpfc_new_scsi_buf_s3 to use lpfc_release_scsi_buf_s3.
Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
James Smart [Wed, 18 Nov 2009 20:40:23 +0000 (15:40 -0500)]
[SCSI] lpfc 8.3.6 : Fix AER issues
Fix AER issues.
- Made AER sysfs entry point return "Operation not permitted" to
OneConnect HBAs
- Stop and abort all I/Os on HBA for AER uncorrectable non-fatal error
handling
Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
James Smart [Wed, 18 Nov 2009 20:39:44 +0000 (15:39 -0500)]
[SCSI] lpfc 8.3.6 : FC Protocol Fixes
FC protocol fixes.
- Fix send sequence logic to handle multi SGL IOCBs.
- Fix FDISC completion always setting VPORT state to failed.
- Ported the fix on reporting of max_vpi to uppper layer.
- Fix incorrect number of Vports allowed to be created.
- Fixed Dead FCoE port after creating vports.
- Added handling of ELS request for Reinstate Recovery Qualifier (RRQ)
- Handle unsolicited CT exchange initiator receiving CT exchange ABTS
- Migrate LUN queue depth ramp up code to scsi mid-layer.
- Made ABTS WQE go to the same WQ as the WQE to be aborted.
- Fix Vport does not rediscover after FCF goes away.
- Fixed lpfc_unreg_vfi failure after devloss timeout.
- Fixed RPI bit leak.
- Fix hbq pointer corruption during target discovery.
Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
James Smart [Wed, 18 Nov 2009 20:39:16 +0000 (15:39 -0500)]
[SCSI] lpfc 8.3.6 : FCoE Protocol Fixes
FCoE Protocol fixes.
- Fixed FIP frame designation for ELS commands.
- Fix CVL received on Port 1 not processed by driver.
- Fix Zeroed frame on wire after FLOGI
- Fix vport keep-alive does not contain the correct WWN.
Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Randy Dunlap [Tue, 17 Nov 2009 22:53:20 +0000 (14:53 -0800)]
[SCSI] fix func names in kernel-doc
Fix scsi_devinfo.c kernel-doc function names to match actual function
names.
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Martin Michlmayr [Mon, 16 Nov 2009 18:49:25 +0000 (20:49 +0200)]
[SCSI] osd_protocol.h: Add missing #include
include/scsi/osd_protocol.h uses ALIGN() without an #include
<linux/kernel.h>, leading to:
| include/scsi/osd_protocol.h:362: error: implicit declaration of function 'ALIGN'
Signed-off-by: Martin Michlmayr <tbm@cyrius.com> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Cc: Stable Tree <stable@kernel.org> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Boaz Harrosh [Mon, 16 Nov 2009 18:48:38 +0000 (20:48 +0200)]
[SCSI] libosd: Error handling revamped
Administer some love to the osd_req_decode_sense function
* Fix a bad bug with osd_req_decode_sense(). If there was no scsi
residual, .i.e the request never reached the target, then all the
osd_sense_info members where garbage.
* Add grossly missing in/out_resid to osd_sense_info and fill them in
properly.
* Define an osd_err_priority enum which divides the possible errors into
7 categories in ascending severity. Each category is also assigned a
Linux return code translation.
Analyze the different osd/scsi/block returned errors and set the
proper osd_err_priority and Linux return code accordingly.
* extra check a few situations so not to get stuck with inconsistent
error view. Example an empty residual with an error code, and other
places ...
Lots of libosd's osd_req_decode_sense clients had this logic in some
form or another. Consolidate all these into one place that should
actually know about osd returns. Thous translating it to a more
abstract error.
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Boaz Harrosh [Mon, 16 Nov 2009 18:47:07 +0000 (20:47 +0200)]
[SCSI] libosd: bug in osd_req_decode_sense_full()
The (never tested) osd_sense_attribute_identification case
has never worked. The loop was never advanced on.
Fix it to work as intended.
On 10/30/2009 04:39 PM, Roel Kluin wrote:
I found this by code analysis, searching for while
loops that test a local variable, but do not modify
the variable.
Boaz Harrosh [Sun, 29 Nov 2009 14:26:45 +0000 (16:26 +0200)]
[SCSI] libosd: osd_dev_info: Unique Identification of an OSD device
Define an osd_dev_info structure that Uniquely identifies an OSD
device lun on the network. The identification is built from unique
target attributes and is the same for all network/SAN machines.
osduld_info_lookup() - NEW
New API that will lookup an osd_dev by its osd_dev_info.
This is used by pNFS-objects for cross network global device
identification. And by exofs multy-device support, the device
info is specified in the on-disk exofs device table.
osduld_device_info() - NEW
Given an osd_dev handle returns its associated osd_dev_info.
The ULD fetches this information at startup and hangs it on
each OSD device. (This is a fast operation that can be called
at any condition)
osduld_device_same() - NEW
With a given osd_dev at one hand and an osd_dev_info
at another, we would like to know if they are the same
device.
Two osd_dev handles can be checked by:
osduld_device_same(od1, osduld_device_info(od2));
osd_auto_detect_ver() - REVISED
Now returns an osd_dev_info structure. Is only called once
by ULD as before. See added comments for how to use.
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Boaz Harrosh [Sun, 29 Nov 2009 14:25:26 +0000 (16:25 +0200)]
[SCSI] osduld: Use device->release instead of internal kref
The true logic of this patch will be clear in the next patch where we
use the class_find_device() API. When doing so the use of an internal
kref leaves us a narrow window where a find is started while the actual
object can go away. Using the device's kobj reference solves this
problem because now the same kref is used for both operations. (Remove
and find)
Core changes
* Embed a struct device in uld_ structure and use device_register
instead of devie_create. Set __remove to be the device release
function.
* __uld_get/put is just get_/put_device. Now every thing is accounted
for on the device object. Internal kref is removed.
* At __remove() we can safely de-allocate the uld_ structure. (The
function has moved to avoid forward declaration)
Some cleanups
* Use class register/unregister is cleaner for this driver now.
* cdev ref-counting games are no longer necessary
I have incremented the device version string in case of new bugs.
Note: Previous bugfix of taking the reference around fput() still
applies.
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Boaz Harrosh [Mon, 16 Nov 2009 18:44:02 +0000 (20:44 +0200)]
[SCSI] osduld: Ref-counting bug fix
If scsi has released the device (logout), and exofs has last
reference on the osduld_device it will be freed by
osd_uld_release() within the call to fput(). But this will
oops in cdev_release() which is called after the fops->release.
(cdev is embedded within osduld_device). __uld_get/put pair
makes sure we have a cdev for the duration of fput()
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Boaz Harrosh [Mon, 16 Nov 2009 18:41:03 +0000 (20:41 +0200)]
[SCSI] libosd: osd_sense: OSD_CFO_PERMISSIONS
Add one more important cdb_field_offset that can be returned with
scsi_invalid_field_in_cdb. It is the offset of the permissions_bit_mask
field in the capabilities structure.
Interestingly, the offset is the same for V1/V2
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
This patch includes the following changes:
- Fixed Panic/Hang when using polling mode for fcp commands
- Added support for Read_rev mbox bits indicating FIP mode of HBA
- Optimize performance of slow-path handling of els responses
- Add code to cleanup orphaned unsolicited receive sequences
- Fixed Devloss timeout when multiple initiators are in same zone
Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
James Smart [Fri, 2 Oct 2009 19:16:51 +0000 (15:16 -0400)]
[SCSI] lpfc 8.3.5: fix sysfs parameters, vport creation and other bugs and update logging
This patch include the following fixes and changes:
- Fix crash when "error" is echoed to board_mode sysfs parameter
- Fix FCoE Parameter parsing in regions 23
- Fix driver crash when creating vport with large number of targets on SLI4
- Fix bug with npiv message being logged when it is not supported by the adapter
- Fix a potential dereferencing mailbox structure after free bug
- Fix firmware crash after vport create with high target count
- Error out requests to set board_mode to warm restart via sysfs on SLI4 HBAs
- Fix Block guard logging
- Fix a memory corruption issue during GID_FT IO prep
- Fix crash while processing unsolicited FC frames
- Fix failed to allocate XRI message is not a critical failure
- Update and fix formatting in some log messages
- Fix missing new line characters in log messages
- Removed the use of the locally defined FC transport layer related macros
- Check the rsplen in lpfc_handle_fcp_err function before using rsplen
Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
James Smart [Fri, 2 Oct 2009 19:16:45 +0000 (15:16 -0400)]
[SCSI] lpfc 8.3.5: fix VPI registration, error clean up and add support for vlink events
This patch includes the following fixes and new features:
- Fix mask size for CT field in WQE
- Fix VPI base not used when unregistering VPI on port 1.
- Fix UNREG_VPI mailbox command to unreg the correct VPI
- Fixed Check for aborted els command
- Fix error when trying to load driver with wrong firmware on FCoE HBA.
- Fix bug with probe_one routines not putting the Scsi_Host back upon error
- Add support for Clear Virtual Link Async Events
- Add support for unsolicited CT exchange sequence abort
- Add 0x0714 OCeXXXXX PCI ID
Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
James Smart [Fri, 2 Oct 2009 19:16:39 +0000 (15:16 -0400)]
[SCSI] lpfc 8.3.5: fix reset path, ELS ordering and discovery issues
This patch includes the following fixes:
- Fixed panic during HBA reset.
- Fixed FCoE event tag passed in resume_rpi.
- Fix out of order ELS commands
- Fixed discovery issues found during VLAN testing.
- Fix UNREG_VPI failure on extended link pull
- Fixed crash while processing unsolicited FC frames.
- Clear retry count in the delayed ELS handler
- Fixed discovery failure during quick link bounce.
Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Mike Christie [Wed, 11 Nov 2009 22:34:36 +0000 (16:34 -0600)]
[SCSI] libiscsi: hook into ramp up/down handling
It is rare to get a queue full with iscsi, because targets seem to
just reduce the iscsi cmd window. However, there is at least
one iscsi target that will throw a queue full when overloaded.
This hooks the iscsi code in to the ramp up/down code, so we
can handle it.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Mike Christie [Wed, 11 Nov 2009 22:34:33 +0000 (16:34 -0600)]
[SCSI] libiscsi: add warm target reset tmf support
This implements warm target reset tmf support for
the scsi-ml target reset callback. Previously we would
just drop the session in that callback. This patch will
now try a target reset and if that fails drop the session.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Mike Christie [Wed, 11 Nov 2009 22:34:32 +0000 (16:34 -0600)]
[SCSI] libiscsi: Check TMF state before sending PDU
Patch and mail from both MikeC and HannesR:
Before we're trying to send a PDU we have to check whether a TMF
is active. If so and if the PDU will be affected by the TMF
we should allow only Data-out PDUs to be sent.
If fast_abort is set, no Data-out PDUs will be sent while
a LUN reset is being processed for a affected LUN.
fast_abort is now ingored during a ABORT TASK tmf. We will not
send any Data-outs for a task if the task is being aborted.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Mike Christie [Wed, 11 Nov 2009 22:34:31 +0000 (16:34 -0600)]
[SCSI] libiscsi: fix login/text checks in pdu injection code
For some reason we used to check for the the immediate bit
set and the opcocde in many places instead of just masking
the opcode. In the passthrough code this is a problem
because userspace may or may not have set the immediate bit
and it does not have to. This fixes up the opcode checks
in the passthrough code, so we mask off the opcode then
check against the iscsi proto definition like is done in
other places.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Mike Christie [Wed, 11 Nov 2009 22:34:30 +0000 (16:34 -0600)]
[SCSI] bnx2i: use common iscsi suspend queue
This just has bnx2i use the iscsi_suspend_queue helper.
The suspend works as follows:
When ep_poll has succeeed iscsid will call conn_bind, the LLD will
then call iscsi_conn_bind which will clear the suspend bit.
When ep_disconnect is called (or if there is a conn error) we set
the suspend bit. For the ep_disconnect case I added a helper
in the previous kernel that will take the session lock to make sure
iscsi_queuecommand/xmit_task is not running and it will set
the suspend bit.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Acked-by: Anil Veerabhadrappa <anilgv@broadcom.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Takahiro Yasui [Tue, 10 Nov 2009 21:22:19 +0000 (16:22 -0500)]
[SCSI] scsi_devinfo: update Hitachi entries (v2)
Four models, OPEN-/DF400/DF500/DISK-SUBSYSTEM, can handle REPORT_LUN,
and the BLIST_REPORTLUN2 flag needs to be set. And DF600 doesn't require
any flags because it returns ANSI 03h (SPC).
Signed-off-by: Takahiro Yasui <tyasui@redhat.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Mike Christie [Thu, 5 Nov 2009 17:18:09 +0000 (11:18 -0600)]
[SCSI] fc class: fail fast bsg requests
If the port state is blocked and the fast io fail tmo has
fired then this patch will fail bsg requests immediately.
This is needed if userspace is sending IOs to test the transport
like with fcping, so it will not have to wait for the dev loss tmo.
With this patch he bsg req fast io fail code behaves like the normal
and sg io/passthrough fast io fail.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Acked-By: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
jack_wang [Thu, 5 Nov 2009 14:33:51 +0000 (22:33 +0800)]
[SCSI] pm8001: Fixes for tag alloc, error goto and code cleanup
Allocate right size for bitmap tag,fix error goto and cleanup print
message and undocable commemts. patch attached.
Signed-off-by: Lindar Liu <lindar_liu@usish.com> Signed-off-by: Jack Wang <jack_wang@usish.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
jack_wang [Thu, 5 Nov 2009 14:33:35 +0000 (22:33 +0800)]
[SCSI] pm8001: enhance IOMB process modules
We set interupt cascading count of outbound queue to get better
performance, correct some unnecessary return values and some noisy
print messages. patch attached.
Signed-off-by: Jack Wang <jack_wang@usish.com> Signed-off-by: Lindar Liu <lindar_liu@usish.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
jack_wang [Thu, 5 Nov 2009 14:32:31 +0000 (22:32 +0800)]
[SCSI] pm8001: add reinitialize SPC parameters before phy start
Signed-off-by: Jack Wang <jack_wang@usish.com> Signed-off-by: Lindar Liu <lindar_liu@usish.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
James Bottomley [Thu, 5 Nov 2009 19:33:12 +0000 (13:33 -0600)]
[SCSI] scsi_lib_dma: fix bug with dma maps on nested scsi objects
Some of our virtual SCSI hosts don't have a proper bus parent at the
top, which can be a problem for doing DMA on them
This patch makes the host device cache a pointer to the physical bus
device and provides an extra API for setting it (the normal API picks
it up from the parent). This patch also modifies the qla2xxx and lpfc
vport logic to use the new DMA host setting API.
Acked-By: James Smart <james.smart@emulex.com> Cc: Stable Tree <stable@kernel.org> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Roel Kluin [Tue, 3 Nov 2009 23:38:44 +0000 (00:38 +0100)]
[SCSI] qlogicpti: add missing parentheses
`+' has a higher precedence than `?' so the condition always
evaluates to true and this is preprocessed to `7*((ql) - 1)'
Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Joe Eykholt [Tue, 3 Nov 2009 19:50:21 +0000 (11:50 -0800)]
[SCSI] libfc fcoe: increase ELS and CT timeouts
The FC-LS spec. says ELS timeouts should be 2 x R_A_TOV.
The FC-GS spec. says CT timeouts should be 3 x R_A_TOV.
We've been using E_D_TOV for both of those.
Change for all ELS and CT requests except FLOGI, which we
leave at 2 seconds (using E_D_TOV). One could argue that
R_A_TOV is locally determined until after FLOGI succeeds.
This does change FLOGI for vports which becomes FDISC.
This does not change the REC/SRR timeout which is 2 seconds.
Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Vasu Dev [Tue, 3 Nov 2009 19:50:10 +0000 (11:50 -0800)]
[SCSI] libfc: fix an issue of pending exch/es after i/f destroyed or rmmod fcoe
All exches must be freed before its EM mempool destroyed in this
case but currently some exches could be still pending in their
scheduled delayed work after EM mempool is destroyed causing
this issue discussed and reported in this latest email thread:-
This patch fixes this issue by adding dedicated work queue thread
fc_exch_workqueue for exch delayed work and then flush this work
queue before destroying EM mempool.
The cancel_delayed_work_sync cannot be called during final
fc_exch_reset due to lport and exch locking ordering, so removes
related comment block not relevant any more with this patch.
Reported-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@suse.de>
Chris Leech [Tue, 3 Nov 2009 19:50:05 +0000 (11:50 -0800)]
[SCSI] libfc, fcoe: fixes for highmem skb linearize panics
There are cases outside of our control that may result in a transmit
skb being linearized in dev_queue_xmit. There are a couple of bugs
in libfc/fcoe that can result in a panic at that point. This patch
contains two fixes to prevent those panics.
1) use fast cloning instead of shared skbs with dev_queue_xmit
dev_queue_xmit doen't want shared skbuffs being passed in, and
__skb_linearize will BUG if the skb is shared. FCoE is holding an extra
reference around the call to dev_queue_xmit, so that when it returns an
error code indicating the frame has been dropped it can maintain it's
own backlog and retransmit. Switch to using fast skb cloning for this
instead.
2) don't append compound pages as > PAGE_SIZE skb fragments
fc_fcp_send_data will append pages from a scatterlist to the nr_frags[]
if the netdev supports it. But, it's using > PAGE_SIZE compound pages
as a single skb_frag. In the highmem linearize case that page will be
passed to kmap_atomic to get a mapping to copy out of, but
kmap_atomic will only allow access to the first PAGE_SIZE part.
The memcpy will keep going and cause a page fault once is crosses the
first boundary.
If fc_fcp_send_data uses linear buffers from the start, it calls
kmap_atomic one PAGE_SIZE at a time. That same logic needs to be
applied when setting up skb_frags.
Signed-off-by: Chris Leech <christopher.leech@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Yi Zou [Tue, 3 Nov 2009 19:49:59 +0000 (11:49 -0800)]
[SCSI] fcoe: Fix using VLAN ID in creating lport's WWWN/WWPN
If the underlying netdev is a VLAN device, make sure the VLAN ID is integrated
into the WWNN/WWPN name generation. Also added/updated the comments to reflect
this change.
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>
Mike Christie [Tue, 3 Nov 2009 19:49:54 +0000 (11:49 -0800)]
[SCSI] libfc: do not use DID_NO_CONNECT for pkt alloc failures.
DID_NO_CONNECT is not a nice value to use for pkt alloc failures,
because you can probably retry and IO will become available again.
For the device reset callout, we do not want to set the scsi command
result for the above reason, and because we do not need to set
the scsi_cmd->result in this path. We and other drivers do not set it
for success for example, and we do not set it for other failure.
And scsi-ml does not send every command through this path, and it is
not expecting us to use the scsi_cmnd struct like a cmd coming thruogh
queuecommand. I think it is more for storage in case we need a cmd
struct for a tmf and to give us certain params like the LUN.
Patch was made over scsi-misc today.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Yi Zou [Tue, 3 Nov 2009 19:49:49 +0000 (11:49 -0800)]
[SCSI] fcoe: Fix setting lport's WWNN/WWPN to use san mac address
We are still using netdev->dev_addr to generate lport's WWNN/WWPN even if the
LLD has support for NETDEV_HW_ADDR_T_SAN. Instead, we should just use the
fip->ctl_src_addr, which is the NETDEV_HW_ADDR_T_SAN if LLD supports it or it
is just the netdev->dev_addr if it does not.
Signed-off-by: Yi Zou <yi.zou@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Joe Eykholt [Tue, 3 Nov 2009 19:49:32 +0000 (11:49 -0800)]
[SCSI] fnic: enable bsg pass-thru for fcping
Add initialization of .bsg_request in the scsi_transport_fc
template so that fcping works.
Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Joe Eykholt [Tue, 3 Nov 2009 19:49:27 +0000 (11:49 -0800)]
[SCSI] libfc: register FC4 features with the FC switch
Customers and certification tests have pointed out that we don't
show up on the switch management software as an initiator.
On some MDS switches 'show fcns database' command shows libfc
initiators as 'fcp' not 'fcp:init' like other initiators.
On others switches, I think the switch gets the features by doing a PRLI,
but it may be only certain models or under certain configurations.
Fix this by registering our FC4 features with the RFF_ID CT request
after local port login and after the RFT_ID.
Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Joe Eykholt [Tue, 3 Nov 2009 19:49:22 +0000 (11:49 -0800)]
[SCSI] fnic: Add FIP support to the fnic driver
Use libfcoe as a common FIP implementation with fcoe.
FIP or non-FIP mode is fully automatic if the firmware
supports and enables it.
Even if FIP is not supported, this uses libfcoe for the non-FIP
handling of FLOGI and its response.
Use the new lport_set_port_id() notification to capture
successful FLOGI responses and port_id resets.
While transitioning between Ethernet and FC mode, all rx and
tx FC frames are queued. In Ethernet mode, all frames are
passed to the exchange manager to capture FLOGI responses.
Change to set data_src_addr to the ctl_src_addr whenever it
would have previously been zero because we're not logged in.
This seems safer so we'll never send a frame with a 0 source MAC.
This also eliminates a special case for sending FLOGI frames.
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>
There was a locking problem where the fip->lock was held during
the call to update_mac(). The rtnl_lock() must be taken before
the fip->lock, not the other way around. This fixes that.
Now that fcoe_ctlr_recv_flog() is called only from the response handler
to a FLOGI request, some checking can be eliminated. Instead of calling
update_mac(), just fill in the granted_mac address for the passed-in
frame (skb).
Eliminate the passed-in source MAC address since it is also in the skb.
Also, in fcoe, call fcoe_set_src_mac() directly instead of going thru
the fip function pointer. This will generate less code.
Then, since fip isn't needed for LOGO response, use lport as the arg.
Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Joe Eykholt [Tue, 3 Nov 2009 19:49:11 +0000 (11:49 -0800)]
[SCSI] libfc: add host number to lport link up/down messages.
The libfc link up/down messages don't indicate which port is changing.
The Port ID will often be 0.
Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Joe Eykholt [Tue, 3 Nov 2009 19:49:05 +0000 (11:49 -0800)]
[SCSI] libfc: add set_fid function to libfc template
This is to notify the LLD when an FC_ID is assigned to the local port.
The fnic driver needs to push the assigned FC_ID to firmware.
It currently does this by intercepting the FLOGI responses, and
in order to make that code more common with FIP and NPIV, it
makes more sense to wait until the local port has completely
handled the FLOGI or FDISC response. Also, when we fix
point-to-point FC_ID assignment, we'll need this callback as well.
Add a call to the libfc template, which is called whenever
the local port FC_ID is being assigned. It defaults to
fc_lport_set_fid(), supplied by libfc.
As additional benefit of this function, the LLD may determine
the MAC address that caused the change by looking at the received frame.
We also print the assigned port ID as long as it isn't 0.
Setting port ID to 0 happens often in reset while retrying FLOGI,
and would be uninteresting. This replaces the previous message
which didn't identify the host adapter instance.
patch v2 note: changed one word in a comment. "intercepted" -> "provided".
Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Joe Eykholt [Tue, 3 Nov 2009 19:49:00 +0000 (11:49 -0800)]
[SCSI] libfc: fix fc_els_resp_type to correct display of CT responses
Local port debug messages were using fc_els_resp_type() which showed
all CT responses as rejects.
Handle CT responses correctly based by inspecting fh_type.
I decided not to rename the function to keep the patch smaller.
We could call it just fc_resp_type() or fc_elsct_resp_type().
Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Joe Eykholt [Tue, 3 Nov 2009 19:48:55 +0000 (11:48 -0800)]
[SCSI] libfc: fix symbolic name registrations smashing skb data
The strncpy for RSPN_ID and RSNN_NN requests was padding
past the allocated frame size.
Get the string length before filling in the ct header.
Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Joe Eykholt [Tue, 3 Nov 2009 19:48:50 +0000 (11:48 -0800)]
[SCSI] libfc: fix RNN_ID smashing skb payload
The code that filled in the name server RNN_ID (register node name)
request had somehow gotten a line in it from the RFT_ID code
which copies 32 bytes of data over the relatively short payload.
This caused some corruption and hangs.
Simply deleted the extraneous line.
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>
john fastabend [Tue, 3 Nov 2009 19:48:44 +0000 (11:48 -0800)]
[SCSI] fcoe: add check to fail gracefully in bonding mode
This patch adds a check to fail gracefully when the netdevice
is bonded. Previously, the error was detected but the stack
would continue to load. This resulted in a partially enabled
fcoe intance and errors when the fcoe instance was destroy.
Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Joe Eykholt [Tue, 3 Nov 2009 19:48:32 +0000 (11:48 -0800)]
[SCSI] libfcoe: don't send ELS in FIP mode if no FCF selected
If link is up, but no FCF is selected, don't send any ELS frames.
This came up when an fnic received a multicast advertisement but
no solitited advertisments, so no FCF was selected. It tried
to send FLOGIs anyway.
Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Joe Eykholt [Tue, 3 Nov 2009 19:48:27 +0000 (11:48 -0800)]
[SCSI] libfcoe: FIP should report link to libfc whether selected or not
The fnic driver with FIP is reporting link up, even though it's down.
When the interface is shut down by the switch, we receive a clear
virtual link, and set the state reported to libfc as down, although
we still report it up. Clearly wrong. That causes the subsequent
link down event not to be reported, and /sys shows the host "Online".
Currently, in FIP mode, if an FCF times out, then link to libfc
is reported as down, to stop FLOGIs. That interferes with the LLD
link down being reported.
Users really need to know the physical link information, to diagnose
cabling issues, so physical link status should be reported to libfc.
If the selected FCF needs to be reported, that should be done
separately, in a later patch.
Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Joe Eykholt [Tue, 3 Nov 2009 19:48:22 +0000 (11:48 -0800)]
[SCSI] libfcoe: fip: allow FIP receive to be called from IRQ.
FIP's fcoe_ctlr_recv() function was previously only called from
the soft IRQ in FCoE. It's not performance critical and is more
convenient for some drivers to call it from the IRQ level. Just
Change to use skb_queue()/dequeue() which uses spinlock_irqsave
instead of separate locking with _bh locks.
Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Joe Eykholt [Tue, 3 Nov 2009 19:48:16 +0000 (11:48 -0800)]
[SCSI] libfcoe: fip: use SCSI host number to identify debug messages.
Use scsi host number to identify debug messages.
Previously, no instance information was given, so if multiple
ports were active, it became confusing. Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Joe Eykholt [Tue, 3 Nov 2009 19:48:11 +0000 (11:48 -0800)]
[SCSI] libfcoe: Allow FIP to be disabled by the driver
Allow FIP to be disabled by the driver for devices
that want to use libfcoe in non-FIP mode.
The driver merely sets the fcoe_ctlr mode to the state which
should be entered when the link comes up. The default is auto.
No change is needed for fcoe.c which uses auto mode.
Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Vasu Dev [Tue, 3 Nov 2009 19:48:06 +0000 (11:48 -0800)]
[SCSI] libfc: adds can_queue ramp up
Adds last_can_queue_ramp_down_time and updates this on every
ramp down. If last_can_queue_ramp_down_time is not zero then
do ramp up on any IO completion in added fc_fcp_can_queue_ramp_up.
Reset last_can_queue_ramp_down_time to zero once can_queue
is ramped up to added max_can_queue limit, this is to avoid any
more ramp up attempts on subsequent IO completion.
The ramp down and up are skipped for FC_CAN_QUEUE_PERIOD
to avoid infrequent changes to can_queue, this required
keeping track of ramp up time also in last_can_queue_ramp_up_time.
Adds code to ramp down can_queue if lp->qfull is set, with added
new ramp up code the can_queue will be increased after
FC_CAN_QUEUE_PERIOD, therefore it is safe to do ramp down
without fsp in this case and will avoid thrash. This required
fc_fcp_can_queue_ramp_down locking change so that it can be
called with Scsi_Host lock held.
Removes si->throttled and fsp state FC_SRB_NOMEM, not needed with
added ramp up code.
Signed-off-by: Vasu Dev <vasu.dev@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Vasu Dev [Tue, 3 Nov 2009 19:48:00 +0000 (11:48 -0800)]
[SCSI] libfc: reduce can_queue for all FCP frame allocation failures
Currently can_queue is reduced only if frame alloc fails
during fc_fcp_send_data but frame alloc can fail at several
other places in FCP data path and can_queue needs to be
reduced for any FCP frame alloc failure.
This patch adds fc_fcp_frame_alloc for all FCP frame allocations
and if fc_frame_alloc fails in fc_fcp_frame_alloc then reduce
can_queue in fc_fcp_frame_alloc, this will reduce can_queue for
all FCP frame alloc failures.
This required moving fc_fcp_reduce_can_queue up, to build without
adding its prototype. Also renamed fc_fcp_reduce_can_queue to
fc_fcp_can_queue_ramp_down.
Removes fc_fcp_reduce_can_queue calling from fc_fcp_recv since
not needed with added fc_fcp_frame_alloc reducing can_queue.
Signed-off-by: Vasu Dev <vasu.dev@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Vasu Dev [Tue, 3 Nov 2009 19:47:55 +0000 (11:47 -0800)]
[SCSI] fcoe, libfc: use single frame allocation API
Cleans up frame allocation APIs to have just single fc_frame_alloc API.
Removes _fc_frame_alloc, renames __fc_frame_alloc to _fc_frame_alloc.
Modifies fc_fcp_send_data for removed _fc_frame_alloc, fc_fcp_send_data
was the only user of removed _fc_frame_alloc.
Also Adds check in fc_frame_alloc to do mod by 4 for only non-zero
len value.
This patch is prep work to fix can_queue reducing in next patch.
Single fc_frame_alloc API helps in fixing can_queue reducing in
next patch.
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 [Tue, 3 Nov 2009 19:47:39 +0000 (11:47 -0800)]
[SCSI] libfc: Formatting cleanups across libfc
This patch makes a variety of cleanup changes to all libfc files.
This patch adds kernel-doc headers to all functions lacking them
and attempts to better format existing headers. It also add kernel-doc
headers to structures.
This patch ensures that the current naming conventions for local ports,
remote ports and remote port private data is upheld in the following
manner.
Steve Ma [Tue, 3 Nov 2009 19:47:34 +0000 (11:47 -0800)]
[SCSI] libfc, fcoe: Add FC passthrough support
This is the Open-FCoE implementation of the FC
passthrough support via bsg interface.
Passthrough support is added to both N_Ports and
VN_Ports.
Signed-off-by: Steve Ma <steve.ma@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Robert Love [Tue, 3 Nov 2009 19:47:28 +0000 (11:47 -0800)]
[SCSI] libfc: Add routine to copy data from a buffer to a SG list
When handling the multi-frame responses of fc pass-thru requests,
a code segment similar to fc_fcp_recv_data (routine to receive
inbound SCSI data) is used in the response handler. This patch
is to add a routine, called fc_copy_buffer_to_sglist(), to handle
the common function of copying data from a buffer to a scatter-
gather list in order to avoid code duplication.
Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Chris Leech [Tue, 3 Nov 2009 19:47:18 +0000 (11:47 -0800)]
[SCSI] fcoe: vport symbolic name support
Allow a vport specific string to be appended to the port symbolic
name. The new symbolic name is sent to the name server after it
is set.
This currently messes with libhbalinux, which is looking for
the fcoe "fcoe <ver> over <ethX>" string and expects whatever
comes after the "over" to be a network interface name only.
Adds an EXPORT_SYMBOL to libfc for fc_frame_alloc_fill, which is
needed to allow fcoe to allocate a frame of variable length for
the RSPN request.
Signed-off-by: Chris Leech <christopher.leech@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Chris Leech [Tue, 3 Nov 2009 19:47:12 +0000 (11:47 -0800)]
[SCSI] libfc: combine name server registration request functions
Signed-off-by: Chris Leech <christopher.leech@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Chris Leech [Tue, 3 Nov 2009 19:47:07 +0000 (11:47 -0800)]
[SCSI] libfc: combine name server registration response handlers
They all do the same thing, so combine them into a single function.
Signed-off-by: Chris Leech <christopher.leech@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Chris Leech [Tue, 3 Nov 2009 19:47:01 +0000 (11:47 -0800)]
[SCSI] libfc: Register Symbolic Port Name (RSPN_ID)
Register the fc_host symbolic name as the symbolic port name
with the fabric name server.
Signed-off-by: Chris Leech <christopher.leech@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Chris Leech [Tue, 3 Nov 2009 19:46:56 +0000 (11:46 -0800)]
[SCSI] libfc: Register Symbolic Node Name (RSNN_NN)
Register the fc_host symbolic name as the symbolic node name
with the fabric name server.
Signed-off-by: Chris Leech <christopher.leech@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Chris Leech [Tue, 3 Nov 2009 19:46:51 +0000 (11:46 -0800)]
[SCSI] libfc: RNN_ID may be required before RSNN_NN with some switches
One could interpret FC-GS-5 to say that an explicit RNN_ID is required
before RSNN_NN is allowed to succeed, which is why RNN_ID was not obsoleted
along with RPN_ID acording to this document:
ftp://ftp.t11.org/t11/member/fc/gs-5/05-546v2.pdf
Signed-off-by: Chris Leech <christopher.leech@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Chris Leech [Tue, 3 Nov 2009 19:46:46 +0000 (11:46 -0800)]
[SCSI] libfc: RPN_ID is obsolete and unnecessary
RPN_ID has been obsolete per FC-GS-5 for several years. The port name is
registered implicitly as part of FLOGI, and it is undesirable for ports to
change a registered port name using RPN_ID while logged into the fabric.
Signed-off-by: Chris Leech <christopher.leech@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Chris Leech [Tue, 3 Nov 2009 19:46:40 +0000 (11:46 -0800)]
[SCSI] fcoe: NPIV vport create/destroy
Add NPIV vport create and destroy handlers and register them with the
FC transport.
Signed-off-by: Chris Leech <christopher.leech@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Chris Leech [Tue, 3 Nov 2009 19:46:34 +0000 (11:46 -0800)]
[SCSI] fcoe: add a separate scsi transport template for NPIV vports
Right now it's exactly the same as the physical port template,
and there is no way to create a port on anything other than the
netdev. When the vport_create entry point gets hooked up it will
create lports on top of vport devices, which will use this.
Rename scsi_transport_fcoe_sw to fcoe_transport_template to be more
clear with naming now that there are two templates.
Signed-off-by: Chris Leech <christopher.leech@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Chris Leech [Tue, 3 Nov 2009 19:46:29 +0000 (11:46 -0800)]
[SCSI] libfcoe, fcoe: libfcoe NPIV support
The FIP code in libfcoe needed several changes to support NPIV
1) dst_src_addr needs to be managed per-n_port-ID for FPMA fabrics with NPIV
enabled. Managing the MAC address is now handled in fcoe, with some slight
changes to update_mac() and a new get_src_addr() function pointer.
2) The libfc elsct_send() hook is used to setup FCoE specific response
handlers for FIP encapsulated ELS exchanges. This lets the FCoE specific
handling know which VN_Port the exchange is for, and doesn't require
tracking OX_IDs. It might be possible to roll back to the full FIP frame
in these, but for now I've just stashed the contents of the MAC address
descriptor in the skb context block for later use. Also, because
fcoe_elsct_send() just passes control on to fc_elsct_send(), all transmits
still come through the normal frame_send() path.
3) The NPIV changes added a mutex hold in the keep alive sending, the lport
mutex is protecting the vport list. We can't take a mutex from a timer,
so move the FIP keep alive logic to the link work struct.
Signed-off-by: Chris Leech <christopher.leech@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Chris Leech [Tue, 3 Nov 2009 19:46:24 +0000 (11:46 -0800)]
[SCSI] libfc, libfcoe: FDISC ELS for NPIV
Add FDISC ELS handling to libfc and libfcoe, treat it the same as FLOGI where
appropriate.
Add checking for NPIV support in the FLOGI LS_ACC service parameters.
Signed-off-by: Chris Leech <christopher.leech@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Chris Leech [Tue, 3 Nov 2009 19:46:19 +0000 (11:46 -0800)]
[SCSI] libfc: vport link handling and fc_vport state managment
NPIV vports are managed in libfc by changing their virtual link state
when the parent N_Ports internal state changes. The vport link is only
online when the N_Port is in a ready state (logged into the fabric).
vport_state is updated as needed in this patch as well, currently the states
LINKDOWN, INITIALIZING, ACTIVE, DSIABLED, and NO_FABRIC_SUPP are used.
This also changes the fc_host port_state handling to differentiate between
LINKDOWN and OFFLINE.
Signed-off-by: Chris Leech <christopher.leech@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Chris Leech [Tue, 3 Nov 2009 19:46:14 +0000 (11:46 -0800)]
[SCSI] libfc: add some generic NPIV support routines to libfc
Adds a function to create a new VN_Port instances, which share the EM
list with the N_Port, VN_Port lookup by fabric ID when responding to a new
request (otherwise the exchange lookup from the N_Ports EM list is trusted to
return an exchange with a cached lport value for the correct VN_Port),
a pointer to a fc_vport structure for VN_Ports, and flags to indicate if an
N_Port supports NPIV and if the switch/fabric allows it.
Signed-off-by: Chris Leech <christopher.leech@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Chris Leech [Tue, 3 Nov 2009 19:46:08 +0000 (11:46 -0800)]
[SCSI] libfc: changes to libfc_host_alloc to consolidate initialization with allocation
I'd like to keep basic initialization together with allocation, which means
this can't just be a tail-call to scsi_host_alloc.
This is needed to create a generic libfc host allocation routine for NPIV
VN_Ports, which will share the exchange ID space (through sharing exchange
manager structures) with the parent lport. In order to clone the exchange
manager list when the lport is allocated, the list head must be initialized
earlier.
Also, update fnic to use the libfc_host_alloc so that later changes do not break
it. (contribution by Joe Eykholt)
Signed-off-by: Chris Leech <christopher.leech@intel.com> 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>
Robert Love [Tue, 3 Nov 2009 19:46:03 +0000 (11:46 -0800)]
[SCSI] libfc: Move libfc_init and libfc_exit to fc_libfc.c
These routines are for the libfc kernel module and should be in
the libfc .c file.
Moving the libfc __init routine into fc_libfc.c caused the creation
of the fc_setup_fcp() and fc_destroy_fcp() routines so that
scsi_pkt_cachep was not exposed outside of fc_fcp.c.
Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Robert Love [Tue, 3 Nov 2009 19:45:58 +0000 (11:45 -0800)]
[SCSI] libfc: Add libfc/fc_libfc.[ch] for libfc internal routines
include/scsi/libfc.h is currently loaded with common code
shared between libfc's sub-modules as well as shared between
libfc and fcoe. Previous patches attempted to move out
non-common code. This patch creates two files for common
libfc routines that will not be shared with fcoe, fnic or
any other LLDs.
Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Robert Love [Tue, 3 Nov 2009 19:45:47 +0000 (11:45 -0800)]
[SCSI] libfc: Move non-common routines and prototypes out of libfc.h
This patch moves all non-common routines and function prototypes
out of libfc.h and into the appropriate .c files. It makes these
routines 'static' when necessary and removes any unnecessary EXPORT_SYMBOL
statements.
A result of moving the fc_exch_seq_send, fc_seq_els_rsp_send, fc_exch_alloc
and fc_seq_start_next prototypes out of libfc.h is that they were no longer
being imported into fc_exch.c when libfc.h was included. This caused errors
where routines in fc_exch.c were looking for undefined symbols. To fix this
this patch reorganizes fc_seq_alloc, fc_seq_start_next and
fc_seq_start_next_locked. This move also made it so that
fc_seq_start_next_locked did not need to be prototyped at the top of
fc_exch.c.
Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
[SCSI] fnic: Allocate OS interrupt resources just before enabling interrupts
The OS interrupt vectors were getting allocated before the interrupt
resources were mapped from hardware. For Legacy interrupts, since
they are shared with other devices, as soon as an interrupt is
registered with the OS, it can fire while the fnic isr resource is
still unmapped. This can cause crash because of access to unmapped resources.
For MSIX and MSI, since interrupts are not shared with other devices,
this problem didnt happen, because the interrupt is enabled as the last
step before returning from _probe. For Legacy however, since the
interrupt is shared, the handler can be called as soon as it is registered.
Solution is to register interrupt handlers with OS as last step before
enabling device interrupts.
Signed-off-by: Abhijeet Joglekar <abjoglek@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Douglas Gilbert [Thu, 29 Oct 2009 05:48:31 +0000 (01:48 -0400)]
[SCSI] scsi_debug: fix Thin provisioning support
While testing scsi_debug with these patches I found a
problem with the Block Limits VPD page function. The
length returned by the inquiry_evpd_b0() function was
too short. A patch to fix that and a cosmetic change
(that the form factor of scsi_debug is less than 1.8
inches) is attached.
Signed-off-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Alok Kataria [Tue, 13 Oct 2009 21:51:05 +0000 (14:51 -0700)]
[SCSI] vmw_pvscsi: SCSI driver for VMware's virtual HBA.
This is a driver for VMware's paravirtualized SCSI device,
which should improve disk performance for guests running
under control of VMware hypervisors that support such devices.
Signed-off-by: Alok N Kataria <akataria@vmware.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>