nvmf: remove arbitrary 4-port limit

Change-Id: Id37a0f044845c175b2de43a5e1fa76513843f314
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2016-07-15 09:23:45 -07:00
parent 3c96acb4f4
commit b10bf60cac

View File

@ -41,9 +41,6 @@
#include "spdk/trace.h" #include "spdk/trace.h"
#include "spdk/nvmf_spec.h" #include "spdk/nvmf_spec.h"
#define MAX_FABRIC_INTF_PER_PORT 4
#define MAX_PORTS 4
static TAILQ_HEAD(, spdk_nvmf_port) g_port_head = TAILQ_HEAD_INITIALIZER(g_port_head); static TAILQ_HEAD(, spdk_nvmf_port) g_port_head = TAILQ_HEAD_INITIALIZER(g_port_head);
/* Assumes caller allocated host and port strings on the heap */ /* Assumes caller allocated host and port strings on the heap */
@ -88,17 +85,11 @@ spdk_nvmf_port_find_fabric_intf_by_addr(char *addr)
{ {
struct spdk_nvmf_port *port; struct spdk_nvmf_port *port;
struct spdk_nvmf_fabric_intf *fabric_intf; struct spdk_nvmf_fabric_intf *fabric_intf;
int i;
if (addr == NULL) if (addr == NULL)
goto find_error; goto find_error;
for (i = 1; i < MAX_PORTS; i++) { TAILQ_FOREACH(port, &g_port_head, tailq) {
port = spdk_nvmf_port_find_by_tag(i);
if (port == NULL) {
continue;
}
TAILQ_FOREACH(fabric_intf, &port->head, tailq) { TAILQ_FOREACH(fabric_intf, &port->head, tailq) {
if (!strncasecmp(fabric_intf->host, addr, strlen(fabric_intf->host))) { if (!strncasecmp(fabric_intf->host, addr, strlen(fabric_intf->host))) {
return fabric_intf; return fabric_intf;