nvmf: don't update discovery log on subsystem create/delete
The discovery log isn't updated when a subsystem is created or deleted, it's only updated when a listener for a subsystem is added or removed. So remove the nvmf_update_discovery_log() in the subsystem create and delete paths. They just generate extra AER completions that potentially cause the host to do unneeded work. Note that if a subsystem is deleted with active listeners, the subsystem delete path will remove each of the listeners before deleting the subsystem itself. So the discovery log will still get updated when those listeners are removed. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: Id01bbfa3b24d3e1279a614a2fd60be41387a03b1 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10545 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Dong Yi <dongx.yi@intel.com> Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
parent
17cd6c3488
commit
9ac2cf7ff0
@ -323,7 +323,6 @@ spdk_nvmf_subsystem_create(struct spdk_nvmf_tgt *tgt,
|
||||
MODEL_NUMBER_DEFAULT);
|
||||
|
||||
tgt->subsystems[sid] = subsystem;
|
||||
nvmf_update_discovery_log(tgt, NULL);
|
||||
|
||||
return subsystem;
|
||||
}
|
||||
@ -403,7 +402,6 @@ _nvmf_subsystem_destroy(struct spdk_nvmf_subsystem *subsystem)
|
||||
free(subsystem->ana_group);
|
||||
|
||||
subsystem->tgt->subsystems[subsystem->id] = NULL;
|
||||
nvmf_update_discovery_log(subsystem->tgt, NULL);
|
||||
|
||||
pthread_mutex_destroy(&subsystem->mutex);
|
||||
|
||||
|
@ -324,14 +324,14 @@ test_discovery_log(void)
|
||||
disc_log = (struct spdk_nvmf_discovery_log_page *)buffer;
|
||||
nvmf_get_discovery_log_page(&tgt, "nqn.2016-06.io.spdk:host1", &iov, 1, 0, sizeof(disc_log->genctr),
|
||||
&trid);
|
||||
CU_ASSERT(disc_log->genctr == 2); /* one added subsystem and listener */
|
||||
CU_ASSERT(disc_log->genctr == 1); /* one added subsystem and listener */
|
||||
|
||||
/* Get only the header, no entries */
|
||||
memset(buffer, 0xCC, sizeof(buffer));
|
||||
disc_log = (struct spdk_nvmf_discovery_log_page *)buffer;
|
||||
nvmf_get_discovery_log_page(&tgt, "nqn.2016-06.io.spdk:host1", &iov, 1, 0, sizeof(*disc_log),
|
||||
&trid);
|
||||
CU_ASSERT(disc_log->genctr == 2);
|
||||
CU_ASSERT(disc_log->genctr == 1);
|
||||
CU_ASSERT(disc_log->numrec == 1);
|
||||
|
||||
/* Offset 0, exact size match */
|
||||
|
Loading…
x
Reference in New Issue
Block a user