summaryrefslogtreecommitdiffstats
path: root/src/vcl/vppcom.c
AgeCommit message (Collapse)AuthorFilesLines
2018-09-06vcl/session/svm: fix coverity warningsFlorin Coras1-1/+8
Change-Id: I27532b3ab244dc95955e836a42b229a6e4e32818 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-09-06session: support multiple worker bindsFlorin Coras1-16/+23
Allows app workers to listen on the same session endpoint. Incoming connects are spread across the workers in a round-robin fashion Change-Id: Ib5f5817230d9abc6127a85cdbdcad70d980c0f7f Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-08-30vcl: add support for multi-worker appsFlorin Coras1-435/+414
Add basic support for app registration of multiple workers. LDP does not work with multi-worker apps. Change-Id: I3fc421a2a591a077b275827463f874b261415a63 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-08-28vcl: remove session locksFlorin Coras1-251/+126
Support for multi-worker apps will be added in future patches. This also disables vce. Change-Id: I43b0ed2d5daa2b3d8f8a12fb18bd89dcdfa0619d Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-08-28vcl/session: use mq for bind repliesFlorin Coras1-4/+58
Change-Id: Iac6e1c32cf99c5392a29f7366401b7fc39e463e3 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-08-25vcl: remove unused binary api handlersFlorin Coras1-11/+73
Change-Id: Ifc36e3934574ba479f71157f797b2d0745b1d100 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-08-17vcl: unset fifo events only in read/writeFlorin Coras1-57/+21
Avoids accumulation of io event messages when the receiver is slow to read. Change-Id: I3a713d339a6ac0781c010be1fbad5a7963ab02c6 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-08-10vcl: support for eventfd mq signalingFlorin Coras1-160/+319
- 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-07-31vcl: add read/write udp supportFlorin Coras1-65/+77
Change-Id: Ie6171c12055cde6915856de340839f5da1b1b1da Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-07-27vcl: use events for epoll/select/read/writeFlorin Coras1-620/+910
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-18Add config option to use dlmalloc instead of mheapDave Barach1-7/+2
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: use msg queue for eventsFlorin Coras1-16/+15
Change-Id: I3c58367eec2243fe19b75be78a175c5261863e9e Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-06-28vcl: move binary api and cfg to separate filesFlorin Coras1-1893/+77
Change-Id: Ib88d703bb7d4b170059960b0688352c90c5fcc39 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-06-28vcl: refactor vcl sessionFlorin Coras1-189/+185
Change-Id: Idcba72fd84128547718dd32858e8c728925a6b1d Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-06-27vcl: refactor debuggingFlorin Coras1-1800/+455
Change-Id: I82e5239239ea24bdc97b1d59946ca0bba739f248 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-06-19VCL: Fix session peer and local addressesDave Wallace1-6/+20
VPP-1302: VCL does not provide local and peer addresses Change-Id: I7ff12e57799796dfeb030b181b4c24da07dc12eb Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-06-19VCL: refactor async & spinlocksDave Wallace1-448/+404
- Consolidate async code. - Add macros for spinlocks to improve readability. Change-Id: I2e0fd2b82ea76987aaf298a183d816c7d2ee0867 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-04-12VCL IOEvent external API callbackKeith Burns (alagalah)1-29/+232
Change-Id: I417357b00c43b27872aa3f681335bdc1ef574eca Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com> Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-03-26VCL: add IPv6 to socket_test.sh and make testDave Wallace1-11/+19
Change-Id: If3827828062a46f1cce43642535333f677f06e62 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-03-19VCL: Fix Coverity CID183003Dave Wallace1-1/+1
*** CID 183003: Program hangs (LOCK) /src/vcl/vppcom.c: 2988 in vppcom_session_accept() Change-Id: I123b73198d305fb0226516942caa410d3647a6bc Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-03-09VCL API for external callback for listener/connect eventKeith Burns (alagalah)1-19/+104
Change-Id: Ic59355683b581945d10a2df97d9b2deae87a998e Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com>
2018-03-09VCL: add event registration to listen session in select()Dave Wallace1-5/+27
Change-Id: Ie2e8f4ec3a7ec1018e5f9ca6f28f8cb18beaa814 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-03-08VCL event handling changesKeith Burns (alagalah)1-1/+2
- added vce_get_event_handler() - added check for event before blocking on mutex in vppcom_session_accept() Change-Id: I8e19ea5fcbaa40279cb28152b9923ca8f1328670 Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com>
2018-03-08VCL refactoringKeith Burns (alagalah)1-28/+37
- simplified event handling and unregister - removed fixed need to bit flip event hash key - added spinlock for client_session_fifo (was using sessions_lockp) - removed redundant vars Change-Id: I3c7645da660fb5560efdc4e9347e105df9650a16 Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com>
2018-03-08VCL: cleanup namespace_secret env-var cfg code.Dave Wallace1-20/+1
Change-Id: I9de8dd822494abe1b8701a72a9b8bede34dea8dc Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-03-06VCL registration handler added to session for polling sessionsKeith Burns (alagalah)1-6/+9
Change-Id: I5f0f3b07a7aa3f243c3d44a9a15cf0670dbb2d46 Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com>
2018-03-05VCL async event handlerKeith Burns (alagalah)1-202/+230
- provides async handling of events such as accept/connect Change-Id: Id95947237ef16629371b3c99822059d423e2f918 Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com>
2018-02-23VCL/LDP: Suppress trace output unless debug is enabled.Dave Wallace1-12/+13
Change-Id: Iaef2fe4b8c6b57d54ef6309423c9a0acba8a2f89 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-02-22VCL: Fix for vppcom_session_listen() q_len <= 0 crashKeith Burns (alagalah)1-0/+3
Change-Id: I089dd3855fc21b26a125ee392c7548d44b5732b8 Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com>
2018-02-20vppcomm refactorKeith Burns (alagalah)1-428/+245
- server_[tx|rx]_fifo renamed to [tx|rx]_fifo - is_cut_thru etc no longer required, vpp session layer works it out - logic to flip tx/rx fifos in vppcom no longer required - allocation of memory in vppcom no longer required (if(0) at moment for testing) - clean up of some uneeded vars - fixstyle Change-Id: I266561a6e4b08edb875c98582b22616c295d5a81 Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com>
2018-02-19VCL: config api prefix using env var.Dave Wallace1-21/+94
- Configure vpp api prefix using VCL_API_PREFIX environment variable. - Prepend api prefix to vpp api filename when connecting to vpp. - Fix stale vcl_cfg ptr after heap allocation. - Cleanup misleading warning messages wrt. reading the vcl config file. Change-Id: I908c9b567ff4f6f0c21ae43a4627a1a3202a3290 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-02-16VPP modified some state checking logicKeith Burns (alagalah)1-72/+72
Change-Id: I5daff79a31f2db33ed55edd54ce043a61f6c6209 Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com>
2018-02-08VCL: remove vrf from vppcom api.Dave Wallace1-18/+7
Change-Id: I6d91c8051de786fb8781cd0750ea9c350036b306 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-02-06VCL: Fix type in trace output.Dave Wallace1-2/+2
Change-Id: I7834e676c23a697a12a6e06111c68450ba787fc9 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-02-05session: segment manager refactorFlorin Coras1-6/+11
- 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-01-29vcl: fix VPPCOM_ATTR_GET_LIBC_EPFD elogFlorin Coras1-10/+4
Change-Id: Idc3e8f4ee69d8871534a94d4f485e695fac81756 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-01-25session: add support for memfd segmentsFlorin Coras1-2/+1
- 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-25Event log entries for VCLKeith Burns (alagalah)1-1/+258
Change-Id: I8303859ef65552f64c94525c9b1112ec9a1a88d0 Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com>
2018-01-20VCL/LD_PRELOAD: Fix unfiltered debug output.Dave Wallace1-3/+4
Change-Id: I625b219fe6ffd21f87a163244569a4075cd432a4 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-01-19Elog entries for VCLKeith Burns (alagalah)1-2/+225
Change-Id: Ica8470aaf581e69a74fe4f0fc0296ff3fb6f87d3 Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com>
2018-01-18Event log entries for VCLKeith Burns (alagalah)1-1/+300
Change-Id: I288ecd7f39422ed900a5c6fbaf9c939ab5c06880 Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com>
2018-01-17LD_PRELOAD: stateless LDPDave Wallace1-278/+906
- Refactor LDP to be stateless. - Use upper bit of fd to identify tag as VCL session. - Clean up debug output. - Add VCOM config env vars for app name and sid bit. - Add VCL get/set attributes - Add VCL poll implementation. Change-Id: I4603ae88254c460a024fdb79fe91c6d1ef9bc7b9 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-01-17ELOG additions for VCLKeith Burns (alagalah)1-41/+148
Change-Id: I61557f9ad9ca2a033ba01bd25a7a8cd4d5ce092e Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com>
2018-01-09VCL eventlog - track create/deleteKeith Burns (alagalah)1-0/+199
Change-Id: I972b7d264e612ab04eb4671253f3654a76578e1c Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com>
2018-01-09api: refactor vlibmemoryFlorin Coras1-17/+14
- 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-06Initial structure for VCL event logging.Keith Burns (alagalah)1-6/+84
- WIP: taking a LARGE patch and breaking into smaller chunks - large LDP/VCL refactor in progress. This minimizes rebase. - LARGE patch removed clib_warning()s erroneously - VPPCOM_DEBUG checks duplicated deliberately as clib_warning() usage will be refactored. Change-Id: I5905ed074187fe22c9f1320fd07ffcaab3a0f63c Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com>
2017-12-15VCL-LDPRELOAD: Fix Coverity Warning CID 178776Dave Wallace1-2/+2
- Fix broken unit test code. - Check for NULL ptr in vppcom_session_attr() VPPCOM_ATTR_GET_*_ADDR endpoint parameters. Change-Id: I01169edce098ee855a9cba08893c2b08c93ea6c3 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2017-12-14session: cleanup attach flagsFlorin Coras1-4/+5
Change-Id: I39d21d15677f57e10b69b8842f2cbca277abddf0 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-12-11vcl: fix session preallocationFlorin Coras1-0/+2
Change-Id: I174ba43380e97104f6721af647c699922e996f5a Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-11-30VCL: add vpp api q length to config file.Dave Wallace1-2/+22
Change-Id: Ibe3e6cea0ea2fc700ef0a284c8ea5fe5d5476514 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>