1. 27 5月, 2020 2 次提交
  2. 05 3月, 2020 2 次提交
    • M
      nvmet: make ctrl model configurable · 013b7ebe
      Mark Ruijter 提交于
      This patch adds a new target subsys attribute which allows user to
      optionally specify model name which then used in the
      nvmet_execute_identify_ctrl() to fill up the nvme_id_ctrl structure.
      
      The default value for the model is set to "Linux" for backward
      compatibility.
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NSagi Grimberg <sagi@grimberg.me>
      Signed-off-by: NMark Ruijter <MRuijter@onestopsystems.com>
      [chaitanya.kulkarni@wdc.com
       *Use macro for default model, coding style fixes.
       *Use RCU for accessing model in for configfs and in
        nvmet_execute_identify_ctrl().
      ]
      Signed-off-by: NChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
      Signed-off-by: NKeith Busch <kbusch@kernel.org>
      013b7ebe
    • C
      nvmet: make ctrl-id configurable · 94a39d61
      Chaitanya Kulkarni 提交于
      This patch adds a new target subsys attribute which allows user to
      optionally specify target controller IDs which then used in the
      nvmet_execute_identify_ctrl() to fill up the nvme_id_ctrl structure.
      
      For example, when using a cluster setup with two nodes, with a dual
      ported NVMe drive and exporting the drive from both the nodes,
      The connection to the host fails due to the same controller ID and
      results in the following error message:-
      
      "nvme nvmeX: Duplicate cntlid XXX with nvmeX, rejecting"
      
      With this patch now user can partition the controller IDs for each
      subsystem by setting up the cntlid_min and cntlid_max. These values
      will be used at the time of the controller ID creation. By partitioning
      the ctrl-ids for each subsystem results in the unique ctrl-id space
      which avoids the collision.
      
      When new attribute is not specified target will fall back to original
      cntlid calculation method.
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
      Signed-off-by: NKeith Busch <kbusch@kernel.org>
      94a39d61
  3. 05 2月, 2020 1 次提交
    • D
      nvmet: update AEN list and array at one place · 0f5be6a4
      Daniel Wagner 提交于
      All async events are enqueued via nvmet_add_async_event() which
      updates the ctrl->async_event_cmds[] array and additionally an struct
      nvmet_async_event is added to the ctrl->async_events list.
      
      Under normal operations the nvmet_async_event_work() updates again
      the ctrl->async_event_cmds and removes the corresponding struct
      nvmet_async_event from the list again. Though nvmet_sq_destroy() could
      be called which calls nvmet_async_events_free() which only updates the
      ctrl->async_event_cmds[] array.
      
      Add new functions nvmet_async_events_process() and
      nvmet_async_events_free() to process async events, update an array and
      the list.
      
      When we destroy submission queue after clearing the aen present on
      the ctrl->async list we also loop over ctrl->async_event_cmds[] for
      any requests posted by the host for which we don't have the AEN in
      the ctrl->async_events list by calling nvmet_async_event_process()
      and nvmet_async_events_free().
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NDaniel Wagner <dwagner@suse.de>
      [chaitanya.kulkarni@wdc.com
       * Loop over and clear out outstanding requests
       * Update changelog
      ]
      Signed-off-by: NChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
      Signed-off-by: NKeith Busch <kbusch@kernel.org>
      0f5be6a4
  4. 04 2月, 2020 2 次提交
  5. 05 11月, 2019 4 次提交
  6. 01 8月, 2019 2 次提交
  7. 21 6月, 2019 3 次提交
  8. 25 4月, 2019 3 次提交
  9. 05 4月, 2019 2 次提交
  10. 29 3月, 2019 1 次提交
  11. 14 3月, 2019 1 次提交
    • Y
      nvme-loop: init nvmet_ctrl fatal_err_work when allocate · d11de63f
      Yufen Yu 提交于
      After commit 4d43d395 (workqueue: Try to catch flush_work() without
      INIT_WORK()), it can cause warning when delete nvme-loop device, trace
      like:
      
      [   76.601272] Call Trace:
      [   76.601646]  ? del_timer+0x72/0xa0
      [   76.602156]  __cancel_work_timer+0x1ae/0x270
      [   76.602791]  cancel_work_sync+0x14/0x20
      [   76.603407]  nvmet_ctrl_free+0x1b7/0x2f0 [nvmet]
      [   76.604091]  ? free_percpu+0x168/0x300
      [   76.604652]  nvmet_sq_destroy+0x106/0x240 [nvmet]
      [   76.605346]  nvme_loop_destroy_admin_queue+0x30/0x60 [nvme_loop]
      [   76.606220]  nvme_loop_shutdown_ctrl+0xc3/0xf0 [nvme_loop]
      [   76.607026]  nvme_loop_delete_ctrl_host+0x19/0x30 [nvme_loop]
      [   76.607871]  nvme_do_delete_ctrl+0x75/0xb0
      [   76.608477]  nvme_sysfs_delete+0x7d/0xc0
      [   76.609057]  dev_attr_store+0x24/0x40
      [   76.609603]  sysfs_kf_write+0x4c/0x60
      [   76.610144]  kernfs_fop_write+0x19a/0x260
      [   76.610742]  __vfs_write+0x1c/0x60
      [   76.611246]  vfs_write+0xfa/0x280
      [   76.611739]  ksys_write+0x6e/0x120
      [   76.612238]  __x64_sys_write+0x1e/0x30
      [   76.612787]  do_syscall_64+0xbf/0x3a0
      [   76.613329]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      We fix it by moving fatal_err_work init to nvmet_alloc_ctrl(), which may
      more reasonable.
      Signed-off-by: NYufen Yu <yuyufen@huawei.com>
      Reviewed-by: NSagi Grimberg <sagi@grimberg.me>
      Reviewed-by: NBart Van Assche <bvanassche@acm.org>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      d11de63f
  12. 20 2月, 2019 1 次提交
  13. 19 12月, 2018 2 次提交
  14. 13 12月, 2018 4 次提交
  15. 08 12月, 2018 8 次提交
  16. 09 11月, 2018 1 次提交
  17. 18 10月, 2018 1 次提交
    • 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