summaryrefslogtreecommitdiff
path: root/src/lib/dev.c
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri.staessens@ugent.be>2018-12-21 16:16:46 +0100
committerSander Vrijders <sander.vrijders@ugent.be>2018-12-22 10:20:31 +0100
commit8eed1b3fc3d4e3261a68855ccc54c35102738a79 (patch)
tree28cbf1e57f267330aae761fa27d47821f7954fb4 /src/lib/dev.c
parent933aa5ab479732d84b3331ef4638dd9be07695b2 (diff)
downloadouroboros-8eed1b3fc3d4e3261a68855ccc54c35102738a79.tar.gz
ouroboros-8eed1b3fc3d4e3261a68855ccc54c35102738a79.zip
irmd: Manage shm_flow_set from IRMd
This moves the creation and destruction of shm_flow_set shared memory structures from the init to the IRMd. Now the management of all shared data objects is performed by the IRMd. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
Diffstat (limited to 'src/lib/dev.c')
-rw-r--r--src/lib/dev.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/dev.c b/src/lib/dev.c
index 42eed7e4..a2ec836f 100644
--- a/src/lib/dev.c
+++ b/src/lib/dev.c
@@ -357,10 +357,6 @@ static void init(int argc,
if (ai.fqueues == NULL)
goto fail_fqueues;
- ai.fqset = shm_flow_set_create();
- if (ai.fqset == NULL)
- goto fail_fqset;
-
ai.rdrb = shm_rdrbuff_open();
if (ai.rdrb == NULL)
goto fail_rdrb;
@@ -407,8 +403,14 @@ static void init(int argc,
if (rxmwheel_init())
goto fail_rxmwheel;
+ ai.fqset = shm_flow_set_open(getpid());
+ if (ai.fqset == NULL)
+ goto fail_fqset;
+
return;
+ fail_fqset:
+ rxmwheel_fini();
fail_rxmwheel:
pthread_rwlock_destroy(&ai.lock);
fail_lock:
@@ -426,8 +428,6 @@ static void init(int argc,
fail_flows:
shm_rdrbuff_close(ai.rdrb);
fail_rdrb:
- shm_flow_set_destroy(ai.fqset);
- fail_fqset:
bmp_destroy(ai.fqueues);
fail_fqueues:
bmp_destroy(ai.fds);
@@ -462,7 +462,7 @@ static void fini(void)
}
}
- shm_flow_set_destroy(ai.fqset);
+ shm_flow_set_close(ai.fqset);
for (i = 0; i < SYS_MAX_FLOWS; ++i) {
pthread_mutex_destroy(&ai.ports[i].state_lock);