From: Arlin Davis Date: Tue, 22 May 2012 17:44:12 +0000 (-0700) Subject: update makefile X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=3ab541b5dfa02181a18ed5656270b1f88b01ed02;p=~ardavis%2Fdapl.git update makefile --- diff --git a/Makefile.am b/Makefile.am index 1da79e3..8cf88ee 100755 --- a/Makefile.am +++ b/Makefile.am @@ -44,12 +44,16 @@ if DEFINE_ATTR_LINK_LAYER XFLAGS += -DDEFINE_ATTR_LINK_LAYER endif +-DSYSCONFDIR=\"$(sysconfdir)\" -DBINDIR=\"$(bindir)\" + if DEBUG -AM_CFLAGS = -g -Wall -D_GNU_SOURCE -DDAPL_DBG -DDAT_CONF="\"$(sysconfdir)/dat.conf\"" +AM_CFLAGS = -g -Wall -D_GNU_SOURCE -DDAPL_DBG -DDAT_CONF="\"$(sysconfdir)/dat.conf\"" else AM_CFLAGS = -g -Wall -D_GNU_SOURCE -DDAT_CONF="\"$(sysconfdir)/dat.conf\"" endif +AM_CFLAGS += -DSYSCONFDIR=\"$(sysconfdir)\" -DBINDIR=\"$(bindir)\" + sysconf_DATA = doc/dat.conf datlibdir = $(libdir) diff --git a/dapl/svc/mpxyd.c b/dapl/svc/mpxyd.c index d1bb77a..de283df 100644 --- a/dapl/svc/mpxyd.c +++ b/dapl/svc/mpxyd.c @@ -34,26 +34,26 @@ #include #include #include -#include #include #include #include #include #include #include -#include #include #include "dat2/udat.h" - /* * Service options - set through mpxy_opts file. */ -static char *opts_file = MPXY_CONF_DIR "/" MPXY_OPTS_FILE; -static char log_file[128] = "/var/log/mpxy.log"; +static char *opts_file = MPXYD_CONF_DIR "/" MPXYD_OPTS_FILE; +static char log_file[128] = "/var/log/mpxyd.log"; static int log_level = 0; -static char lock_file[128] = "/var/run/mpxy.pid"; +static char lock_file[128] = "/var/run/mpxyd.pid"; static short service_id = SCIF_OFED_PORT_7; +static int buffer_pool_mb = 64; +static int tx_depth = 100; +static int tx_signal = 10; static FILE *lfile; static lock_t llock; @@ -95,6 +95,51 @@ static FILE *mpxy_open_log(void) return f; } +static void mpxy_set_options(void) +{ + FILE *f; + char s[120]; + char opt[32], value[32]; + + if (!(f = fopen(opts_file, "r"))) + return; + + while (fgets(s, sizeof s, f)) { + if (s[0] == '#') + continue; + + if (sscanf(s, "%32s%32s", opt, value) != 2) + continue; + + if (!stricmp("log_file", opt)) + strcpy(log_file, value); + else if (!stricmp("log_level", opt)) + log_level = atoi(value); + else if (!stricmp("lock_file", opt)) + strcpy(lock_file, value); + else if (!stricmp("buffer_pool_mb", opt)) + buffer_pool_mb = atoi(value); + else if (!stricmp("service_id", opt)) + service_id = (short) atoi(value); + else if (!stricmp("tx_depth", opt)) + tx_depth = atoi(value); + else if (!stricmp("tx_signal", opt)) + tx_signal = atoi(value); + } + + fclose(f); +} + +static void mpxy_log_options(void) +{ + mpxy_log(0, "log level %d\n", log_level); + mpxy_log(0, "lock file %s\n", lock_file); + mpxy_log(0, "server_port %d\n", service_id); + mpxy_log(0, "rdma buffer pool size %d\n", buffer_size); + mpxy_log(0, "transmit queue depth %d\n", tx_depth); + mpxy_log(0, "transmit completion rate %d\n", tx_signal); +} + static int mpxy_open_lock(void) { int lock_fd; @@ -141,10 +186,9 @@ static void show_usage(char *program) printf("usage: %s\n", program); printf(" [-P] - run as a standard process, (default daemon)\n"); printf(" [-O option_file] - option configuration file\n"); - printf(" (default %s/%s\n", MPXY_CONF_DIR, MPXY_OPTS_FILE); + printf(" (default %s/%s\n", MPXYD_CONF_DIR, MPXYD_OPTS_FILE); } - int main(int argc, char **argv) { int i, op, daemon = 1; @@ -174,7 +218,7 @@ int main(int argc, char **argv) lock_init(&log_lock); logfile = pxd_open_log(); - mpxy_log(0, "MIC Indirect - STD (scif to dapl) Proxy Service\n"); + mpxy_log(0, "MIC Indirect - SCIF to DAPL RDMA Proxy Service\n"); mpxy_log_options(); if (mpxy_open_devices()) {