diff options
author | Minwoo Im <minwoo.im.dev@gmail.com> | 2021-02-28 17:51:02 +0900 |
---|---|---|
committer | Klaus Jensen <k.jensen@samsung.com> | 2021-03-09 11:00:58 +0100 |
commit | f432fdfa1215bc3a00468b2e711176be279b0fd2 (patch) | |
tree | 2bcc4ebfdd4fbdebf4c372c2de6ad1979f395a53 /hw/block/nvme.h | |
parent | 645ce1a70cb6bedc85a11edb547db091375dea55 (diff) |
hw/block/nvme: support changed namespace asynchronous event
If namespace inventory is changed due to some reasons (e.g., namespace
attachment/detachment), controller can send out event notifier to the
host to manage namespaces.
This patch sends out the AEN to the host after either attach or detach
namespaces from controllers. To support clear of the event from the
controller, this patch also implemented Get Log Page command for Changed
Namespace List log type. To return namespace id list through the
command, when namespace inventory is updated, id is added to the
per-controller list (changed_ns_list).
To indicate the support of this async event, this patch set
OAES(Optional Asynchronous Events Supported) in Identify Controller data
structure.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Tested-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Diffstat (limited to 'hw/block/nvme.h')
-rw-r--r-- | hw/block/nvme.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/block/nvme.h b/hw/block/nvme.h index 1287bc2cd1..4955d649c7 100644 --- a/hw/block/nvme.h +++ b/hw/block/nvme.h @@ -192,6 +192,10 @@ typedef struct NvmeCtrl { uint32_t dmrsl; + /* Namespace ID is started with 1 so bitmap should be 1-based */ +#define NVME_CHANGED_NSID_SIZE (NVME_MAX_NAMESPACES + 1) + DECLARE_BITMAP(changed_nsids, NVME_CHANGED_NSID_SIZE); + NvmeSubsystem *subsys; NvmeNamespace namespace; |