1. 10 Sep, 2009 28 commits
  2. 05 Sep, 2009 12 commits
    • Vasu Dev's avatar
      [SCSI] fcoe, libfc: fully makes use of per cpu exch pool and then removes em_lock · b2f0091f
      Vasu Dev authored
      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: 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>
      b2f0091f
    • Vasu Dev's avatar
      [SCSI] fcoe, libfc: adds per cpu exch pool within exchange manager(EM) · e4bc50be
      Vasu Dev authored
      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: 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>
      e4bc50be
    • Joe Eykholt's avatar
      [SCSI] fcoe: libfcoe: extra semicolon in CHECK_LOGGING macros causes compile error · a69b06bc
      Joe Eykholt authored
      If using code like this:
      	if (foo)
      		FCOE_DBG("foo\n);
      	else
      		FCOE_DBG("bar\n");
      
      one gets compile errors because FCOE_DBG expands with its own semicolon,
      making one too many for the if-statement.
      
      Remove the offending semicolon in fcoe.h and also a similar case
      in libfcoe.c.
      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>
      a69b06bc
    • Robert Love's avatar
      [SCSI] libfc: Fix misleading debug statement · cd305ce4
      Robert Love authored
      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: default avatarRobert Love <robert.w.love@intel.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      cd305ce4
    • Robert Love's avatar
      [SCSI] fcoe: Add format spacing to FCOE_NETDEV_DBG debug macro · ee610c67
      Robert Love authored
      There's currently no space between the interface name and the
      user specified format/string. This patch adds a space and a colon
      to the output to separate the interface name and the user
      specified string.
      
      So, instead of "ethXfoo" it will read "ethX: foo".
      Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      ee610c67
    • Mike Christie's avatar
      [SCSI] libiscsi, iscsi_tcp: check suspend bit before each call to xmit_task · 70b31c15
      Mike Christie authored
      If we had multiple tasks on the cmd or requeue  lists, and iscsi_tcp
      returns a error, the write_space function can still run and queue
      iscsi_data_xmit. If it was a legetimate problem and iscsi_conn_failure
      was run but we raced and iscsi_data_xmit was run first it could miss
      the suspend bit checks, and start trying to send data again and hit
      another timeout. A similar problem is present when using cxgb3i.
      
      This has libiscsi check the suspend bit before calling the xmit
      task callout, so we at least do not try sending multiple tasks
      (one could be sent).
      Signed-off-by: default avatarMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      70b31c15
    • Mike Christie's avatar
      [SCSI] iscsi_tcp: add new conn error to indicate tcp conn closed · d1af8a32
      Mike Christie authored
      If a target closed the connection, we will detect it in the
      state_changed or data_ready callout. This adds a new conn
      error value to use for this problem, so it is not confused
      with when the initiator throws a conn error and drops
      the connection.
      Signed-off-by: default avatarMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      d1af8a32
    • Mike Christie's avatar
      [SCSI] iscsi class: Add logging to scsi_transport_iscsi.c · 632248aa
      Mike Christie authored
      Logging for connections and sessions in the scsi_transport_iscsi module
      is now controlled by module parameters.
      Signed-off-by: default avatarErez Zilber <erezzi.list@gmail.com>
      [Mike Christie: newline fixups and modification of some dbg statements]
      Signed-off-by: default avatarMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      632248aa
    • Mike Christie's avatar
      [SCSI] qla4xxx: Removed residual from overrun debug print · b06fc73a
      Mike Christie authored
      The residual variable is only valid for udnerrun so do
      not print it out for the overrun case.
      Signed-off-by: default avatarKaren Higgins <karen.higgins@qlogic.com>
      [Mike Christie: Fix coding style issues in patch]
      Signed-off-by: default avatarMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      b06fc73a
    • Mike Christie's avatar
      [SCSI] libiscsi: handle immediate command rejections · 8afa1439
      Mike Christie authored
      If we sent multiple pdus as immediate the target could be
      rejecting some and we have just been dropping the rejection
      notification. This adds code to handle nop-out rejections,
      so if a nop-out was sent as a ping and rejected we do not
      mark the connection bad. Instead we just clean up the timers
      since we have pdu making a rount trip we know the connection
      is good.
      Signed-off-by: default avatarMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      8afa1439
    • Mike Christie's avatar
      [SCSI] libiscsi: don't increment cmdsn if cmd is not sent · d3305f34
      Mike Christie authored
      We increment session->cmdsn at the top of iscsi_prep_scsi_cmd_pdu, but
      if the prep  ecb or prep bidi or init_task calls fails then we leave the
      session->cmdsn incremented. This moves the cmdsn manipulation to the end
      of the function when we know it has succeeded.
      
      It also adds a session->cmdsn--; in queuecommand for if a driver like
      bnx2i tries to send a a task from that context but it fails. We do not
      have to do this in the xmit thread context because that code will retry
      the same task if the initial call fails.
      Signed-off-by: default avatarMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      d3305f34
    • Hannes Reinecke's avatar
      [SCSI] iscsi_tcp: Evaluate socket state in data_ready() · 523eeac6
      Hannes Reinecke authored
      The network core will call the state_change() callback
      prior to the data_ready() callback, which might cause
      us to lose a connection state change.
      So we have to evaluate the socket state at the end
      of the data_ready() callback, too.
      Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
      Signed-off-by: default avatarMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      523eeac6