Commit 2c43473a authored by Ziye Yang's avatar Ziye Yang Committed by Daniel Verkamp
Browse files

nvmf: fix fabricintf parsing in spdk_nvmf_parse_port function



The index should be 0 for fabricintf.
Moreover, when there is no fabricintf found, error should
be returned

Change-Id: I3aa04566a5a318b8c921dd37c8573ed075254266
Signed-off-by: default avatarZiye Yang <ziye.yang@intel.com>
parent d2376324
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -222,7 +222,7 @@ spdk_nvmf_parse_port(struct spdk_conf_section *sp)

	/* Loop over the fabric interfaces and add them to the port */
	for (i = 0; ; i++) {
		listen_addr = spdk_conf_section_get_nmval(sp, "FabricIntf", i, 1);
		listen_addr = spdk_conf_section_get_nmval(sp, "FabricIntf", i, 0);
		if (listen_addr == NULL) {
			break;
		}
@@ -238,6 +238,11 @@ spdk_nvmf_parse_port(struct spdk_conf_section *sp)
		spdk_nvmf_port_add_fabric_intf(port, fabric_intf);
	}

	if (TAILQ_EMPTY(&port->head)) {
		SPDK_ERRLOG("No fabric interface found\n");
		return -1;
	}

	return 0;
}

+1 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@

[Port1]
  Comment "Test1"
  FabricIntf DA1 192.168.100.8:7174
  FabricIntf 192.168.100.8:7174

[InitiatorGroup1]
  Comment "Initiator Group1"