10 May, 2016

2 commits

  • Signed-off-by: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger

    Christoph Hellwig
     
  • Turns out the template and thus many drivers got the return value wrong:
    0 means the fabrics driver needs to put a session reference, which no
    driver except for the iSCSI target drivers did. Fortunately none of these
    drivers supports explicit Node ACLs, so the bug was harmless.

    Even without that only qla2xxx and iscsi every did real work in
    shutdown_session, so get rid of the boilerplate code in all other
    drivers.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger

    Christoph Hellwig
     

11 Mar, 2016

1 commit


14 Oct, 2015

1 commit

  • This also allows to remove the target-specific old configfs macros, and
    gets rid of the target_core_fabric_configfs.h header which only had one
    function declaration left that could be moved to a better place.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Nicholas Bellinger
    Acked-by: Nicholas Bellinger
    Signed-off-by: Nicholas Bellinger

    Christoph Hellwig
     

25 Jul, 2015

1 commit


05 Jul, 2015

1 commit

  • Pull SCSI target updates from Nicholas Bellinger:
    "It's been a busy development cycle for target-core in a number of
    different areas.

    The fabric API usage for se_node_acl allocation is now within
    target-core code, dropping the external API callers for all fabric
    drivers tree-wide.

    There is a new conversion to RCU hlists for se_node_acl and
    se_portal_group LUN mappings, that turns fast-past LUN lookup into a
    completely lockless code-path. It also removes the original
    hard-coded limitation of 256 LUNs per fabric endpoint.

    The configfs attributes for backends can now be shared between core
    and driver code, allowing existing drivers to use common code while
    still allowing flexibility for new backend provided attributes.

    The highlights include:

    - Merge sbc_verify_dif_* into common code (sagi)
    - Remove iscsi-target support for obsolete IFMarker/OFMarker
    (Christophe Vu-Brugier)
    - Add bidi support in target/user backend (ilias + vangelis + agover)
    - Move se_node_acl allocation into target-core code (hch)
    - Add crc_t10dif_update common helper (akinobu + mkp)
    - Handle target-core odd SGL mapping for data transfer memory
    (akinobu)
    - Move transport ID handling into target-core (hch)
    - Move task tag into struct se_cmd + support 64-bit tags (bart)
    - Convert se_node_acl->device_list[] to RCU hlist (nab + hch +
    paulmck)
    - Convert se_portal_group->tpg_lun_list[] to RCU hlist (nab + hch +
    paulmck)
    - Simplify target backend driver registration (hch)
    - Consolidate + simplify target backend attribute implementations
    (hch + nab)
    - Subsume se_port + t10_alua_tg_pt_gp_member into se_lun (hch)
    - Drop lun_sep_lock for se_lun->lun_se_dev RCU usage (hch + nab)
    - Drop unnecessary core_tpg_register TFO parameter (nab)
    - Use 64-bit LUNs tree-wide (hannes)
    - Drop left-over TARGET_MAX_LUNS_PER_TRANSPORT limit (hannes)"

    * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (76 commits)
    target: Bump core version to v5.0
    target: remove target_core_configfs.h
    target: remove unused TARGET_CORE_CONFIG_ROOT define
    target: consolidate version defines
    target: implement WRITE_SAME with UNMAP bit using ->execute_unmap
    target: simplify UNMAP handling
    target: replace se_cmd->execute_rw with a protocol_data field
    target/user: Fix inconsistent kmap_atomic/kunmap_atomic
    target: Send UA when changing LUN inventory
    target: Send UA upon LUN RESET tmr completion
    target: Send UA on ALUA target port group change
    target: Convert se_lun->lun_deve_lock to normal spinlock
    target: use 'se_dev_entry' when allocating UAs
    target: Remove 'ua_nacl' pointer from se_ua structure
    target_core_alua: Correct UA handling when switching states
    xen-scsiback: Fix compile warning for 64-bit LUN
    target: Remove TARGET_MAX_LUNS_PER_TRANSPORT
    target: use 64-bit LUNs
    target: Drop duplicate + unused se_dev_check_wce
    target: Drop unnecessary core_tpg_register TFO parameter
    ...

    Linus Torvalds
     

