15 Jul, 2015

1 commit

  • We might return res which is not initialized. Also
    reduce code duplication by exporting srp_parse_tmo so
    srp_tmo_set can reuse it.

    Detected by Coverity.

    Signed-off-by: Sagi Grimberg
    Signed-off-by: Jenny Falkovich
    Reviewed-by: Bart Van Assche
    Signed-off-by: Doug Ledford

    Sagi Grimberg
     

19 May, 2015

3 commits

  • Unlike FC, there is no risk that SCSI devices will be offlined
    by the SCSI error handler if the SCSI error handler is started
    while a reconnect attempt is ongoing. Hence report timeout errors
    as soon as possible if a higher software layer (e.g. multipathd)
    needs to be informed about a timeout. It is assumed that if both
    fast_io_fail_tmo < 0 and rport->dev_loss_tmo < 0 that this means
    that there is no need to report timeouts quickly.

    Signed-off-by: Bart Van Assche
    Cc: James Bottomley
    Cc: Sagi Grimberg
    Cc: Sebastian Parschauer
    Signed-off-by: Doug Ledford

    Bart Van Assche
     
  • Avoid that srp_terminate_io() can get invoked while srp_queuecommand()
    is in progress. This patch avoids that an I/O timeout can trigger the
    following kernel warning:

    WARNING: at drivers/infiniband/ulp/srp/ib_srp.c:1447 srp_terminate_io+0xef/0x100 [ib_srp]()
    Call Trace:
    [] dump_stack+0x4e/0x68
    [] warn_slowpath_common+0x81/0xa0
    [] warn_slowpath_null+0x1a/0x20
    [] srp_terminate_io+0xef/0x100 [ib_srp]
    [] __rport_fail_io_fast+0xba/0xc0 [scsi_transport_srp]
    [] rport_fast_io_fail_timedout+0xe0/0xf0 [scsi_transport_srp]
    [] process_one_work+0x1db/0x780
    [] worker_thread+0x11b/0x450
    [] kthread+0xe4/0x100
    [] ret_from_fork+0x7c/0xb0

    See also patch "scsi_transport_srp: Add transport layer error
    handling" (commit ID 29c17324803c).

    Signed-off-by: Bart Van Assche
    Cc: James Bottomley
    Cc: Sagi Grimberg
    Cc: Sebastian Parschauer
    Cc: #v3.13
    Signed-off-by: Doug Ledford

    Bart Van Assche
     
  • Introduce the helper function srp_wait_for_queuecommand().
    Move the definition of scsi_request_fn_active(). Add a comment
    above srp_wait_for_queuecommand() that support for scsi-mq needs
    to be added.

    This patch does not change any functionality. A second call to
    srp_wait_for_queuecommand() will be introduced in the next patch.

    Signed-off-by: Bart Van Assche
    Cc: James Bottomley
    Cc: Sagi Grimberg
    Cc: Sebastian Parschauer
    Cc: #v3.13
    Signed-off-by: Doug Ledford

    Bart Van Assche
     

15 Aug, 2014

1 commit

  • Pull infiniband/rdma updates from Roland Dreier:
    "Main set of InfiniBand/RDMA updates for 3.17 merge window:

    - MR reregistration support
    - MAD support for RMPP in userspace
    - iSER and SRP initiator updates
    - ocrdma hardware driver updates
    - other fixes..."

    * tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: (52 commits)
    IB/srp: Fix return value check in srp_init_module()
    RDMA/ocrdma: report asic-id in query device
    RDMA/ocrdma: Update sli data structure for endianness
    RDMA/ocrdma: Obtain SL from device structure
    RDMA/uapi: Include socket.h in rdma_user_cm.h
    IB/srpt: Handle GID change events
    IB/mlx5: Use ARRAY_SIZE instead of sizeof/sizeof[0]
    IB/mlx4: Use ARRAY_SIZE instead of sizeof/sizeof[0]
    RDMA/amso1100: Check for integer overflow in c2_alloc_cq_buf()
    IPoIB: Remove unnecessary test for NULL before debugfs_remove()
    IB/mad: Add user space RMPP support
    IB/mad: add new ioctl to ABI to support new registration options
    IB/mad: Add dev_notice messages for various umad/mad registration failures
    IB/mad: Update module to [pr|dev]_* style print messages
    IB/ipoib: Avoid multicast join attempts with invalid P_key
    IB/umad: Update module to [pr|dev]_* style print messages
    IB/ipoib: Avoid flushing the workqueue from worker context
    IB/ipoib: Use P_Key change event instead of P_Key polling mechanism
    IB/ipath: Add P_Key change event support
    mlx4_core: Add support for secure-host and SMP firewall
    ...

    Linus Torvalds
     

