Commit 6a138381 authored by Daniel Verkamp's avatar Daniel Verkamp Committed by Benjamin Walker
Browse files

nvmf: rename FabricIntf to Listen, add transport



Change the Port configuration file entries to a new format:

[Port1]
  Listen <transport> <address>:<service>

Initially, this still only supports RDMA, but the new format will allow
specifying other transports once they are added.

Change-Id: Iadfd19b91db57b571064379368dbe77204ccecbb
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent d6a499fe
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -51,10 +51,10 @@
#  NVM subsystem controller session, providing a means to distribute NVMf
#  traffic across all network ports.
[Port1]
  FabricIntf 15.15.15.2:4420
  Listen RDMA 15.15.15.2:4420

[Port2]
  FabricIntf 192.168.2.21:4420
  Listen RDMA 192.168.2.21:4420

# Users must change the Host section(s) to match the IP
#  addresses of the clients that will connect to this target.
+15 −3
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>

#include <rte_config.h>
#include <rte_lcore.h>
@@ -184,7 +185,7 @@ spdk_nvmf_parse_port(struct spdk_conf_section *sp)
{
	struct spdk_nvmf_port		*port;
	struct spdk_nvmf_fabric_intf	*fabric_intf;
	char *listen_addr, *host, *listen_port;
	char *transport_name, *listen_addr, *host, *listen_port;
	int i = 0, rc = 0;

	/* Create the Subsystem Port */
@@ -194,10 +195,21 @@ spdk_nvmf_parse_port(struct spdk_conf_section *sp)
		return -1;
	}

	/* Loop over the fabric interfaces and add them to the port */
	/* Loop over the listen addresses and add them to the port */
	for (i = 0; ; i++) {
		listen_addr = spdk_conf_section_get_nmval(sp, "FabricIntf", i, 0);
		transport_name = spdk_conf_section_get_nmval(sp, "Listen", i, 0);
		if (transport_name == NULL) {
			break;
		}

		if (strcasecmp(transport_name, "RDMA") != 0) {
			SPDK_ERRLOG("Unknown transport type '%s'\n", transport_name);
			return -1;
		}

		listen_addr = spdk_conf_section_get_nmval(sp, "Listen", i, 1);
		if (listen_addr == NULL) {
			SPDK_ERRLOG("Missing address for Listen in Port%d\n", sp->num);
			break;
		}
		rc = spdk_nvmf_parse_addr(listen_addr, &host, &listen_port);
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@

[Port1]
  Comment "Test1"
  FabricIntf 192.168.100.8:4420
  Listen RDMA 192.168.100.8:4420

[Host1]
  Netmask 192.168.100.0/24