diff --git a/include/villas/config.h.in b/include/villas/config.h.in index 282818f4d..c7c96252d 100644 --- a/include/villas/config.h.in +++ b/include/villas/config.h.in @@ -37,8 +37,8 @@ extern "C"{ #define PROCFS_PATH "/proc" /** Default number of values in a sample */ -#define DEFAULT_SAMPLELEN 64 -#define DEFAULT_QUEUELEN 1024 +#define DEFAULT_SAMPLE_LENGTH 64 +#define DEFAULT_QUEUE_LENGTH 1024 /** Number of hugepages which are requested from the the kernel. * @see https://www.kernel.org/doc/Documentation/vm/hugetlbpage.txt */ diff --git a/include/villas/nodes/websocket.h b/include/villas/nodes/websocket.h index 76b900cf2..ec6a0600c 100644 --- a/include/villas/nodes/websocket.h +++ b/include/villas/nodes/websocket.h @@ -40,8 +40,8 @@ extern "C" { #endif -#define DEFAULT_WEBSOCKET_QUEUELEN (DEFAULT_QUEUELEN * 64) -#define DEFAULT_WEBSOCKET_SAMPLELEN DEFAULT_SAMPLELEN +#define DEFAULT_WEBSOCKET_QUEUELEN (DEFAULT_QUEUE_LENGTH * 64) +#define DEFAULT_WEBSOCKET_SAMPLELEN DEFAULT_SAMPLE_LENGTH /* Forward declaration */ struct lws; diff --git a/lib/node.c b/lib/node.c index 97789beb6..2cc65e642 100644 --- a/lib/node.c +++ b/lib/node.c @@ -191,7 +191,7 @@ int node_init(struct node *n, struct node_type *vt) n->_name_long = NULL; /* Default values */ - n->samplelen = DEFAULT_SAMPLELEN; + n->samplelen = DEFAULT_SAMPLE_LENGTH; ret = node_direction_init(&n->in, n); if (ret) diff --git a/lib/nodes/infiniband.c b/lib/nodes/infiniband.c index f3c561a5b..ed597c395 100644 --- a/lib/nodes/infiniband.c +++ b/lib/nodes/infiniband.c @@ -841,7 +841,7 @@ int ib_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *relea j++; sge[i][j].addr = (uint64_t) &smps[i]->data; - sge[i][j].length = SAMPLE_DATA_LENGTH(DEFAULT_SAMPLELEN); + sge[i][j].length = SAMPLE_DATA_LENGTH(DEFAULT_SAMPLE_LENGTH); sge[i][j].lkey = mr->lkey; j++; diff --git a/lib/nodes/loopback.c b/lib/nodes/loopback.c index 8d4673ea1..40ab4773a 100644 --- a/lib/nodes/loopback.c +++ b/lib/nodes/loopback.c @@ -34,7 +34,7 @@ int loopback_parse(struct node *n, json_t *cfg) int ret; /* Default values */ - l->queuelen = DEFAULT_QUEUELEN; + l->queuelen = DEFAULT_QUEUE_LENGTH; ret = json_unpack_ex(cfg, &err, 0, "{ s?: i }", "queuelen", &l->queuelen diff --git a/lib/nodes/websocket.c b/lib/nodes/websocket.c index 472a60a31..1e2dd4cef 100644 --- a/lib/nodes/websocket.c +++ b/lib/nodes/websocket.c @@ -83,7 +83,7 @@ static int websocket_connection_init(struct websocket_connection *c) c->_name = NULL; - ret = queue_init(&c->queue, DEFAULT_QUEUELEN, &memory_hugepage); + ret = queue_init(&c->queue, DEFAULT_QUEUE_LENGTH, &memory_hugepage); if (ret) return ret; diff --git a/lib/path.c b/lib/path.c index a1c3e96c1..d55945b62 100644 --- a/lib/path.c +++ b/lib/path.c @@ -45,7 +45,7 @@ static void path_destination_enqueue(struct path *p, struct sample *smps[], unsi static int path_source_init(struct path_source *ps) { int ret; - unsigned pool_cnt = (strcmp(node_type_name(ps->node->_vt), "infiniband") == 0 ? 8192 : (unsigned) MAX(DEFAULT_QUEUELEN, ps->node->in.vectorize)); + unsigned pool_cnt = (strcmp(node_type_name(ps->node->_vt), "infiniband") == 0 ? 8192 : (unsigned) MAX(DEFAULT_QUEUE_LENGTH, ps->node->in.vectorize)); ret = pool_init(&ps->pool, pool_cnt, SAMPLE_LENGTH(ps->node->samplelen), node_memory_type(ps->node, &memory_hugepage)); if (ret) @@ -313,7 +313,7 @@ int path_init(struct path *p) p->reverse = 0; p->enabled = 1; p->poll = -1; - p->queuelen = DEFAULT_QUEUELEN; + p->queuelen = DEFAULT_QUEUE_LENGTH; #ifdef WITH_HOOKS /* Add internal hooks if they are not already in the list */ @@ -446,7 +446,7 @@ int path_init2(struct path *p) } if (!p->samplelen) - p->samplelen = DEFAULT_SAMPLELEN; + p->samplelen = DEFAULT_SAMPLE_LENGTH; ret = pool_init(&p->pool, pool_cnt, SAMPLE_LENGTH(p->samplelen), pool_mem_type); if (ret) diff --git a/src/villas-convert.cpp b/src/villas-convert.cpp index a911cc81e..2be242297 100644 --- a/src/villas-convert.cpp +++ b/src/villas-convert.cpp @@ -117,7 +117,7 @@ check: if (optarg == endptr) error("Failed to open IO"); } - struct sample *smp = sample_alloc_mem(DEFAULT_SAMPLELEN); + struct sample *smp = sample_alloc_mem(DEFAULT_SAMPLE_LENGTH); for (;;) { ret = io_scan(&input, &smp, 1); diff --git a/src/villas-hook.cpp b/src/villas-hook.cpp index 9665b2699..ad41ec4dd 100644 --- a/src/villas-hook.cpp +++ b/src/villas-hook.cpp @@ -186,7 +186,7 @@ check: if (optarg == endptr) smps = (struct sample **) alloc(cnt * sizeof(struct sample *)); - ret = pool_init(&q, 10 * cnt, SAMPLE_LENGTH(DEFAULT_SAMPLELEN), &memory_hugepage); + ret = pool_init(&q, 10 * cnt, SAMPLE_LENGTH(DEFAULT_SAMPLE_LENGTH), &memory_hugepage); if (ret) error("Failed to initilize memory pool"); diff --git a/src/villas-pipe.cpp b/src/villas-pipe.cpp index cb83733c6..fb909d99c 100644 --- a/src/villas-pipe.cpp +++ b/src/villas-pipe.cpp @@ -135,7 +135,7 @@ static void * send_loop(void *ctx) /* Initialize memory */ unsigned pool_cnt = (strcmp(node_type_name(node->_vt), "infiniband") == 0 ? 8192 : LOG2_CEIL(node->out.vectorize)); - ret = pool_init(&sendd.pool, pool_cnt, SAMPLE_LENGTH(DEFAULT_SAMPLELEN), node_memory_type(node, &memory_hugepage)); + ret = pool_init(&sendd.pool, pool_cnt, SAMPLE_LENGTH(DEFAULT_SAMPLE_LENGTH), node_memory_type(node, &memory_hugepage)); if (ret < 0) error("Failed to allocate memory for receive pool."); @@ -205,7 +205,7 @@ static void * recv_loop(void *ctx) /* Initialize memory */ unsigned pool_cnt = (strcmp(node_type_name(node->_vt), "infiniband") == 0 ? 8192 : LOG2_CEIL(node->in.vectorize)); - ret = pool_init(&recvv.pool, pool_cnt, SAMPLE_LENGTH(DEFAULT_SAMPLELEN), node_memory_type(node, &memory_hugepage)); + ret = pool_init(&recvv.pool, pool_cnt, SAMPLE_LENGTH(DEFAULT_SAMPLE_LENGTH), node_memory_type(node, &memory_hugepage)); if (ret < 0) error("Failed to allocate memory for receive pool."); diff --git a/src/villas-test-cmp.cpp b/src/villas-test-cmp.cpp index ca3d61e0d..b5fa6eadf 100644 --- a/src/villas-test-cmp.cpp +++ b/src/villas-test-cmp.cpp @@ -121,7 +121,7 @@ check: if (optarg == endptr) struct side s[n]; memory_init(0); - ret = pool_init(&pool, n, SAMPLE_LENGTH(DEFAULT_SAMPLELEN), &memory_type_heap); + ret = pool_init(&pool, n, SAMPLE_LENGTH(DEFAULT_SAMPLE_LENGTH), &memory_type_heap); if (ret) error("Failed to initialize pool");