24 Jun, 2015

1 commit

  • Pull SCSI updates from James Bottomley:
    "This is the usual grab bag of driver updates (lpfc, hpsa,
    megaraid_sas, cxgbi, be2iscsi) plus an assortment of minor updates.

    There is also one new driver: the Cisco snic. The advansys driver has
    been rewritten to get rid of the warning about converting it to the
    DMA API, the tape statistics patch got in and finally, there's a
    resuffle of SCSI header files to separate more cleanly initiator from
    target mode (and better share the common definitions)"

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (156 commits)
    snic: driver for Cisco SCSI HBA
    qla2xxx: Fix indentation
    qla2xxx: Comment out unreachable code
    fusion: remove dead MTRR code
    advansys: fix compilation errors and warnings when CONFIG_PCI is not set
    mptsas: fix depth param in scsi_track_queue_full
    megaraid: fix irq setup process regression
    lpfc: Update version to 10.7.0.0 for upstream patch set.
    lpfc: Fix to drop PLOGIs from fabric node till LOGO processing completes
    lpfc: Fix scsi task management error message.
    lpfc: Fix cq_id masking problem.
    lpfc: Fix scsi prep dma buf error.
    lpfc: Add support for using block multi-queue
    lpfc: Devices are not discovered during takeaway/giveback testing
    lpfc: Fix vport deletion failure.
    lpfc: Check for active portpeerbeacon.
    lpfc: Update driver version for upstream patch set 10.6.0.1.
    lpfc: Change buffer pool empty message to miscellaneous category
    lpfc: Fix incorrect log message reported for empty FCF record.
    lpfc: Fix rport leak.
    ...

    Linus Torvalds
     

02 Jun, 2015

1 commit

  • Only include SCSI initiator header files in target code that needs
    these header files, namely the SCSI pass-through code and the tcm_loop
    driver. Change SCSI_SENSE_BUFFERSIZE into TRANSPORT_SENSE_BUFFER in
    target code because the former is intended for initiator code and the
    latter for target code. With this patch the only initiator include
    directives in target code that remain are as follows:

    $ git grep -nHE 'include .scsi/(scsi.h|scsi_host.h|scsi_device.h|scsi_cmnd.h)' drivers/target drivers/infiniband/ulp/{isert,srpt} drivers/usb/gadget/legacy/tcm_*.[ch] drivers/{vhost,xen} include/{target,trace/events/target.h}
    drivers/target/loopback/tcm_loop.c:29:#include
    drivers/target/loopback/tcm_loop.c:31:#include
    drivers/target/loopback/tcm_loop.c:32:#include
    drivers/target/loopback/tcm_loop.c:33:#include
    drivers/target/target_core_pscsi.c:39:#include
    drivers/target/target_core_pscsi.c:40:#include
    drivers/xen/xen-scsiback.c:52:#include /* SG_ALL */

    Signed-off-by: Bart Van Assche
    Reviewed-by: Christoph Hellwig
    Signed-off-by: James Bottomley

    Bart Van Assche
     

31 May, 2015

11 commits


03 May, 2015

1 commit

  • TCMU requires more work to correctly handle both user handlers that want
    all SCSI commands (pass_level=0) for a se_device, and also handlers that
    just want I/O commands and let the others be emulated by the kernel
    (pass_level=1). Only support the latter for now.

    For full passthrough, we will need to support a second se_subsystem_api
    template, due to configfs attributes being different between the two modes.
    Thus pass_level is extraneous, and we can remove it.

    The ABI break for TCMU v2 is already applied for this release, so it's
    best to do this now to avoid another ABI break in the future.

    Signed-off-by: Andy Grover
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger

    Andy Grover
     

