nvmf: add discovery subsystem entries to discovery log page

When generating the discovery log page, add entries for
the discovery subsystem, skipping the listener associated
with the command generating the log page.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id6a14a7d5cdce483f8f3c2eff1b4ededd40bc029
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11542
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Jim Harris 2022-02-10 11:22:09 +00:00 committed by Tomasz Zawadzki
parent 09240a1c3c
commit fd0f154f47

View File

@ -122,16 +122,19 @@ nvmf_generate_discovery_log(struct spdk_nvmf_tgt *tgt, const char *hostnqn, size
continue;
}
if (subsystem->subtype == SPDK_NVMF_SUBTYPE_DISCOVERY) {
continue;
}
if (!spdk_nvmf_subsystem_host_allowed(subsystem, hostnqn)) {
continue;
}
for (listener = spdk_nvmf_subsystem_get_first_listener(subsystem); listener != NULL;
listener = spdk_nvmf_subsystem_get_next_listener(subsystem, listener)) {
if (subsystem->subtype == SPDK_NVMF_SUBTYPE_DISCOVERY &&
!spdk_nvme_transport_id_compare(listener->trid, cmd_source_trid)) {
/* Do not generate an entry for the transport ID for the listener
* entry associated with the controller that generated this command.
*/
continue;
}
if ((tgt->discovery_filter & SPDK_NVMF_TGT_DISCOVERY_MATCH_TRANSPORT_TYPE) != 0 &&
!nvmf_discovery_compare_trtype(listener->trid, cmd_source_trid)) {