aboutsummaryrefslogtreecommitdiffstats
path: root/src/svm
AgeCommit message (Collapse)AuthorFilesLines
2018-10-16Fix coverity issue for potentially overflowing of page sizeHaiyang Tan1-1/+1
Change-Id: I2779626d745badb63386efcf729da7a094a4f297 Signed-off-by: Haiyang Tan <haiyangtan@tencent.com>
2018-10-05session: fix local session tagging and cleanupFlorin Coras3-2/+6
Change-Id: I0d42a0c71fea7dd669fb1fe5ded7e6e944245c7d Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-09-25tcp: add option to cfg max rx fifo sizeFlorin Coras1-1/+1
Change-Id: Icff3d688506e7658330db004c58bcfcac273fcec Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-09-24svm: march svm_fifo take 2Florin Coras1-71/+17
Change-Id: Ifa4fceef7edbe43d444790a624957db0817064de Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-09-20session/svm: add want_tx_event flag to fifoFlorin Coras1-0/+13
Have applications use explicit flag to request events from vpp when it transmits from a full fifo. Change-Id: I687c8f050a066bd5ce739d880eaec1f286038d95 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-09-18svm: better march support for svm fifoFlorin Coras2-96/+87
Change-Id: I6a4335654882a2ca66d3d465e35e350868242b8d Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-09-12vcl: add apis that expos fifo as bufferFlorin Coras2-2/+57
Change-Id: I4bd9c9f73499711e04b38d53daa5c917a4285bf5 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-09-12vcl: improve read and fifo event handlingFlorin Coras2-5/+9
Change-Id: Ic1c51818b8aa8dbd164e70bb3b7471868e5af6f6 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-09-06vcl/session/svm: fix coverity warningsFlorin Coras1-1/+1
Change-Id: I27532b3ab244dc95955e836a42b229a6e4e32818 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-08-2832/64 shmem bihash interoperabilityDave Barach1-1/+1
Move the binary api segment above 4gb Change-Id: I40e8aa7a97722a32397f5a538b5ff8344c50d408 Signed-off-by: Dave Barach <dave@barachs.net>
2018-08-26cmake: add add_vpp_library and add_vpp_executable macrosDamjan Marion1-24/+21
Change-Id: I1382021a6f616571b4b3243ba8c8999239d10815 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-08-24session: add support for multiple app workersFlorin Coras1-3/+4
Refactor session layer to support multiple workers per application. Change-Id: Ie67354688d396449d14bbbb8c56050206e307cd8 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-08-17CMake as an alternative to autotools (experimental)Damjan Marion1-0/+62
Change-Id: Ibc59323e849810531dd0963e85493efad3b86857 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-08-10vcl: support for eventfd mq signalingFlorin Coras4-27/+167
- support eventfd based mq signaling. Based on configuration, vcl epoll/select can use either condvars or epoll on mq eventfds. - add vcl support for memfd segments - vpp explicitly registers cut-through segments with apps/vcl - if using eventfd, make ldp allow one call to libc_epoll_create. Needed for the message queue epfd - update svm_queue_t to allow blocking calls with eventfd signaling. Change-Id: I064151ac370bbe29bb16c968bf4e3659c8286bea Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-08-03svm: add support for eventfd signaling to queueFlorin Coras4-68/+113
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-07-27vcl: use events for epoll/select/read/writeFlorin Coras3-18/+44
Have vcl poll and wait on the event message queues as opposed to constantly polling the session fifos. This also adds event signaling to cut through sessions. On the downside, because we can't wait on multiple condvars, i.e., when we have multiple message queues because of cut-through registrations, we do timed waits. Change-Id: I29ade95dba449659fe46008bb1af502276a7c5fd Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-07-23session: send rx events only if session readyFlorin Coras1-0/+6
Change-Id: I8d631121b104fb40c20701d4c1b428f2b71e5785 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-07-23fix vector index range checksEyal Bari1-1/+1
Change-Id: I63c36644c9d93f2c3ec6606ca0205b407499de4e Signed-off-by: Eyal Bari <ebari@cisco.com>
2018-07-18svm: make message queue more compactFlorin Coras2-18/+31
Change-Id: Id45957163c2b95a2300a8ac9104fc92b9cc928ed Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-07-18Add config option to use dlmalloc instead of mheapDave Barach3-19/+87
Configure w/ --enable-dlmalloc, see .../build-data/platforms/vpp.mk src/vppinfra/dlmalloc.[ch] are slightly modified versions of the well-known Doug Lea malloc. Main advantage: dlmalloc mspaces have no inherent size limit. Change-Id: I19b3f43f3c65bcfb82c1a265a97922d01912446e Signed-off-by: Dave Barach <dave@barachs.net>
2018-07-17session: send ctrl msg over mqFlorin Coras2-2/+3
Change-Id: I242056bc46ddb671064665916b2687860292dcb2 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-07-17session: use msg queue for eventsFlorin Coras6-40/+255
Change-Id: I3c58367eec2243fe19b75be78a175c5261863e9e Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-07-17session: make sure segment sizes are page alignedFlorin Coras1-2/+3
Change-Id: Ibbba75d069ca1bbf9e5a1b8bd2f405d32021c656 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-07-11session: push tx notifications only if neededFlorin Coras1-0/+6
VPP-1340 Change-Id: Ia3f2fc054dbfb2ba912a768c70466e7042024e32 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-07-08session/svm: fix coverity warningsFlorin Coras1-2/+5
Change-Id: Ic5daed1f6c23d9561a04e235dcbf257f190d066a Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-07-06svm: add unidirectional message queueFlorin Coras4-3/+496
Meant for single reader/writer message exchanges. Supports multiple message rings. Change-Id: I925de9a6ae19226c5c39a63caff76424ed123a13 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-06-11tcp: cleanup connection/session fixesFlorin Coras2-0/+8
- Cleanup session state after last ack and avoid using a cleanup timer. - Change session cleanup to free the session as opposed to waiting for delete notify. - When in close-wait, postpone sending the fin on close until all outstanding data has been sent. - Don't flush rx fifo unless in closed state Change-Id: Ic2a4f0d5568b65c83f4b55b6c469a7b24b947f39 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-06-05VPP API: Memory traceOle Troan1-0/+4
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-06-01session: improve disconnect handlingFlorin Coras1-1/+2
If the caller is the session owning thread or the main thread with a worker barrier sync (cli/api) add an event to the pending disconnects vector in the session node and entirely avoid using the event queue. Useful for bursts of disconnects (like an app detach). If disconnects come from a processes, be willing to retry enqueueing the disconnect to the event queue multiple times. Change-Id: Ieece1f1091b713f94c41c703b6e805bc8498816a Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-05-31VPP-1299: Reset uid/gid on shared memory segment if client starts first.Ole Troan1-0/+4
Change-Id: I2b5bc7d864f8829e1dff63fec3c9484078601309 Signed-off-by: Ole Troan <ot@cisco.com>
2018-05-24VPP-1286: close the fd after mmap-ing svm segmentsDave Barach1-0/+2
Broken for years. Duh. Change-Id: Ie5fb8e802f143aacd3301c45b136b24a8d4f6d74 Signed-off-by: Dave Barach <dave@barachs.net>
2018-05-10vppinfra: use count_trailing_zeros in sparse_vec_indexDamjan Marion1-1/+1
It is much cheaper to use ctzll than to do shift,subtract and mask in likely case when we are looking for 1st set bit in the uword. Change-Id: I31954081571978878c7098bafad0c85a91755fa2 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-05-09session: cleanup session tx functionFlorin Coras1-3/+3
- rework the function to declutter and avoid building more than one tx frame - add dual loop although benefits in my tests seem to be minimal - improve tcp/udp echo external apps. They have slightly better throughput than internal echo apps. - udp bugfixes Change-Id: Iea4a245b1b1bb407a7f403dedcce2664a49f774b Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-04-27svm/session: improve svm fifo allocationFlorin Coras1-13/+15
Change-Id: Id9bad9a2fd99d22296a705ab08d1daedc3fef5c1 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-04-18udp/session: refactor to support dgram modeFlorin Coras2-1/+24
- adds session layer support for datagram based protocols - updates udp to work in pure connectionless and datagram mode. The existing connected mode is now 'accessible' for apps as a dummy UDPC, as in, connected udp, protocol. - updates udp_echo, echo client, echo server code to work in datagram mode. Change-Id: I2960c0d2d246cb166005f545794ec31fe0d546dd Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-03-16Fix sample-plugin build on ubuntu 18.04Damjan Marion1-1/+0
Change-Id: Ia10aadc7f969b20e8cd50989230a80e7e21cbff4 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-15tls: add openssl engineFlorin Coras1-0/+43
Change-Id: I6c215858d2c9c620787632b570950b15274c0df2 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-03-02session: first approximation implementation of tlsFlorin Coras2-5/+7
It consists of two main parts. First, add an application transport type whereby applications can offer transport to other applications. For instance, a tls app can offer transport services to other applications. And second, a tls transport app that leverages the mbedtls library for tls protocol implementation. Change-Id: I616996c6e6539a9e2368fab8a1ac874d7c5d9838 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-02-14session: support local sessions and deprecate redirectsFlorin Coras2-5/+8
Memfd backed shared memory segments can only be negotiated over sockets. For such scenarios, the existing redirect mechanism that establishes cut-through sessions does not work anymore as the two peer application do not share such a socket. This patch adds support for local sessions, as opposed to sessions backed by a transport connection, in a way that is almost transparent to the two applications by reusing the existing binary api messages. Moreover, all segment allocations are now entirely done through the segment manager valloc, so segment overlaps due to independent allocations previously required for redirects are completely avoided. The one notable characteristic of local sessions (cut-through from app perspective) notification messages is that they carry pointers to two event queues, one for each app peer, instead of one. For transport-backed sessions one of the queues can be inferred but for local session they cannot. Change-Id: Ia443fb63e2d9d8e43490275062a708f039038175 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-02-05session: segment manager refactorFlorin Coras5-159/+173
- use valloc as a 'central' segment baseva manager - use per segment manager segment pools and use rwlocks to guard them - add session test that exercises segment creation - embed segment manager properties into application since they're shared - fix rw locks Change-Id: I761164c147275d9e8a926f1eda395e090d231f9a Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-02-02vlmemory/svm: fix client detach from svm regionFlorin Coras2-5/+36
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 Coras4-104/+214
- 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 Kazmi2-6/+46
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-17ssvm: reuse clib mem infra for memfd segmentsFlorin Coras3-71/+55
Change-Id: I67648dbed3c7ed291b3e1ce617d83a776d3623bb Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-01-15svm: refactor memfd and remove ssvm_ethFlorin Coras4-336/+137
Change-Id: Icde296e956eb89ea3a17d547f04a833916ec6440 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-01-14vabits - subtract from the 'end' address instead of from 'bits'.Gabriel Ganne1-2/+3
This is a fixup for the commits on calc base address on AArch64 based on autodetected VA space size As reported by: Brian Brooks <brian.brooks@arm.com> Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com> Change-Id: Id1bd7b7d7e5c188d8547c46134082bd4563b92db
2018-01-10svm: calc base address on AArch64 based on autodetected VA space sizeGabriel Ganne1-4/+3
fix proposal for aec8f8984771cabc79a8ed64f56afcf61465d00a * fix 0/1 bit count * fix memory leak Change-Id: I488229917c463be10b8a5a1b0a3d7723f05061d0 Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
2018-01-10svm: calc base address on AArch64 based on autodetected VA space sizeDamjan Marion3-11/+42
Change-Id: I7487eb74b8deebff849d662b55a6708566ccd9ef Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-01-09api: refactor vlibmemoryFlorin Coras2-0/+478
- 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>
2017-12-14session: cleanup attach flagsFlorin Coras2-3/+2
Change-Id: I39d21d15677f57e10b69b8842f2cbca277abddf0 Signed-off-by: Florin Coras <fcoras@cisco.com>