diff --git a/CHANGELOG.md b/CHANGELOG.md index 61a9a3bf0..83f9dc14e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,9 @@ it for NVMe controllers. When the option is enabled, the controller will not do shutdown process and just disable the controller, users can start their application later again to initialize the controller to the ready state. +A controller flag `SPDK_NVME_CTRLR_WRR_SUPPORTED` was added to indicate the controller +can support weighted round robin arbitration feature with submission queue. + ### iSCSI Portals may no longer be associated with a cpumask. The scheduling of diff --git a/include/spdk/nvme.h b/include/spdk/nvme.h index add66a8cd..756433cf8 100644 --- a/include/spdk/nvme.h +++ b/include/spdk/nvme.h @@ -322,6 +322,7 @@ struct spdk_nvme_host_id { enum spdk_nvme_ctrlr_flags { SPDK_NVME_CTRLR_SGL_SUPPORTED = 0x1, /**< The SGL is supported */ SPDK_NVME_CTRLR_SECURITY_SEND_RECV_SUPPORTED = 0x2, /**< security send/receive is supported */ + SPDK_NVME_CTRLR_WRR_SUPPORTED = 0x4, /**< Weighted Round Robin is supported */ }; /** diff --git a/lib/nvme/nvme_ctrlr.c b/lib/nvme/nvme_ctrlr.c index 7714b3821..4c8585947 100644 --- a/lib/nvme/nvme_ctrlr.c +++ b/lib/nvme/nvme_ctrlr.c @@ -2361,6 +2361,10 @@ nvme_ctrlr_init_cap(struct spdk_nvme_ctrlr *ctrlr, const union spdk_nvme_cap_reg ctrlr->cap = *cap; ctrlr->vs = *vs; + if (ctrlr->cap.bits.ams & SPDK_NVME_CAP_AMS_WRR) { + ctrlr->flags |= SPDK_NVME_CTRLR_WRR_SUPPORTED; + } + ctrlr->min_page_size = 1u << (12 + ctrlr->cap.bits.mpsmin); /* For now, always select page_size == min_page_size. */