1. 11 Oct, 2013 1 commit
    • Robert Love's avatar
      libfcoe: Make fcoe_sysfs optional / fix fnic NULL exception · 9d34876f
      Robert Love authored
      fnic doesn't use any of the create/destroy/enable/disable interfaces
      either from the (legacy) module paramaters or the (new) fcoe_sysfs
      interfaces. When fcoe_sysfs was introduced fnic wasn't changed since
      it wasn't using the interfaces. libfcoe incorrectly assumed that that
      all of its users were using fcoe_sysfs and when adding and deleting
      FCFs would assume the existance of a fcoe_ctlr_device. fnic was not
      allocating this structure because it doesn't care about the standard
      user interfaces (fnic starts on link only). If/When libfcoe tried to use
      the fcoe_ctlr_device's lock for the first time a NULL pointer exception
      would be triggered.
      
      Since fnic doesn't care about sysfs or user interfaces, the solution
      is to drop libfcoe's assumption that all drivers are using fcoe_sysfs.
      
      This patch accomplishes this by changing some of the structure
      relationships.
      
      We need a way to determine when a LLD is using fcoe_sysfs or not and
      we can do that by checking for the existance of the fcoe_ctlr_device.
      Prior to this patch, it was assumed that the fcoe_ctlr structure was
      allocated with the fcoe_ctlr_device and immediately followed it in
      memory. To reach the fcoe_ctlr_device we would simply go back in memory
      from the fcoe_ctlr to get the fcoe_ctlr_device.
      
      Since fnic doesn't allocate the fcoe_ctlr_device, we cannot keep that
      assumption. This patch adds a pointer from the fcoe_ctlr to the
      fcoe_ctlr_device. For bnx2fc and fcoe we will continue to allocate the
      two structures together, but then we'll set the ctlr->cdev pointer
      to point at the fcoe_ctlr_device. fnic will not change and will continue
      to allocate the fcoe_ctlr itself, and ctlr->cdev will remain NULL.
      
      When libfcoe adds fcoe_fcf's to the fcoe_ctlr it will check if ctlr->cdev
      is set and only if so will it continue to interact with fcoe_sysfs.
      Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
      Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Tested-by: default avatarHiral Patel <hiralpat@cisco.com>
      9d34876f
  2. 14 Dec, 2012 5 commits
    • Yi Zou's avatar
      libfcoe, fcoe: consolidate the fcoe_ctlr_get_lesb/fcoe_get_lesb · 57c2728f
      Yi Zou authored
      Similarly they can be moved into libfcoe instead of being private to fcoe now.
      Also add comments particularly on the term LESB to the corresponding function.
      Signed-off-by: default avatarYi Zou <yi.zou@intel.com>
      Cc: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
      Tested-by: default avatarMarcus Dennis <marcusx.e.dennis@intel.com>
      Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
      57c2728f
    • Yi Zou's avatar
      libfcoe, fcoe: move fcoe_link_speed_update() to libfcoe and export it · 03702689
      Yi Zou authored
      With the previous patch, fcoe_link_speed_update() can be moved into libfcoe and
      exported to used by fcoe, bnx2fc, and etc.
      Signed-off-by: default avatarYi Zou <yi.zou@intel.com>
      Cc: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
      Tested-by: default avatarMarcus Dennis <marcusx.e.dennis@intel.com>
      Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
      03702689
    • Yi Zou's avatar
      fcoe: add support to the get_netdev() for fcoe_interface · 66524ec9
      Yi Zou authored
      Adds support to fcoe_port's newly added get_netdev fucntion pointer.
      Signed-off-by: default avatarYi Zou <yi.zou@intel.com>
      Cc: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
      Tested-by: default avatarMarcus Dennis <marcusx.e.dennis@intel.com>
      Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
      66524ec9
    • Yi Zou's avatar
      fcoe: prep work to start consolidate the usage of fcoe_netdev · 8106fb47
      Yi Zou authored
      Currently, in the default kernel fcoe driver, it is needed to get to the underlying
      private per fcoe transport's private structure, e.g., fcoe_interface in
      fcoe.ko, and returns the associated netdev. The similar logic exists in other
      fcoe drivers, e.g., bnx2fc, so we add a function pointer into the common
      fcoe_port struct to allow individual fcoe transport implementaion (fcoe
      and bnx2fc) to get the corresponding netdev associated with a give lport.
      
      Then a inline fcoe_get_netdev() is added as part of libfcoe for all underlying
      fcoe transport drivers to use regardless of its individual fcoe transport
      driver, and also allows move more common code such as fcoe_link_speed_update or
      fcoe_ctlr_get_lesb to be in libfcoe, rather than specific to fcoe.
      
      This patch is a prep work that adds aforementioned fucntion pointer, and
      followed by the actual code changes to make use of it.
      Signed-off-by: default avatarYi Zou <yi.zou@intel.com>
      Cc: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
      Tested-by: default avatarMarcus Dennis <marcusx.e.dennis@intel.com>
      Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
      8106fb47
    • Robert Love's avatar
      libfcoe, fcoe, bnx2fc: Add new fcoe control interface · 6a891b07
      Robert Love authored
      This patch does a few things.
      
      1) Makes /sys/bus/fcoe/ctlr_{create,destroy} interfaces.
         These interfaces take an <ifname> and will either
         create an FCoE Controller or destroy an FCoE
         Controller depending on which file is written to.
      
         The new FCoE Controller will start in a DISABLED
         state and will not do discovery or login until it
         is ENABLED. This pause will allow us to configure
         the FCoE Controller before enabling it.
      
      2) Makes the 'mode' attribute of a fcoe_ctlr_device
         writale. This allows the user to configure the mode
         in which the FCoE Controller will start in when it
         is ENABLED.
      
         Possible modes are 'Fabric', or 'VN2VN'.
      
         The default mode for a fcoe_ctlr{,_device} is 'Fabric'.
         Drivers must implement the set_fcoe_ctlr_mode routine
         to support this feature.
      
         libfcoe offers an exported routine to set a FCoE
         Controller's mode. The mode can only be changed
         when the FCoE Controller is DISABLED.
      
         This patch also removes the get_fcoe_ctlr_mode pointer
         in the fcoe_sysfs function template, the code in
         fcoe_ctlr.c to get the mode and the assignment of
         the fcoe_sysfs function pointer to the fcoe_ctlr.c
         implementation (in fcoe and bnx2fc). fcoe_sysfs can
         return that value for the mode without consulting the
         LLD.
      
      3) Make a 'enabled' attribute of a fcoe_ctlr_device. On a
         read, fcoe_sysfs will return the attribute's value. On
         a write, fcoe_sysfs will call the LLD (if there is a
         callback) to notifiy that the enalbed state has changed.
      
      This patch maintains the old FCoE control interfaces as
      module parameters, but it adds comments pointing out that
      the old interfaces are deprecated.
      Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
      Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      6a891b07
  3. 07 Oct, 2012 1 commit
  4. 23 May, 2012 3 commits
    • Robert Love's avatar
      [SCSI] fcoe, bnx2fc, libfcoe: SW FCoE and bnx2fc use FCoE Syfs · 8d55e507
      Robert Love authored
      This patch has the SW FCoE driver and the bnx2fc
      driver make use of the new fcoe_sysfs API added
      earlier in this patch series.
      
      After this patch a fcoe_ctlr_device is allocated with
      private data in this order.
      
      +------------------+   +------------------+
      | fcoe_ctlr_device |   | fcoe_ctlr_device |
      +------------------+   +------------------+
      | fcoe_ctlr        |   | fcoe_ctlr        |
      +------------------+   +------------------+
      | fcoe_interface   |   | bnx2fc_interface |
      +------------------+   +------------------+
      
      libfcoe also takes part in this new model since it
      discovers and manages fcoe_fcf instances. The memory
      allocation is different for FCFs. I didn't want to
      impact libfcoe's fcoe_fcf processing, so this patch
      creates fcoe_fcf_device instances for each discovered
      fcoe_fcf. The two are paired using a (void * priv)
      member of the fcoe_ctlr_device. This allows libfcoe
      to continue maintaining its list of fcoe_fcf instances
      and simply attaches and detaches them from existing
      or new fcoe_fcf_device instances.
      Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
      Tested-by: default avatarRoss Brattain <ross.b.brattain@intel.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      8d55e507
    • Robert Love's avatar
      [SCSI] libfcoe: Add fcoe_sysfs · 9a74e884
      Robert Love authored
      This patch adds a 'fcoe bus' infrastructure to the kernel
      that is driven by changes to libfcoe which allow LLDs to
      present FIP (FCoE Initialization Protocol) discovered
      entities and their attributes to user space via sysfs.
      
      This patch adds the following APIs-
      
      fcoe_ctlr_device_add
      fcoe_ctlr_device_delete
      fcoe_fcf_device_add
      fcoe_fcf_device_delete
      
      They allow the LLD to expose the FCoE ENode Controller
      and any discovered FCFs (Fibre Channel Forwarders, e.g.
      FCoE switches) to the user. Each of these new devices
      has their own bus_type so that they are grouped together
      for easy lookup from a user space application. Each
      new class has an attribute_group to expose attributes
      for any created instances. The attributes are-
      
      fcoe_ctlr_device
      * fcf_dev_loss_tmo
      * lesb_link_fail
      * lesb_vlink_fail
      * lesb_miss_fka
      * lesb_symb_err
      * lesb_err_block
      * lesb_fcs_error
      
      fcoe_fcf_device
      * fabric_name
      * switch_name
      * priority
      * selected
      * fc_map
      * vfid
      * mac
      * fka_peroid
      * fabric_state
      * dev_loss_tmo
      
      A device loss infrastructre similar to the FC Transport's
      is also added by this patch. It is nice to have so that a
      link flapping adapter doesn't continually advance the count
      used to identify the discovered FCF. FCFs will exist in a
      "Disconnected" state until either the timer expires or the
      FCF is rediscovered and becomes "Connected."
      
      This patch generates a few checkpatch.pl WARNINGS that
      I'm not sure what to do about. They're macros modeled
      around the FC Transport attribute building macros, which
      have the same 'feature' where the caller can ommit a cast
      in the argument list and no cast occurs in the code. I'm
      not sure how to keep the code condensed while keeping the
      macros. Any advice would be appreciated.
      Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
      Tested-by: default avatarRoss Brattain <ross.b.brattain@intel.com>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      9a74e884
    • Robert Love's avatar
      [SCSI] fcoe: Allocate fcoe_ctlr with fcoe_interface, not as a member · 619fe4be
      Robert Love authored
      Currently the fcoe_ctlr associated with an interface is allocated
      as a member of struct fcoe_interface. This causes problems when
      attempting to use the new fcoe_sysfs APIs which allow us to allocate
      the fcoe_interface as private data to the fcoe_ctlr_device instance.
      The problem is that libfcoe wants to be able use pointer math to find a
      fcoe_ctlr's fcoe_ctlr_device as well as finding a fcoe_ctlr_device's
      assocated fcoe_ctlr. To do this we need to allocate the
      fcoe_ctlr_device, with private data for the LLD. The private data
      contains the fcoe_ctlr and its private data is the fcoe_interface.
      This patch only allocates the fcoe_interface with the fcoe_ctlr, the
      fcoe_ctlr_device will be added in a later patch, which will complete
      the below diagram-
      
      +------------------+
      | fcoe_ctlr_device |
      +------------------+
      | fcoe_ctlr        |
      +------------------+
      | fcoe_interface   |
      +------------------+
      
      This prep work will allow us to go from a fcoe_ctlr_device instance
      to its fcoe_ctlr as well as from a fcoe_ctlr to its fcoe_ctlr_device
      once the fcoe_sysfs API is in use (later patches in this series).
      Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
      Tested-by: default avatarRoss Brattain <ross.b.brattain@intel.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      619fe4be
  5. 28 Mar, 2012 1 commit
  6. 15 Dec, 2011 1 commit
  7. 16 Oct, 2011 1 commit
  8. 27 Aug, 2011 1 commit
  9. 28 Feb, 2011 1 commit
  10. 12 Feb, 2011 2 commits
  11. 21 Dec, 2010 1 commit
  12. 28 Jul, 2010 4 commits
    • Joe Eykholt's avatar
      [SCSI] libfcoe: fcoe: fnic: add FIP VN2VN point-to-multipoint support · e10f8c66
      Joe Eykholt authored
      The FC-BB-6 committee is proposing a new FIP usage model called
      VN_port to VN_port mode.  It allows VN_ports to discover each other
      over a loss-free L2 Ethernet without any FCF or Fibre-channel fabric
      services.  This is point-to-multipoint.  There is also a variant
      of this called point-to-point which provides for making sure there
      is just one pair of ports operating over the Ethernet fabric.
      
      We add these new states:  VNMP_START, _PROBE1, _PROBE2, _CLAIM, and _UP.
      These usually go quickly in that sequence.  After waiting a random
      amount of time up to 100 ms in START, we select a pseudo-random
      proposed locally-unique port ID and send out probes in states PROBE1
      and PROBE2, 100 ms apart.  If no probe responses are heard, we
      proceed to CLAIM state 400 ms later and send a claim notification.
      We wait another 400 ms to receive claim responses, which give us
      a list of the other nodes on the network, including their FC-4
      capabilities.  After another 400 ms we go to VNMP_UP state and
      should start interoperating with any of the nodes for whic we
      receivec claim responses.  More details are in the spec.j
      
      Add the new mode as FIP_MODE_VN2VN.  The driver must specify
      explicitly that it wants to operate in this mode.  There is
      no automatic detection between point-to-multipoint and fabric
      mode, and the local port initialization is affected, so it isn't
      anticipated that there will ever be any such automatic switchover.
      
      It may eventually be possible to have both fabric and VN2VN
      modes on the same L2 network, which may be done by two separate
      local VN_ports (lports).
      
      When in VN2VN mode, FIP replaces libfc's fabric-oriented discovery
      module with its own simple code that adds remote ports as they
      are discovered from incoming claim notifications and responses.
      These hooks are placed by fcoe_disc_init().
      
      A linear list of discovered vn_ports is maintained under the
      fcoe_ctlr struct.  It is expected to be short for now, and
      accessed infrequently.  It is kept under RCU for lock-ordering
      reasons.  The lport and/or rport mutexes may be held when we
      need to lookup a fcoe_vnport during an ELS send.
      
      Change fcoe_ctlr_encaps() to lookup the destination vn_port in
      the list of peers for the destination MAC address of the
      FIP-encapsulated frame.
      
      Add a new function fcoe_disc_init() to initialize just the
      discovery portion of libfcoe for VN2VN mode.
      Signed-off-by: default avatarJoe Eykholt <jeykholt@cisco.com>
      Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      e10f8c66
    • Joe Eykholt's avatar
      [SCSI] libfcoe: fcoe: fnic: change fcoe_ctlr_init interface to specify mode · 3d902ac0
      Joe Eykholt authored
      There are three modes that libfcoe currently supports, and a new one
      is coming.  Change the fcoe_ctlr_init() interface to add the mode
      desired.  This should not change any functionality.
      Signed-off-by: default avatarJoe Eykholt <jeykholt@cisco.com>
      Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      3d902ac0
    • Joe Eykholt's avatar
      [SCSI] libfcoe: convert FIP to lock with mutex instead of spin lock · fdb068c6
      Joe Eykholt authored
      It turns out most of the FIP work is now done from worker threads
      or process context now, so there's no need to use a spin lock.
      
      Change to use mutex instead of spin lock and delayed_work instead
      of a timer.
      
      This will make it nicer for the VN_port to VN_port feature that
      will interact more with the libfc layers requiring that
      spinlocks not be held.
      Signed-off-by: default avatarJoe Eykholt <jeykholt@cisco.com>
      Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      fdb068c6
    • Vasu Dev's avatar
      [SCSI] fcoe: adds src and dest mac address checking for fcoe frames · 519e5135
      Vasu Dev authored
      This is  per FC-BB-5 Annex-D recommendation and per that
      if address checking fails then drop the frame.
      
      FIP code paths are already doing this so only needed for fcoe
      frames.
      
      The src address checking is limited to only fip mode since
      this might break non-fip mode used in p2p due to used OUI
      based addressing in some p2p code paths, going forward FIP
      will be the only mode, therefore limited this to only FIP
      mode so that it won't break non-fip p2p mode for now.
      
      -v2
      Removes FCOE packet type checking since fcoe_rcv is
      registered to receive only FCoE type packets from netdev
      and it is already checked by netdev.
      Signed-off-by: default avatarVasu Dev <vasu.dev@intel.com>
      Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      519e5135
  13. 11 Apr, 2010 2 commits
  14. 04 Dec, 2009 6 commits
    • Yi Zou's avatar
      [SCSI] libfcoe: add checking disable flag in FIP_FKA_ADV · 8cdffdcc
      Yi Zou authored
      When the D bit is set if the FKA_ADV_Period of the FIP Discovery
      Advertisement, the ENode should not transmit period ENode FIP Keep Alive and
      VN_Port FIP Keep Alive (FC-BB-5 Rev2, 7.8.3.13).
      
      Note that fcf->flags is taken directly from the fip_header, I am claiming one
      bit for the purpose of the FIP_FKA_Period D bit as FIP_FL_FK_ADV_B, and use
      FIP_HEADER_FLAGS as bitmask for bits used in fip_header.
      Signed-off-by: default avatarYi Zou <yi.zou@intel.com>
      Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      8cdffdcc
    • Joe Eykholt's avatar
      [SCSI] libfcoe: fcoe: simplify receive FLOGI response · 386309ce
      Joe Eykholt authored
      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: default avatarJoe Eykholt <jeykholt@cisco.com>
      Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      386309ce
    • Joe Eykholt's avatar
      [SCSI] libfcoe: FIP should report link to libfc whether selected or not · dd42dac4
      Joe Eykholt authored
      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: default avatarJoe Eykholt <jeykholt@cisco.com>
      Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      dd42dac4
    • Joe Eykholt's avatar
      [SCSI] libfcoe: Allow FIP to be disabled by the driver · 22bcd225
      Joe Eykholt authored
      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: default avatarJoe Eykholt <jeykholt@cisco.com>
      Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      22bcd225
    • Robert Love's avatar
      [SCSI] libfcoe: formatting and comment cleanups · 70b51aab
      Robert Love authored
      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: default avatarRobert Love <robert.w.love@intel.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      70b51aab
    • Chris Leech's avatar
      [SCSI] libfcoe, fcoe: libfcoe NPIV support · 11b56188
      Chris Leech authored
      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: default avatarChris Leech <christopher.leech@intel.com>
      Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      11b56188
  15. 17 May, 2009 1 commit
    • Vasu Dev's avatar
      fcoe: adds spma mode support · 184dd345
      Vasu Dev authored
      If we can find a type NETDEV_HW_ADDR_T_SAN mac address from the
      corresponding netdev for a fcoe interface then sets up added the
      fc->ctlr.spma flag and stores spma mode address in ctl_src_addr.
      
      In case the spma flag is set then:-
      
       1. Adds spma mode MAC address in ctl_src_addr as secondary
          MAC address, the FLOGI for FIP and pre-FIP will go out
          using this address.
       2. Cleans up stored spma MAC address in ctl_src_addr in
          fcoe_netdev_cleanup.
       3. Sets up spma bit in fip_flags for FIP solicitations along
          with exiting FPMA bit setting.
       4. Initialize the FLOGI FIP MAC descriptor to stored spma
          MAC address in ctl_src_addr. This is used as proposed
          FCoE MAC address from initiator along with both SPMA
          and FPMA bit set in FIP solicitation, in response the
          switch may grant any FPMA or SPMA mode MAC address to
          initiator.
      
      Removes FIP descriptor type checking against ELS type
      ELS_FLOGI in fcoe_ctlr_encaps to update a FIP MAC descriptor,
      instead now checks against FIP_DT_FLOGI.
      
      I've tested this with available FPMA-only FCoE switch but
      since data_src_addr is updated using same old code for
      both FPMA and SPMA modes with FIP or pre-FIP links, so added
      SPMA mode will work with SPMA-only switch also provided that
      switch grants a valid MAC address.
      Signed-off-by: default avatarVasu Dev <vasu.dev@intel.com>
      Signed-off-by: default avatarYi Zou <yi.zou@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      184dd345
  16. 03 Apr, 2009 6 commits
  17. 13 Mar, 2009 1 commit
    • Yi Zou's avatar
      [SCSI] libfc: add support of large receive offload by ddp in fc_fcp · b277d2aa
      Yi Zou authored
      When LLD supports direct data placement (ddp) for large receive of an scsi
      i/o coming into fc_fcp, we call into libfc_function_template's ddp_setup()
      to prepare for a ddp of large receive for this read I/O. When I/O is complete,
      we call the corresponding ddp_done() to get the length of data ddped as well
      as to let LLD do clean up.
      
      fc_fcp_ddp_setup()/fc_fcp_ddp_done() are added to setup and complete a ddped
      read I/O described by the given fc_fcp_pkt. They would call into corresponding
      ddp_setup/ddp_done implemented by the fcoe layer. Eventually, fcoe layer calls
      into LLD's ddp_setup/ddp_done provided through net_device
      Signed-off-by: default avatarYi Zou <yi.zou@intel.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
      b277d2aa
  18. 10 Mar, 2009 2 commits
    • Vasu Dev's avatar
      [SCSI] fcoe: Out of order tx frames was causing several check condition SCSI status · c826a314
      Vasu Dev authored
      frames followed by these errors in log.
      
      	[sdp] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE,SUGGEST_OK
      	[sdp] Sense Key : Aborted Command [current]
      	[sdp] Add. Sense: Data phase error
      
      This was causing some test apps to exit due to write failure under heavy
      load.
      
      This was due to a race around adding and removing tx frame skb in
      fcoe_pending_queue, Chris Leech helped me to find that brief unlocking
      period when pulling skb from fcoe_pending_queue in various contexts
      (fcoe_watchdog and fcoe_xmit) and then adding skb back into fcoe_pending_queue
      up on a failed fcoe_start_io could change skb/tx frame order in
      fcoe_pending_queue. Thanks Chris.
      
      This patch allows only single context to pull skb from fcoe_pending_queue
      at any time to prevent above described ordering issue/race by use of
      fcoe_pending_queue_active flag.
      
      This patch simplified fcoe_watchdog with modified fcoe_check_wait_queue by
      use of FCOE_LOW_QUEUE_DEPTH instead previously used several conditionals
      to clear and set lp->qfull.
      
      I think FCOE_MAX_QUEUE_DEPTH with FCOE_LOW_QUEUE_DEPTH  will work better
      in re/setting lp->qfull and these could be fine tuned for performance.
      Signed-off-by: default avatarVasu Dev <vasu.dev@intel.com>
      Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
      c826a314
    • Robert Love's avatar
      [SCSI] libfc, fcoe: Remove unnecessary cast by removing inline wrapper · fc47ff6b
      Robert Love authored
      Comment from "Andrew Morton <akpm@linux-foundation.org>"
      
      > +{
      > +     return (struct fcoe_softc *)lport_priv(lp);
      
      unneeded/undesirable cast of void*.  There are probably zillions of
      instances of this - there always are.
      
      This whole inline function was unnecessary. The FCoE layer knows
      that it's data structure is stored in the lport private data, it
      can just access it from lport_priv().
      Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
      fc47ff6b