1. 07 7月, 2017 4 次提交
  2. 19 2月, 2017 1 次提交
    • D
      uapi: fix linux/target_core_user.h userspace compilation errors · 762b6f00
      Dmitry V. Levin 提交于
      Consistently use types from linux/types.h to fix the following
      linux/target_core_user.h userspace compilation errors:
      
      /usr/include/linux/target_core_user.h:108:4: error: unknown type name 'uint32_t'
          uint32_t iov_cnt;
      /usr/include/linux/target_core_user.h:109:4: error: unknown type name 'uint32_t'
          uint32_t iov_bidi_cnt;
      /usr/include/linux/target_core_user.h:110:4: error: unknown type name 'uint32_t'
          uint32_t iov_dif_cnt;
      /usr/include/linux/target_core_user.h:111:4: error: unknown type name 'uint64_t'
          uint64_t cdb_off;
      /usr/include/linux/target_core_user.h:112:4: error: unknown type name 'uint64_t'
          uint64_t __pad1;
      /usr/include/linux/target_core_user.h:113:4: error: unknown type name 'uint64_t'
          uint64_t __pad2;
      /usr/include/linux/target_core_user.h:117:4: error: unknown type name 'uint8_t'
          uint8_t scsi_status;
      /usr/include/linux/target_core_user.h:118:4: error: unknown type name 'uint8_t'
          uint8_t __pad1;
      /usr/include/linux/target_core_user.h:119:4: error: unknown type name 'uint16_t'
          uint16_t __pad2;
      /usr/include/linux/target_core_user.h:120:4: error: unknown type name 'uint32_t'
          uint32_t __pad3;
      Signed-off-by: NDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      762b6f00
  3. 11 3月, 2016 1 次提交
  4. 11 9月, 2015 1 次提交
  5. 20 4月, 2015 1 次提交
    • A
      target: Version 2 of TCMU ABI · 0ad46af8
      Andy Grover 提交于
      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: NAndy Grover <agrover@redhat.com>
      Reviewed-by: NIlias Tsitsimpis <iliastsi@arrikto.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      0ad46af8
  6. 19 12月, 2014 1 次提交
  7. 04 10月, 2014 1 次提交
    • A
      target: Add a user-passthrough backstore · 7c9e7a6f
      Andy Grover 提交于
      Add a LIO storage engine that presents commands to userspace for execution.
      This would allow more complex backstores to be implemented out-of-kernel,
      and also make experimentation a-la FUSE (but at the SCSI level -- "SUSE"?)
      possible.
      
      It uses a mmap()able UIO device per LUN to share a command ring and data
      area. The commands are raw SCSI CDBs and iovs for in/out data. The command
      ring is also reused for returning scsi command status and optional sense
      data.
      
      This implementation is based on Shaohua Li's earlier version but heavily
      modified. Differences include:
      
      * Shared memory allocated by kernel, not locked-down user pages
      * Single ring for command request and response
      * Offsets instead of embedded pointers
      * Generic SCSI CDB passthrough instead of per-cmd specialization in ring
        format.
      * Uses UIO device instead of anon_file passed in mailbox.
      * Optional in-kernel handling of some commands.
      
      The main reason for these differences is to permit greater resiliency
      if the user process dies or hangs.
      
      Things not yet implemented (on purpose):
      
      * Zero copy. The data area is flexible enough to allow page flipping or
        backend-allocated pages to be used by fabrics, but it's not clear these
        are performance wins. Can come later.
      * Out-of-order command completion by userspace. Possible to add by just
        allowing userspace to change cmd_id in rsp cmd entries, but currently
        not supported.
      * No locks between kernel cmd submission and completion routines. Sounds
        like it's possible, but this can come later.
      * Sparse allocation of mmaped area. Current code vmallocs the whole thing.
        If the mapped area was larger and not fully mapped then the driver would
        have more freedom to change cmd and data area sizes based on demand.
      
      Current code open issues:
      
      * The use of idrs may be overkill -- we maybe can replace them with a
        simple counter to generate cmd_ids, and a hash table to get a cmd_id's
        associated pointer.
      * Use of a free-running counter for cmd ring instead of explicit modulo
        math. This would require power-of-2 cmd ring size.
      
      (Add kconfig depends NET - Randy)
      Signed-off-by: NAndy Grover <agrover@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      7c9e7a6f