1. 24 10月, 2011 4 次提交
  2. 11 10月, 2011 1 次提交
  3. 16 9月, 2011 1 次提交
  4. 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
  5. 22 7月, 2011 10 次提交
    • 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
    • C
      target: merge release_cmd methods · 35462975
      Christoph Hellwig 提交于
      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: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      35462975
    • C
    • A
      target: Updates from AGrover and HCH (round 3) · a1d8b49a
      Andy Grover 提交于
      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: NAndy Grover <agrover@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      a1d8b49a
    • A
      target: More core cleanups from AGrover (round 2) · 5951146d
      Andy Grover 提交于
      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: NAndy Grover <agrover@redhat.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      5951146d
    • A
      target: Core cleanups from AGrover (round 1) · e3d6f909
      Andy Grover 提交于
      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: NAndy Grover <agrover@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      e3d6f909
    • N
      target: Remove unnecessary *cdb transport_get_lun_for_cmd parameter · efa4988d
      Nicholas Bellinger 提交于
      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: NFubo Chen <fubo.chen@gmail.com>
      Signed-off-by: NNicholas A. Bellinger <nab@linux-iscsi.org>
      efa4988d
  6. 30 6月, 2011 2 次提交
    • K
      [SCSI] tcm_fc: Fixing reference counting problem which was causing ft_sess to be deleted. · f2f7b09c
      Kiran Patil 提交于
      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: NKiran Patil <kiran.patil@intel.com>
      Signed-off-by: NRobert Love <robert.w.love@intel.com>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      f2f7b09c
    • Y
      [SCSI] libfc, tcm_fc: add ddp_targ() to libfc function template to supprot FCoE DDP in target mode · 33dc362b
      Yi Zou 提交于
      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: NYi Zou <yi.zou@intel.com>
      Signed-off-by: NKiran Patil <kiran.patil@intel.com>
      Signed-off-by: NRobert Love <robert.w.love@intel.com>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      33dc362b
  7. 24 6月, 2011 1 次提交
    • K
      tcm_fc: Fix ft_send_tm LUN lookup OOPs · 61db9527
      Kiran Patil 提交于
      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: NPatil, Kiran <kiran.patil@intel.com>
      Signed-off-by: NRobert Love <robert.w.love@intel.com>
      Signed-off-by: NNicholas A. Bellinger <nab@linux-iscsi.org>
      61db9527
  8. 20 6月, 2011 1 次提交
  9. 27 5月, 2011 1 次提交
  10. 25 5月, 2011 1 次提交
  11. 17 5月, 2011 1 次提交