1. 30 May, 2012 3 commits
  2. 23 May, 2012 6 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] bnx2fc: Allocate fcoe_ctlr with bnx2fc_interface, not as a member · fd8f8902
      Robert Love authored
          Currently the fcoe_ctlr associated with an interface is allocated
          as a member of struct bnx2fc_interface. This causes problems when
          when later patches attempt to use the new fcoe_sysfs APIs which
          allow us to allocate the bnx2fc_interface as private data to a
          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 will contain the fcoe_ctlr
          and its private data will be the bnx2fc_interface.
      
          +-------------------+
          | fcoe_ctlr_device  |
          +-------------------+
          | fcoe_ctlr         |
          +-------------------+
          | bnx2fc_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>
      fd8f8902
    • 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
    • Jun'ichi Nomura's avatar
      [SCSI] Fix dm-multipath starvation when scsi host is busy · b7e94a16
      Jun'ichi Nomura authored
      block congestion control doesn't have any concept of fairness across
      multiple queues.  This means that if SCSI reports the host as busy in
      the queue congestion control it can result in an unfair starvation
      situation in dm-mp if there are multiple multipath devices on the same
      host.  For example:
      http://www.redhat.com/archives/dm-devel/2012-May/msg00123.html
      
      The fix for this is to report only the sdev busy state (and ignore the
      host busy state) in the block congestion control call back.
      The host is still congested, but the SCSI subsystem will sort out the
      congestion in a fair way because it knows the relation between the
      queues and the host.
      
      [jejb: fixed up trailing whitespace]
      Reported-by: default avatarBernd Schubert <bernd.schubert@itwm.fraunhofer.de>
      Tested-by: default avatarBernd Schubert <bernd.schubert@itwm.fraunhofer.de>
      Signed-off-by: default avatarJun'ichi Nomura <j-nomura@ce.jp.nec.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      b7e94a16
    • Namjae Jeon's avatar
      [SCSI] ufs: fix potential NULL pointer dereferencing error in ufshcd_prove. · 4886b1af
      Namjae Jeon authored
      Avoid dereferencing a NULL pointer if scsi_host_alloc is failed.
      Signed-off-by: default avatarNamjae Jeon <linkinjeon@gmail.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      4886b1af
  3. 22 May, 2012 31 commits