1. 05 9月, 2009 2 次提交
    • V
      [SCSI] fcoe, libfc: adds per cpu exch pool within exchange manager(EM) · e4bc50be
      Vasu Dev 提交于
      Adds per cpu exch pool for these reasons:-
      
       1. Currently an EM instance is shared across all cpus to manage
          all exches for all cpus. This required em_lock across all
          cpus for an exch alloc, free, lookup and reset each frame
          and that made em_lock expensive, so instead having per cpu
          exch pool with their own per cpu pool lock will likely reduce
          locking contention in fast path for an exch alloc, free and
          lookup.
      
       2. Per cpu exch pool will likely improve cache hit ratio since
          all frames of an exch will be processed on the same cpu on
          which exch originated.
      
      This patch is only prep work to help in keeping complexity of next
      patch low, so this patch only sets up per cpu exch pool and related
      helper funcs to be used by next patch. The next patch fully makes
      use of per cpu exch pool in all code paths ie. tx, rx and reset.
      
      Divides per EM exch id range equally across all cpus to setup per
      cpu exch pool. This division is such that lower bits of exch id
      carries cpu number info on which exch originated, later a simple
      bitwise AND operation on exch id of incoming frame with fc_cpu_mask
      retrieves cpu number info to direct all frames to same cpu on which
      exch originated. This required a global fc_cpu_mask and fc_cpu_order
      initialized to max possible cpus number nr_cpu_ids rounded up to 2's
      power, this will be used in mapping exch id and exch ptr array
      index in pool during exch allocation, find or reset code paths.
      
      Adds a check in fc_exch_mgr_alloc() to ensure specified min_xid
      lower bits are zero since these bits are used to carry cpu info.
      
      Adds and initializes struct fc_exch_pool with all required fields
      to manage exches in pool.
      
      Allocates per cpu struct fc_exch_pool with memory for exches array
      for range of exches per pool. The exches array memory is followed
      by struct fc_exch_pool.
      
      Adds fc_exch_ptr_get/set() helper functions to get/set exch ptr in
      pool exches array at specified array index.
      
      Increases default FCOE_MAX_XID to 0x0FFF from 0x07EF, so that more
      exches are available per cpu after above described exch id range
      division across all cpus to each pool.
      Signed-off-by: NVasu Dev <vasu.dev@intel.com>
      Signed-off-by: NRobert Love <robert.w.love@intel.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      e4bc50be
    • R
      [SCSI] libfc: Fix misleading debug statement · cd305ce4
      Robert Love 提交于
      The statement reads, "Exchange timed out, notifying the upper layer",
      however, this statement is printed whenever the timer is armed. This
      is confusing to someone debugging the code because every time an
      exchange is initialized, there is an incorrect statement stating that
      the timer has already timed out. This patch changes the statement to
      read, "Exchange timer armed" which is more accurate.
      
      This patch also adds a debug statement in the timeout handler to
      properly indicate that the exchange has timed out.
      Signed-off-by: NRobert Love <robert.w.love@intel.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      cd305ce4
  2. 23 8月, 2009 6 次提交
    • V
      [SCSI] fcoe, libfc: adds offload EM per eth device with only single xid range per EM · d7179680
      Vasu Dev 提交于
      Updates fcoe_em_config to allocate a single instance of sharable offload
      EM for supported lp->lro_xid per eth device, and then share this EM
      for subsequently more lports creation on same eth device (e.g when using
      VLAN).
      
      Adds tiny fcoe_oem_match function for offload EM to return true for read
      types IO to have read IO exchanges allocated from offload shared EM.
      
      Removes fc_em_alloc_xid function completely which was needed to manage
      two xid ranges within a EM, this is not needed any more with allocation
      of separate sharable offload EM per eth device. Instead this patch adds
      simple xid allocation logic to manage single xid range.
      
      Adds fc_exch_em_alloc with mp->next_xid as cursor to allocate new xid
      from single xid range of EM, uses mp->next_xid instead removed mp->last_xid
      which slightly increase probability of finding empty xid on exch allocation.
      
      Removes restriction of not allowing use of xid zero along with changing
      two xid range change to single xid range.
      
      Makes fc_fcp_ddp_setup calling conditional to only xid allocated from
      shared offload EM.
      Signed-off-by: NVasu Dev <vasu.dev@intel.com>
      Signed-off-by: NRobert Love <robert.w.love@intel.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      d7179680
    • V
      [SCSI] fcoe, fnic, libfc: modifies current code paths to use EM anchor list · 52ff878c
      Vasu Dev 提交于
      Modifies current code to use EM anchor list in EM allocation, EM free,
      EM reset, exch allocation and exch lookup code paths.
      
       1. Modifies fc_exch_mgr_alloc to accept EM match function and then
          have allocated EM added to the lport using fc_exch_mgr_add API
          while also updating EM kref for newly added EM.
      
       2. Updates fc_exch_mgr_free API to accept only lport pointer instead
          EM and then have this API free all EMs of the lport from EM anchor
          list.
      
       3. Removes single lport pointer link from the EM, which was used in
          associating lport pointer in newly allocated exchange. Instead have
          lport pointer passed along new exchange allocation call path and
          then store passed lport pointer in newly allocated exchange, this
          will allow a single EM instance to be used across more than one
          lport and used in EM reset to reset only lport specific exchanges.
      
       4. Modifies fc_exch_mgr_reset to reset all EMs from the EM anchor list
          of the lport, adds additional exch lport pointer (ep->lp) check for
          shared EM case to reset exchange specific to a lport requested reset.
      
       5. Updates exch allocation API fc_exch_alloc to use EM anchor list and
          its anchor match func pointer. The fc_exch_alloc will walk the list
          of EMs until it finds a match, a match will be either null match
          func pointer or call to match function returning true value.
      
       6. Updates fc_exch_recv to accept incoming frame on local port using
          only lport pointer and frame pointer without specifying EM instance
          of incoming frame. Instead modified fc_exch_recv to locate EM for the
          incoming frame by matching xid of incoming frame against a EM xid range.
          This change was required to use EM list in libfc Rx path and after this
          change the lport fc_exch_mgr pointer emp is not needed anymore, so
          removed emp pointer.
      
       7. Updates fnic for removed lport emp pointer and above modified libfc APIs
          fc_exch_recv, fc_exch_mgr_alloc and fc_exch_mgr_free.
      
       8. Removes exch_get and exch_put from libfc_function_template as these
          are no longer needed with EM anchor list and its match function use.
          Also removes its default function fc_exch_get.
      
      A defect this patch introduced regarding the libfc initialization order in
      the fnic driver was fixed by Joe Eykholt <jeykholt@cisco.com>.
      Signed-off-by: NVasu Dev <vasu.dev@intel.com>
      Signed-off-by: NRobert Love <robert.w.love@intel.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      52ff878c
    • R
      [SCSI] libfc: Remove the FC_EM_DBG macro · d459b7ea
      Robert Love 提交于
      Currently there is a 1:1 relationship between the lport
      and exchange manager. This macro takes an EM as an argument
      and determines the lport from it. However, later patches
      will use an EM list per lport, so we will no longer have
      this 1:1 relationship- this macro must change.
      
      The FC_EM_DBG macro is rarely used. There are four callers,
      two can use FC_LPORT_DBG instead and two can be removed
      since they're not necessary. This patch makes those changes
      and removes the macro.
      Signed-off-by: NRobert Love <robert.w.love@intel.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      d459b7ea
    • V
      [SCSI] fcoe, libfc: adds exchange manager(EM) anchor list per lport and related APIs · 96316099
      Vasu Dev 提交于
      Adds EM list using a anchor struct fc_exch_mgr_anchor, anchor is used
      to allow same EM instance sharing across more than one lport on a eth
      device, this implementation is per discussed design posted at
      http://www.open-fcoe.org/pipermail/devel/2009-June/002566.html.
      
      The shared EM is required for multiple lports on eth device when
      using multiple VLANs or NPIV.
      
      Adds fc_exch_mgr_add API to add a EM to the lport and fc_exch_mgr_del
      API to delete previously added EM.
      
      Also adds function fc_exch_mgr_destroy() to destroy allocated EM.
      The kref is added to the EM to keep track of EM usage count, the EM is
      destroyed when no longer in use upon kref reaching to zero.
      
      The caller can specify match function to fc_exch_mgr_add, this
      will be used in determining exchange allocation from its EM or not.
      
      Moved calling of fcoe_em_config below fcoe_libfc_config calling,
      so that list head lp->ema_list is initialized before configuring
      EM.
      Signed-off-by: NVasu Dev <vasu.dev@intel.com>
      Signed-off-by: NRobert Love <robert.w.love@intel.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      96316099
    • J
      [SCSI] libfc: fix WARNING from fc_seq_start_next on closed exchanges · 84b05445
      Joe Eykholt 提交于
      We saw periodic messages like:
      
      WARNING: at drivers/scsi/libfc/fc_exch.c:825 fc_seq_start_next+0x30/0x4b
      
      This was due to trying to allocate a sequence in a request handler
      when the exchange had been reset.
      
      Delete the WARN_ON.
      Signed-off-by: NJoe Eykholt <jeykholt@cisco.com>
      Signed-off-by: NRobert Love <robert.w.love@intel.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      84b05445
    • J
      [SCSI] libfc: rename lport NONE state to DISABLED · b1d9fd55
      Joe Eykholt 提交于
      The state NONE was meant to be invalid, but has been used as
      the initial state.  Rename it to be DISABLED, as more descriptive.
      Further patches will make it the like the RESET state, except
      it won't transition to FLOGI until fc_lport_fabric_login() is called.
      Signed-off-by: NJoe Eykholt <jeykholt@cisco.com>
      Signed-off-by: NRobert Love <robert.w.love@intel.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      b1d9fd55
  3. 30 7月, 2009 1 次提交
  4. 22 6月, 2009 1 次提交
  5. 09 6月, 2009 1 次提交
  6. 14 3月, 2009 1 次提交
    • Y
      [SCSI] libfc: add support of large receive offload by ddp in fc_fcp · b277d2aa
      Yi Zou 提交于
      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: NYi Zou <yi.zou@intel.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      b277d2aa
  7. 13 3月, 2009 1 次提交
  8. 10 3月, 2009 2 次提交
  9. 07 3月, 2009 4 次提交
  10. 30 12月, 2008 1 次提交
    • R
      [SCSI] libfc: A modular Fibre Channel library · 42e9a92f
      Robert Love 提交于
      libFC is composed of 4 blocks supported by an exchange manager
      and a framing library. The upper 4 layers are fc_lport, fc_disc,
      fc_rport and fc_fcp. A LLD that uses libfc could choose to
      either use libfc's block, or using the transport template
      defined in libfc.h, override one or more blocks with its own
      implementation.
      
      The EM (Exchange Manager) manages exhcanges/sequences for all
      commands- ELS, CT and FCP.
      
      The framing library frames ELS and CT commands.
      
      The fc_lport block manages the library's representation of the
      host's FC enabled ports.
      
      The fc_disc block manages discovery of targets as well as
      handling changes that occur in the FC fabric (via. RSCN events).
      
      The fc_rport block manages the library's representation of other
      entities in the FC fabric. Currently the library uses this block
      for targets, its peer when in point-to-point mode and the
      directory server, but can be extended for other entities if
      needed.
      
      The fc_fcp block interacts with the scsi-ml and handles all
      I/O.
      Signed-off-by: NRobert Love <robert.w.love@intel.com>
      [jejb: added include of delay.h to fix ppc64 compile prob spotted by sfr]
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      42e9a92f