aboutsummaryrefslogtreecommitdiffstats
path: root/src/vcl
AgeCommit message (Collapse)AuthorFilesLines
2019-02-22session/vcl: fix coverity warningsFlorin Coras2-1/+6
Change-Id: I9b0e6d65255e516cf5bf18757d4769176ef76e92 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-02-21vcl/session: send unlisten over message queueFlorin Coras3-18/+45
Change-Id: I68cd6c0e6be3e8088792df3885ae190bb00462b0 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-02-20tls: add vcl testFlorin Coras1-1/+1
Change-Id: If4c7efaf6506a827e7a95a56c2f6b6060df03fa1 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-02-19ldp: return byte count from a successful recvfromHaggai Eran1-2/+6
Unless there's an error, recvfrom should return the number of bytes received. The current code returns zero on success due to ldp_copy_ep_to_sockaddr returning zero. Change-Id: Ib843b99a08c44b5ee2d16efe9edab0cf5df65170 Signed-off-by: Haggai Eran <haggai.eran@gmail.com>
2019-02-14Add -fno-common compile optionBenoît Ganne1-1/+1
-fno-common makes sure we do not have multiple declarations of the same global symbol across compilation units. It helps debug nasty linkage bugs by guaranteeing that all reference to a global symbol use the same underlying object. It also helps avoiding benign mistakes such as declaring enum as global objects instead of types in headers (hence the minor fixes scattered across the source). Change-Id: I55c16406dc54ff8a6860238b90ca990fa6b179f1 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-02-05sock api: allow to start client with no rx_threadTomasz Kulasek1-1/+1
Change-Id: Ia30ff1e62304e65f27497ce05f8e40631c06d69e Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
2019-02-04session: cleanup part 1Florin Coras3-9/+9
Rename core data structures. This will break compatibility for out of tree builtin apps. - stream_session_t to session_t - server_rx/tx_fifo to rx/tx_fifo - stream_session.h to session_types.h - update copyright Change-Id: I414097c6e28bcbea866fbf13b8773c7db3f49325 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-01-31vcl: improve handling of close on rwFlorin Coras2-48/+55
Change-Id: Ie01a37612d7e3e0d0bad0f0aa9583b3ed411f46f Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-01-30vls: support passive listenersFlorin Coras4-85/+265
If an application worker calls listen on a session, vpp registers the worker to the listener's work load balance group and, as new connections are accepted, it may potentially push accept notifications to it. There are however applications, like nginx, that on some workers may never accept new connections on a session they've started listening on. To avoid accumulating accept events on such workers, this patch adds support for passive listeners. That is, workers that have started listening on a session but then never call accept or epoll/select on that listener. Change-Id: I007e6dcb54fc88a0e3aab3c6e2a3d1ef135cbd58 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-01-30ldp: initialize clib timeFlorin Coras1-8/+18
Change-Id: Ie598443f024a677a9c6938b3f3634960fd712b09 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-01-29vls: multi-process and multi-threaded apps improvementsFlorin Coras6-122/+341
- More fine tuning for multi-process applications. - Experimental support for multi-thread apps. This is meant for app whose threads are not vcl workers and the sessions are shared between them. Change-Id: Ie07651da5f2cdcf39f5dead5431f50ad39cf3f74 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-01-26vcl: add api to expose worker message queues epfdFlorin Coras2-0/+17
This only works if vcl is configured to do eventd based message queue notifications, instead of condvars. For that, add "use-mq-eventfd" to vcl startup conf. Change-Id: Id0f0288a40ec7d3daef7370f8b88420425867ab6 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-01-24session/vcl: support worker ownership change for listenersFlorin Coras1-7/+14
Change-Id: I2ad54b20b96f10b009c3e651b2a2f885577ca5b6 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-01-23vcl: generate epoll events only if requestedFlorin Coras2-17/+16
Change-Id: I6e96607f09c18755eead2c7099e1f546bdae7b88 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-01-21ldp: add support for TCP_CONGESTION sockopts (VPP-1550)Florin Coras1-0/+9
Change-Id: I0fcf3385cc4fb96f000b84d5f880f74131c0d60f Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-01-18vcl: move forking logic to vlsFlorin Coras5-345/+299
Change-Id: I721542aca139d7908a4f917629856f82cae79962 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-01-17vcl/session: replicate events for shared sessionsFlorin Coras1-0/+11
Change-Id: I7fb5402d4a530b5f2ffd9bb5787632099f4b4189 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-01-10session/vcl: improve fifo tx notificationsFlorin Coras1-4/+14
Change-Id: Ied476c417c8ba5b4d7c615125c36eecd9ca64fbc Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-01-08vcl/ldp: select cleanup/improvementsFlorin Coras4-254/+223
Change-Id: I640e69388f2ab0f66ad60c5165c749f5a5a9f525 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-01-07vcl/ldp: add locked sessions shim layerFlorin Coras7-1297/+890
Moves LDP logic that allows sharing of sessions between multi-process app workers into a separate VCL shim layer. Also refactors LDP to use the new layer. Change-Id: I8198b51eae7d099a8c486e36b29e3a0cb8cee8e9 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-01-05vcl/session: add api for changing session app workerFlorin Coras6-168/+368
In case of multi process apps, after forking, the parent may decide to close part or all of the sessions it shares with the child. Because the sessions have fifos allocated in the parent's segment manager, they must be moved to the child's segment manager. Change-Id: I85b4c8c8545005724023ee14043647719cef61dd Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-01-04Add TLS support for VCLPing Yu7-10/+246
Ater this patch, vcl_test_client and vcl_test_server can work happily with TLS connection. "-S" is to indicate TLS connection. Change-Id: I761894b0b5929912691625f0fe63604725b55978 Signed-off-by: Ping Yu <ping.yu@intel.com>
2019-01-02Fixes for buliding for 32bit targets:David Johnson7-53/+74
* u32/u64/uword mismatches * pointer-to-int fixes * printf formatting issues * issues with incorrect "ULL" and related suffixes * structure alignment and padding issues Change-Id: I70b989007758755fe8211c074f651150680f60b4 Signed-off-by: David Johnson <davijoh3@cisco.com>
2019-01-02ldp/vcl: epoll and shutdown cleanupFlorin Coras2-141/+77
Change-Id: I882b4c495426551fad63372dc106496c5e8c141e Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-01-01vcl/ldp: add write msg function and fine tuningFlorin Coras3-65/+30
Allows app to push data. Additionally, ensure reset/close replies are not sent unless vcl closes the session. Change-Id: Icbbf933cf57b55cfbcc7b802af0f83919a066f65 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-28vcl: handle invalid sessions in epollFlorin Coras1-3/+10
Change-Id: I62d37f3c05451e5667863a2c6c551872d5dac1ea Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-23vcl: fix coverity warningsFlorin Coras3-3/+21
Change-Id: I24445b08a46041c370094ebba4243422e2342a26 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-17vcl: handle reset while reading/writing dataFlorin Coras1-17/+9
Change-Id: I73d1dde5b78bbb7835f3a4f0d35fc0d5e46ec103 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-17vcl/session: handle reset/disconnect before app acceptFlorin Coras2-68/+145
Also further improves reset handling. Change-Id: I6e517632f700f181761726b965134e0c217eb06d Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-13ldp/vcl: reduce debug verbosityFlorin Coras2-336/+129
Also cleanup some ldp debug code. Change-Id: I23d1b9d744289244f4778f623702fc2b5d6fcd8b Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-13tcp: validate seq for handshake ackFlorin Coras1-0/+1
Change-Id: Ifc0584d781efc30904069ea17c0afbb68c49c442 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-13session/tcp: support tx flush markFlorin Coras1-3/+14
For tcp this means that the last enqueued data goes out with a psh bit set. Change-Id: I29d357ecae6f02e748b59a7b799150ec73d14ba2 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-05bapi: add options to have vpp cleanup client registrationFlorin Coras1-5/+8
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-05ldp: avoid calling write in destructorsFlorin Coras2-5/+8
Change-Id: Ia9c3d7a68a23dc4ab3be06f88fdfb053db422372 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-04vcl: cleanup children that use _exit()Florin Coras4-32/+152
Change-Id: Ia56c2698adb0ea7811203844dc4db10e121fbc42 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-04vcl: test refactor and improvementsFlorin Coras4-11/+17
Change-Id: I92f415bf253d6e051ec9d94ebeb98f081b2a0293 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-03vcl: handle worker process exitFlorin Coras4-15/+41
Change-Id: Ife05d25fd736ae3064f01e974e5aecc5b48de924 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-03svm: use explicit svm fifo segment main for slavesFlorin Coras3-4/+7
Change-Id: Id39d64bf1b49345a3dc31c63360569212aba6865 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-11-30vcl: wait for segments with segment handleFlorin Coras4-67/+140
Instead of waiting for notification from binary api. Change-Id: I5ecab857d6bcdbed62d6bb06709570c4cf6b19ea Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-11-30session: segment handle in accept/connect notificationsFlorin Coras1-1/+2
Change-Id: I03884b6cde9d4c38ae13d1994fd8d37d44016ef0 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-11-29vcl: basic support for apps that forkFlorin Coras8-166/+356
- intercept fork and register a new worker with vpp - share sessions between parent and forked child - keep binary api state per worker Change-Id: Ib177517d661724fa042bd2d98d18e777056352a2 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-11-29ldp: basic multiworker supportFlorin Coras3-119/+170
Change-Id: Ia794fa7e15dac02c8607c4cee2f119ad9815c0a8 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-11-27ldp: sid to fd mapper for apps with multiple workersFlorin Coras3-22/+112
Change-Id: I79585cd6b467b007c3eb9a7668387ff3777de46d Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-11-21session: cleanup use of api_client_indexFlorin Coras4-5/+5
Change-Id: I8a680be62ab91d2ccb144641981a635506973a49 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-11-18vcl/session: apps with process workersFlorin Coras5-44/+118
Allow apps to register child processes as app workers. In particular, on fork vcl now registers the child process with vpp as a new worker. Change-Id: I52a65fbc3292962b1f6e1fe0f6153f739e6e0d4a Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-11-17ldp: fixes/improvements to selectFlorin Coras2-94/+84
Change-Id: I3f3e8fce01309da02689c7e9d23cf1b3181e78c9 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-11-14Remove c-11 memcpy checks from perf-critical codeDave Barach3-65/+69
Change-Id: Id4f37f5d4a03160572954a416efa1ef9b3d79ad1 Signed-off-by: Dave Barach <dave@barachs.net>
2018-11-14vcl/ldp: fix pollFlorin Coras3-70/+80
Change-Id: I8eb5546ff8634d5498d8ce5bbc9407bceb9ae3ef Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-10-16vcl: fix bidirectional tests (VPP-1455)Florin Coras3-13/+17
- add epoll dequeued events beyond maxevents to unhandled - filter multiple epoll rx events Change-Id: I618f5f02b19581473de891b3b59bb6a0faad10b5 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-10-14vcl: fix empty epoll returns (VPP-1453)Florin Coras1-0/+3
Change-Id: I0b191ddb749b1aa132c2d33b8359c146b36d27af Signed-off-by: Florin Coras <fcoras@cisco.com>