1. 07 4月, 2012 2 次提交
  2. 20 3月, 2012 1 次提交
  3. 16 3月, 2012 1 次提交
  4. 11 3月, 2012 3 次提交
    • N
      target: Bump core version to v4.1.0-rc2-ml + fabric versions · 9765b1f3
      Nicholas Bellinger 提交于
      Bump core version to v4.1.0-rc2-ml, and for versions from the
      following mainline fabric modules:
      
      loopback: v2.1-rc2
      tcm_fc: v0.4
      iscsi-target: v4.1.0-rc2
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      9765b1f3
    • N
      tcm_fc: Fix fc_exch memory leak in ft_send_resp_status · 031ed4d5
      Nicholas Bellinger 提交于
      This patch fixes a bug in tcm_fc where fc_exch memory from fc_exch_mgr->ep_pool
      is currently being leaked by ft_send_resp_status() usage.  Following current
      code in ft_queue_status() response path, using lport->tt.seq_send() needs to be
      followed by a lport->tt.exch_done() in order to release fc_exch memory back into
      libfc_em kmem_cache.
      
      ft_send_resp_status() code is currently used in pre submit se_cmd ft_send_work()
      error exceptions, TM request setup exceptions, and main TM response callback
      path in ft_queue_tm_resp().  This bugfix addresses the leak in these cases.
      
      Cc: Mark D Rustad <mark.d.rustad@intel.com>
      Cc: Kiran Patil <kiran.patil@intel.com>
      Cc: Robert Love <robert.w.love@intel.com>
      Cc: Andy Grover <agrover@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      031ed4d5
    • N
      target: Drop unused legacy target_core_fabric_ops API callers · c7ec05c8
      Nicholas Bellinger 提交于
      This patch drops the following unused legacy API callers from target_core_fabric.h:
      
      *) TFO->fall_back_to_erl0()
      *) TFO->stop_session()
      *) TFO->sess_logged_in()
      *) TFO->is_state_remove()
      
      This patch also removes the stub usage in loopback, tcm_fc, iscsi_target,
      and ib_srpt fabric modules.
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      c7ec05c8
  5. 26 2月, 2012 10 次提交
  6. 22 2月, 2012 1 次提交
  7. 07 2月, 2012 1 次提交
    • A
      target: Change target_submit_cmd() to return void · 1edcdb49
      Andy Grover 提交于
      Retval not very useful, and may even be harmful. Once submitted, fabrics
      should expect a sense error if anything goes wrong. All fabrics checking
      of this retval are useless or broken:
      
      fc checks it just to emit more debug output.
      ib_srpt trickles retval up, then it is ignored.
      qla2xxx trickles it up, which then causes a bug because the abort goto
      in qla_target.c thinks cmd hasn't been sent to target.
      
      Just returning nothing is best.
      Signed-off-by: NAndy Grover <agrover@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      1edcdb49
  8. 14 12月, 2011 2 次提交
    • N
      tcm_fc: Convert ft_send_work to use target_submit_cmd · 4355a911
      Nicholas Bellinger 提交于
      This patch converts the main ft_send_work() I/O path to use
      target_submit_cmd() with a single se_cmd->cmd_kref reference
      that is released via the existing ft_check_stop_free() response
      path callback.
      
      It also makes ft_send_tm() use transport_init_se_cmd() and
      target_get_sess_cmd() to also use single se_cmd->cmd_kref
      reference.
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Kiran Patil <kiran.patil@intel.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      4355a911
    • C
      target: header reshuffle, part2 · c4795fb2
      Christoph Hellwig 提交于
      This reorganized the headers under include/target into:
      
       - target_core_base.h stays as is with all target-wide data stuctures and defines
       - target_core_backend.h contains the whole interface to I/O backends
       - target_core_fabric.h contains the whole interface to fabric modules
      
      Except for those only the various configfs macro headers stay around.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      c4795fb2
  9. 06 12月, 2011 2 次提交
    • N
      target: Drop config_item_name usage in fabric TFO->free_wwn() · 6297b07c
      Nicholas Bellinger 提交于
      This patch removes config_item_name() informational usage of
      TFO->free_wwn() treewide in loopback, tcm_fc, ib_srpt and
      tcm_vhost module code.
      
      Using v4 target_core_fabric_configfs.c logic, a fabric call for
      config_item_name() in TFO->drop_wwn() context returns NULL as
      target_fabric_drop_wwn() invoking config_item_put() ->
      config_group_put() will release fabric_port->port_wwn.wwn_group
      before the last config_item_put() -> TFO->drop_wwn() is
      invoked.
      Reported-by: NBart Van Assche <bvanassche@acm.org>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      6297b07c
    • 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
  10. 02 11月, 2011 1 次提交
    • N
      target: Make TFO->check_stop_free return free status · 88dd9e26
      Nicholas Bellinger 提交于
      This patch converts target_core_fabric_ops->check_stop_free() usage in
      transport_cmd_check_stop() and associated fabric module usage to
      return '1' when the passed se_cmd has been released directly within
      ->check_stop_free(), or return '0' when the passed se_cmd has not
      been released.
      
      This addresses an issue where transport_cmd_finish_abort() ->
      transport_cmd_check_stop_to_fabric() was leaking descriptors during
      LUN_RESET for modules using ->check_stop_free(), but not directly
      releasing se_cmd in all cases.
      
      Cc: stable@kernel.org
      Signed-off-by: NNicholas Bellinger <nab@risingtidesystems.com>
      88dd9e26
  11. 24 10月, 2011 5 次提交
  12. 11 10月, 2011 1 次提交
  13. 16 9月, 2011 2 次提交
    • C
      tcm_fc: Work queue based approach instead of managing own thread and event based mechanism · 58fc73d1
      Christoph Hellwig 提交于
      Problem: Changed from wake_up_interruptible -> wake_up_process and
      wait_event_interruptible-> schedule_timeout_interruptible broke the FCoE
      target.  Earlier approach of wake_up_interruptible was also looking at
      'queue_cnt' which is not necessary, because it increment of 'queue_cnt'
      with wake_up_inetrriptible / waker_up_process introduces race condition.
      
      Fix: Instead of fixing the code which used wake_up_process and remove
      'queue_cnt', using work_queue based approach is cleaner and acheives
      same result. As well, work queue based approach has less programming
      overhead and OS manages threads which processes work queues.
      
      This patch is developed by Christoph Hellwig and reviwed+validated by
      Kiran Patil.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NKiran Patil <kiran.patil@intel.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      58fc73d1
    • K
      tcm_fc: Invalidation of DDP context for FCoE target in error conditions · 079587b4
      Kiran Patil 提交于
      Problem: HW DDP context wasn;t invalidated in case of ABORTS, etc...
      This leads to the problem where memory pages which are used for DDP
      as user descriptor could get reused for some other purpose (such as to
      satisfy new memory allocation request either by kernel or user mode threads)
      and since HW DDP context was not invalidated, HW continue to write to
      those pages, hence causing memory corruption.
      
      Fix: Either on incoming ABORTS or due to exchange time out, allowed the
      target to cleanup HW DDP context if it was setup for respective ft_cmd.
      Added new function to perform this cleanup, furthur it can be enhanced
      for other cleanup activity.
      
      Additinal Notes: To avoid calling ddp_done from multiple places, composed
      the functionality in helper function "ft_invl_hw_context" and it is being
      called from multiple places. Cleaned up code in function "ft_recv_write_data"
      w.r.t DDP.
      Signed-off-by: NKiran Patil <kiran.patil@intel.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      079587b4
  14. 15 9月, 2011 1 次提交
  15. 23 8月, 2011 2 次提交
    • R
      target: Convert acl_node_lock to be IRQ-disabling · 28638887
      Roland Dreier 提交于
      With qla2xxx, acl_node_lock is taken inside qla2xxx's hardware_lock,
      which is taken in hardirq context.  This means acl_node_lock must become
      an IRQ-disabling lock; in particular this fixes lockdep warnings along
      the lines of
      
          ======================================================
          [ INFO: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected ]
      
           (&(&se_tpg->acl_node_lock)->rlock){+.....}, at: [<ffffffffa026f872>] transport_deregister_session+0x92/0x140 [target_core_mod]
      
          and this task is already holding:
           (&(&ha->hardware_lock)->rlock){-.-...}, at: [<ffffffffa017c5e7>] qla_tgt_stop_phase1+0x57/0x2c0 [qla2xxx]
          which would create a new lock dependency:
           (&(&ha->hardware_lock)->rlock){-.-...} -> (&(&se_tpg->acl_node_lock)->rlock){+.....}
      
          but this new dependency connects a HARDIRQ-irq-safe lock:
           (&(&ha->hardware_lock)->rlock){-.-...}
      
          to a HARDIRQ-irq-unsafe lock:
           (&(&se_tpg->acl_node_lock)->rlock){+.....}
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      28638887
    • R
      tcm_fc: init/exit functions should not be protected by "#ifdef MODULE" · 4e0f0529
      Roland Dreier 提交于
      There's no need for the #ifdef protection when building into the kernel,
      and in fact we need the module_init() for the initialization function to
      be called.
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      4e0f0529
  16. 03 8月, 2011 1 次提交
    • K
      tcm_fc: Handle DDP/SW fc_frame_payload_get failures in ft_recv_write_data · dcd998cc
      Kiran Patil 提交于
      Problem: HW DDP context was not invalidated in case of ABORTS, etc...
      This leads to the problem where memory pages which are used for DDP
      as user descriptor could get reused for some other purpose (such as to
      satisfy new memory allocation request either by kernel or user mode threads)
      and since HW DDP context was not invalidated, HW continue to write to
      those pages, hence causing memory corruption.
      
      Fix: Either on incoming ABORTS or due to exchange time out, allowed the
      target to cleanup HW DDP context if it was setup for respective ft_cmd.
      Added new function to perform this cleanup, furthur it can be enhanced
      for other cleanup activity.  Fix ft_recv_write_data() to properly handle
      fc_frame_payload_get to return pointer to payload if it exist. If there is
      no payload which is most common case (+ve case in case if DDP is working
      as expected, it will return NULL. Yes, scope of buf is limited to printk.
      Invalidation of HW context (which is done inside ft_invl_hw_context() is
      necessary in SUCCESS and FAILURE case of DDP. Hence invalidation is DONE
      as long as there was DDP setup (whether it worked correctly or not,
      
      NOTE: For some reason, if there is any error w.r.t DDP such as out of
      order packet reception, HW simply post the full packet in rx queue.
      Signed-off-by: NKiran Patil <kiran.patil@intel.com>
      Cc: Robert W Love <robert.w.love@intel.com>
      Signed-off-by: NNicholas A. Bellinger <nab@linux-iscsi.org>
      dcd998cc
  17. 22 7月, 2011 4 次提交
    • A
      target: Follow up core updates from AGrover and HCH (round 4) · 6708bb27
      Andy Grover 提交于
      This patch contains the squashed version of forth round series cleanups
      from Andy and Christoph following the post heavy lifting in the preceeding:
      'Eliminate usage of struct se_mem' and 'Make all control CDBs scatter-gather'
      changes.  This also includes a conversion of target core and the v3.0
      mainline fabric modules (loopback and tcm_fc) to use pr_debug and the
      CONFIG_DYNAMIC_DEBUG infrastructure!
      
      These have been squashed into this third and final round for v3.1.
      
      target: Remove ifdeffed code in t_g_process_write
      target: Remove direct ramdisk code
      target: Rename task_sg_num to task_sg_nents
      target: Remove custom debug macros for pr_debug. Use pr_err().
      target: Remove custom debug macros in mainline fabrics
      target: Set WSNZ=1 in block limits VPD. Abort if WRITE_SAME sectors = 0
      target: Remove transport do_se_mem_map callback
      target: Further simplify transport_free_pages
      target: Redo task allocation return value handling
      target: Remove extra parentheses
      target: change alloc_task call to take *cdb, not *cmd
      
      (nab: Fix bogus struct file assignments in fd_do_readv and fd_do_writev)
      Signed-off-by: NAndy Grover <agrover@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      6708bb27
    • A
      target: Eliminate usage of struct se_mem · ec98f782
      Andy Grover 提交于
      Both backstores and fabrics use arrays of struct scatterlist to describe
      data buffers. However TCM used struct se_mems, basically a linked list
      of scatterlist entries. We are able to simplify the code by eliminating
      this intermediate data structure and just using struct scatterlist[]
      throughout.
      
      Also, moved attachment of task to cmd out of transport_generic_get_task
      and into allocate_control_task and allocate_data_tasks. The reasoning
      is that it's nonintuitive that get_task should automatically add it to
      the cmd's task list -- it should just return an allocated, initialized
      task. That's all it should do, based on the function's name, so either the
      function shouldn't do it, or the name should change to encapsulate the
      entire essence of what it does.
      
      (nab: Fix compile warnings in tcm_fc, and make transport_kmap_first_data_page
       honor sg->offset for SGLs from contigious memory with TCM_Loop, and
       fix control se_cmd descriptor memory leak)
      Signed-off-by: NAndy Grover <agrover@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      ec98f782
    • A
      target: Make all control CDBs scatter-gather · 05d1c7c0
      Andy Grover 提交于
      Previously, some control CDBs did not allocate memory in pages for their
      data buffer, but just did a kmalloc. This patch makes all cdbs allocate
      pages.
      
      This has the benefit of streamlining some paths that had to behave
      differently when we used two allocation methods. The downside is that
      all accesses to the data buffer need to kmap it before use, and need to
      handle data in page-sized chunks if more than a page is needed for a given
      command's data buffer.
      
      Finally, note that cdbs with no data buffers are handled a little
      differently. Before, SCSI_NON_DATA_CDBs would not call get_mem at all
      (they'd be in the final else in transport_allocate_resources) but now
      these will make it into generic_get_mem, but just not allocate any
      buffers.
      Signed-off-by: NAndy Grover <agrover@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      05d1c7c0
    • N
      tcm_fc: Convert to wake_up_process and schedule_timeout_interruptible · 2be18149
      Nicholas Bellinger 提交于
      This patch converts ft_queue_cmd() to use wake_up_process() and
      ft_thread() to use schedule_timeout_interruptible(MAX_SCHEDULE_TIMEOUT)
      instead of wait_event_interruptible().  This fixes a potential race with
      the wait_event_interruptible() conditional with qobj->queue_cnt in
      ft_thread().
      
      This patch also drops the unnecessary set_user_nice(current, -20) in
      ft_thread(), and drops extra () around two if (!(acl)) conditionals in
      tfc_conf.c.
      Reported-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NNicholas A. Bellinger <nab@linux-iscsi.org>
      2be18149