1. 15 7月, 2022 1 次提交
    • J
      hw/nvme: Implement shadow doorbell buffer support · 3f7fe8de
      Jinhao Fan 提交于
      Implement Doorbel Buffer Config command (Section 5.7 in NVMe Spec 1.3)
      and Shadow Doorbel buffer & EventIdx buffer handling logic (Section 7.13
      in NVMe Spec 1.3). For queues created before the Doorbell Buffer Config
      command, the nvme_dbbuf_config function tries to associate each existing
      SQ and CQ with its Shadow Doorbel buffer and EventIdx buffer address.
      Queues created after the Doorbell Buffer Config command will have the
      doorbell buffers associated with them when they are initialized.
      
      In nvme_process_sq and nvme_post_cqe, proactively check for Shadow
      Doorbell buffer changes instead of wait for doorbell register changes.
      This reduces the number of MMIOs.
      
      In nvme_process_db(), update the shadow doorbell buffer value with
      the doorbell register value if it is the admin queue. This is a hack
      since hosts like Linux NVMe driver and SPDK do not use shadow
      doorbell buffer for the admin queue. Copying the doorbell register
      value to the shadow doorbell buffer allows us to support these hosts
      as well as spec-compliant hosts that use shadow doorbell buffer for
      the admin queue.
      Signed-off-by: NJinhao Fan <fanjinhao21s@ict.ac.cn>
      Reviewed-by: NKlaus Jensen <k.jensen@samsung.com>
      Reviewed-by: NKeith Busch <kbusch@kernel.org>
      [k.jensen: rebased]
      Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
      3f7fe8de
  2. 24 6月, 2022 8 次提交
  3. 04 6月, 2022 1 次提交
  4. 11 5月, 2022 1 次提交
  5. 03 3月, 2022 4 次提交
  6. 14 2月, 2022 2 次提交
  7. 27 7月, 2021 3 次提交
  8. 29 6月, 2021 7 次提交
  9. 17 5月, 2021 8 次提交
  10. 07 4月, 2021 3 次提交
    • K
      hw/block/nvme: fix handling of private namespaces · e5489356
      Klaus Jensen 提交于
      Prior to this patch, if a private nvme-ns device (that is, a namespace
      that is not linked to a subsystem) is wired up to an nvme-subsys linked
      nvme controller device, the device fails to verify that the namespace id
      is unique within the subsystem. NVM Express v1.4b, Section 6.1.6 ("NSID
      and Namespace Usage") states that because the device supports Namespace
      Management, "NSIDs *shall* be unique within the NVM subsystem".
      
      Additionally, prior to this patch, private namespaces are not known to
      the subsystem and the namespace is considered exclusive to the
      controller with which it is initially wired up to. However, this is not
      the definition of a private namespace; per Section 1.6.33 ("private
      namespace"), a private namespace is just a namespace that does not
      support multipath I/O or namespace sharing, which means "that it is only
      able to be attached to one controller at a time".
      
      Fix this by always allocating namespaces in the subsystem (if one is
      linked to the controller), regardless of the shared/private status of
      the namespace. Whether or not the namespace is shareable is controlled
      by a new `shared` nvme-ns parameter.
      
      Finally, this fix allows the nvme-ns `subsys` parameter to be removed,
      since the `shared` parameter now serves the purpose of attaching the
      namespace to all controllers in the subsystem upon device realization.
      It is invalid to have an nvme-ns namespace device with a linked
      subsystem without the parent nvme controller device also being linked to
      one and since the nvme-ns devices will unconditionally be "attached" (in
      QEMU terms that is) to an nvme controller device through an NvmeBus, the
      nvme-ns namespace device can always get a reference to the subsystem of
      the controller it is explicitly (using 'bus=' parameter) or implicitly
      attaching to.
      
      Fixes: e5707685 ("hw/block/nvme: support for shared namespace in subsystem")
      Cc: Minwoo Im <minwoo.im.dev@gmail.com>
      Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
      Reviewed-by: NGollu Appalanaidu <anaidu.gollu@samsung.com>
      Reviewed-by: NKeith Busch <kbusch@kernel.org>
      Reviewed-by: NMinwoo Im <minwoo.im.dev@gmail.com>
      e5489356
    • K
      hw/block/nvme: fix warning about legacy namespace configuration · f447f92c
      Klaus Jensen 提交于
      Remove the unused BlockConf from the controller structure and remove the
      noop constraint checking.
      
      Device works just fine with both legacy drive parameter namespace and
      nvme-ns namespace definitions.
      Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
      Reviewed-by: NGollu Appalanaidu <anaidu.gollu@samsung.com>
      f447f92c
    • K
      hw/block/nvme: fix missing string representation for ns attachment · 349bf41d
      Klaus Jensen 提交于
      Add the missing nvme_adm_opc_str entry for the Namespace Attachment
      command.
      Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
      Reviewed-by: NGollu Appalanaidu <anaidu.gollu@samsung.com>
      Reviewed-by: NKeith Busch <kbusch@kernel.org>
      349bf41d
  11. 18 3月, 2021 2 次提交