Spdk/test/unit/lib
Shuhei Matsumoto 071d80f37b lib/nvmf: Add an internal API nvmf_subsystem_set_ana_state()
Add an internal API nvmf_subsystem_set_ana_state() to change the
ANA state of the subsystem listener whose trid matches.

ANA optimized state, ANA non-optimized state, and ANA inaccessible
state are supported. ANA change state is not used and ANA persistent
loss state is not supported.

After changing the ANA state of the subsystem listener, on each poll
group, controllers, whose the subsystem listener match, send ANA
change notice.

Initiators query ANA log page anyway if they receive ANA change
notification. False positive notification should be avoided but is
acceptable.

To avoid any concurrency conflict, simply compare ctrlr->listener and
the passed listener.

It may be better to execute nvmf_subsystem_set_ana_state() on the
subsystem thread but currently the RPC thread adds and removes a
listener to and from the subsystem, respectively, and the subsystem
has been suspended while executing nvmf_subsystem_set_ana_state().
Hence we keep this as a future enhancement.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: If1910b79dd33d904114e258ae2c5e868947cdc52
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4079
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Anil Veerabhadrappa <anil.veerabhadrappa@broadcom.com>
2020-09-16 07:55:28 +00:00
..
bdev bdev/nvme: add a function for specifying a multipath trid. 2020-08-07 15:06:01 +00:00
blob blob: switch to bit_pool for tracking used_clusters 2020-09-15 07:12:44 +00:00
blobfs module/blobfs: remove spdk prefix from static/internal functions. 2020-05-18 09:48:18 +00:00
event lib/event: remove _spdk prefix from functions. 2020-05-27 07:35:02 +00:00
ftl lib/ftl: Keep tracing functions under define flag 2020-06-05 09:03:31 +00:00
idxd lib/idxd: add unit test for idxd_wq_config() 2020-04-23 15:48:32 +00:00
ioat ut: make use of CUnit macro to reduce duplications 2020-04-02 14:50:12 +00:00
iscsi lib/iscsi: Make max outstanding R2Ts per connection configurable 2020-08-18 07:27:45 +00:00
json lib: json-nbd remove spdk prefix from static functions. 2020-05-21 09:19:00 +00:00
jsonrpc lib/jsonrpc: remove spdk_ prefix from internal functions. 2020-05-11 12:29:07 +00:00
log log: spdk_log_dump more characters than required 2020-04-14 11:34:45 +00:00
lvol lvol: let thin_provision flag be consistent with Blob 2020-05-22 10:42:28 +00:00
notify ut: make use of CUnit macro to reduce duplications 2020-04-02 14:50:12 +00:00
nvme nvme: add initial namespace types support 2020-09-11 07:29:51 +00:00
nvmf lib/nvmf: Add an internal API nvmf_subsystem_set_ana_state() 2020-09-16 07:55:28 +00:00
reduce test: add generic unlink wrapper 2020-05-06 12:43:57 +00:00
scsi UT/scsi_reserve: add Persistent Reserve with SPC2 RESERVE/RELEASE test case 2020-06-25 07:16:08 +00:00
sock ut/sock: Add get/set_opts unit tests for posix sockets 2020-06-02 09:48:00 +00:00
thread lib/thread: remove _spdk prefix. 2020-06-01 13:07:30 +00:00
util cpuset: fix parse_mask 2020-08-27 08:34:07 +00:00
vhost lib/vhost: remove dependency on lib/event 2020-05-13 07:47:01 +00:00
json_mock.c subsystem: add per module configuration dump 2018-03-23 02:47:40 -04:00
Makefile lib/idxd: add unit test framework and first unit test 2020-04-23 15:48:32 +00:00