Spdk/test/unit/lib
Anton Eidelman 0b9100e8a5 bdev/nvme: replace nn with mnan in ana_log size calculation
Calculation of the ANA log page size should use the
identify ctrl MNAN field
(maximum number of allowed namespaces)
not the NN (maximum valid nsid value).

An ANA-enabled controller must have a non-zero MNAN value,
see NVMe Base Specification, Figure 251,
therefore nvme_ctrlr_init_ana_log_page() may safely use MNAN.

Since NN might be much higher than MNAN,
ANA log size based on NN may results in a very large
log page and cause a failure to get ANA log,
e.g. if it is larger than the controller's MDTS.

Fix: replace cdata->nn with cdata->mnan
in nvme_ctrlr_init_ana_log_page()

Signed-off-by: Anton Eidelman <anton@lightbitslabs.com>
Change-Id: I2a522dca833a27dddad25848d7688efa23d23091
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13039
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
2022-06-15 08:10:48 +00:00
..
accel Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
bdev bdev/nvme: replace nn with mnan in ana_log size calculation 2022-06-15 08:10:48 +00:00
blob Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
blobfs Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
dma Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
env_dpdk Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
event Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
ftl Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
idxd Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
init Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
ioat Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
iscsi Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
json Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
jsonrpc Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
log Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
lvol Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
notify Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
nvme Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
nvmf Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
reduce Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
rpc Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
scsi Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
sock Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
thread Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
util Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
vhost test: add ENV_CFLAGS after includes 2022-06-10 07:56:02 +00:00
json_mock.c Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
Makefile Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00