02 Aug, 2014

1 commit

  • If scsi_remove_host() is called while an rport is in the blocked state
    then scsi_remove_host() will only finish if the rport is unblocked
    from inside a timer function. Make sure that an rport only enters the
    blocked state if a timer will be started that will unblock it. This
    avoids that unloading the ib_srp kernel module after having
    disconnected the initiator from the target system results in a
    deadlock if both the fast_io_fail_tmo and dev_loss_tmo parameters have
    been set to "off".

    Signed-off-by: Bart Van Assche
    Reviewed-by: Sagi Grimberg
    Reviewed-by: David Dillow
    Cc:
    Signed-off-by: Roland Dreier

    Bart Van Assche
     

18 Jul, 2014

1 commit

  • Now that the ibmvstgt driver as the only user of scsi_tgt is gone, the
    scsi_tgt kernel module, the CONFIG_SCSI_TGT, CONFIG_SCSI_SRP_TGT_ATTRS and
    CONFIG_SCSI_FC_TGT_ATTRS kbuild variable, the scsi_host_template
    transfer_response method are no longer needed.

    [hch: minor updates to the current tree, changelog update]

    Signed-off-by: Bart Van Assche
    Signed-off-by: Christoph Hellwig
    Reviewed-by: Paolo Bonzini
    Reviewed-by: Hannes Reinecke

    Bart Van Assche
     

25 Mar, 2014

1 commit

  • This patch fixes the following two kernel-doc warnings:

    Warning(drivers/scsi/scsi_transport_srp.c:819): No description found for parameter 'rport'
    Warning(include/scsi/scsi_transport_srp.h:75): Excess struct/union/enum/typedef member 'deleted' description in 'srp_rport'

    Signed-off-by: Bart Van Assche
    Reported-by: Masanari Iida
    Acked-by: Sebastian Riemer
    Signed-off-by: Roland Dreier

    Bart Van Assche
     

22 Jan, 2014

