nvme: add disable_read_changed_ns_list_log_page
Similar to the disable_read_ana_log_page ctrlr_opt, this enables the application to tell the NVMe driver to *not* read the CHANGED_NS_LIST log page in response to a NS_ATTR_CHANGED AEN, and will do the read itself. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: Ie447734187d4a4cb95ceef6e0131b640b8ba5984 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14088 Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot
This commit is contained in:
parent
57e90e4378
commit
b801af090a
@ -258,8 +258,16 @@ struct spdk_nvme_ctrlr_opts {
|
|||||||
|
|
||||||
/* Hole at bytes 610-616. */
|
/* Hole at bytes 610-616. */
|
||||||
uint8_t reserved610[7];
|
uint8_t reserved610[7];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disable reading CHANGED_NS_LIST log page in response to an NS_ATTR_CHANGED AEN
|
||||||
|
* The upper layer should reading CHANGED_NS_LIST log page instead if set to true.
|
||||||
|
*
|
||||||
|
* Default is `false` (CHANGED_NS_LIST log page is read).
|
||||||
|
*/
|
||||||
|
uint8_t disable_read_changed_ns_list_log_page;
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvme_ctrlr_opts) == 616, "Incorrect size");
|
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvme_ctrlr_opts) == 617, "Incorrect size");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NVMe acceleration operation callback.
|
* NVMe acceleration operation callback.
|
||||||
|
@ -961,6 +961,7 @@ nvme_ctrlr_opts_init(struct spdk_nvme_ctrlr_opts *opts,
|
|||||||
SET_FIELD(admin_queue_size);
|
SET_FIELD(admin_queue_size);
|
||||||
SET_FIELD(fabrics_connect_timeout_us);
|
SET_FIELD(fabrics_connect_timeout_us);
|
||||||
SET_FIELD(disable_read_ana_log_page);
|
SET_FIELD(disable_read_ana_log_page);
|
||||||
|
SET_FIELD(disable_read_changed_ns_list_log_page);
|
||||||
|
|
||||||
#undef FIELD_OK
|
#undef FIELD_OK
|
||||||
#undef SET_FIELD
|
#undef SET_FIELD
|
||||||
|
@ -232,6 +232,7 @@ spdk_nvme_ctrlr_get_default_ctrlr_opts(struct spdk_nvme_ctrlr_opts *opts, size_t
|
|||||||
SET_FIELD(admin_queue_size, DEFAULT_ADMIN_QUEUE_SIZE);
|
SET_FIELD(admin_queue_size, DEFAULT_ADMIN_QUEUE_SIZE);
|
||||||
SET_FIELD(fabrics_connect_timeout_us, NVME_FABRIC_CONNECT_COMMAND_TIMEOUT);
|
SET_FIELD(fabrics_connect_timeout_us, NVME_FABRIC_CONNECT_COMMAND_TIMEOUT);
|
||||||
SET_FIELD(disable_read_ana_log_page, false);
|
SET_FIELD(disable_read_ana_log_page, false);
|
||||||
|
SET_FIELD(disable_read_changed_ns_list_log_page, false);
|
||||||
|
|
||||||
#undef FIELD_OK
|
#undef FIELD_OK
|
||||||
#undef SET_FIELD
|
#undef SET_FIELD
|
||||||
@ -2980,6 +2981,10 @@ nvme_ctrlr_clear_changed_ns_log(struct spdk_nvme_ctrlr *ctrlr)
|
|||||||
uint32_t nsid;
|
uint32_t nsid;
|
||||||
size_t buf_size = (SPDK_NVME_MAX_CHANGED_NAMESPACES * sizeof(uint32_t));
|
size_t buf_size = (SPDK_NVME_MAX_CHANGED_NAMESPACES * sizeof(uint32_t));
|
||||||
|
|
||||||
|
if (ctrlr->opts.disable_read_changed_ns_list_log_page) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
buffer = spdk_dma_zmalloc(buf_size, 4096, NULL);
|
buffer = spdk_dma_zmalloc(buf_size, 4096, NULL);
|
||||||
if (!buffer) {
|
if (!buffer) {
|
||||||
NVME_CTRLR_ERRLOG(ctrlr, "Failed to allocate buffer for getting "
|
NVME_CTRLR_ERRLOG(ctrlr, "Failed to allocate buffer for getting "
|
||||||
|
Loading…
Reference in New Issue
Block a user