1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-30 00:00:11 +01:00
VILLASnode/lib/nodes
Dennis Potter 0230389593 Node gives back samples to framework at disconnect
The node blocks a certain amount of samples to use in its queues.
Before this commit, the only moment to release them to the framwork was
during ib_read()/ib_write().

But, there were a couple of problems. In the following I will take
ib_read() as example, but ib_write() will be analogous.

The first problem was:
1. If a QP disconnect, all Work Requests get invalidated and will be
   "flushed" to a Completion Queue.

A possible solution would be, to save them in an intermediate buffer.
We could then "exchange" these samples with the framework as soon as the node
connects again and ib_read() is called again. So, we would get valid
samples from the framwork, post them, and give the "invalidated" samples back.

But, there is a second problem:
2. We cannot assume that ib_read() is ever called again after
   ib_disconnect(). This is for example the case if the disconnect is
   triggered by ib_stop() and not by an external node that disconnects.

   This would result in a memory leak, since the samples would never be
   returned to the framework, although the node is stopped.

Because of this second problem, I decided to return all samples with
sample_put() in the disconnect function. An additional benefit is that
this is more convenient than another buffer to temporarily safe the
invalidated samples.
2018-07-16 13:41:53 +02:00
..
amqp.c Fixes #166, all node interfaces are modified 2018-07-11 18:14:29 +02:00
cbuilder.c Fixes #166, all node interfaces are modified 2018-07-11 18:14:29 +02:00
CMakeLists.txt cmake: add support for infiniband node-type 2018-07-04 17:50:26 +02:00
comedi.c comedi: better debug output 2018-06-15 19:29:23 +02:00
file.c Fixes #166, all node interfaces are modified 2018-07-11 18:14:29 +02:00
iec61850.c iec61850: fix ether_aton() call on OS X 2018-06-29 14:36:50 +02:00
iec61850_sv.c Merge branch 'infiniband' into develop 2018-07-04 16:50:36 +02:00
infiniband.c Node gives back samples to framework at disconnect 2018-07-16 13:41:53 +02:00
influxdb.c Fixes #166, all node interfaces are modified 2018-07-11 18:14:29 +02:00
loopback.c Fixes #166, all node interfaces are modified 2018-07-11 18:14:29 +02:00
mqtt.c check if publish/ subscribe topic is set before subscribing or publishing, provide a warning to the user in case subscribing/ publishing cannot be done because of lack of topic 2018-07-13 13:36:13 +02:00
nanomsg.c Fixes #166, all node interfaces are modified 2018-07-11 18:14:29 +02:00
ngsi.c Fixes #166, all node interfaces are modified 2018-07-11 18:14:29 +02:00
opal.c c++: add proper casts from void * 2017-10-20 11:54:00 +02:00
shmem.c Fixes #166, all node interfaces are modified 2018-07-11 18:14:29 +02:00
signal_generator.c Fixes #166, all node interfaces are modified 2018-07-11 18:14:29 +02:00
socket.c Fixes #166, all node interfaces are modified 2018-07-11 18:14:29 +02:00
stats.c Fixes #166, all node interfaces are modified 2018-07-11 18:14:29 +02:00
test_rtt.c Fixes #166, all node interfaces are modified 2018-07-11 18:14:29 +02:00
websocket.c Fixes #166, all node interfaces are modified 2018-07-11 18:14:29 +02:00
zeromq.c Fixes #166, all node interfaces are modified 2018-07-11 18:14:29 +02:00