]> git.openfabrics.org - ~ardavis/dapl.git/commitdiff
update makefile
authorArlin Davis <arlin.r.davis@intel.com>
Tue, 22 May 2012 17:44:12 +0000 (10:44 -0700)
committerArlin Davis <arlin.r.davis@intel.com>
Tue, 22 May 2012 17:44:12 +0000 (10:44 -0700)
Makefile.am
dapl/svc/mpxyd.c

index 1da79e3061f9df598e9d5e121e74cf06a8c5dc4d..8cf88ee5e84fcf6524c05b6d1aacbc02145d408d 100755 (executable)
@@ -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)
index d1bb77ae5e775b78ee50f9dca7101dec163a07fa..de283df2cb4dfe35917847019fe01d591a170df0 100644 (file)
 #include <stdio.h>
 #include <stdarg.h>
 #include <string.h>
-#include <osd.h>
 #include <arpa/inet.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/time.h>
 #include <getopt.h>
 #include <fcntl.h>
-#include <udat.h>
 #include <scif.h>
 #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()) {