ACM_ROUTE_PRELOAD_OSM_FULL_V1
};
+enum acm_addr_preload {
+ ACM_ADDR_PRELOAD_NONE,
+ ACM_ADDR_PRELOAD_HOSTS
+};
+
/*
* Nested locking order: dest -> ep, dest -> port
*/
static char *acme = BINDIR "/ib_acme -A";
static char *opts_file = ACM_CONF_DIR "/" ACM_OPTS_FILE;
static char *addr_file = ACM_CONF_DIR "/" ACM_ADDR_FILE;
-<<<<<<< current
static char route_data_file[128] = ACM_CONF_DIR "/ibacm_route.data";
-=======
-static char path_rec_file[128] = ACM_CONF_DIR "/" ACM_PATH_REC_FILE;
-static char hosts_file[128] = "none";
->>>>>>> patched
+static char addr_data_file[128] = ACM_CONF_DIR "/ibacm_hosts.data";
static char log_file[128] = "/var/log/ibacm.log";
static int log_level = 0;
static char lock_file[128] = "/var/run/ibacm.pid";
static uint8_t min_mtu = IBV_MTU_2048;
static uint8_t min_rate = IBV_RATE_10_GBPS;
static enum acm_route_preload route_preload;
+static enum acm_addr_preload addr_preload;
#define acm_log(level, format, ...) \
acm_write(level, "%s: "format, __func__, ## __VA_ARGS__)
return route_preload;
}
+static enum acm_route_preload acm_convert_addr_preload(char *param)
+{
+ if (!stricmp("none", param) || !stricmp("no", param))
+ return ACM_ADDR_PRELOAD_NONE;
+ else if (!stricmp("acm_hosts", param))
+ return ACM_ADDR_PRELOAD_HOSTS;
+
+ return addr_preload;
+}
+
static enum ibv_rate acm_get_rate(uint8_t width, uint8_t speed)
{
switch (width) {
if (acm_parse_osm_fullv1(ep))
acm_log(0, "ERROR - failed to preload EP\n");
break;
+ default:
+ return;
+ }
+
+ switch (addr_preload) {
+ case ACM_ADDR_PRELOAD_HOSTS:
+ acm_parse_hosts_file(ep);
+ break;
default:
break;
}
lock_acquire(&port->lock);
DListInsertHead(&ep->entry, &port->ep_list);
lock_release(&port->lock);
-<<<<<<< current
acm_ep_preload(ep);
-=======
-
- if (path_rec_fmt == ACM_PATH_REV_FMT_OSM_FULL_V1) {
- ret = acm_parse_path_records(ep);
- if (ret)
- acm_log(1, "unable to find ep in path records\n");
- }
- if (hosts_opt) {
- if (path_rec_fmt == ACM_PATH_REV_FMT_NONE)
- acm_log(0, "when using hosts file option should also use path records option\n");
- acm_parse_hosts_file(ep);
- }
-
->>>>>>> patched
return;
err2:
min_mtu = acm_convert_mtu(atoi(value));
else if (!stricmp("min_rate", opt))
min_rate = acm_convert_rate(atoi(value));
-<<<<<<< current
else if (!stricmp("route_preload", opt))
route_preload = acm_convert_route_preload(value);
else if (!stricmp("route_data_file", opt))
strcpy(route_data_file, value);
-=======
- else if (!stricmp("path_rec_fmt", opt))
- path_rec_fmt = acm_convert_path_rec_fmt(value);
- else if (!stricmp("path_rec_file", opt))
- strcpy(path_rec_file, value);
- else if (!stricmp("hosts_file", opt)) {
- strcpy(hosts_file, value);
- if (!stricmp(hosts_file, "none"))
- hosts_opt = 0;
- else
- hosts_opt = 1;
- }
->>>>>>> patched
+ else if (!stricmp("addr_preload", opt))
+ addr_preload = acm_convert_addr_preload(value);
+ else if (!stricmp("addr_data_file", opt))
+ strcpy(addr_data_file, opt);
}
fclose(f);
acm_log(0, "receive depth %d\n", recv_depth);
acm_log(0, "minimum mtu %d\n", min_mtu);
acm_log(0, "minimum rate %d\n", min_rate);
-<<<<<<< current
acm_log(0, "route preload %d\n", route_preload);
acm_log(0, "route data file %s\n", route_data_file);
-=======
- acm_log(0, "path record format %d\n", path_rec_fmt);
- acm_log(0, "path record file %s\n", path_rec_file);
- acm_log(0, "hosts file %s\n", hosts_file);
->>>>>>> patched
+ acm_log(0, "address preload %d\n", addr_preload);
+ acm_log(0, "address data file %s\n", addr_data_file);
}
static FILE *acm_open_log(void)
fprintf(f, "# Default is ACM_CONF_DIR/ibacm_route.data\n");
fprintf(f, "# /etc/rdma/ibacm_route.data\n");
fprintf(f, "\n");
- fprintf(f, "# hosts_file:\n");
- fprintf(f, "# none - No hosts file\n");
- fprintf(f, "# If hosts_file is other than \"none\", full pathname of hosts file\n");
+ fprintf(f, "# addr_preload:\n");
+ fprintf(f, "# Specifies if the ACM address cache should be preloaded, or built on demand.\n");
+ fprintf(f, "# If preloaded, indicates the method used to build the cache.\n");
+ fprintf(f, "# Supported preload values are:\n");
+ fprintf(f, "# none - The address cache is not pre-built (default)\n");
+ fprintf(f, "# acm_hosts - ACM address to GID file format\n");
+ fprintf(f, "\n");
+ fprintf(f, "addr_preload none\n");
fprintf(f, "\n");
- fprintf(f, "hosts_file none\n");
+ fprintf(f, "# addr_data_file:\n");
+ fprintf(f, "# Specifies the location of the address data file to use when preloading\n");
+ fprintf(f, "# the ACM cache. This option is only valid if addr_preload\n");
+ fprintf(f, "# indicates that address data should be read from a file.\n");
+ fprintf(f, "# Default is ACM_CONF_DIR/ibacm_hosts.data\n");
+ fprintf(f, "# /etc/rdma/ibacm_hosts.data\n");
fprintf(f, "\n");
}