summaryrefslogtreecommitdiffstats
path: root/src/vcl/vppcom.c
AgeCommit message (Collapse)AuthorFilesLines
2021-02-10vcl: validate seg handle on migrate only if neededFlorin Coras1-5/+10
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I3c15a465f84f2ceb6bd5f1c459899824d4bc1c90
2021-02-09tls: dtls initial implementationFlorin Coras1-0/+7
Type: feature Basic dtls transport protocol implementation that relies on openssl wire protocol implementation. Retries/timeouts not yet supported. To test using vcl test apps, first ensure all arp entries are properly resolved and subsequently: server: vcl_server -p dtls 1234 client: vcl_client -p dtls <server-ip> 1234 -U -N 2000000 -T 1460 -X Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I04b4516a8fe9ce85ba230bcdd891f33a900046ed
2021-02-05session svm: non blocking mqFlorin Coras1-103/+33
Avoid synchronizing producers and the consumer. Instead, only use mutex or spinlock (if eventfds are configured) to synchronize producers. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie2aafbdc2e07fced5d5e46ee2df6b30a186faa2f
2021-01-28vcl: support set/get vrf attributeFlorin Coras1-0/+21
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I011faa52939d44bdc90de69ad381dc1eea8c8eb3
2021-01-28vcl: fix select want deq ntf for ct sessionsFlorin Coras1-32/+35
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2d008a12da6c6e68ad8955a638b44d09e4febd8d
2021-01-28vcl: honor time wait in eventfd epoll waitFlorin Coras1-11/+35
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I4bfdeb4bfbdcf333cfd4047a80edd04e35a371fc
2021-01-07vcl session: switch to generic cert key apisFlorin Coras1-2/+37
Remove the deprecated tls apis. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ia1e12bd813671146f0aca22e83d04c23ac13e595
2020-12-29svm: allow mq attachments at random offsetsFlorin Coras1-13/+12
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic373cd2c11272da539eb4b0db27227f36f2f9688
2020-12-24svm: split fifo into private and shared structsFlorin Coras1-73/+41
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id8e77e8b2623be719fd43a95e181eaa5b7df2b6e
2020-12-14misc: refactor clib_bitmap_foreach macroDamjan Marion1-4/+4
Type: refactor Change-Id: I077110e1a422722e20aa546a6f3224c06ab0cde5 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-12-14misc: move to new pool_foreach macrosDamjan Marion1-2/+2
Type: refactor Change-Id: Ie67dc579e88132ddb1ee4a34cb69f96920101772 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-12-11vcl: fix listener session close problemwanghanlin1-1/+1
Type: fix Signed-off-by: wanghanlin <wanghanlin@corp.netease.com> Change-Id: I34ac04f05b84b271679aafc253f1606f11e29835
2020-11-26vcl: avoid coalescing dgrams on readFlorin Coras1-2/+2
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I035f1ef26202bbcf918548cbaa3cdbc17944bf8a
2020-11-19vcl: stop tracking vpp event queues and thread indexFlorin Coras1-45/+21
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Icbee02a39650bc792532adc714bcf4f47f3fbe59
2020-10-29vcl: support fifo segments with ct sessionsFlorin Coras1-7/+12
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Icf0194f569da88f26a4cba29d8fe75a0bddfc144
2020-10-29vcl session: minimize ct io eventsFlorin Coras1-4/+10
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic4072fbc182fff38a28b415be0bb16f0559a4064
2020-10-29vcl: fix epoll fd cleanupFlorin Coras1-1/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2886155495ac0e518b9dc09856132cc2f6843503
2020-10-27vcl: postpone unhandled ctrl events if neededFlorin Coras1-63/+112
Unhandled control events, i.e., events delivered outside of epoll/select loops, that need to be propagated to apps should be postponed such that epoll and select can later deliver them. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I3d05e154382631a16a19e71494c2d92c35dacb70
2020-10-26vcl: avoid epoll cleanup before app closeFlorin Coras1-69/+74
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I09f9faab72e6b77c975b8b79694081216c6ba115
2020-10-21vcl: wait for sendto to connect if neededFlorin Coras1-8/+15
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I39948b046c79dea1b034619e1eaa22dd8a4997fb
2020-10-20vcl: confirm reset on transport cleanupFlorin Coras1-3/+16
Type: fix Change-Id: Ife579f305409bf987639634213008a7d7f35acd7 Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-10-20vcl: more session struct cleanupFlorin Coras1-71/+72
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I8e466e789c860caaa55f67095a57fc6ab670f32b
2020-10-20vcl: convert vep variables into flagsFlorin Coras1-60/+49
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ief017abc4879bc928746d9f5b9d2cfe04da89bd3
2020-10-19vcl: cleanup read and write readyFlorin Coras1-2/+2
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ib6afedf24c7bd7cc0d98bb324a83517030a05aa7
2020-10-16vcl: remove accept state and rename connect to readyFlorin Coras1-11/+8
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I57fcc6f9c154a6f83e0d59873b76c2e380e6f90a
2020-10-15vcl: refactor session state enumFlorin Coras1-90/+82
Only allow one state instead of using flags. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I08ffccbf8c3f6e2f61533996bb36c799cbc931e7
2020-10-14vcl: set STATE_UPDATED state when connect with non-blocking socket!fanyf1-1/+4
State set to STATE_UPDATED to ensure the session is not assumed to be open and to also allow the app to close it prior to vpp's connected reply! Type: fix Signed-off-by: fanyf <fanyufei521@outlook.com> Change-Id: I7a6d0914599cb9296d112205dac725ecd11a5d0f
2020-10-12vcl svm: segments improvementsFlorin Coras1-15/+23
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I717c64666972bb4e440cb3d1180a5cb26ee25577
2020-09-29vcl svm: provide apps access to fifo chunksFlorin Coras1-18/+17
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2191b8594b1e87ecc00f237316457db249f73603
2020-09-28vppinfra: don't call dlmalloc API directly from the codeDamjan Marion1-4/+2
- it is confusing from end consumer perspective that some thing is somewhere called heap and somewhere mspace - this is base for additional work where heap pointer is not the same thing like mspace Type: improvement Change-Id: I644d5a0de17690d65d164d8cec3c5654571629ef Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-16vcl: refactor bapi client index for sapi reuseFlorin Coras1-10/+10
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ibebb6f7d4e610570693e213acd2f6d9332c563c6
2020-09-14vcl: add support for app socket apiFlorin Coras1-4/+33
To enable add "app-socket-api /path/to/socket" to vcl.conf. On vpp side, add use-app-socket-api to session stanza in startup.conf VPP allocates a socket per application namespace which it places in the app_ns_sockets subfolder of the run folder (default /var/run/vpp). The socket used implicitly selects the app namespace for the vcl app. Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ifc14b93dcbf6ef9bed1852d46cd069f4855b92ef
2020-09-14vcl: cleanup bapi and wrk registrationFlorin Coras1-131/+14
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I0391db5c3ad038265cb8ebf9de02925653e35959
2020-09-14vcl: always fill buffer or drain rx fifoFlorin Coras1-4/+16
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ibbe438aa6f2fe6d9f55c56ca6d3aec1a29b32cad
2020-09-02vcl: handle svm fifo write failureFlorin Coras1-1/+3
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I4b132cad8ff906ef24846cc43935ccfd6aa7b4ec
2020-08-25vcl: cleanup non-blocking connectFlorin Coras1-2/+16
Make sure session is in non-closed state after non-blocking connect to ensure cleanup is performed, if needed. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic1533b9864828f875c840dfdfeed08bf32d10651
2020-08-14vcl: rx dequeue notifications with epollFlorin Coras1-52/+57
Add deq request on ct fifo if present and clear event when session is removed from epoll group. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I8a20342879b3aac2f8fe8171556baaf9c992363b
2020-08-14vcl: minimize vpp to vcl rx eventsFlorin Coras1-1/+11
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2015162bd315927e45b9fe583324b1458fe69d8f
2020-08-13vcl: clear ct rx event on right fifoFlorin Coras1-1/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I70bab0d86287c108c6dffda5c5b2f29277c15de1
2020-08-12vcl: support multi-threads with session migrationhanlin1-5/+8
Currently, mutlti-threads only support one dispatch thread and multiple worker threads, eventually only dispatch thread is a vcl worker and can interact with epoll. This patch will register all threads as vcl worker, and then each thread can interact with epoll now. Moreover, session migration also supported, such as socket created in thread A and used (bind, connect and etc.) in thread B. Type: feature Signed-off-by: hanlin <hanlin_wang@163.com> Change-Id: Iab0b43a33466968c1423d7d20faf1460c8589d91
2020-08-11vcl: support inter worker rpcFlorin Coras1-0/+48
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I664cd14c84fc5cf2ffe61efce99c95219b44fad7
2020-08-09vcl: fix getting wrong non-blocking flags issue in VPPCOM_ATTR_GET_FLAGS actionSimon Zhang1-2/+4
Type: fix Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com> Change-Id: If4c700b59b8936a43d6a73ed75cc6fdaf6cf141d
2020-08-04vcl: fix epoll timeoutFlorin Coras1-1/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I917158a62e5881b97917c3339527d3c34c37565a
2020-06-15vcl: move helper functions out of header fileFlorin Coras1-1/+90
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I3889fd80b145cf80f76f6054d63247e76bdf20ff
2020-05-26vcl: do not propagate epoll events if session closedFlorin Coras1-6/+11
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I1e9652b476bbc07852b4e701a948c36a0d8c67fa
2020-05-21vcl: support connected udp listensFlorin Coras1-0/+7
Request connected udp listener behavior by setting VPPCOM_ATTR_SET_CONNECTED attribute with vppcom_session_attr Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Iba95155c0f41cea8c6e1a4263946270d49c213ac
2020-05-15vcl: remove udpc transportFlorin Coras1-4/+0
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I145ff3301f168973c4f7f32c337bbcac47900705
2020-05-14vcl svm: fix rx event losshanlin1-2/+5
When vcl_epoll_wait_handle_mq handles rx events exceeding maxevents, VPP will not signal because cursize > 0, and the remaining rx events cannot be triggered because the eventfd event has been read. Therefore, we should dequeue all events until cursize = 0. And then handle msg up to maxevents with vcl_epoll_wait_handle_mq_event and those beyond with vcl_handle_mq_event. Type: fix Signed-off-by: hanlin <hanlin_wang@163.com> Change-Id: I8a0c87cb41c837deb8284b40f668cc3c7d9d6e56 Signed-off-by: hanlin <hanlin_wang@163.com>
2020-05-12vcl: de-init vcl on destroyFlorin Coras1-0/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: If3372e3edd403240c2c9da746246170549a3e644
2020-05-04vcl: allow vcl worker index to be set by applicationsPivo1-0/+6
When using vppcom_session* apis to setup TCP sessions in applications build outside of the VPP repository, it is necessary to set the worker_index explicitly when these apis are called from the none-VCL worker threads. An example is when data is to be sent to the TCP session that is originated from a different thread, like the main program thread or from the bin api thread. This change allows the application to set it. Type: fix Signed-off-by: IJsbrand Wijnands <ice@cisco.com> Change-Id: I37f3654a49ea9a8cf3a0d3d0e672583018c12299