1. 13 8月, 2015 1 次提交
    • J
      libiscsi: Fix host busy blocking during connection teardown · 660d0831
      John Soni Jose 提交于
      In case of hw iscsi offload, an host can have N-number of active
      connections. There can be IO's running on some connections which
      make host->host_busy always TRUE. Now if logout from a connection
      is tried then the code gets into an infinite loop as host->host_busy
      is always TRUE.
      
       iscsi_conn_teardown(....)
       {
         .........
          /*
           * Block until all in-progress commands for this connection
           * time out or fail.
           */
           for (;;) {
            spin_lock_irqsave(session->host->host_lock, flags);
            if (!atomic_read(&session->host->host_busy)) { /* OK for ERL == 0 */
      	      spin_unlock_irqrestore(session->host->host_lock, flags);
                    break;
            }
           spin_unlock_irqrestore(session->host->host_lock, flags);
           msleep_interruptible(500);
           iscsi_conn_printk(KERN_INFO, conn, "iscsi conn_destroy(): "
                       "host_busy %d host_failed %d\n",
      	          atomic_read(&session->host->host_busy),
      	          session->host->host_failed);
      
      	................
      	...............
           }
        }
      
      This is not an issue with software-iscsi/iser as each cxn is a separate
      host.
      
      Fix:
      Acquiring eh_mutex in iscsi_conn_teardown() before setting
      session->state = ISCSI_STATE_TERMINATE.
      Signed-off-by: NJohn Soni Jose <sony.john@avagotech.com>
      Reviewed-by: NMike Christie <michaelc@cs.wisc.edu>
      Reviewed-by: NChris Leech <cleech@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJames Bottomley <JBottomley@Odin.com>
      660d0831
  2. 24 11月, 2014 2 次提交
  3. 12 11月, 2014 1 次提交
    • C
      scsi: don't set tagging state from scsi_adjust_queue_depth · c8b09f6f
      Christoph Hellwig 提交于
      Remove the tagged argument from scsi_adjust_queue_depth, and just let it
      handle the queue depth.  For most drivers those two are fairly separate,
      given that most modern drivers don't care about the SCSI "tagged" status
      of a command at all, and many old drivers allow queuing of multiple
      untagged commands in the driver.
      
      Instead we start out with the ->simple_tags flag set before calling
      ->slave_configure, which is how all drivers actually looking at
      ->simple_tags except for one worke anyway.  The one other case looks
      broken, but I've kept the behavior as-is for now.
      
      Except for that we only change ->simple_tags from the ->change_queue_type,
      and when rejecting a tag message in a single driver, so keeping this
      churn out of scsi_adjust_queue_depth is a clear win.
      
      Now that the usage of scsi_adjust_queue_depth is more obvious we can
      also remove all the trivial instances in ->slave_alloc or ->slave_configure
      that just set it to the cmd_per_lun default.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NMike Christie <michaelc@cs.wisc.edu>
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Reviewed-by: NMartin K. Petersen <martin.petersen@oracle.com>
      c8b09f6f
  4. 30 9月, 2014 1 次提交
  5. 19 9月, 2014 1 次提交
  6. 16 9月, 2014 1 次提交
  7. 01 8月, 2014 1 次提交
  8. 25 7月, 2014 1 次提交
  9. 18 7月, 2014 1 次提交
  10. 12 6月, 2014 1 次提交
  11. 19 5月, 2014 1 次提交
  12. 18 3月, 2014 1 次提交
    • S
      SCSI/libiscsi: Add check_protection callback for transports · 55e51eda
      Sagi Grimberg 提交于
      iSCSI needs to be at least aware that a task involves protection
      information.  In case it does, after the transaction completed libiscsi
      will ask the transport to check the protection status of the
      transaction.
      
      Unlike transport errors, DIF errors should not prevent successful
      completion of the transaction from the transport point of view, but
      should be escelated to scsi mid-layer when constructing the scsi
      result and sense data.
      
      check_protection routine will return the ascq corresponding to the DIF
      error that occured (or 0 if no error happened).
      
      return ascq:
      - 0x1: GUARD_CHECK_FAILED
      - 0x2: APPTAG_CHECK_FAILED
      - 0x3: REFTAG_CHECK_FAILED
      Signed-off-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NAlex Tabachnik <alext@mellanox.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      55e51eda
  13. 16 3月, 2014 3 次提交
    • M
      [SCSI] libiscsi: remove unneeded queue work when max_cmdsn is increased · 46a84c65
      Mike Christie 提交于
      iscsi_queuecommand will only take in commands that can fit in the
      current window. So, if a command is on the cmdqueue then it can
      fit in the current window. If a command is on the mgmtqueue, then
      we are setting the immediate bit so they will also fit in the
      window. As a result, we never need to to do a iscsi_conn_queue_work
      when the maxCmdSn is increased.
      
      What should happen is that a command will complete the window will
      be increased, then the scsi layer will send us more commands by
      running the scsi_device queues.
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      46a84c65
    • S
      [SCSI] libiscsi: Reduce locking contention in fast path · 659743b0
      Shlomo Pongratz 提交于
      Replace the session lock with two locks, a forward lock and
      a backwards lock named frwd_lock and back_lock respectively.
      
      The forward lock protects resources that change while sending a
      request to the target, such as cmdsn, queued_cmdsn, and allocating
      task from the commands' pool with kfifo_out.
      
      The backward lock protects resources that change while processing
      a response or in error path, such as cmdsn_exp, cmdsn_max, and
      returning tasks to the commands' pool with kfifo_in.
      
      Under a steady state fast-path situation, that is when one
      or more processes/threads submit IO to an iscsi device and
      a single kernel upcall (e.g softirq) is dealing with processing
      of responses without errors, this patch eliminates the contention
      between the queuecommand()/request response/scsi_done() flows
      associated with iscsi sessions.
      
      Between the forward and the backward locks exists a strict locking
      hierarchy. The mutual exclusion zone protected by the forward lock can
      enclose the mutual exclusion zone protected by the backward lock but not
      vice versa.
      
      For example, in iscsi_conn_teardown or in iscsi_xmit_data when there is
      a failure and __iscsi_put_task is called, the backward lock is taken while
      the forward lock is still taken. On the other hand, if in the RX path a nop
      is to be sent, for example in iscsi_handle_reject or __iscsi_complete_pdu
      than the forward lock is released and the backward lock is taken for the
      duration of iscsi_send_nopout, later the backward lock is released and the
      forward lock is retaken.
      
      libiscsi_tcp uses two kernel fifos the r2t pool and the r2t queue.
      
      The insertion and deletion from these queues didn't corespond to the
      assumption taken by the new forward/backwards session locking paradigm.
      
      That is, in iscsi_tcp_clenup_task which belongs to the RX (backwards)
      path, r2t is taken out from r2t queue and inserted to the r2t pool.
      In iscsi_tcp_get_curr_r2t which belong to the TX (forward) path, r2t
      is also inserted to the r2t pool and another r2t is pulled from r2t
      queue.
      
      Only in iscsi_tcp_r2t_rsp which is called in the RX path but can requeue
      to the TX path, r2t is taken from the r2t pool and inserted to the r2t
      queue.
      
      In order to cope with this situation, two spin locks were added,
      pool2queue and queue2pool. The former protects extracting from the
      r2t pool and inserting to the r2t queue, and the later protects the
      extracing from the r2t queue and inserting to the r2t pool.
      Signed-off-by: NShlomo Pongratz <shlomop@mellanox.com>
      Signed-off-by: NOr Gerlitz <ogerlitz@mellanox.com>
      [minor fix up to apply cleanly and compile fix]
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      659743b0
    • V
      [SCSI] iscsi: fix wrong order of opcode and itt in iscsi_handle_reject prompt · e5dbbe27
      Vaughan Cao 提交于
      This patch makes reject messages show right value for opcode and itt, which
      is converse previously.
      Signed-off-by: NVaughan Cao <vaughan.cao@oracle.com>
      Acked-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      e5dbbe27
  14. 20 12月, 2013 1 次提交
  15. 26 8月, 2013 1 次提交
  16. 24 8月, 2013 3 次提交
  17. 27 6月, 2013 1 次提交
  18. 12 4月, 2013 2 次提交
  19. 19 2月, 2012 3 次提交
  20. 01 11月, 2011 1 次提交
  21. 27 8月, 2011 1 次提交
  22. 25 7月, 2011 3 次提交
  23. 30 6月, 2011 1 次提交
  24. 25 2月, 2011 1 次提交
  25. 31 12月, 2010 3 次提交
  26. 22 12月, 2010 1 次提交
  27. 17 11月, 2010 1 次提交
    • J
      SCSI host lock push-down · f281233d
      Jeff Garzik 提交于
      Move the mid-layer's ->queuecommand() invocation from being locked
      with the host lock to being unlocked to facilitate speeding up the
      critical path for drivers who don't need this lock taken anyway.
      
      The patch below presents a simple SCSI host lock push-down as an
      equivalent transformation.  No locking or other behavior should change
      with this patch.  All existing bugs and locking orders are preserved.
      
      Additionally, add one parameter to queuecommand,
      	struct Scsi_Host *
      and remove one parameter from queuecommand,
      	void (*done)(struct scsi_cmnd *)
      
      Scsi_Host* is a convenient pointer that most host drivers need anyway,
      and 'done' is redundant to struct scsi_cmnd->scsi_done.
      
      Minimal code disturbance was attempted with this change.  Most drivers
      needed only two one-line modifications for their host lock push-down.
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      Acked-by: NJames Bottomley <James.Bottomley@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f281233d
  28. 02 5月, 2010 1 次提交
    • M
      [SCSI] libiscsi: regression: fix header digest errors · 96b1f96d
      Mike Christie 提交于
      This fixes a regression introduced with this commit:
      
      commit d3305f34
      Author: Mike Christie <michaelc@cs.wisc.edu>
      Date:   Thu Aug 20 15:10:58 2009 -0500
      
          [SCSI] libiscsi: don't increment cmdsn if cmd is not sent
      
      in 2.6.32.
      
      When I moved the hdr->cmdsn after init_task, I added
      a bug when header digests are used. The problem is
      that the LLD may calculate the header digest in init_task,
      so if we then set the cmdsn after the init_task call we
      change what the digest will be calculated by the target.
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Cc: Stable Tree <stable@kernel.org>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      96b1f96d