20 Apr, 2015

1 commit

  • The initial version of TCMU (in 3.18) does not properly handle
    bidirectional SCSI commands -- those with both an in and out buffer. In
    looking to fix this it also became clear that TCMU's support for adding
    new types of entries (opcodes) to the command ring was broken. We need
    to fix this now, so that future issues can be handled properly by adding
    new opcodes.

    We make the most of this ABI break by enabling bidi cmd handling within
    TCMP_OP_CMD opcode. Add an iov_bidi_cnt field to tcmu_cmd_entry.req.
    This enables TCMU to describe bidi commands, but further kernel work is
    needed for full bidi support.

    Enlarge tcmu_cmd_entry_hdr by 32 bits by pulling in cmd_id and __pad1. Turn
    __pad1 into two 8 bit flags fields, for kernel-set and userspace-set flags,
    "kflags" and "uflags" respectively.

    Update version fields so userspace can tell the interface is changed.

    Update tcmu-design.txt with details of how new stuff works:
    - Specify an additional requirement for userspace to set UNKNOWN_OP
    (bit 0) in hdr.uflags for unknown/unhandled opcodes.
    - Define how Data-In and Data-Out fields are described in req.iov[]

    Changed in v2:
    - Change name of SKIPPED bit to UNKNOWN bit
    - PAD op does not set the bit any more
    - Change len_op helper functions to take just len_op, not the whole struct
    - Change version to 2 in missed spots, and use defines
    - Add 16 unused bytes to cmd_entry.req, in case additional SAM cmd
    parameters need to be included
    - Add iov_dif_cnt field to specify buffers used for DIF info in iov[]
    - Rearrange fields to naturally align cdb_off
    - Handle if userspace sets UNKNOWN_OP by indicating failure of the cmd
    - Wrap some overly long UPDATE_HEAD lines

    (Add missing req.iov_bidi_cnt + req.iov_dif_cnt zeroing - Ilias)

    Signed-off-by: Andy Grover
    Reviewed-by: Ilias Tsitsimpis
    Signed-off-by: Nicholas Bellinger

    Andy Grover
     

16 Apr, 2015

1 commit


15 Apr, 2015

1 commit

  • Instead of calling target_fabric_configfs_init() +
    target_fabric_configfs_register() / target_fabric_configfs_deregister()
    target_fabric_configfs_free() from every target driver, rewrite the API
    so that we have simple register/unregister functions that operate on
    a const operations vector.

    This patch also fixes a memory leak in several target drivers. Several
    target drivers namely called target_fabric_configfs_deregister()
    without calling target_fabric_configfs_free().

    A large part of this patch is based on earlier changes from
    Bart Van Assche .

    (v2: Add a new TF_CIT_SETUP_DRV macro so that the core configfs code
    can declare attributes as either core only or for drivers)

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger

    Christoph Hellwig
     

07 Jan, 2015

1 commit


03 Oct, 2014

1 commit


17 Oct, 2013

1 commit


20 Aug, 2013

1 commit


18 Sep, 2012

2 commits

  • Every fabric driver has to supply a se_tfo->set_fabric_sense_len()
    method, just so iSCSI can return an offset of 2. However, every fabric
    driver is already allocating a sense buffer and passing it into the
    target core, either via transport_init_se_cmd() or target_submit_cmd().

    So instead of having iSCSI pass the start of its sense buffer into the
    core and then later tell the core to skip the first 2 bytes, it seems
    easier for iSCSI just to do the offset of 2 when it passes the sense
    buffer into the core. Then we can drop the se_tfo->set_fabric_sense_len()
    everywhere, and just add a couple of lines of code to iSCSI to set the
    sense data length to the beginning of the buffer right before it sends
    it over the network.

    (nab: Remove .set_fabric_sense_len usage from tcm_qla2xxx_npiv_ops +
    change transport_get_sense_buffer to follow v3.6-rc6 code w/o
    ->set_fabric_sense_len usage)

    Signed-off-by: Roland Dreier
    Signed-off-by: Nicholas Bellinger

    Roland Dreier
     
  • There are no callers of se_tfo->get_fabric_sense_len(), so we should
    stop having every fabric driver implement it.

    Signed-off-by: Roland Dreier
    Signed-off-by: Nicholas Bellinger

    Roland Dreier
     