3 commits

  • The following command has been used to verify that the kernel-doc
    tool no longer complains about undocumented fields:

    scripts/kernel-doc -html drivers/scsi/scsi_transport_srp.c \
    include/scsi/scsi_transport_srp.h >srp-transport-doc.html

    Signed-off-by: Bart Van Assche
    Acked-by: Sebastian Riemer
    Acked-by: Randy Dunlap
    Signed-off-by: Roland Dreier

    Bart Van Assche
     
  • The rport timers must be stopped before the SRP initiator destroys the
    resources associated with the SCSI host. This is necessary because
    otherwise the callback functions invoked from the SRP transport layer
    could trigger a use-after-free. Stopping the rport timers before
    invoking scsi_remove_host() can trigger long delays in the SCSI error
    handler if a transport layer failure occurs while scsi_remove_host()
    is in progress. Hence move the code for stopping the rport timers from
    srp_rport_release() into a new function and invoke that function after
    scsi_remove_host() has finished. This patch fixes the following
    sporadic kernel crash:

    kernel BUG at include/asm-generic/dma-mapping-common.h:64!
    invalid opcode: 0000 [#1] SMP
    RIP: 0010:[] [] srp_unmap_data+0x121/0x130 [ib_srp]
    Call Trace:
    [] srp_free_req+0x3c/0x80 [ib_srp]
    [] srp_finish_req+0x48/0x70 [ib_srp]
    [] srp_terminate_io+0x4b/0x60 [ib_srp]
    [] __rport_fail_io_fast+0x75/0x80 [scsi_transport_srp]
    [] rport_fast_io_fail_timedout+0x88/0xc0 [scsi_transport_srp]
    [] worker_thread+0x170/0x2a0
    [] kthread+0x96/0xa0
    [] child_rip+0xa/0x20

    Signed-off-by: Bart Van Assche
    Signed-off-by: Roland Dreier

    Bart Van Assche
     
  • The current behavior of the SRP transport layer when a transport layer
    error is encountered is to block SCSI command processing only if
    fast_io_fail_tmo != off. The current behavior of the FC transport
    layer when a transport layer error is encountered is to block SCSI
    command processing no matter which value fast_io_fail_tmo has been set
    to. Make the behavior of the SRP transport layer consistent with that
    of the FC transport layer to avoid confusion.

    Signed-off-by: Bart Van Assche
    Signed-off-by: Roland Dreier

    Bart Van Assche
     

09 Nov, 2013

3 commits

  • Add support for periodically reconnecting to an SRP target until
    the dev_loss timer expires. After the tenth reconnection attempt,
    gradually slow down subsequent reconnect attempts.

    Signed-off-by: Bart Van Assche
    Acked-by: David Dillow
    Signed-off-by: Roland Dreier

    Bart Van Assche
     
  • Add the necessary functions in the SRP transport module to allow an
    SRP initiator driver to implement transport layer error handling
    similar to the functionality already provided by the FC transport
    layer. This includes:

    - Support for implementing fast_io_fail_tmo, the time that should
    elapse after having detected a transport layer problem and
    before failing I/O.
    - Support for implementing dev_loss_tmo, the time that should
    elapse after having detected a transport layer problem and
    before removing a remote port.

    Signed-off-by: Bart Van Assche
    Acked-by: David Dillow
    Signed-off-by: Roland Dreier

    Bart Van Assche
     
  • Keep the rport data structure around after srp_remove_host() has
    finished until cleanup of the IB transport layer has finished
    completely. This is necessary because later patches use the rport
    pointer inside the queuecommand callback. Without this patch
    accessing the rport from inside a queuecommand callback is racy
    because srp_remove_host() must be invoked before scsi_remove_host()
    and because the queuecommand callback could get invoked after
    srp_remove_host() has finished. In other words, without this patch
    the queuecommand callback can get invoked after the rport data
    structure has been freed.

    Signed-off-by: Bart Van Assche
    Acked-by: David Dillow
    Signed-off-by: Roland Dreier

    Bart Van Assche
     

01 Dec, 2012

3 commits

  • Make it possible to disconnect the IB RC connection used by the SRP
    protocol to communicate with a target.

    Have the SRP transport layer create a sysfs "delete" attribute for
    initiator drivers that support this functionality.

    Signed-off-by: Bart Van Assche
    Acked-by: David Dillow
    Cc: FUJITA Tomonori
    Cc: Robert Jennings
    Signed-off-by: Roland Dreier

    Bart Van Assche
     
  • Eliminate the private_rport_attrs[] array and the SETUP_*() macros
    used to set up that array since the information in that array
    duplicates the information in the static device attributes. Also,
    verify whether SRP_RPORT_ATTRS is large enough since it is easy to
    forget to update that macro when adding new attributes.

    Signed-off-by: Bart Van Assche
    Cc: FUJITA Tomonori
    Cc: Robert Jennings
    Acked-by: David Dillow
    Signed-off-by: Roland Dreier

    Bart Van Assche
     
  • Register transport attributes after the attribute array has been set
    up instead of before. The current code can trigger a race condition
    because the code reading the attribute array can run on another thread
    than the code that initialized that array. Make sure that any code
    reading the attribute array will see all values written into that
    array.

    Signed-off-by: Bart Van Assche
    Cc: FUJITA Tomonori
    Cc: Robert Jennings
    Acked-by: David Dillow
    Signed-off-by: Roland Dreier

    Bart Van Assche
     

03 Jan, 2009

1 commit


20 Apr, 2008

1 commit


12 Jan, 2008

2 commits

  • - Change title to remove "Mid-Layer" since the doc is about all of the
    SCSI layers.
    - Use "SCSI" instead of "scsi" in docbook text.
    - Use "*/" to end kernel-doc notation blocks.
    - A few other minor typo fixes.

    Signed-off-by: Randy Dunlap
    Signed-off-by: James Bottomley

    Randy Dunlap
     
  • Add Documentation/DocBook/scsi_midlayer.tmpl, add to Makefile, and update
    lots of kerneldoc comments in drivers/scsi/*.

    Updated with comments from Stefan Richter, Stephen M. Cameron,
    James Bottomley and Randy Dunlap.

    Signed-off-by: Rob Landley
    Signed-off-by: James Bottomley

    Rob Landley
     

05 Jan, 2008

1 commit

  • The SCSI SRP transport class currently iterates over all children
    devices of the host that is being removed in srp_remove_host(). However,
    not all of those children were created by the SRP transport, and
    removing them will cause corruption and an oops when their creator tries
    to remove them.

    Signed-off-by: David Dillow
    Acked-by: FUJITA Tomonori
    Signed-off-by: James Bottomley

    Dave Dillow
     

13 Oct, 2007

6 commits