numam-spdk/test/unit
Niklas Cassel 726ac67c55 nvme: use the most appropriate is_active() function
There are two different is_active() functions.
spdk_nvme_ctrlr_is_active_ns() which iterates through the active_ns_list,
and spdk_nvme_ns_is_active(), which simply checks the nsdata.
There is an event callback that refreshes active_ns_list when a relevant
events has occured.

In nvme_ns_construct(), nvme_ctrlr_identify_ns() has just been called,
so we know that nsdata is as fresh as possible.

Hence, there is no reason to iterate through a less fresh active_ns_list.
Since we know that the nvme_ctrlr_identify_ns() call was done through the
same controller, we also know that the active/inactive is from the
perspective of the correct controller, so that is not a reason to use the
less efficient is_active() function.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I185f59b53e16e70163e33a3909f4b55ebf631cc4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4293
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-09-18 07:25:06 +00:00
..
include test/unit: remove duplicate mk/spdk.common.mk includes 2019-02-11 09:30:27 +00:00
lib nvme: use the most appropriate is_active() function 2020-09-18 07:25:06 +00:00
Makefile test: add histogram unit tests 2017-12-29 14:20:48 -05:00
unittest.sh test: Enable uring test in CI pool. 2020-07-03 07:31:08 +00:00