1. 13 12月, 2018 1 次提交
    • C
      nvmet: add error-log definitions · e4a97625
      Chaitanya Kulkarni 提交于
      This patch adds necessary fields in the target data structures to
      support error log page. For a target controller, we add a new error log
      field to maintain the error log, at any given point we maintain error
      entries equal to NVMET_ERROR_LOG_SLOTS for each controller. In the
      following patch, we also update the error log page entry in the I/O
      completion path so we introduce a spinlock for synchronization of the
      log.
      
      For nvmet_req, we add a new field error_loc to hold the location of
      the error in the command when the actual error occurs for each request
      and a starting LBA if applicable.
      Signed-off-by: NChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
      Reviewed-by: NSagi Grimberg <sagi@grimberg.me>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      e4a97625
  2. 08 12月, 2018 8 次提交
  3. 09 11月, 2018 1 次提交
  4. 18 10月, 2018 2 次提交
    • L
      nvmet: Optionally use PCI P2P memory · c6925093
      Logan Gunthorpe 提交于
      Create a configfs attribute in each nvme-fabrics namespace to enable P2P
      memory use.  The attribute may be enabled (with a boolean) or a specific
      P2P device may be given (with the device's PCI name).
      
      When enabled, the namespace will ensure the underlying block device
      supports P2P and is compatible with any specified P2P device.  If no device
      was specified it will ensure there is compatible P2P memory somewhere in
      the system.  Enabling a namespace with P2P memory will fail with EINVAL
      (and an appropriate dmesg error) if any of these conditions are not met.
      
      Once a controller is set up on a specific port, the P2P device to use for
      each namespace will be found and stored in a radix tree by namespace ID.
      When memory is allocated for a request, the tree is used to look up the P2P
      device to allocate memory against.  If no device is in the tree (because no
      appropriate device was found), or if allocation of P2P memory fails, fall
      back to using regular memory.
      Signed-off-by: NStephen Bates <sbates@raithlin.com>
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      [hch: partial rewrite of the initial code]
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NLogan Gunthorpe <logang@deltatee.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      c6925093
    • L
      nvmet: Introduce helper functions to allocate and free request SGLs · 5b2322e4
      Logan Gunthorpe 提交于
      Add helpers to allocate and free the SGL in a struct nvmet_req:
      
        int nvmet_req_alloc_sgl(struct nvmet_req *req)
        void nvmet_req_free_sgl(struct nvmet_req *req)
      
      This will be expanded in a future patch to implement peer-to-peer memory
      DMAs and should be common with all target drivers.
      
      The new helpers are used in nvmet-rdma.  Seeing we use req.transfer_len as
      the length of the SGL it is set earlier and cleared on any error.  It also
      seems to be unnecessary to accumulate the length as the map_sgl functions
      should only ever be called once per request.
      Signed-off-by: NLogan Gunthorpe <logang@deltatee.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Acked-by: NSagi Grimberg <sagi@grimberg.me>
      5b2322e4
  5. 17 10月, 2018 1 次提交
    • B
      nvmet: use strcmp() instead of strncmp() for subsystem lookup · 43a6f8fb
      Bart Van Assche 提交于
      strncmp() stops comparing when either the end of one of the first two arguments
      is reached or when 'n' characters have been compared, whichever comes first.
      That means that strncmp(s1, s2, n) is equivalent to strcmp(s1, s2) if n exceeds
      the length of s1 or the length of s2. Since that is the case in
      nvmet_find_get_subsys(), change strncmp() into strcmp(). This patch avoids that
      the following warning is reported by smatch:
      
      drivers/nvme/target/core.c:940:1 nvmet_find_get_subsys() error: strncmp() '"nqn.2014-08.org.nvmexpress.discovery"' too small (37 vs 223)
      Signed-off-by: NBart Van Assche <bvanassche@acm.org>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      43a6f8fb
  6. 28 8月, 2018 1 次提交
  7. 08 8月, 2018 1 次提交
    • C
      nvmet: add ns write protect support · dedf0be5
      Chaitanya Kulkarni 提交于
      This patch implements the Namespace Write Protect feature described in
      "NVMe TP 4005a Namespace Write Protect". In this version, we implement
      No Write Protect and Write Protect states for target ns which can be
      toggled by set-features commands from the host side.
      
      For write-protect state transition, we need to flush the ns specified
      as a part of command so we also add helpers for carrying out synchronous
      flush operations.
      Signed-off-by: NChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
      [hch: fixed an incorrect endianess conversion, minor cleanups]
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      dedf0be5
  8. 28 7月, 2018 4 次提交
  9. 25 7月, 2018 1 次提交
  10. 23 7月, 2018 2 次提交
    • S
      nvmet-rdma: support max(16KB, PAGE_SIZE) inline data · 0d5ee2b2
      Steve Wise 提交于
      The patch enables inline data sizes using up to 4 recv sges, and capping
      the size at 16KB or at least 1 page size.  So on a 4K page system, up to
      16KB is supported, and for a 64K page system 1 page of 64KB is supported.
      
      We avoid > 0 order page allocations for the inline buffers by using
      multiple recv sges, one for each page.  If the device cannot support
      the configured inline data size due to lack of enough recv sges, then
      log a warning and reduce the inline size.
      
      Add a new configfs port attribute, called param_inline_data_size,
      to allow configuring the size of inline data for a given nvmf port.
      The maximum size allowed is still enforced by nvmet-rdma with
      NVMET_RDMA_MAX_INLINE_DATA_SIZE, which is now max(16KB, PAGE_SIZE).
      And the default size, if not specified via configfs, is still PAGE_SIZE.
      This preserves the existing behavior, but allows larger inline sizes
      for small page systems.  If the configured inline data size exceeds
      NVMET_RDMA_MAX_INLINE_DATA_SIZE, a warning is logged and the size is
      reduced.  If param_inline_data_size is set to 0, then inline data is
      disabled for that nvmf port.
      Reviewed-by: NSagi Grimberg <sagi@grimberg.me>
      Reviewed-by: NMax Gurtovoy <maxg@mellanox.com>
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      0d5ee2b2
    • C
      nvmet: add buffered I/O support for file backed ns · 55eb942e
      Chaitanya Kulkarni 提交于
      Add a new "buffered_io" attribute, which disabled direct I/O and thus
      enables page cache based caching when enabled.   The attribute can only
      be changed when the namespace is disabled as the file has to be reopend
      for the change to take effect.
      
      The possibly blocking read/write are deferred to a newly introduced
      global workqueue.
      Signed-off-by: NChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      55eb942e
  11. 20 6月, 2018 1 次提交
  12. 01 6月, 2018 4 次提交
  13. 25 5月, 2018 3 次提交
  14. 26 3月, 2018 1 次提交
  15. 01 3月, 2018 1 次提交
  16. 16 1月, 2018 1 次提交
  17. 08 1月, 2018 2 次提交
  18. 11 11月, 2017 1 次提交
  19. 20 10月, 2017 1 次提交
  20. 19 10月, 2017 1 次提交
  21. 26 9月, 2017 1 次提交
  22. 25 9月, 2017 1 次提交