1. 31 5月, 2015 31 次提交
  2. 20 5月, 2015 1 次提交
  3. 15 5月, 2015 2 次提交
  4. 03 5月, 2015 2 次提交
  5. 20 4月, 2015 2 次提交
    • A
      target: Put TCMU under a new config option · 68d4cef3
      Andy Grover 提交于
      Conceptually version 2 should be viewed as an entirely new, incompatible
      version of TCMU, so emphasize this by changing the config option and
      Kconfig text.
      Signed-off-by: NAndy Grover <agrover@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      68d4cef3
    • 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. 16 4月, 2015 2 次提交
    • A
      target/file: Fix UNMAP with DIF protection support · 64d240b7
      Akinobu Mita 提交于
      When UNMAP command is issued with DIF protection support enabled,
      the protection info for the unmapped region is remain unchanged.
      So READ command for the region causes data integrity failure.
      
      This fixes it by invalidating protection info for the unmapped region
      by filling with 0xff pattern.  This change also adds helper function
      fd_do_prot_fill() in order to reduce code duplication with existing
      fd_format_prot().
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Reviewed-by: NSagi Grimberg <sagig@mellanox.com>
      Reviewed-by: N"Martin K. Petersen" <martin.petersen@oracle.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: <stable@vger.kernel.org> # v3.14+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      64d240b7
    • A
      target/file: Fix SG table for prot_buf initialization · c8367778
      Akinobu Mita 提交于
      In fd_do_prot_rw(), it allocates prot_buf which is used to copy from
      se_cmd->t_prot_sg by sbc_dif_copy_prot().  The SG table for prot_buf
      is also initialized by allocating 'se_cmd->t_prot_nents' entries of
      scatterlist and setting the data length of each entry to PAGE_SIZE
      at most.
      
      However if se_cmd->t_prot_sg contains a clustered entry (i.e.
      sg->length > PAGE_SIZE), the SG table for prot_buf can't be
      initialized correctly and sbc_dif_copy_prot() can't copy to prot_buf.
      (This actually happened with TCM loopback fabric module)
      
      As prot_buf is allocated by kzalloc() and it's physically contiguous,
      we only need a single scatterlist entry.
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: <stable@vger.kernel.org> # v3.14+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      c8367778