aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi/libsas.h (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2009-12-04[SCSI] scsi_dh: create sysfs file, dh_state for all SCSI disk devicesChandra Seetharaman1-7/+4
Create the sysfs file, dh_state even if the new SCSI device is not in the any of the device handler's internal lists. Signed-Off-by: Chandra Seetharaman <sekharan@us.ibm.com> Acked-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-12-04[SCSI] qlogicpti: add missing parenthesesRoel Kluin1-1/+1
`+' 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>
2009-12-04[SCSI] libfc fcoe: increase ELS and CT timeoutsJoe Eykholt4-12/+22
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>
2009-12-04[SCSI] libfcoe: Do not pad FIP keep-alive to full frame sizeYi Zou1-2/+1
According to the FC-BB-5 Rev2.0, 7.8.6.2, we should not pad FIP keep-alive frames. 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: fix an issue of pending exch/es after i/f destroyed or rmmod fcoeVasu Dev1-8/+8
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:- http://www.open-fcoe.org/pipermail/devel/2009-October/004788.html 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>
2009-12-04[SCSI] libfc, fcoe: fixes for highmem skb linearize panicsChris Leech3-14/+16
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>
2009-12-04[SCSI] fcoe: Fix using VLAN ID in creating lport's WWWN/WWPNYi Zou1-2/+9
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>
2009-12-04[SCSI] libfc: do not use DID_NO_CONNECT for pkt alloc failures.Mike Christie1-1/+0
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>
2009-12-04[SCSI] fcoe: Fix setting lport's WWNN/WWPN to use san mac addressYi Zou1-2/+2
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>
2009-12-04[SCSI] fcoe: Fix getting san mac for VLAN interfaceYi Zou1-1/+4
Make sure we are get the SAN MAC address from the real netdev if the input netdev is a VLAN device. 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] fcoe: Fix checking san mac addressYi Zou1-1/+1
This was fixed before in 7a7f0c7 but it's introduced again recently. 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] fnic: enable bsg pass-thru for fcpingJoe Eykholt1-0/+1
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>
2009-12-04[SCSI] libfc: register FC4 features with the FC switchJoe Eykholt5-2/+43
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] fnic: Add FIP support to the fnic driverJoe Eykholt8-342/+382
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>
2009-12-04[SCSI] libfcoe: fcoe: simplify receive FLOGI responseJoe Eykholt3-17/+12
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 host number to lport link up/down messages.Joe Eykholt1-10/+14
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>
2009-12-04[SCSI] libfc: add set_fid function to libfc templateJoe Eykholt2-7/+47
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 fc_els_resp_type to correct display of CT responsesJoe Eykholt1-6/+35
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>
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] fcoe: add check to fail gracefully in bonding modejohn fastabend1-1/+9
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>
2009-12-04[SCSI] fcoe: remove extra function decalrationsYi Zou1-3/+0
Remove the two extra function decalartions in fcoe.c. 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] libfcoe: don't send ELS in FIP mode if no FCF selectedJoe Eykholt1-0/+2
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>
2009-12-04[SCSI] libfcoe: FIP should report link to libfc whether selected or notJoe Eykholt2-30/+31
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: fip: allow FIP receive to be called from IRQ.Joe Eykholt1-13/+4
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>
2009-12-04[SCSI] libfcoe: fip: use SCSI host number to identify debug messages.Joe Eykholt1-21/+26
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>
2009-12-04[SCSI] libfcoe: Allow FIP to be disabled by the driverJoe Eykholt2-2/+6
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] libfc: adds can_queue ramp upVasu Dev1-19/+59
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>
2009-12-04[SCSI] libfc: reduce can_queue for all FCP frame allocation failuresVasu Dev1-43/+59
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>
2009-12-04[SCSI] fcoe, libfc: use single frame allocation APIVasu Dev3-27/+10
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] fcoe: Formatting cleanups and commentingRobert Love2-356/+441
Added kernel-doc comment blocks to all structures and functions. Renamed fc_lport instances rom lp to lport to be inline with our naming convention. Renamed all misnamed net_device instances to netdev to be inline with our naming convention. 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 Love2-147/+153
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 Love9-1255/+1624
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 Ma3-0/+278
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: Add routine to copy data from a buffer to a SG listRobert Love3-46/+78
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>
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] fcoe: vport symbolic name supportChris Leech2-0/+34
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>
2009-12-04[SCSI] libfc: combine name server registration request functionsChris Leech1-122/+42
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: combine name server registration response handlersChris Leech1-175/+30
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>
2009-12-04[SCSI] libfc: Register Symbolic Port Name (RSPN_ID)Chris Leech4-0/+112
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 Leech5-3/+115
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 Leech3-3/+93
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 Leech2-93/+3
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] fcoe: NPIV vport create/destroyChris Leech1-23/+139
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>
2009-12-04[SCSI] fcoe: add a separate scsi transport template for NPIV vportsChris Leech1-7/+47
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>
2009-12-04[SCSI] libfcoe, fcoe: libfcoe NPIV supportChris Leech8-60/+207
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 Leech4-5/+40
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 Leech3-15/+140
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 Leech4-1/+137
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 Leech4-15/+19
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>