1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

refactor:

- DEFAULT_SAMPLELEN -> DEFAULT_SAMPLE_LENGTH
- DEFAULT_QUEUELEN -> DEFAULT_QUEUE_LENGTH
This commit is contained in:
Steffen Vogel 2018-08-02 10:43:49 +02:00
parent f35588aad8
commit 32de7761fe
11 changed files with 16 additions and 16 deletions

View file

@ -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 */

View file

@ -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;

View file

@ -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)

View file

@ -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++;

View file

@ -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

View file

@ -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;

View file

@ -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)

View file

@ -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);

View file

@ -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");

View file

@ -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.");

View file

@ -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");