aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi (follow)
AgeCommit message (Collapse)AuthorFilesLines
2009-12-04[SCSI] libosd: osd_dev_info: Unique Identification of an OSD deviceBoaz Harrosh1-4/+34
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>
2009-12-04[SCSI] osduld: Use device->release instead of internal krefBoaz Harrosh1-1/+0
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>
2009-12-04[SCSI] libosd: osd_sense: OSD_CFO_PERMISSIONSBoaz Harrosh1-0/+3
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>
2009-12-04[SCSI] libosd: osd_dev_is_ver1 - Minor API cleanupBoaz Harrosh1-6/+10
define a new osd_dev_is_ver1 that operates on devices and the old osd_req_is_ver1 uses that new API. Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-12-04[SCSI] libiscsi: add warm target reset tmf supportMike Christie2-0/+4
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>
2009-12-04[SCSI] libiscsi: Check TMF state before sending PDUMike Christie1-0/+2
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>
2009-12-04[SCSI] scsi_lib_dma: fix bug with dma maps on nested scsi objectsJames Bottomley1-1/+15
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>
2009-12-04[SCSI] libfc: register FC4 features with the FC switchJoe Eykholt4-1/+32
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>
2009-12-04[SCSI] libfcoe: fcoe: simplify receive FLOGI responseJoe Eykholt1-1/+1
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>
2009-12-04[SCSI] libfc: add set_fid function to libfc templateJoe Eykholt1-0/+20
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>
2009-12-04[SCSI] libfc: fix symbolic name registrations smashing skb dataJoe Eykholt1-8/+9
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>
2009-12-04[SCSI] libfc: fix RNN_ID smashing skb payloadJoe Eykholt1-1/+0
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>
2009-12-04[SCSI] libfcoe: FIP should report link to libfc whether selected or notJoe Eykholt1-0/+1
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>
2009-12-04[SCSI] libfcoe: Allow FIP to be disabled by the driverJoe Eykholt1-0/+2
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>
2009-12-04[SCSI] fcoe, libfc: use single frame allocation APIVasu Dev1-13/+3
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>
2009-12-04[SCSI] libfcoe: formatting and comment cleanupsRobert Love1-42/+42
Ensures that there are kernel-doc style comments for all routines and structures. There were also a few instances of fc_lport's named 'lp' which were switched to 'lport' as per the libfc/libfcoe/fcoe naming convention. Also, emacs 'indent-region' and 'tabify' were ran on libfcoe.c. Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-12-04[SCSI] libfc: Formatting cleanups across libfcRobert Love1-489/+505
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. struct instance (i.e. variable name) -------------------------------------------------- fc_lport lport fc_rport rport fc_rport_libfc_priv rpriv fc_rport_priv rdata I also renamed dns_rp and ptp_rp to dns_rdata and ptp_rdata respectively. I used emacs 'indent-region' and 'tabify' on all libfc files to correct spacing alignments. I feel sorry for anyone attempting to review this patch. Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-12-04[SCSI] libfc, fcoe: Add FC passthrough supportSteve Ma1-0/+7
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>
2009-12-04[SCSI] libfc: Export FC headersRobert Love6-0/+13
Export fc_els.h, fc_fs.h, fc_gs.h and fc_ns.h so that they may be used by applications. This will be needed for FC Passthrough applications like fcping, but could be used by other applications. Fix to include <linux/types.h> to exported files provided 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>
2009-12-04[SCSI] libfc: Register Symbolic Port Name (RSPN_ID)Chris Leech3-0/+22
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>
2009-12-04[SCSI] libfc: Register Symbolic Node Name (RSNN_NN)Chris Leech3-0/+21
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>
2009-12-04[SCSI] libfc: RNN_ID may be required before RSNN_NN with some switchesChris Leech2-2/+3
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>
2009-12-04[SCSI] libfc: RPN_ID is obsolete and unnecessaryChris Leech1-1/+0
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>
2009-12-04[SCSI] libfcoe, fcoe: libfcoe NPIV supportChris Leech3-5/+23
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>
2009-12-04[SCSI] libfc, libfcoe: FDISC ELS for NPIVChris Leech2-1/+32
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>
2009-12-04[SCSI] libfc: vport link handling and fc_vport state managmentChris Leech1-0/+8
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>
2009-12-04[SCSI] libfc: add some generic NPIV support routines to libfcChris Leech1-0/+20
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>
2009-12-04[SCSI] libfc: changes to libfc_host_alloc to consolidate initialization with allocationChris Leech1-3/+12
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>
2009-12-04[SCSI] libfc: Add libfc/fc_libfc.[ch] for libfc internal routinesRobert Love1-79/+0
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>
2009-12-04[SCSI] libfc: Remove fc_fcp_completeRobert Love1-8/+0
This function is never used, let's remove it. Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-12-04[SCSI] libfc: Move non-common routines and prototypes out of libfc.hRobert Love1-49/+0
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>
2009-12-04[SCSI] scsi_transport_fc: Introduce helper function for blocking scsi_ehChristof Schmitt1-0/+1
Move the duplicated code from FC LLDs to SCSI FC transport class. Acked-by: James Smart <james.smart@emulex.com> Acked-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Acked-by: Abhijeet Joglekar <abjoglek@cisco.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-12-04[SCSI] scsi_dh: Change the scsidh_activate interface to be asynchronousChandra Seetharaman2-3/+6
Make scsi_dh_activate() function asynchronous, by taking in two additional parameters, one is the callback function and the other is the data to call the callback function with. Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-12-04[SCSI] add queue_depth ramp up codeVasu Dev1-3/+6
Current FC HBA queue_depth ramp up code depends on last queue full time. The sdev already has last_queue_full_time field to track last queue full time but stored value is truncated by last four bits. So this patch updates last_queue_full_time without truncating last 4 bits to store full value and then updates its only current usages in scsi_track_queue_full to ignore last four bits to keep current usages same while also use this field in added ramp up code. Adds scsi_handle_queue_ramp_up to ramp up queue_depth on successful completion of IO. The scsi_handle_queue_ramp_up will do ramp up on all luns of a target, just same as ramp down done on all luns on a target. The ramp up is skipped in case the change_queue_depth is not supported by LLD or already reached to added max_queue_depth. Updates added max_queue_depth on every new update to default queue_depth value. The ramp up is also skipped if lapsed time since either last queue ramp up or down is less than LLD specified queue_ramp_up_period. Adds queue_ramp_up_period to sysfs but only if change_queue_depth is supported since ramp up and queue_ramp_up_period is needed only in case change_queue_depth is supported first. Initializes queue_ramp_up_period to 120HZ jiffies as initial default value, it is same as used in existing lpfc and qla2xxx. -v2 Combined all ramp code into this single patch. -v3 Moves max_queue_depth initialization after slave_configure is called from after slave_alloc calling done. Also adjusted max_queue_depth check to skip ramp up if current queue_depth is >= max_queue_depth. -v4 Changes sdev->queue_ramp_up_period unit to ms when using sysfs i/f to store or show its value. Signed-off-by: Vasu Dev <vasu.dev@intel.com> Tested-by: Christof Schmitt <christof.schmitt@de.ibm.com> Tested-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-12-04[SCSI] modify change_queue_depth to take in reason why it is being calledMike Christie4-4/+12
This patch modifies scsi_host_template->change_queue_depth so that it takes an argument indicating why it is being called. This will be used so that if a LLD needs to do some extra processing when handling queue fulls or later ramp ups, it can do so. This is a simple port of the drivers setting a change_queue_depth callback. In the patch I just have these LLDs adjust the queue depth if the user was requesting it. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> [Vasu.Dev: v2 Also converted pmcraid_change_queue_depth and then verified all modules compile using "make allmodconfig" for any new build warnings on X86_64. Updated original description after combing two original patches from Mike to make this patch git bisectable.] Signed-off-by: Vasu Dev <vasu.dev@intel.com> [jejb: fixed up 53c700] Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-12-04[SCSI] libfc: fix free of fc_rport_priv with timer pendingJoe Eykholt1-0/+1
Timer crashes were caused by freeing a struct fc_rport_priv with a timer pending, causing the timer facility list to be corrupted. This was during FC uplink flap tests with a lot of targets. After discovery, we were doing an PLOGI on an rdata that was in DELETE state but not yet removed from the lookup list. This moved the rdata from DELETE state to PLOGI state. If the PLOGI exchange allocation failed and needed to be retried, the timer scheduling could race with the free being done by fc_rport_work(). When fc_rport_login() is called on a rport in DELETE state, move it to a new state RESTART. In fc_rport_work, when handling a LOGO, STOPPED or FAILED event, look for restart state. In the RESTART case, don't take the rdata off the list and after the transport remote port is deleted and exchanges are reset, re-login to the remote port. Note that the new RESTART state also corrects a problem we had when re-discovering a port that had moved to DELETE state. In that case, a new rdata was created, but the old rdata would do an exchange manager reset affecting the FC_ID for both the new rdata and old rdata. With the new state, the new port isn't logged into until after any old exchanges are reset. 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>
2009-12-04[SCSI] libfc: Fix frags in frame exceeding SKB_MAX_FRAGS in fc_fcp_send_dataYi Zou1-0/+3
In case of sequence offload, in fc_fcp_send_data(), the skb_fill_page_info() called may end up adding more frags to the skb_shinfo(fp_skb(fp))->frags[], exceeding SKB_MAX_FRAGS, this eventually corrupts the memory. I am adding the FR_FRAME_SG_LEN back, but as SKB_MAX_FRAGS -1, leaving 1 for our fcoe_eof_crc page. And send will be broken into multiple large sends if the frame already contains more frags than skb handle. 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>
2009-12-04[SCSI] libfc: removes unused disc_work and ex_listVasu Dev1-1/+0
Reported-by: Alex Lyakas <alexl@mellanox.co.il> 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>
2009-12-04[SCSI] scsi: Add missing command definitionsMartin K. Petersen1-0/+4
Add definitions for UNMAP, WRITE SAME{16,32} and GET LBA STATUS commands. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-10-02[SCSI] libiscsi: iscsi_session_setup to allow for private spaceJayamohan Kallickal1-1/+2
This patch contains changes that allow iscsi_session_setup to allocate private space for LLD's Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com> Acked-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-10-02[SCSI] sd: Support disks formatted with DIF Type 2Martin K. Petersen1-0/+3
Disks formatted with DIF Type 2 reject READ/WRITE 6/10/12/16 commands when protection is enabled. Only the 32-byte variants are supported. Implement support for issusing 32-byte READ/WRITE and enable Type 2 drives in the protection type detection logic. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-10-02[SCSI] sd: Detach DIF from block integrity infrastructureMartin K. Petersen1-4/+11
So far we have only issued DIF commands if CONFIG_BLK_DEV_INTEGRITY is enabled. However, communication between initiator and target should be independent of protection information DMA. There are DIF-only host adapters coming out that will be able to take advantage of this. Move the relevant DIF bits to sd.c. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-10-02[SCSI] Deprecate SCSI_PROT_*_CONVERT operationsMartin K. Petersen1-4/+0
The checksum format is orthogonal to whether the protection information is being passed on beyond the HBA or not. It is perfectly valid to use a non-T10 CRC with WRITE_STRIP and READ_INSERT. Consequently it no longer makes sense to explicitly refer to the conversion in the protection operation. Update sd_dif and lpfc accordingly. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Acked-by: Ihab Hamadi <Ihab.Hamadi@Emulex.Com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-09-21trivial: remove unnecessary semicolonsJoe Perches1-2/+1
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-09-12[SCSI] libiscsi, bnx2i: make bound ep check commonMike Christie1-0/+1
bnx2i currently has a check for if a ep is properly bound, so if iscsi_queuecommand/xmit_task is called while there is no ep we will not queue IO. be2iscsi sends IO from queuecommand/xmit_task like how bnx2i does and needs a similar test. This patch has us just use the suspend_bit test for this. 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 am adding a helper in this patch 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> Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-09-12[SCSI] libiscsi: add completion function for drivers that do not need pdu processingMike Christie1-0/+2
beiscsi does not need the iscsi scsi cmd processing. It does not even get this info on the completion path. This adds a function to just update the sequencing numbers and complete a task. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-09-10[SCSI] libfc: send GPN_ID in reaction to single-port RSCNs.Joe Eykholt1-2/+14
When an RSCN indicates changes to individual remote ports, don't blindly log them out and then back in. Instead, determine whether they're still in the directory, by doing GPN_ID. If that is successful, call login, which will send ADISC and reverify, otherwise, call logoff. Perhaps we should just delete the rport, not send LOGO, but it seems safer. Also, fix a possible issue where if a mix of records in the RSCN cause us to queue disc_ports for disc_single and then we decide to do full rediscovery, we leak memory for those disc_ports queued. So, go through the list of disc_ports even if doing full discovery. Free the disc_ports in any case. If any of the disc_single() calls return error, do a full discovery. The ability to fill in GPN_ID requests was added to fc_ct_fill(). For this, it needs the FC_ID to be passed in as an arg. The did parameter for fc_elsct_send() is used for that, since the actual D_DID will always be 0xfffffc for all CT requests so far. 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>
2009-09-10[SCSI] libfc: use ADISC to verify rport login stateJoe Eykholt2-0/+22
When rport_login is called on an rport that is already thought to be logged in, use ADISC. If that fails, redo PLOGI. This is less disruptive after fabric changes that don't affect the state of the target. Implement the sending of ADISC via fc_els_fill. Add ADISC state to the rport state machine. This is entered from READY and returns to READY after successful completion. If it fails, the rport is either logged off and deleted or re-does PLOGI. 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>
2009-09-10[SCSI] libfc: improve debug messages for ELS response handlersJoe Eykholt1-0/+5
Improve lport and rport debug messages to indicate whether the response is LS_ACC, LS_RJT, closed, or timeout. 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>
2009-09-10[SCSI] libfc: move remote port lookup for ELS requests into fc_rport.c.Joe Eykholt1-1/+1
This moves the remote port lookup for incoming ELS requests into fc_rport.c, in preparation for handing PLOGI and LOGO from unknown rports. This changes the arg to rport_recv_req from an rdata to an lport. 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>