1. 05 12月, 2009 4 次提交
    • R
      [SCSI] libfc: Move non-common routines and prototypes out of libfc.h · 1a7b75ae
      Robert Love 提交于
      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: NRobert Love <robert.w.love@intel.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      1a7b75ae
    • M
      [SCSI] modify change_queue_depth to take in reason why it is being called · e881a172
      Mike Christie 提交于
      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: NMike 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: NVasu Dev <vasu.dev@intel.com>
      [jejb: fixed up 53c700]
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      e881a172
    • J
      [SCSI] libfc: fix free of fc_rport_priv with timer pending · b4a9c7ed
      Joe Eykholt 提交于
      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: NJoe Eykholt <jeykholt@cisco.com>
      Signed-off-by: NRobert Love <robert.w.love@intel.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      b4a9c7ed
    • V
  2. 11 9月, 2009 15 次提交
  3. 05 9月, 2009 2 次提交
    • V
      [SCSI] fcoe, libfc: fully makes use of per cpu exch pool and then removes em_lock · b2f0091f
      Vasu Dev 提交于
      1. Updates fcoe_rcv() to queue incoming frames to the fcoe per
         cpu thread on which this frame's exch was originated and simply
         use current cpu for request exch not originated by initiator.
         It is redundant to add this code under CONFIG_SMP, so removes
         CONFIG_SMP uses around this code.
      
      2. Updates fc_exch_em_alloc, fc_exch_delete, fc_exch_find to use
         per cpu exch pools, here fc_exch_delete is rename of older
         fc_exch_mgr_delete_ep since ep/exch are now deleted in pools
         of EM and so brief new name is sufficient and better name.
      
         Updates these functions to map exch id to their index into exch
         pool using fc_cpu_mask, fc_cpu_order and EM min_xid.
         This mapping is as per detailed explanation about this in
         last patch and basically this is just as lower fc_cpu_mask
         bits of exch id as cpu number and upper bit sum of EM min_xid
         and exch index in pool.
      
         Uses pool next_index to keep track of exch allocation from
         pool along with pool_max_index as upper bound of exches array
         in pool.
      
      3. Adds exch pool ptr to fc_exch to free exch to its pool in
         fc_exch_delete.
      
      4. Updates fc_exch_mgr_reset to reset all exch pools of an EM,
         this required adding fc_exch_pool_reset func to reset exches
         in pool and then have fc_exch_mgr_reset call fc_exch_pool_reset
         for each pool within each EM for a lport.
      
      5. Removes no longer needed exches array, em_lock, next_xid, and
         total_exches from struct fc_exch_mgr, these are not needed after
         use of per cpu exch pool, also removes not used max_read,
         last_read from struct fc_exch_mgr.
      
      6. Updates locking notes for exch pool lock with fc_exch lock and
         uses pool lock in exch allocation, lookup and reset.
      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>
      b2f0091f
    • 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
  4. 23 8月, 2009 7 次提交
  5. 22 6月, 2009 1 次提交
  6. 24 5月, 2009 1 次提交
  7. 27 4月, 2009 1 次提交
    • A
      [SCSI] libfc: Track rogue remote ports · b4c6f546
      Abhijeet Joglekar 提交于
      Rogue ports are currently not tracked on any list. The only reference
      to them is through any outstanding exchanges pending on the rogue ports.
      If the module is removed while a retry is set on a rogue port
      (say a Plogi retry for instance), this retry is not cancelled because there
      is no reference to the rogue port in the discovery rports list. Thus the
      local port can clean itself up, delete the exchange pool, and then the
      rogue port timeout can fire and try to start up another exchange.
      
      This patch tracks the rogue ports in a new list disc->rogue_rports. Creating
      a new list instead of using the disc->rports list keeps remote port code
      change to a minimum.
      
      1)  Whenever a rogue port is created, it is immediately added to the
      disc->rogue_rports list.
      
      2) When the rogues port goes to ready, it is removed from the rogue list
      and the real remote port is added to the disc->rports list
      
      3) The removal of the rogue from the disc->rogue_rports list is done in
      the context of the fc_rport_work() workQ thread in discovery callback.
      
      4) Real rports are removed from the disc->rports list like before. Lookup
      is done only in the real rports list. This avoids making large changes
      to the remote port code.
      
      5) In fc_disc_stop_rports, the rogues list is traversed in addition to the
      real list to stop the rogue ports and issue logoffs on them. This way, rogue
      ports get cleaned up when the local port goes away.
      
      6) rogue remote ports are not removed from the list right away, but
      removed late in fc_rport_work() context, multiple threads can find the same
      remote port in the list and call rport_logoff(). Rport_logoff() only
      continues with the logoff if port is not in NONE state, thus preventing
      multiple logoffs and multiple list deletions.
      
      7) Since the rport is removed from the disc list at a later stage
      (in the disc callback), incoming frames can find the rport even if
      rport_logoff() has been called on the rport. When rport_logoff() is called,
      the rport state is set to NONE, and we are trying to cancel all exchanges
      and retries on that port. While in this state, if an incoming
      Plogi/Prli/Logo or other frames match the rport, we should not reply
      because the rport is in the NONE state. Just drop the frame, since the
      rport will be deleted soon in the disc callback (fc_rport_work)
      
      8)  In fc_disc_single(), remove rport lookup and call to fc_disc_del_target.
      fc_disc_single() is called from recv_rscn_req() where rport lookup
      and rport_logoff is already done.
      Signed-off-by: NAbhijeet Joglekar <abjoglek@cisco.com>
      Signed-off-by: NRobert Love <robert.w.love@intel.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      b4c6f546
  8. 03 4月, 2009 2 次提交
  9. 14 3月, 2009 2 次提交
  10. 10 3月, 2009 1 次提交
    • R
      [SCSI] libfc, fcoe: Fix kerneldoc comments · 34f42a07
      Robert Love 提交于
      1) Added '()' for function names in kerneldoc comments
      
      2) Changed comment bookends from '**/' to '*/'. The comment on the the
         mailing list was that '**/' "is consistently unconventional.  Not
         wrong, just odd." The Documentation/kernel-doc-nano-HOWTO.txt
         states that kerneldoc comment blocks should end with '**/' but most
         (if not all) instance I found under drivers/scsi/ were only using
         the '*/' so I converted to that style.
      
      3) Removed incorrect linebreaks in kerneldoc comments where found
      
      4) Removed a few unnecessary blank comment lines in kerneldoc comment
         blocks
      Signed-off-by: NRobert Love <robert.w.love@intel.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      34f42a07
  11. 07 3月, 2009 4 次提交