24 Nov, 2014

2 commits

  • Drop the now unused reason argument from the ->change_queue_depth method.
    Also add a return value to scsi_adjust_queue_depth, and rename it to
    scsi_change_queue_depth now that it can be used as the default
    ->change_queue_depth implementation.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Mike Christie
    Reviewed-by: Hannes Reinecke

    Christoph Hellwig
     
  • All drivers use the implementation for ramping the queue up and down, so
    instead of overloading the change_queue_depth method call the
    implementation diretly if the driver opts into it by setting the
    track_queue_depth flag in the host template.

    Note that a few drivers validated the new queue depth in their
    change_queue_depth method, but as we never go over the queue depth
    set during slave_configure or the sysfs file this isn't nessecary
    and can safely be removed.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Mike Christie
    Reviewed-by: Hannes Reinecke
    Reviewed-by: Venkatesh Srinivas

    Christoph Hellwig
     

12 Nov, 2014

4 commits

  • Now that we also get proper values in cmd->request->tag for untagged
    commands, there is no need to force tagged_supported to on in drivers
    that need host-wide tags.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Mike Christie
    Reviewed-by: Hannes Reinecke

    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: Christoph Hellwig
    Reviewed-by: Mike Christie
    Reviewed-by: Hannes Reinecke
    Reviewed-by: Martin K. Petersen

    Christoph Hellwig
     
  • Allow a driver to ask for block layer tags by setting .use_blk_tags in the
    host template, in which case it will always see a valid value in
    request->tag, similar to the behavior when using blk-mq. This means even
    SCSI "untagged" commands will now have a tag, which is especially useful
    when using a host-wide tag map.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Mike Christie
    Reviewed-by: Martin K. Petersen
    Reviewed-by: Hannes Reinecke

    Christoph Hellwig
     
  • Unless we want to build a SPI tag message we should just check SCMD_TAGGED
    instead of reverse engineering a tag type through the use of
    scsi_populate_tag_msg.

    Also rename the function to spi_populate_tag_msg, make it behave like the
    other spi message helpers, and move it to the spi transport class.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Mike Christie
    Reviewed-by: Hannes Reinecke

    Christoph Hellwig
     

01 Aug, 2014

1 commit


30 Jul, 2014

4 commits


18 Jul, 2014

1 commit

  • The SCSI standard defines 64-bit values for LUNs, and large arrays
    employing large or hierarchical LUN numbers become more and more
    common.

    So update the linux SCSI stack to use 64-bit LUN numbers.

    Signed-off-by: Hannes Reinecke
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Ewan Milne
    Signed-off-by: Christoph Hellwig

    Hannes Reinecke
     

29 May, 2014

1 commit


20 May, 2014

16 commits


16 Mar, 2014

11 commits

  • 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: Shlomo Pongratz
    Signed-off-by: Or Gerlitz
    [minor fix up to apply cleanly and compile fix]
    Signed-off-by: Mike Christie
    Signed-off-by: James Bottomley

    Shlomo Pongratz
     
  • Signed-off-by: Vikas Chaudhary
    Signed-off-by: James Bottomley

    Vikas Chaudhary
     
  • Fix following sparse warnings:-
    drivers/scsi/qla4xxx/ql4_os.c:2109:33: warning: cast truncates bits from constant value (ffff7fff becomes 7fff)
    drivers/scsi/qla4xxx/ql4_os.c:2306:33: warning: cast truncates bits from constant value (ffff7fff becomes 7fff)

    Signed-off-by: Vikas Chaudhary
    Reviewed-by: Mike Christie
    Signed-off-by: James Bottomley

    Vikas Chaudhary
     
  • Signed-off-by: Nilesh Javali
    Signed-off-by: Vikas Chaudhary
    Reviewed-by: Mike Christie
    Signed-off-by: James Bottomley

    Nilesh Javali
     
  • Signed-off-by: Vikas Chaudhary
    Reviewed-by: Mike Christie
    Signed-off-by: James Bottomley

    Vikas Chaudhary
     
  • Signed-off-by: Vikas Chaudhary
    Reviewed-by: Mike Christie
    Signed-off-by: James Bottomley

    Vikas Chaudhary
     
  • Signed-off-by: Vikas Chaudhary
    Reviewed-by: Mike Christie
    Signed-off-by: James Bottomley

    Vikas Chaudhary
     
  • Signed-off-by: Vikas Chaudhary
    Reviewed-by: Mike Christie
    Signed-off-by: James Bottomley

    Vikas Chaudhary
     
  • Removing unused code as FW does not need any value in mbox-5.

    Signed-off-by: Vikas Chaudhary
    Reviewed-by: Mike Christie
    Signed-off-by: James Bottomley

    Vikas Chaudhary
     
  • Issue:
    While unloading driver MBOX 0x31 fail as DDB logout (MBOX 0x56)
    operation is not completed.

    Fix:
    Wait for DDB Logout completion before MBOX 0x31

    Signed-off-by: Vikas Chaudhary
    Reviewed-by: Mike Christie
    Signed-off-by: James Bottomley

    Vikas Chaudhary
     
  • Issue:
    Driver holds rom-lock for too long during reset recovery.

    During adapter reset testing, it was found that the driver
    holds the rom-lock for too long, because of which other
    drivers fail to acquire the rom-lock, leading to reset
    failures.
    The primary cause is, in the bootstrap code, while
    holding the rom-lock, the driver checks if the peg is
    halted, causing a 2 second contention.

    Fix:
    When a reset recovery starts, the driver deduces the cause, and
    sets appropriate flags in watchdog & recover_adapter routines.
    This flag should be used to determine if bootstrap is invoked
    from probe or reset context, reducing the rom-lock footprint of
    the drivers.

    Signed-off-by: Vikas Chaudhary
    Reviewed-by: Mike Christie
    Signed-off-by: James Bottomley

    Vikas Chaudhary