An error occurred fetching the project authors.
  1. 25 Feb, 2012 4 commits
  2. 07 Feb, 2012 1 commit
    • Andy Grover's avatar
      target: Change target_submit_cmd() to return void · 1edcdb49
      Andy Grover authored
      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: default avatarAndy Grover <agrover@redhat.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      1edcdb49
  3. 14 Dec, 2011 2 commits
    • Nicholas Bellinger's avatar
      tcm_fc: Convert ft_send_work to use target_submit_cmd · 4355a911
      Nicholas Bellinger authored
      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: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      4355a911
    • Christoph Hellwig's avatar
      target: header reshuffle, part2 · c4795fb2
      Christoph Hellwig authored
      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: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      c4795fb2
  4. 06 Dec, 2011 1 commit
    • Nicholas Bellinger's avatar
      target: Address legacy PYX_TRANSPORT_* return code breakage · 03e98c9e
      Nicholas Bellinger authored
      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: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      03e98c9e
  5. 02 Nov, 2011 1 commit
    • Nicholas Bellinger's avatar
      target: Make TFO->check_stop_free return free status · 88dd9e26
      Nicholas Bellinger authored
      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: default avatarNicholas Bellinger <nab@risingtidesystems.com>
      88dd9e26
  6. 24 Oct, 2011 4 commits
  7. 11 Oct, 2011 1 commit
  8. 16 Sep, 2011 1 commit
  9. 15 Sep, 2011 1 commit
  10. 03 Aug, 2011 1 commit
    • Kiran Patil's avatar
      tcm_fc: Handle DDP/SW fc_frame_payload_get failures in ft_recv_write_data · dcd998cc
      Kiran Patil authored
      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: default avatarKiran Patil <kiran.patil@intel.com>
      Cc: Robert W Love <robert.w.love@intel.com>
      Signed-off-by: default avatarNicholas A. Bellinger <nab@linux-iscsi.org>
      dcd998cc
  11. 22 Jul, 2011 10 commits
    • Andy Grover's avatar
      target: Follow up core updates from AGrover and HCH (round 4) · 6708bb27
      Andy Grover authored
      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: default avatarAndy Grover <agrover@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      6708bb27
    • Andy Grover's avatar
      target: Eliminate usage of struct se_mem · ec98f782
      Andy Grover authored
      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: default avatarAndy Grover <agrover@redhat.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      ec98f782
    • Andy Grover's avatar
      target: Make all control CDBs scatter-gather · 05d1c7c0
      Andy Grover authored
      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: default avatarAndy Grover <agrover@redhat.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      05d1c7c0
    • Nicholas Bellinger's avatar
      tcm_fc: Convert to wake_up_process and schedule_timeout_interruptible · 2be18149
      Nicholas Bellinger authored
      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: default avatarChristoph Hellwig <hch@infradead.org>
      Signed-off-by: default avatarNicholas A. Bellinger <nab@linux-iscsi.org>
      2be18149
    • Christoph Hellwig's avatar
      target: merge release_cmd methods · 35462975
      Christoph Hellwig authored
      The release_cmd_to_pool and release_cmd_direct methods are always the same.
      Merge them into a single release_cmd method, and clean up the fallout.
      
      (nab: fix breakage in transport_generic_free_cmd() parameter build breakage
       in drivers/target/tcm_fc/tfc_cmd.c)
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      35462975
    • Christoph Hellwig's avatar
    • Andy Grover's avatar
      target: Updates from AGrover and HCH (round 3) · a1d8b49a
      Andy Grover authored
      This patch contains a squashed version of third round series cleanups,
      improvements ,and simplfications from Andy and Christoph ahead of the
      heavy lifting between round 3 -> 4 for the target core SGL conversion.
      
      This include cleanups to the main target I/O path and other miscellaneous
      updates.
      
      target: Replace custom sg<->buf functions with lib funcs
      target: Simplify sector limiting code
      target: get_cdb should never return NULL
      target: Simplify transport_memcpy_se_mem_read_contig
      target: Use assignment rather than increment for t_task_cdbs
      target: Don't pass dma_size to generic_get_mem
      target: Pass sg with type scatterlist in transport_map_sg_to_mem
      target: Move task_sg_num next to task_sg in struct se_task
      target: inline struct se_transport_task into struct se_cmd
      target: Change name & semantics of transport_get_sectors()
      target: Remove unused members of se_cmd
      target: Rename se_cmd.t_task_cdbs to t_task_list_num
      target: Fix some spelling
      target: Remove unused var from transport_generic_do_tmr
      target: map_sg_to_mem: return sg_count in return value
      target/pscsi: Use min_t for sector limits
      target/pscsi: Unused param for pscsi_get_bio()
      target: Rename get_cdb_count to allocate_tasks
      target: Make transport_generic_new_cmd() available for iscsi-target
      target: Remove fabric callback to allocate iovecs
      target: Fix transport_generic_new_cmd WRITE comment
      
      (hch: Use __GFP_ZERO usage for alloc_pages() usage)
      Signed-off-by: default avatarAndy Grover <agrover@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      a1d8b49a
    • Andy Grover's avatar
      target: More core cleanups from AGrover (round 2) · 5951146d
      Andy Grover authored
      This patch contains the squashed version of second round of target core
      cleanups and simplifications and Andy and Co.   It also contains a handful
      of fixes to address bugs the original series and other minor cleanups.
      
      Here is the condensed shortlog:
      
      target: Remove unneeded casts to void*
      target: Rename get_lun_for_{cmd,tmr} to lookup_{cmd,tmr}_lun
      target: Make t_task a member of se_cmd, not a pointer
      target: Handle functions returning "-2"
      target: Use cmd->se_dev over cmd->se_lun->lun_se_dev
      target: Embed qr in struct se_cmd
      target: Replace embedded struct se_queue_req with a list_head
      target: Rename list_heads that are nodes in struct se_cmd to "*_node"
      target: Fold transport_device_setup_cmd() into lookup_{tmr,cmd}_lun()
      target: Make t_mem_list and t_mem_list_bidi members of t_task
      target: Add comment & cleanup transport_map_sg_to_mem()
      target: Remove unneeded checks in transport_free_pages()
      
      (Roland: Fix se_queue_req removal leftovers OOPs)
      (nab: Fix transport_lookup_tmr_lun failure case)
      (nab: Fix list_empty(&cmd->t_task.t_mem_bidi_list) inversion bugs)
      Signed-off-by: default avatarAndy Grover <agrover@redhat.com>
      Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      5951146d
    • Andy Grover's avatar
      target: Core cleanups from AGrover (round 1) · e3d6f909
      Andy Grover authored
      This patch contains the squashed version of a number of cleanups and
      minor fixes from Andy's initial series (round 1) for target core this
      past spring.  The condensed log looks like:
      
      target: use errno values instead of returning -1 for everything
      target: Rename transport_calc_sg_num to transport_init_task_sg
      target: Fix leak in error path in transport_init_task_sg
      target/pscsi: Remove pscsi_get_sh() usage
      target: Make two runtime checks into WARN_ONs
      target: Remove hba queue depth and convert to spin_lock_irq usage
      target: dev->dev_status_queue_obj is unused
      target: Make struct se_queue_req.cmd type struct se_cmd *
      target: Remove __transport_get_qr_from_queue()
      target: Rename se_dev->g_se_dev_list to se_dev_node
      target: Remove struct se_global
      target: Simplify scsi mib index table code
      target: Make dev_queue_obj a member of se_device instead of a pointer
      target: remove extraneous returns at end of void functions
      target: Ensure transport_dump_vpd_ident_type returns null-terminated str
      target: Function pointers don't need to use '&' to be assigned
      target: Fix comment in __transport_execute_tasks()
      target: Misc style cleanups
      target: rename struct pr_reservation_template to pr_reservation
      target: Remove #defines that just perform indirection
      target: Inline transport_get_task_from_execute_queue()
      target: Minor header comment fixes
      Signed-off-by: default avatarAndy Grover <agrover@redhat.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      e3d6f909
    • Nicholas Bellinger's avatar
      target: Remove unnecessary *cdb transport_get_lun_for_cmd parameter · efa4988d
      Nicholas Bellinger authored
      This patch removes the now unnecessary 'unsigned char *cdb' function
      parameter from transport_get_lun_for_cmd().  This also includes updating
      lio-target, tcm_loop and tcm_fc usage of transport_get_lun_for_cmd().
      Reported-by: default avatarFubo Chen <fubo.chen@gmail.com>
      Signed-off-by: default avatarNicholas A. Bellinger <nab@linux-iscsi.org>
      efa4988d
  12. 29 Jun, 2011 2 commits
    • Kiran Patil's avatar
      [SCSI] tcm_fc: Fixing reference counting problem which was causing ft_sess to be deleted. · f2f7b09c
      Kiran Patil authored
      Problem: After fixing the issue in TCM core w.r.t LUN Reset (Task
      Management request) , ran into issue where during the completing of
      this LUN Reset command, reference count of "ft_sess" drops to zero
      which caused "sess" to be deleted.
      
      Fix: As part of handling task management request (e.g. LUN Reset), TCM
      core function "transport_generic_do_tmr" ends up calling ft_free_cmd
      which in turn calls "ft_sess_put" (which drops session's reference
      count by 1) and then frees ft_cmd. Then function
      "transport_generic_do_tmr" calls "transport_cmd_check_stop" which in
      turn also calls ft_free_cmd (which calls ft_sess_put - which drops
      reference count of sess by 1, hence reference count of sess becomes
      zero and session gets deleted). Fix is to just send response in case
      of tmr from function "ft_queue_resp_code" and not delete "ft_cmd"
      (means don't call ft_free_cmd). Earlier code was to send the response
      code and also free ft_cmd. ft_free_cmd will be freed later after
      sending response code as a result of "transport_cmd_check_stop" (which
      calls ft_release_cmd -> ft_free_cmd) being called from
      "transport_generic_do_tmr" after sening TMR response code.
      
      Notes/Dependencies: This bug was found after fixing NULL pointer
      access issue in TCM core (in LUN Reset codepath)
      Signed-off-by: default avatarKiran Patil <kiran.patil@intel.com>
      Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      f2f7b09c
    • Yi Zou's avatar
      [SCSI] libfc, tcm_fc: add ddp_targ() to libfc function template to supprot FCoE DDP in target mode · 33dc362b
      Yi Zou authored
      The fcoe driver can implement ddp_targ() similarly to ddp_setup() when fcoe
      stack works with existing target frame, e.g., tcm, where the ddp_targ() would
      eventually point to the underlying hardware driver's implementation of
      ndo_fcoe_ddp_targ() through net_device_ops. This new API sets up DDP context
      for target appropriately by setting required bits for DDP context.
      Signed-off-by: default avatarYi Zou <yi.zou@intel.com>
      Signed-off-by: default avatarKiran Patil <kiran.patil@intel.com>
      Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      33dc362b
  13. 24 Jun, 2011 1 commit
    • Kiran Patil's avatar
      tcm_fc: Fix ft_send_tm LUN lookup OOPs · 61db9527
      Kiran Patil authored
      This patch fixes a bug in ft_send_tm() that was incorrectly calling
      ft_get_lun_for_cmd() -> transport_get_lun_for_cmd(), instead of using
      transport_get_lun_for_tmr() for the proper struct se_lun lookup
      that was triggering an OOPs in the se_cmd->tmr_req failure path.
      
      This patch fixes the issue by re-arranging the codepath where
      transport_get_lun_for_tmr() is called after tmr request is allocated and
      made it available as part of se_cmd.
      
      It also drops the now unnecessary ft_get_lun_for_cmd() unpacking code, and
      uses scsilun_to_int() directly ahead of transport_get_lun_for_cmd() and
      transport_get_lun_for_tmr() usage.
      Signed-off-by: default avatarPatil, Kiran <kiran.patil@intel.com>
      Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
      Signed-off-by: default avatarNicholas A. Bellinger <nab@linux-iscsi.org>
      61db9527
  14. 20 Jun, 2011 1 commit
  15. 27 May, 2011 1 commit
  16. 24 May, 2011 1 commit
  17. 17 May, 2011 1 commit
    • Kiran Patil's avatar
      [SCSI] tcm_fc: Adding FC_FC4 provider (tcm_fc) for FCoE target (TCM - target core) support · 3699d92a
      Kiran Patil authored
      This is a comprehensive patch for FC-FC4 provider. tcm_fc is a FC-FC4
      provider which glues target core (TCM) with Fiber channel library
      (libfc). tcm_fc uses existing FC4 provider hooks from Fiber channel
      library. This Fiber channel library is used by FCoE (transport - FC
      over Ethernet) protocol driver as well.
      
      Combination of modules such as Fiber channel library, tcm_fc, TCM
      target core, and FCoE protocol driver enables functional FCoE target.
      
      This patch includes initial commit for tcm_fc plus additional
      enhancement, bug fixes.
      
      This tcm_fc module essentially contains 3 entry points such as "prli",
      "prlo", "recv".  When process login request (ELS_PRLI) request is
      received, Fiber channel library (libfc) module calls passive providers
      (FC-FC4, tcm_fc) (if any registered) "prli" function. Likewise when
      LOGO request is received, "prlo" function of passive provider is
      invoked by libfc.  For all other request (e.g. any read/write, task
      management, LUN inquiry commands), "recv" function of passiver
      provider is invoked by libfc. Those passive providers "prli, prlo,
      recv" functions interact with TCM target core for requested operation.
      
      This module was primarily developed by "Joe Eykholt" and there were
      significant contributions from the people listed under signed-off.
      Signed-off-by: default avatarJoe Eykholt <jeykholt@cisco.com>
      Signed-off-by: default avatarNicholas A. Bellinger <nab@linux-iscsi.org>
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarYi Zou <yi.zou@intel.com>
      Signed-off-by: default avatarKiran Patil <kiran.patil@intel.com>
      Acked-by: default avatarRobert Love <robert.w.love@intel.com>
      Signed-off-by: default avatarJames Bottomley <jbottomley@parallels.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      3699d92a