summaryrefslogtreecommitdiffstats
path: root/src/vcl/vppcom.c
AgeCommit message (Collapse)AuthorFilesLines
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
2020-04-30vcl: disconnect both flavors of bapi transport on destroyFlorin Coras1-5/+8
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I6697296b45c5816a31535b0cf44b8e726292b8bb
2020-04-25session vcl: propagate transport cleanup notificationsFlorin Coras1-0/+11
Type: improvement Can be used to force app to close a connection on which it still waits for data. Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I7c3a8245cbbc23728e4408feb63a659a11f718ed
2020-04-25vcl: generate select events on read/write errorsFlorin Coras1-8/+8
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I3429f9d0406b6d710846fc82d77400f26f77fdf4
2020-04-22vcl: fix use-after-freeBenoît Ganne1-1/+2
Make sure we disconnect from vlib prior to free-ing the last worker, as we'll need to access it. Type: fix Change-Id: Id5bdd17f0f5efa1ce52021b4270eb4f1e95cc61d Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-04-20vcl: ensure sessions are open on select eventsFlorin Coras1-7/+5
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I4d56b61af574dfdaf6028160ce331606bdf65609
2020-04-17vcl: fix app destroyFlorin Coras1-20/+19
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I21daa87b1a301142270a1bf20680dd9e9395aac9
2020-04-07udp session: jumbo frames and configurable mtuFlorin Coras1-1/+0
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I6b750bef5df0f8544e05177ccd480f87a020832d
2020-04-06vcl session: enforce full dgram reads/writesFlorin Coras1-24/+44
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I4a3861e31ca42faf0b59f8f09393fb10413bf3af
2020-04-06session udp: shared local endpointsFlorin Coras1-1/+3
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie7102355b95eefb233ec7d146e61819051a7bf07
2020-04-03session: improve error reportingFlorin Coras1-3/+3
Type: improvement Change-Id: I9dd850a1ce85b0adb5136233f176117e0ee38817 Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-04-01session udp: support connect on listenersFlorin Coras1-4/+29
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I6aaaec20a2b6d4c6ddfbe659d9402acc1be2f7e2
2020-04-01vcl: support sendto for dgramsFlorin Coras1-35/+26
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2a0fdced6a3ae262b30cda6a51f1fa96c1d44665
2020-03-25session: api to add new transport typesFlorin Coras1-4/+0
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: If4dee6dba1ea942daa921d566b35cdecdda680ee
2020-02-25svm: refactor fifoFlorin Coras1-2/+4
Type: refactor Switch from a wrapped byte space to a "continuous" one wherein fifo chunks are appended to the fifo as more data is enqueued and chunks are removed as data is dequeued. The fifo is still subject to a maximum size, i.e., maximum number of bytes that can be enqueued, so the max number of chunks associated to the fifo is also constrained. When enqueueing data, which must fit within the available free space, if not enough "supporting" chunk memory is available, the fifo asks the fifo segment for enough chunk memory to ensure that the write can succeed. To avoid allocating large amounts of small chunks due to small writes, if possible, the size of the chunks requested is lower capped by min_alloc. When dequeuing data, all the chunks that have been completely drained, i.e., head moved beyond the chunks’ end bytes, are unlinked from the fifo and returned to the fifo segment. The one exception to this is the last chunk which is never unlinked. Change-Id: I98c1dbd9135fb79650365c7e40c29238b96cd4ee Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-02-13vcl: clear accept msg flagsFlorin Coras1-0/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Idb513232e7b091c8f767726bfa1deb10a7e3b751
2020-02-13vcl: handle close after resetFlorin Coras1-9/+31
Can happen if a connection is reset before fully accepted. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I0ae68d71b66722dd19ca6f1cee44a080e5ff4447
2020-02-04vcl: switch to closed state after app closeFlorin Coras1-3/+5
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I851db474538de76d5f70dd6d6f83a6487a5a02bd
2020-01-30vcl session: propagate cleanup notifications to appsFlorin Coras1-40/+67
Type: feature Change-Id: I7f8e3763d7f8364563a25d0fcc782976b906b325 Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-01-23vcl: always report EPOLLHUP/EPOLLRDHUP on closeFlorin Coras1-4/+0
Type: fix Change-Id: I3d24a7973c7113ffeb9109e89cda7fa960e73a5b Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-01-23vcl session: udp session migration notificationsFlorin Coras1-0/+39
Type: feature Change-Id: I402549818ba6e078802e914293304174dc6625c2 Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-01-16vcl: add rx event on epoll ctl if neededFlorin Coras1-2/+10
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ib6d0387076a4bb0b52e4cdfdcd62b6060b704fe6
2019-12-27vcl: EPOLLOUT should be generated when epoll_ctl called with EPOLLOUThanlin1-0/+20
event Type: fix When we call epoll_ctl to add or mod fd with EPOLLOUT event, mostly to check if we can write. So we expect a EPOLLOUT event should be generated immediately unless tx queue is full. Signed-off-by: hanlin <hanlin_wang@163.com> Change-Id: Ie99986a44dbb07b6ff2fba6512171056f79e77bd
2019-12-21session: move add/del segment msg to mqFlorin Coras1-20/+74
Type: refactor Change-Id: I32234173ebd69f80acb1afa4039fffbd19157f6d Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-12-17vcl: RX event may lost when accept session repeatedlywanghanlin1-1/+1
Type: fix Some applications may call accept repeatedly to process all connect request until get EAGIAIN error. Subsequent call may get RX event of previous accepted session, then should process it rather than just discard it. Signed-off-by: wanghanlin <wanghanlin@corp.netease.com> Change-Id: Ice53442de66289a62591b79a9cc31e883e894c23
2019-12-12vcl: fix disconnect from binary apiFlorin Coras1-4/+0
Type: fix Change-Id: I4398d26879b5efd932fa1d9ae232aa918ec736d6 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-12-11vcl: separate binary api connections per thread workerFlorin Coras1-3/+12
Type: fix Change-Id: I2d72efc74a3b0a5b9e4da265475b1b01bf361125 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-12-05vcl: resolve VCL part session cleanup issueYu Ping1-0/+2
In Nginx performance test, we notice that there are so many session kept open with the state of TRANSPORT_DELETE, and it is root caused that vppcom fails to return close state. Type: fix Change-Id: Ia30f959e0e5adb5b8bcfa13fb1dd7b2cb410a31b Signed-off-by: Yu Ping <ping.yu@intel.com>
2019-11-21vcl: if the ldp user send buf with 0 len, it will assert failed.jiangxiaoming1-1/+1
Type: fix Change-Id: I8ff60cf8726c463491c687e170ad0b1026a1303a Signed-off-by: jiangxiaoming <jiangxiaoming@outlook.com>
2019-11-12vcl: fix nonblocking accept with >1 event in the queueCarl Smith1-3/+3
We discard unwanted events until we get an ACCEPTED. But if we are non-blocking we need to check the queue length every time and EAGAIN if empty before waiting. Type: fix Signed-off-by: Carl Smith <carl.smith@alliedtelesis.co.nz> Change-Id: Ie0c7e5cb00f0d37d2e1534f8bb384221ff56f2e3
2019-11-08vcl: fix epoll connected events sidFlorin Coras1-2/+1
Type: fix Use sid returned by vcl_session_connected_handler instead of trying to infer it from vpp session handle. Change-Id: Ic0fbb90ec2bd851b435fc3f2a34265ac9a8ab29f Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-10-29vcl: handle rx notifications on reused sessionsFlorin Coras1-0/+2
Type: fix Ignore events on sessions that have been reused but not fully initialized. Change-Id: Ided020eb5245d665d0a2e4a9e1f8a6dddebae009 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-10-22vcl: handle segment map errorsFlorin Coras1-8/+12
Type: fix Change-Id: Ibd122a4565c067627c4bbc8cac7df2d5b6497392 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-10-21vcl: add api to set lcl ipFlorin Coras1-6/+39
Type: feature Change-Id: I40169fbbe8a20670dd612c341b6c78b5c925bf74 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-08-30vcl: allow non-blocking connectsFlorin Coras1-3/+14
Type: feature Change-Id: I55349f482ce6781337f747b2f0d2c0a027c3a675 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-08-27session: move ctrl messages from bapi to mqFlorin Coras1-18/+106
Type:refactor Moves connect, disconnect, bind, unbind and app detach to message queue from binary api. Simplifies app/vcl interaction with the session layer since all session control messages are now handled over the mq. Add/del segment messages require internal C api changes which affect all builtin applications. They'll be moved in a different patch and might not be back portable to 19.08. Change-Id: I93f6d18e551b024effa75d47f5ff25f23ba8aff5 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-08-05vcl: fix bapi disconnect with socket transportFlorin Coras1-1/+1
Type:fix Change-Id: I7b69c28118f3d7054a20ca48792dfc403a8e2694 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-07-31vcl: fix epoll chain validationFlorin Coras1-22/+22
Type:fix Change-Id: I91dfe7e0ae2e632022fbf639ca16c93f570849de Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-07-19vcl: fix coverity warningFlorin Coras1-1/+2
Type:fix Change-Id: I7b91ce9359f94131882ab430606586b1a6cf3e02 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-07-19session: Use parent_handle instead of transport_optsNathan Skrzypczak1-2/+2
Type: feature This is mostly used for quic in the case of a stream creation (i.e. connect on an already established QUIC session). We want do default parent_handle to INVALID to be able to distinguish it from parent_handle = 0 Change-Id: Id5ac0b0155a3c44e51334231b711e4fd87a96a10 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-07-18vcl: add QUIC supportNathan Skrzypczak1-13/+155
Type: feature * Adds the concept of a "connectable listener" : a session that can be both connected and accepted on. * vppcom_session_is_connectable_listener (fd) that tells if the fd is a connectable listener * vppcom_session_listener (fd) that gives you the listener's fd that accepted the session (if any) * vppcom_session_n_accepted (fd) that gives the number of sessions a listener accepted. Change-Id: Id89d67d8339fb15a7cf7e00a9c5448175eca04fc Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-07-08vcl: add worker unregister apiFlorin Coras1-0/+7
Type:feature Change-Id: Ie73644aed94e58d5dce822de5000183e414401df Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-07-08vcl: cleanup listener accept fifoFlorin Coras1-0/+14
Type: fix Change-Id: Ic470d429f4bf1924185f720d66efe06f4727bcbd Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-06-29svm: rename fifo tx notifications to reflect useFlorin Coras1-8/+8
Type: refactor Change-Id: I651db44acdcb666a9c63e1037352cf88c68795b5 Signed-off-by: Florin Coras <fcoras@cisco.com>