aboutsummaryrefslogtreecommitdiffstats
path: root/src/vcl
AgeCommit message (Collapse)AuthorFilesLines
2023-03-14session vcl: refactor builtin tx event for main txFlorin Coras2-6/+17
Rename unused SESSION_IO_EVT_BUILTIN_TX to SESSION_IO_EVT_TX_MAIN and leverage it for non-connected udp tx. Non-connected udp sessions are listeners and are therefore allocated on main thread. Consequently, whenever session queue node is not polling main, tx events generated by external applications might be missed or processed with some delay. To solve this, request that apps use SESSION_IO_EVT_TX_MAIN tx events as opposed to SESSION_IO_EVT_TX and send that to first worker as opposed to main. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I5df5ac3dc80c0f192b2eefb1d465e9deefe8786b
2023-03-10vcl: init ldp config before vcl initFlorin Coras1-26/+31
This avoids printing ldp debug messages while debug is disabled and vcl is initializing. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I5dfd1d59032db937fea146b6b84b8e26307a0de0
2023-03-09vcl: fix select connected deq notificationFlorin Coras1-6/+12
Also make sure that only sessions with fifos try to set deq notification flag on fifo Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I878c2d2e18bb98109ee03b42a4f0f8c48aa23e9f
2023-03-09vcl: fix epoll out evt on connectFlorin Coras1-1/+1
Make sure session has a tx fifo. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ibde40645b401ca0255da298ea4ba691ee924a2d2
2023-03-06vcl: do not stop listeners on vls epoll delFlorin Coras1-1/+7
Although removal from epoll means listener no longer accepts new sessions, the accept queue built by vpp cannot be drained by stopping the listener. Morover, some applications, e.g., nginx, might constantly remove and add listeners to their epfds. Removing listeners in such situations causes a lot of churn in vpp as segments and segment managers need to be recreated. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ia412b3f8d50fbb4881a99ff024f798353b521af7
2023-03-06vcl: always drain libc epoll with eventfds in ldpFlorin Coras1-17/+36
Otherwise if vcl epoll lt events are ignored by the app, libc and vcl mq events are never drained. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I1e22f6da46d56236c52714181f6c20dcb80a33a5
2023-03-01vcl: accept bound notifications in epoll waitFlorin Coras1-0/+3
Async binds may be possible due to vls generated async binds as a result of application adding or removing listeners from epoll. App does not need to be notified of the event. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I4d01be7ddb39ba894db85feef55e9935556c24f5
2023-03-01vcl: accept vcl spurious wakeup in epoll wait eventfdFlorin Coras1-1/+5
Accept one spurious wakeup from vcl in epoll_pwait_eventfd to avoid returning zero events to app without timeout. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I447c7f8176413c562be28605376a92d15e22a1f9
2023-03-01vcl: close libc epfd on vls epfd closeFlorin Coras1-7/+7
Nginx recreates epfds. Make sure ldp tracks the event and recreates the libc epfd or eventfd flavor of epoll pwait will not work. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2994bead9494f0fbb85dd32767cecc1cf69ff6eb
2023-03-01vcl: only add sessions to lt list if neededFlorin Coras1-1/+8
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I777979dbb89f9af774533cb280e77af58b81fb29
2023-03-01vcl: fix undeclared UDP_SEGMENT for centos 8Tianyu Li1-0/+4
Old distros Centos 8 / Ubuntu 18.04 header files doesn't have UDP_SEGMENT declared, define UDP_SEGMENT to right value if not defined. Type: fix Fixes: eff5f7aea8c7 ("vcl: ldp support for ip_pktinfo") Signed-off-by: Tianyu Li <tianyu.li@arm.com> Change-Id: I99314b895e7d09962a36e7f5582c09d0d77563dc
2023-02-28vcl: use program invocation name in ldp app nameFlorin Coras1-3/+2
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2c97faa2cdca32d083aabc3344c8fe67c74ff2fd
2023-02-28vcl: handle lt events in epoll ctlFlorin Coras1-18/+26
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I4e176e9ada32d5f61d10aeca1c68f72114dec9b8
2023-02-27vcl: improve vls handling of shared listenersFlorin Coras3-54/+49
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I1970408de52e53d24cea06b3ae0cc68a38cbc97a
2023-02-20vcl: ldp support for ip_pktinfoFlorin Coras4-87/+245
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I3c15f38a4a3f5e92506059277948e7fca9cd8b55
2023-02-16vcl: fix incorrect ldp worker in ldp_epoll_pwait()Liangxing Wang1-1/+5
For some apps(e.g. wrk2) upon vpp hoststack, ldp_epoll_pwait() is called. In this function, epoll fd was created on one thread, but it is now used on another thread. The vcl worker index is still invalid, so the fetched ldp worker is also invalid and can corrupt some already allocated memory. Just as the ldp_epoll_pwait_eventfd(), make sure the vcl worker is valid before getting the ldp worker in ldp_epoll_pwait(). Type: fix Signed-off-by: Liangxing Wang <liangxing.wang@arm.com> Change-Id: I2ec23a4b5d5b0879a06642ffd80f95e948af4274
2023-02-07vcl: drop lock on segment attach failureFlorin Coras1-0/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I3bc2c7986f492b7b7dfbc84e4893202354223790
2023-02-07vcl: add ldp implementation for recvmmsgFlorin Coras1-31/+39
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I7322abc3d3b0aa81399667bf02b03786fc62c958
2023-02-07vcl: better handlig of ldp apis that rely on gnu sourceFlorin Coras6-91/+139
Control use of apis that rely on _GNU_SOURCE being defined with compile time macro. Also fixes sendmmsg and recvmmsg which were not probably wrapped. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I207de23210d4b9dc960bb4289159502760c5614d
2023-01-13vcl: set deq notify flag on epoll connected sessionsFlorin Coras1-0/+4
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I021f8e8bba247b0050d390a37dbc75900dc6a598
2023-01-12misc: use right include for fctnl.h and poll.hGuillaume Solignac1-2/+2
Musl is stricter than glibc and has a warning that including fctnl.h and poll.h should be prefered rather than their sys/ counterparts, which breaks -Wall setups. Type: fix Signed-off-by: Guillaume Solignac <gsoligna@cisco.com> Change-Id: Id101e999371951b0927cc8c4109f8f1536de1bc2
2022-12-14vcl: enable gso for 'sendmsg' in LDP mode.Dou Chao3-16/+62
Some upon apps(e.g. Nginx-quic) package it's several protocol buffers into a struct msg which is a combination of gso_buffer and gso_size. but if HostStack regardless the gso_size to the buffer and split the buffer with default mss, that cause peer client failed on parsing the package. Type: improvement Signed-off-by: Dou Chao <chao.dou@intel.com> Change-Id: I805eb642be826038ba96d1b85dad8ec0c0f6c459 Signed-off-by: Dou Chao <chao.dou@intel.com>
2022-10-27vcl: register workers when reattaching to vppMaros Ondrejicka3-2/+51
Type: improvement Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech> Change-Id: I82a286e2872338974c1930138c30db78103ae499
2022-10-11vppinfra: fix AddressSanitizerBenoît Ganne1-0/+2
When checking for CLIB_SANITIZE_ADDR to enable specific behavior for AddressSanitizer, we must have vppinfra/clib.h included as it is defined there. Type: fix Change-Id: I9060c3c29c1289d28596c215a1d1709b2ea7c84e Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-10-06vcl: add api to check if vcl disconnected from vppMaros Ondrejicka2-1/+21
Type: feature Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech> Change-Id: I98bc108360f9d04a33126865ce49d2702cbe9cdf
2022-09-29api: deprecate vl_msg_api_set_handlersDamjan Marion1-5/+12
Type: refactor Change-Id: I7b7ca9ec62cb70243c5b7e87968eab1338d67ec8 Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-09-27vcl: repatch "align the RST behaviour with kernel"Yacan Liu1-1/+1
The previous patch[37164] was a bit flawed. Type: fix Signed-off-by: Yacan Liu <liuyacan@corp.netease.com> Change-Id: Ia9d8b9c7853e8f4b960ce7de26d0384243deb667
2022-09-26api: replace print functions wth formatDamjan Marion1-7/+5
Type: improvement Change-Id: I7f7050c19453a69a7fb6c5e62f8f57db847d9144 Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-09-20vcl: align the RST behaviour with kernelYacan Liu1-1/+13
When ESTABLISHED TCP connection is terminated by an RST packet, EPOLLHUP + EPOLLRDHUP would be updeliever by VCL. If not using VPP, app would receive EPOLLHUP + EPOLLERR + EPOLLIN(if requested) + EPOLLRDHUP(if requested). libevent will interpret the two cases as different EV combinations. Below is the code snippet for libevent v2.12: if (what & EPOLLERR) { ev = EV_READ | EV_WRITE; } else if ((what & EPOLLHUP) && !(what & EPOLLRDHUP)) { ev = EV_READ | EV_WRITE; } else { if (what & EPOLLIN) ev |= EV_READ; if (what & EPOLLOUT) ev |= EV_WRITE; if (what & EPOLLRDHUP) ev |= EV_CLOSED; } Type: fix Signed-off-by: Yacan Liu <liuyacan@corp.netease.com> Change-Id: Ice3d2861183b6ea499f66b727bbe175eeae5cb05
2022-09-15vcl: add hugepage for vcl configure and svmJunfeng Wang4-2/+11
add hugepage for vcl configure and svm Type: feature Signed-off-by: Junfeng Wang <drenfong.wang@intel.com> Change-Id: I6a8905e3fec23d840e629114b1e5a403d0a258ef
2022-07-20vcl: new vcl api to get detailed session errorsRadha krishna Saragadam3-0/+42
Sometimes VPP rejects application connection requests due to various reasons. Some errors application can retry to get a successful connection. In a non-blocking session, VCL sends EPOLLHUP. An application can call a new API vppcom_session_get_error to find the details and retry depending on the error. Type: fix Signed-off-by: Radha krishna Saragadam <krishna_srk2003@yahoo.com> Change-Id: If0e21a8e25701f66a190a2799b2209e0c31f897c
2022-06-30vcl: check if listener valid on disconnect cleanupFlorin Coras1-1/+2
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie057d0d5a51d3226a1a188cf9d48a5d82dc4a3c7
2022-06-10vcl: fix iperf3 server crash issue when it runs over vpp host stack.Liangxing Wang1-1/+8
Issue: Let iperf3 server run via ldp and vcl on top of vpp's host stack. If iperf3 client connects this iperf3 server with tcp MSS setting option, iperf3 server will always crash. Root cause: When MSS option is specified by iperf3 client, iperf3 server will recreate the listening socket firstly, then call setsockopt() to set MSS immediately. Iperf3 code can be referred here: https://github.com/esnet/iperf/blob/58332f8154e2140e40a6e0ea060a418138291718/src/iperf_tcp.c#L186. However, in vcl layer vpp_evt_q of this recreated session is not allocated yet. So iperf3 server crashes with vpp_evt_q null pointer access. Fix: Add session vpp_evt_q null pointer check in vcl_session_transport_attr(). Add a vcl test case for this MSS option scenario. Type: fix Signed-off-by: Liangxing Wang <liangxing.wang@arm.com> Change-Id: I2863bd0cffbe6e60108ab333f97c00530c006ba7
2022-04-04vppinfra: make _vec_len() read-onlyDamjan Marion1-1/+1
Use of _vec_len() to set vector length breaks address sanitizer. Users should use vec_set_len(), vec_inc_len(), vec_dec_len () instead. Type: improvement Change-Id: I441ae948771eb21c23a61f3ff9163bdad74a2cb8 Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-31vcl: fix api detach if attach failedFlorin Coras2-1/+12
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Idd1df83bb01951c2455b23c08e3cc1fcd9b91064
2022-03-17vcl: fix invalid socket readFilip Tehlar1-1/+1
Type: fix Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Change-Id: Ic8cc12788d9062f30faa992afaecc0c64078c4d7
2022-03-03vcl: validate vls_epoll_ctl inputsFlorin Coras1-2/+18
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I315ef0122ccb21ccfef117a58b1dc998127618ce
2022-03-02vcl: fix segment detach post api disconnectFlorin Coras2-9/+36
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I0982f0f5c8186f9ed962db49a14f35aa19f6a276
2022-02-17vcl: add support for reconnectFilip Tehlar4-1/+127
Supported only when eventfd option is enabled. Type: feature Change-Id: Ic9d6e38604e978f7bc8e54d74fe9b8f3fc53622d Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2022-02-09vcl: make eventfd flag configurable from envFilip Tehlar2-0/+8
Type: feature Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Change-Id: Id25e2188c9167b2e187923ebe10660e0bc9c3c0a
2022-01-19svm: update number of segments in svm_fifo_segmentsFlorin Coras1-1/+1
In addition to returning the number of bytes also update the number of segments to reflect the number used. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ia87dc2aa62cea38b18dfa83df94dc2abe29d5121
2021-12-14api: verify message size on receiptKlement Sekera1-1/+6
When a message is received, verify that it's sufficiently large to accomodate any VLAs within message. To do that, we need a way to calculate message size including any VLAs. This patch adds such funcionality to vppapigen and necessary C code to use those to validate message size on receipt. Drop messages which are malformed. Type: improvement Signed-off-by: Klement Sekera <ksekera@cisco.com> Change-Id: I2903aa21dee84be6822b064795ba314de46c18f4
2021-12-08vcl: validate closed sessions on disconnect and resetFlorin Coras1-2/+2
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I0375d639e979e29d287dc9fee16b0434fb5c788b
2021-12-07vcl: debug code improvementsFlorin Coras1-36/+33
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I18cd4131c692e776c98eba36161813035e9dec53
2021-12-07vcl: handle reordering of disconnect and reset msgsFlorin Coras2-11/+61
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I817e8510029a060876697701b81a952286597db1
2021-12-06vcl: fix ldp shared listener bitmap leakFlorin Coras1-1/+2
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id1e273bf80c1cc687ce7e5ea3b8cc6a3ec3862f9
2021-11-30vcl: improve handling of failed connectsFlorin Coras1-10/+13
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: If6235888cb0870ec3e1279ab1856a00715bd6c68
2021-11-30vcl: avoid ip format function vnet dependencyFlorin Coras3-169/+187
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I89103d4c99b21c5a466dbe511f0151bd754559a0
2021-11-29vcl: fix build with older gccFlorin Coras1-1/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic941065aa7d7c0002863a6391c8914089c438445
2021-11-15vcl: add DSCP support in VCLFilip Tehlar3-0/+15
Type: feature Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Change-Id: I835675267c997b5dc92a0aaccdb58648bc786bb9