10 Feb, 2012

1 commit


14 Dec, 2011

3 commits

  • This includes:
    - remove on _ in "__NAMELEN" in $fabric _make_tport
    - target_fabric_configfs_init() returns an error pointer and not NULL
    anymore. Consider that.
    - replace (!(var_name)) with (!var_name). The extra () are not required
    - remove #ifdef MODULE. If the code is builtin it needs an init function
    or the code is useless
    - put exit/clean functions into __exit

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Nicholas Bellinger

    Sebastian Andrzej Siewior
     
  • This patch fixes TFO->release_cmd() and removes legacy pack_lun() usage
    and new_cmd_failure when generating new TCM fabric skeleton from the
    tcm_mod_builder.py script.

    Reported-by: Stefan Bergstrand
    Signed-off-by: Nicholas Bellinger

    Nicholas Bellinger
     
  • 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: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger

    Christoph Hellwig
     

24 Mar, 2011

2 commits

  • This patch adds the missing core_tpg_del_initiator_node_acl() call required
    by fabric modules for struct se_node_acl->acl_group context shutdown via

    target_core_fabric_configfs.c:target_fabric_nacl_base_release() ->

    struct target_core_fabric_ops->fabric_drop_nodeacl()

    for tcm_mod_builder.py generated $FABRIC_MOD_configfs.c skeleton code.

    Signed-off-by: Fubo Chen
    Signed-off-by: Nicholas A. Bellinger
    Signed-off-by: James Bottomley

    Fubo Chen
     
  • This patch converts the tcm_mod_builder.py generation script to
    create a new drivers/target/$TCM_FABRIC_MOD/Makefile and update
    drivers/target/Makefile, instead of creating+updating a 'Kbuild'
    filename.

    It also removes the remaining EXTRA_CFLAGS includes from
    tcm_mod_build_kbuild(), and converts fabric module generated .c
    code to us ""-style includes for $FABRIC_MOD_[base,fabric].h

    Reported-by: Christoph Hellwig
    Signed-off-by: Nicholas A. Bellinger
    Signed-off-by: James Bottomley

    Nicholas Bellinger
     

15 Jan, 2011

1 commit

  • LIO target is a full featured in-kernel target framework with the
    following feature set:

    High-performance, non-blocking, multithreaded architecture with SIMD
    support.

    Advanced SCSI feature set:

    * Persistent Reservations (PRs)
    * Asymmetric Logical Unit Assignment (ALUA)
    * Protocol and intra-nexus multiplexing, load-balancing and failover (MC/S)
    * Full Error Recovery (ERL=0,1,2)
    * Active/active task migration and session continuation (ERL=2)
    * Thin LUN provisioning (UNMAP and WRITE_SAMExx)

    Multiprotocol target plugins

    Storage media independence:

    * Virtualization of all storage media; transparent mapping of IO to LUNs
    * No hard limits on number of LUNs per Target; maximum LUN size ~750 TB
    * Backstores: SATA, SAS, SCSI, BluRay, DVD, FLASH, USB, ramdisk, etc.

    Standards compliance:

    * Full compliance with IETF (RFC 3720)
    * Full implementation of SPC-4 PRs and ALUA

    Significant code cleanups done by Christoph Hellwig.

    [jejb: fix up for new block bdev exclusive interface. Minor fixes from
    Randy Dunlap and Dan Carpenter.]
    Signed-off-by: Nicholas A. Bellinger
    Signed-off-by: James Bottomley

    Nicholas Bellinger