summaryrefslogtreecommitdiffstats
path: root/src/vlibmemory/memory_client.c
AgeCommit message (Collapse)AuthorFilesLines
2019-04-16API: Handle pthread cond signal case where signal is missed.Ole Troan1-2/+2
Especially on a single core setup the RX thread could signal the main thread that it was done, before main thread listened to the signal. Change-Id: Ib70337b21bcf77787ce4ee0aa9cf80c6da2215af Signed-off-by: Ole Troan <ot@cisco.com>
2019-04-10API: Fix shared memory only action handlers.Ole Troan1-0/+1
Some API action handlers called vl_msg_ai_send_shmem() directly. That breaks Unix domain socket API transport. A couple (bond / vhost) also tried to send a sw_interface_event directly, but did not send the message to all that had registred interest. That scheme never worked correctly. Refactored and improved the interface event code. Change-Id: Idb90edfd8703c6ae593b36b4eeb4d3ed7da5c808 Signed-off-by: Ole Troan <ot@cisco.com>
2019-02-05sock api: allow to start client with no rx_threadTomasz Kulasek1-0/+10
Change-Id: Ia30ff1e62304e65f27497ce05f8e40631c06d69e Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
2018-12-05bapi: add options to have vpp cleanup client registrationFlorin Coras1-2/+3
A client can send a memclnt delete message and ask vpp to cleanup the shared memory queue. Obviously, in this case no delete reply is sent back to the client. Change-Id: I9c8375093f8607680ad498a6bed0690ba02a7c3b Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-03vcl: handle worker process exitFlorin Coras1-7/+14
Change-Id: Ife05d25fd736ae3064f01e974e5aecc5b48de924 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-10-23c11 safe string handling supportDave Barach1-7/+7
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab Signed-off-by: Dave Barach <dave@barachs.net>
2018-08-03svm: add support for eventfd signaling to queueFlorin Coras1-2/+2
Support the use of eventfds to signal queue updates between consumer and producer pairs. Change-Id: Idb6133be2b731fff78ed520daf9d2e0399642aab Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-06-05VPP API: Memory traceOle Troan1-16/+27
if you plan to put a hash into shared memory, the key sum and key equal functions MUST be set to constants such as KEY_FUNC_STRING, KEY_FUNC_MEM, etc. -lvppinfra is PIC, which means that the process which set up the hash won't have the same idea where the key sum and key compare functions live in other processes. Change-Id: Ib3b5963a0d2fb467b91e1f16274df66ac74009e9 Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Dave Barach <dave@barachs.net> Signed-off-by: Ole Troan <ot@cisco.com>
2018-02-02vlmemory/svm: fix client detach from svm regionFlorin Coras1-3/+4
Clients cannot know at svm region detach time if the shm backing files have been recreated (e.g., if vpp restarts) and therefore should not try to unlink them. Otherwise, terminating clients attached to previous instantiations of a re-allocated region end up making the new instance un-mappable by removing its backing file. Change-Id: Idcd0cab776e63fd75b821bc9f0fac58217b9ccbe Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-01-25session: add support for memfd segmentsFlorin Coras1-7/+24
- update segment manager and session api to work with both flavors of ssvm segments - added generic ssvm slave/master init and del functions - cleanup/refactor tcp_echo - fixed uses of svm fifo pool as vector Change-Id: Ieee8b163faa407da6e77e657a2322de213a9d2a0 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-01-22svm: queue sub: Add conditional timed waitMohsin Kazmi1-2/+2
On reviece side svm queue only permits blocking and non-blocking calls. This patch adds timed wait blocking functionality which returns either on signal/event or on given time out. It also preserves the original behavior, so it will not hurt client applications which are using svm queue. Change-Id: Ic10632170330a80afb8bc781d4ccddfe4da2c69a Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-01-15svm: refactor memfd and remove ssvm_ethFlorin Coras1-0/+1
Change-Id: Icde296e956eb89ea3a17d547f04a833916ec6440 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-01-09api: refactor vlibmemoryFlorin Coras1-35/+15
- separate client/server code for both memory and socket apis - separate memory api code from generic vlib api code - move unix_shared_memory_fifo to svm and rename to svm_fifo_t - overall declutter Change-Id: I90cdd98ff74d0787d58825b914b0f1eafcfa4dc2 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-01-05sock api: add first msg id retrieval functionFlorin Coras1-10/+34
Change-Id: I2032b5fc8e1904005b8eb871b9be06d025ed9b71 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-10-25VCL-LDPRELOAD: statically link VPP objects into libvcl_ldpreload.soDave Wallace1-6/+0
Change-Id: If8fb5484b64a5b1c04e34573490fedcf63feabc9 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2017-10-18CSIT-844: fix binary api rx pthread heap push/popDave Barach1-3/+22
We need to push/pop the rx pthread's heap without affecting other thread(s). Search clib_per_cpu_mheaps, locate an unused slot. Duplicate the main thread heap pointer in that slot, and set __os_thread_index appropriately. Miscellaneous cleanups. Print exec_inband results as a vector, instead of as a format string. Don't bail out of vpp_api_test with results pending, e.g. at the end of a vpp_api_test script. Even though vpp will eventuallly garbage-collect them, We don't want to leave allocated reply messages lurking in the api message allocation rings... Change-Id: I0e8a25d1ff0d3700249dc330d079db16c2fcbc55 Signed-off-by: Dave Barach <dave@barachs.net>
2017-10-03Repair vlib API socket serverDave Barach1-13/+52
- Teach vpp_api_test to send/receive API messages over sockets - Add memfd-based shared memory - Add api messages to create memfd-based shared memory segments - vpp_api_test supports both socket and shared memory segment connections - vpp_api_test pivot from socket to shared memory API messaging - add socket client support to libvlibclient.so - dead client reaper sends ping messages, container-friendly - dead client reaper falls back to kill (<pid>, 0) live checking if e.g. a python app goes silent for tens of seconds - handle ping messages in python client support code - teach show api ring about pairwise shared-memory segments - fix ip probing of already resolved destinations (VPP-998) We'll need this work to implement proper host-stack client isolation Change-Id: Ic23b65f75c854d0393d9a2e9d6b122a9551be769 Signed-off-by: Dave Barach <dave@barachs.net> Signed-off-by: Dave Wallace <dwallacelf@gmail.com> Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-05-09Fix remaining 32-bit compile issuesDamjan Marion1-1/+1
Change-Id: I9664214652229b663c3e3ba7406b4ede96bfb123 Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-05-03A sprinkling of const in vlibmemory/api.h and friendsNeale Ranns1-7/+9
Change-Id: I953ebb37eeec7de0c4a6b00258c3c67a83cbc020 Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-04-11move binary-api client-only routines to memory_client.cDave Barach1-9/+241
Change-Id: I0755f731b1b01e6a1a231948d498c625a2c966b7 Signed-off-by: Dave Barach <dave@barachs.net>
2016-12-28Reorganize source tree to use single autotools instanceDamjan Marion1-0/+283
Change-Id: I7b51f88292e057c6443b12224486f2d0c9f8ae23 Signed-off-by: Damjan Marion <damarion@cisco.com>