aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlibmemory/memory_shared.c
AgeCommit message (Collapse)AuthorFilesLines
2022-04-05vppinfra: refactor address sanitizerDamjan Marion1-2/+2
Type: refactor Change-Id: I5ca142ec1557d5b5c3806b43553ad9d3b5ea1112 Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-04-04vppinfra: make _vec_len() read-onlyDamjan Marion1-2/+2
Use of _vec_len() to set vector length breaks address sanitizer. Users should use vec_set_len(), vec_inc_len(), vec_dec_len () instead. Type: improvement Change-Id: I441ae948771eb21c23a61f3ff9163bdad74a2cb8 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-12-11api: Use vl_msg_push/pop_heapNathan Skrzypczak1-10/+5
Type: refactor Change-Id: I0eb46676fc22ce6825b2d879498df344b5a855e8 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-12-10api: multiple connections per processDave Barach1-24/+28
Type: feature Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I2272521d6e69edcd385ef684af6dd4eea5eaa953
2019-12-06api: avoid swapping vlib_rp before barrier syncFlorin Coras1-29/+27
Type: fix Change-Id: I9868d13e827c6f5aa5535a38f629efb62ff12dbc Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com> Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-11-27misc: add address sanitizer heap instrumentationBenoît Ganne1-5/+10
Introduce AddressSanitizer support: https://github.com/google/sanitizers/ This starts with heap instrumentation. vlib_buffer, bihash and stack instrumentation should follow. Type: feature Change-Id: I7f20e235b2f79db72efd0e756f22c75f717a9884 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-07-16api: enable binary API event logging in vatDave Barach1-1/+22
Cleaned up a few instances of side-bet elog_string hash table usage. Elog_string handles that problem itself. Add cli commands to vat to initialize, enable/disable, and save an event log. Event logging at the same time in both vpp and vat yields a pair of event logs which can be merged by the "test_elog" tool. Type: refactor Change-Id: I8d6a72206f2309c967ea1630077fba31aef47f93 Signed-off-by: Dave Barach <dave@barachs.net>
2019-07-03api: remove garbage from sockclnt_create replyVratko Polak1-0/+20
The fix uses memset to zero after alloc, as sizing of source string is not obvious. Function vl_msg_api_alloc_zero is added (and used), so similar bugs can be fixed easily. Type: fix Ticket: VPP-1716 Change-Id: I3b20040d0de4222686c58779f2c0af78c5543504 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2019-03-07vlibmemory: coverity woesSteven Luong1-1/+1
Coverity complains about resource leak after open when fd gets 0 with below warning. off_by_one: Testing whether handle tfd is strictly greater than zero is suspicious. tfd leaks when it is zero. It is right. 0 is a valid fd. -1 is not. Change-Id: I22c2eb75b99bb6209921b9f874190cbbdf10e6ce Signed-off-by: Steven Luong <sluong@cisco.com>
2019-02-21API: client does not set root permissions on shm segmentNeale Ranns1-4/+2
Change-Id: I4ba099832b646392c1b6fa34236ca3377c9f786c Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-01-23Initialize gc_mark_timestamp to zero to avoid garbage values.Brian Nesbitt1-0/+1
Change-Id: Ib3f030e906da9828fdad27e19b9efb0c349b0734 Signed-off-by: Brian Nesbitt <brian.nesbitt@owmobility.com>
2018-12-31binary api clients: wait for vpp to startDave Barach1-0/+29
Change-Id: I740a7423327b724e88fdfa35d90cb1285e9f9746 Signed-off-by: Dave Barach <dbarach@cisco.com>
2018-11-18Complain if a client binary API queue is fullDave Barach1-0/+8
Definitely indicates a client binary API queue handling issue. We can't simply turf the message, or we'll end up with a more subtle derivative misbehavior. Change-Id: I6363fda1430b0a9ec33ad69badc1e0072fe20fa8 Signed-off-by: Dave Barach <dave@barachs.net>
2018-10-23c11 safe string handling supportDave Barach1-2/+2
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab Signed-off-by: Dave Barach <dave@barachs.net>
2018-08-03svm: add support for eventfd signaling to queueFlorin Coras1-9/+7
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-02-02vlmemory/svm: fix client detach from svm regionFlorin Coras1-4/+17
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-0/+20
- 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-1/+1
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-11api: fix handlers that explicitly depend on svm queueFlorin Coras1-0/+6
Fixes the remainig apis that explicitly check svm queue length. Change-Id: I6055c7c50050affee3098e162e15fb12c205e5db Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-01-09api: refactor vlibmemoryFlorin Coras1-91/+18
- 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 infra for bootstrapping shm clientsFlorin Coras1-14/+68
- add function to sock client that bootstraps shm api - allow sock clients to request custom shm ring configs Change-Id: Iabc1dd4f0dc8bbf8ba24de37f4966339fcf86107 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-12-01session: allocate cb messages from client ringFlorin Coras1-0/+2
Change-Id: Ib644a1840c5f24203b6968561f467fbe5e255055 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-10-03Repair vlib API socket serverDave Barach1-61/+114
- 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-08-23Fix vl_map_shmem() root_path dangling reference.Dave Wallace1-5/+8
Change-Id: I90c9d8e151cacf50a99ce76b7a589079303196e8 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2017-08-18API: More gracefully fail when opening shared memory segment fails.Ole Troan1-2/+6
API clients would fail with an ASSERT (and core dump) whenever the API shared memory segment could not be opened. This returns an error value to the client's connect instead. Change-Id: Id122a3a090b24b139c382ae09f341bde61fd2540 Signed-off-by: Ole Troan <ot@cisco.com>
2017-08-14jvpp: make shm_prefix configurable (VPP-591)Jan Srnicek1-3/+16
svm.c - set default map region root path only if root path is not already present memory_shared.c - added option for tests to send memory region name and root path in one variable, if so name and root path are separated here and set to map region structure so find function can find it properly jvpp-registry.c - added parameters shmPrefix to be able pass + removed sudo restriction specific shared memory prefix that is used while starting python tests(see framework.py) JVppRegistyImpl - added option to specify shmPrefix VppJNIConnection - added option to specify shmPrefix Change-Id: I3f89f867fb9b20eef00fbd497cb0e41b25d6eab7 Signed-off-by: Jan Srnicek <jsrnicek@cisco.com> Signed-off-by: Matej Perina <mperina@cisco.com>
2017-06-01Improve fifo allocator performanceDave Barach1-4/+18
- add option to preallocate fifos in a segment - track active fifos with doubly linked list instead of vector - update udp redirect test code to read fifo pointers from API call instead of digging them up from fifo segment header - input-node based active-open session generator Change-Id: I804b81e99d95f8690d17e12660c6645995e28a9a Signed-off-by: Dave Barach <dave@barachs.net> Signed-off-by: Florin Coras <fcoras@cisco.com> Signed-off-by: Dave Barach <dbarach@cisco.com>
2017-05-03A sprinkling of const in vlibmemory/api.h and friendsNeale Ranns1-2/+2
Change-Id: I953ebb37eeec7de0c4a6b00258c3c67a83cbc020 Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-04-11move binary-api client-only routines to memory_client.cDave Barach1-241/+0
Change-Id: I0755f731b1b01e6a1a231948d498c625a2c966b7 Signed-off-by: Dave Barach <dave@barachs.net>
2017-01-09Self-service garbage collection for the API message allocatorDave Barach1-0/+21
Change-Id: Iadc08eede15fa5978e4010bbece0232aab8b0fee Signed-off-by: Dave Barach <dave@barachs.net>
2016-12-28Reorganize source tree to use single autotools instanceDamjan Marion1-0/+852
Change-Id: I7b51f88292e057c6443b12224486f2d0c9f8ae23 Signed-off-by: Damjan Marion <damarion@cisco.com>