1. 11 9月, 2013 1 次提交
  2. 21 6月, 2013 1 次提交
  3. 14 2月, 2013 1 次提交
  4. 28 11月, 2012 1 次提交
  5. 07 11月, 2012 1 次提交
  6. 01 11月, 2012 1 次提交
  7. 17 7月, 2012 2 次提交
  8. 07 5月, 2012 5 次提交
  9. 26 2月, 2012 3 次提交
    • N
      target: Add TMR_ABORT_TASK task management support · 3d28934a
      Nicholas Bellinger 提交于
      This patch adds initial support for TMR_ABORT_TASK ops for se_cmd
      descriptors using se_sess->sess_cmd_list and se_cmd->cmd_kref counting.
      
      It will perform an explict abort for all outstanding se_cmd ops based
      upon tmr->ref_task_tag that have not been set CMD_T_COMPLETE.
      It will cancel se_cmd->work and wait for backing I/O to complete before
      attempting to send SAM_STAT_TASK_ABORTED and perform
      target_put_sess_cmd() to release the referenced descriptor.
      
      It also adds a CMD_T_ABORTED check into transport_complete_task() to
      catch the completion from backend I/O that has been aborted, and
      updates transport_wait_for_tasks() to allow CMD_T_ABORTED usage with
      core_tmr_abort_task() context.
      Reported-by: NRoland Dreier <roland@purestorage.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      3d28934a
    • A
      target: Add SCF_SCSI_TMR_CDB usage and drop se_tmr_req_cache · c8e31f26
      Andy Grover 提交于
      Change the test for if a cmd is a tmr request to checking if
      SCF_SCSI_TMR_CDB (a new flag) is set in cmd->se_cmd_flags.
      
      Also remove se_tmr_req_cache usage in favor of kzalloc usage,
      and make core_tmr_alloc_req() return int + setup se_cmd->se_tmr_req
      directly and fix up various fabric module usages
      
      Cc: Andy Grover <agrover@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      c8e31f26
    • C
      target: replace various cmd flags with a transport state · 7d680f3b
      Christoph Hellwig 提交于
      Replace various atomic_ts used as flags in struct se_cmd with a single
      transport_state bitmap that requires t_state_lock to be held for modifications.
      
      In the target core that assumption generally is true, but some recently added
      code in the SRP target had to grow new lock calls.  I can't say I like the way
      how it messes with the command state directly, but let's leave that for later.
      
      (Re-add missing ib_srpt.c changes that nab dropped..)
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      7d680f3b
  10. 14 12月, 2011 5 次提交
  11. 06 12月, 2011 1 次提交
    • N
      target: Address legacy PYX_TRANSPORT_* return code breakage · 03e98c9e
      Nicholas Bellinger 提交于
      This patch removes legacy usage of PYX_TRANSPORT_* return codes in a number
      of locations and addresses cases where transport_generic_request_failure()
      was returning the incorrect sense upon CHECK_CONDITION status after the
      v3.1 converson to use errno return codes.
      
      This includes the conversion of transport_generic_request_failure() to
      process cmd->scsi_sense_reason and handle extra TCM_RESERVATION_CONFLICT
      before calling transport_send_check_condition_and_sense() to queue up
      response status.  It also drops PYX_TRANSPORT_OUT_OF_MEMORY_RESOURCES legacy
      usgae, and returns TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE w/ a response
      for these cases.
      
      transport_generic_allocate_tasks(), transport_generic_new_cmd(), backend
      SCF_SCSI_DATA_SG_IO_CDB ->do_task(), and emulated ->execute_task() have
      all been updated to set se_cmd->scsi_sense_reason and return errno codes
      universally upon failure.  This includes cmd->scsi_sense_reason assignment
      in target_core_alua.c, target_core_pr.c and target_core_cdb.c emulation code.
      
      Finally it updates fabric modules to remove the legacy usage, and for
      TFO->new_cmd_map() callers forwards return values outside of fabric code.
      iscsi-target has also been updated to remove a handful of special cases
      related to the cleanup and signaling QUEUE_FULL handling w/ ft_write_pending()
      
      (v2: Drop extra SCF_SCSI_CDB_EXCEPTION check during failure from
           transport_generic_new_cmd, and re-add missing task->task_error_status
           assignment in transport_complete_task)
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: stable@kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      03e98c9e
  12. 02 11月, 2011 2 次提交
    • N
      target: Remove core TRANSPORT_FREE_CMD_INTR usage · 3151d069
      Nicholas Bellinger 提交于
      This patch drops TRANSPORT_FREE_CMD_INTR usage from target core, which
      includes the removal of transport_generic_free_cmd_intr() symbol,
      TRANSPORT_FREE_CMD_INTR usage in transport_processing_thread(), and
      special case LUN_RESET handling to skip TRANSPORT_FREE_CMD_INTR processing
      in core_tmr_drain_cmd_list().  We now expect that fabric modules will
      use an internal workqueue to provide process context when releasing
      se_cmd descriptor resources via transport_generic_free_cmd().
      Reported-by: NChristoph Hellwig <hch@lst.de>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Roland Dreier <roland@purestorage.com>
      Cc: Madhuranath Iyengar <mni@risingtidesystems.com>
      Signed-off-by: NNicholas Bellinger <nab@risingtidesystems.com>
      3151d069
    • J
      target: Avoid double list_del for aborted se_tmr_req · b8a11d73
      Joern Engel 提交于
      After the list_del() in core_tmr_drain_tmr_list(),
      core_tmr_release_req() would list_del() the same object again.
      
      Call graph:
              core_tmr_drain_tmr_list
              transport_cmd_finish_abort_tmr
              transport_generic_remove
              transport_free_se_cmd
              core_tmr_release_req
      
      So use list_del_init(), as list_del() of an initialized list_head is
      safe and essentially a nop.  In the CONFIG_DEBUG_LIST case, list_del()
      actually poisons the list_head, but that is fine as we free the object
      directly afterwards.
      Signed-off-by: NJoern Engel <joern@logfs.org>
      Cc: stable@kernel.org
      Signed-off-by: NNicholas Bellinger <nab@risingtidesystems.com>
      b8a11d73
  13. 01 11月, 2011 1 次提交
  14. 27 10月, 2011 3 次提交
  15. 24 10月, 2011 10 次提交
    • C
      target: use a workqueue for I/O completions · 35e0e757
      Christoph Hellwig 提交于
      Instead of abusing the target processing thread for offloading I/O
      completion in the backends to user context add a new workqueue.  This means
      completions can be processed as fast as available CPU time allows it,
      including in parallel with other completions and more importantly I/O
      submission or QUEUE FULL retries.  This should give much better performance
      especially on loaded systems.
      
      As a fallout we can merge all the completed states into a single
      one.
      
      On the downside this change complicates lun reset handling a bit by
      requiring us to cancel a work item only for those states that have it
      initialized.  The alternative would be to either always initialize the work
      item to a dummy handler, or always use the same handler and do a switch on
      the state. The long term solution will be a flag that says that the command
      has an initialized work item, but that's only going to be useful once we
      have more users.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      35e0e757
    • C
      target: remove TRANSPORT_DEFERRED_CMD state · f2da9dbd
      Christoph Hellwig 提交于
      We never check for this state, and it makes testing for a completed
      state much harder given that it overrides the existing state.
      
      Also remove the unused deferred_t_state which is related to it.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      f2da9dbd
    • C
    • C
      target: Remove unnecessary se_task members · 04629b7b
      Christoph Hellwig 提交于
      This is a squashed version of the following unnecessary se_task structure
      member removal patches:
      
      target: remove the task_execute_queue field in se_task
      
          Instead of using a separate flag we can simply do list_emptry checks
          on t_execute_list if we make sure to always use list_del_init to remove
          a task from the list.  Also factor some duplicate code into a new
          __transport_remove_task_from_execute_queue helper.
      
      target: remove the read-only task_no field in se_task
      
          The task_no field never was initialized and only used in debug printks,
          so kill it.
      
      target: remove the task_padded_sg field in se_task
      
          This field is only check in one place and not actually needed there.
      
          Rationale:
          - transport_do_task_sg_chain asserts that we have task_sg_chaining
            set early on
          - we only make use of the sg_prev_nents field we calculate based on it
            if there is another sg list that gets chained onto this one, which
            never happens for the last (or only) task.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      04629b7b
    • C
      target: make more use of the task_flags field in se_task · 6c76bf95
      Christoph Hellwig 提交于
      Replace various atomic_t variables that were mostly under t_state_lock
      with new flags in task_flags.  Note that the execution error path
      didn't take t_state_lock before, so add it there.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      6c76bf95
    • N
      target: Merge transport_cmd_finish_abort_tmr into transport_cmd_finish_abort · 8dc52b54
      Nicholas Bellinger 提交于
      This patch merges transport_cmd_finish_abort_tmr() logic into a single
      transport_cmd_finish_abort() function by adding a cmd->se_tmr_req check
      around transport_lun_remove_cmd(), and updates the single caller within
      core_tmr_drain_tmr_list().
      Reported-by: NChristoph Hellwig <hch@lst.de>
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      8dc52b54
    • R
      target: Have core_tmr_alloc_req() take an explicit GFP_xxx flag · dd503a5f
      Roland Dreier 提交于
      Testing in_interrupt() to know when sleeping is allowed is not really
      reliable (since eg it won't be true if the caller is holding a spinlock).
      Instead have the caller tell core_tmr_alloc_req() what GFP_xxx to use;
      every caller except tcm_qla2xxx can use GFP_KERNEL.
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      dd503a5f
    • N
      target: Prevent TRANSPORT_FREE_CMD_INTR processing in core_tmr_drain_cmd_list · b0e062ae
      Nicholas Bellinger 提交于
      This patch contains a bugfix for TMR LUN_RESET related to TRANSPORT_FREE_CMD_INTR
      operation, where core_tmr_drain_cmd_list() will now skip processing for this
      case to prevent an ABORT_TASK status from being returned for descriptors that
      are already queued up to be released by processing thread context.
      
      Cc: Roland Dreier <roland@purestorage.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: stable@kernel.org
      Signed-off-by: NNicholas Bellinger <nab@risingtidesystems.com>
      b0e062ae
    • N
      target: Re-org of core_tmr_lun_reset · d050ffb9
      Nicholas Bellinger 提交于
      This patch is a re-orginzation of core_tmr_lun_reset() logic to properly
      scan the active tmr_list, dev->state_task_list and qobj->qobj_list w/ the
      relivent locks held, and performing a list_move_tail onto seperate local
      scope lists before performing the full drain.
      
      This involves breaking out the code into three seperate list specific
      functions: core_tmr_drain_tmr_list(), core_tmr_drain_task_list() and
      core_tmr_drain_cmd_list().
      
      (nab: Include target: Remove non-active tasks from execute list during
            LUN_RESET patch to address original breakage)
      Reported-by: NRoland Dreier <roland@purestorage.com>
      Cc: Roland Dreier <roland@purestorage.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: stable@kernel.org
      Signed-off-by: NNicholas Bellinger <nab@risingtidesystems.com>
      d050ffb9
    • R
      target: Prevent cmd->se_queue_node double add · 79a7fef2
      Roland Dreier 提交于
      This patch addresses a bug with the lio-core-2.6.git conversion of
      transport_add_cmd_to_queue() to use a single embedded list_head, instead
      of individual struct se_queue_req allocations allowing a single se_cmd to
      be added to the queue mulitple times.  This was changed in the following:
      
      commit 2a9e4d5ca5d99f4c600578d6285d45142e7e5208
      Author: Andy Grover <agrover@redhat.com>
      Date:   Tue Apr 26 17:45:51 2011 -0700
      
          target: Embed qr in struct se_cmd
      
      The problem is that some target code still assumes performing multiple
      adds is allowed via transport_add_cmd_to_queue(), which ends up causing
      list corruption in qobj->qobj_list code.  This patch addresses this
      by removing an existing struct se_cmd from the list before the add, and
      removes an unnecessary list walk in transport_remove_cmd_from_queue()
      
      It also changes cmd->t_transport_queue_active to use explict sets intead
      of increment/decrement to prevent confusion during exception path handling.
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Cc: Andy Grover <agrover@redhat.com>
      Cc: stable@kernel.org
      Signed-off-by: NNicholas Bellinger <nab@risingtidesystems.com>
      79a7fef2
  16. 11 10月, 2011 1 次提交
  17. 15 9月, 2011 1 次提交