summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session.h
AgeCommit message (Collapse)AuthorFilesLines
2023-08-09session: async rx event notificationsFlorin Coras1-6/+19
Move from synchronous flushing of io and ctrl events from transports to applications to an async model via a new session_input input node that runs in interrupt mode. Events are coalesced per application worker. On the one hand, this helps by minimizing message queue locking churn. And on the other, it opens the possibility for further optimizations of event message generation, obviates need for rx rescheduling rpcs and is a first step towards a fully async data/io rx path. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id6bebcb65fc9feef8aa02ddf1af6d9ba6f6745ce
2023-07-27session: remove unused codeFilip Tehlar1-17/+0
Type: improvement Change-Id: I7525aa81acf073707550b23541fdcc358b9bf49c Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2023-07-21vcl: ldp support SO_ORIGINAL_DSTqinyang1-0/+11
Type: improvement Support SO_ORIGINAL_DST socket option to get original dst_ip4 and dst_port if nat44 rule enabled. Change-Id: If00e00d03e48f3b78a23a68f1b078954d79dd0f7 Signed-off-by: qinyang <qiny@yusur.tech>
2023-06-27session udp: add len check for tx dgramsFlorin Coras1-0/+13
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I35391fb8c39defbe0e57a241a357c3c98e8cef54
2023-03-22session: add session statsFilip Tehlar1-0/+24
Type: feature Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Change-Id: I02d9bb5292b32ffb1b2f05daccd8a7d5dba05125
2023-03-14session vcl: refactor builtin tx event for main txFlorin Coras1-1/+1
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
2022-12-23hsa: fix echo client workers initializationBenoît Ganne1-3/+3
We were creating an additional worker not backed by any VPP threads, leading off-by-1 access in the session main workers vector. Also uses vec_elt_at_index() when accessing session main workers vector elements to catch those errors more easily. Type: fix Change-Id: I6059116b7b64ae6b26ad83c1fcf55df8522868ad Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-12-02session: move connects to first workerFlorin Coras1-19/+13
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I035e3fdbb52eca010ad7b2c20ca2930cb1645978
2022-11-10session: reduce safe pool expand rateFlorin Coras1-2/+1
Make sure they only double in size. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I18d5508c7f32836deb3b25943e8e3af39d0dbc33
2022-11-03session: fix tx_fifo clear and incorrect bitmap invalidationDongya Zhang1-1/+2
The tx_fifo of session may not be set up yet, if app request to disconnect the session, svm_fifo_dequeue_drop_all will crash. In debug image, ho_session_alloc will do clib_bitmap_validate to prevent race condition, however the input is not correct which will make vpp crash. Type: fix Change-Id: Ia8bff325d238eacb671e6764ea2a4eecd3fca609 Signed-off-by: Dongya Zhang <fortitude.zhang@gmail.com>
2022-10-26session: add session event log for session stateSteven Luong1-0/+7
To aid sesipon debug, add session event log in SM debug to track the session state. Type: improvement Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I6909cf969cd5b6a3ea5a06d08ae32c2f1d48f686
2022-10-12misc: fix issues reported by clang-15Damjan Marion1-1/+1
Type: improvement Change-Id: I3fbbda0378b72843ecd39a7e8592dedc9757793a Signed-off-by: Damjan Marion <dmarion@me.com>
2022-09-15session: support dma optionMarvin Liu1-0/+20
add dma support to session, acclerate host-stack with dma Type: feature Signed-off-by: Marvin Liu <yong.liu@intel.com> Signed-off-by: Junfeng Wang <drenfong.wang@intel.com> Change-Id: I3d492921d69d9e3e0b34d33adc33fba3bde9e1cc
2022-04-01session: leverage new pool functions in safe reallocFlorin Coras1-32/+48
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2c264c31d2470b11b94d68411fa8266387319146
2022-03-31vlib: add support for workers syncFlorin Coras1-38/+2
Adds api that allows workers to synchronize through main thread. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I1e75e2fb5144d397d19b13c4dfc7e937f11c044c
2022-03-26session: simplify safe pool reallocFlorin Coras1-62/+42
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I1c55c054fea6c6886d8287a9b6e264a308f89504
2022-03-22session: use safe realloc for poolsFlorin Coras1-50/+7
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I313c916d268c4b2b448b93e90bc67da341b803e3
2022-03-21session: linked list of events to be handled by mainFlorin Coras1-0/+4
Minimize amount of rpcs from first worker to main Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I3794ff028a17d18b7bff69ede2b62e1e2d45ae77
2022-03-18session: add infra for safe pool reallocsFlorin Coras1-0/+147
This is not to be used lightly. The idea is to forces pool reallocs to be done only on main thread with a barrier to make sure pools are always reallocated without peekers/readers. If rpcs are delayed and the pool runs out of elements, workers will block waiting for barrier and force the realloc. Consumers of this api should be session layer and transports. Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I533272a29534338935a3fcf7027c0e7af2ca948c
2022-02-10session: avoid debug half-open session pool contentionFlorin Coras1-0/+11
Half-opens are only allocated from main with worker barrier but can be cleaned up, i.e., session_half_open_free, from main without a barrier. In debug images, the free_bitmap can grow while workers peek the sessions pool, e.g., session_half_open_migrate_notify, and as a result crash while validating the session. To avoid, proactively grow bitmap in debug images. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2410793f933fb638651fe8dc08ba78e9bee0bd77
2022-01-22session: update time for list of subscribersFlorin Coras1-0/+6
Instead of constantly scanning all transport vfts for update time functions, build list at transport enable time. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id5c07cc03ee1fdd072ebbbd40119d1a440a5e3b1
2022-01-12session: pass tx buffers in bulk to transportsFlorin Coras1-0/+1
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I1025cccd784f80b557847f69c3ea1ada5c9de60d
2021-11-18session: deprecate mq segments basevaFlorin Coras1-2/+0
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I5b6cb8dd9db7e003a470ca4aeb8472fa7cb9a128
2021-11-18session: improve wrk mq segment allocationFlorin Coras1-4/+4
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I9e5438a2f82762aa8a88bbacf4290151ef30969e
2021-07-12session: api cleanupFilip Tehlar1-0/+1
Use autogenerated code. Does not change API definitions. Type: improvement Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Change-Id: Iacc58d27ac51c8a1c571087f98297e046b3477c2
2021-05-21session: improve main thread connects rpcFlorin Coras1-1/+1
Avoid grabbing the worker barrier if there's no work to be done. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ice3de5df41cd1752aba3419ad2e2dd82f30e9bfb
2021-05-19session: cleanup event llist usageFlorin Coras1-22/+8
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I750c856ac81d951e8c0e62c710e0f35a0c80d6f9
2021-05-18tls: fix dtls with no workersFlorin Coras1-0/+9
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Iecc33fda7f28c037289775ffe0525a50f89a2b8c
2021-05-18session: poll main thread if pending connectsFlorin Coras1-0/+3
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie8a15c50531f3ccd5f91dbc0779e4d9c0d146844
2021-05-18session: move tx-buffers to tx ctxFlorin Coras1-3/+3
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I10ec410fb7f3acb47128dda23510162dc13b20d0
2021-05-16session: rpc for connects to mainFlorin Coras1-0/+6
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ifa47e1500e5cfb3c717f87b1d21131b9531c9005
2021-05-14tls: switch dtls to vc and track half-opensFlorin Coras1-0/+2
Also adds support for half-open support transport migration. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id04c194138956336f93246bbed0332a7030c67e2
2021-05-12tls: switch to vc service and track half-open sessionsFlorin Coras1-0/+1
Half-open tls sessions are now tracked by the app worker and are cleaned up only when tcp cleans up its half-open session, i.e., independent of when the established tls context is allocated. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: If5d594d7095192dd527daf4ea1358ffeccdfcc7a
2021-05-12session: return connect session handle to appFlorin Coras1-1/+1
App transports not supported for now. Will have to be updated individually. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I75cb6c4e1c5af008af72858a9ee573016812abd4
2021-05-12session: support half-close connectionliuyacan1-0/+2
Some app(e.g. Envoy) may call shutdown() instead of close() when draining connection. Type: improvement Signed-off-by: liuyacan <liuyacan@corp.netease.com> Change-Id: I9543b9ca3caa87b10b134fd1fc4019124e41e4d2
2021-05-10session: use half-open sessions for vc establishmentFlorin Coras1-4/+26
Use half-open sessions to track virtual circuit connection establishment. These sesssions can only be allocated and freed by the thread that allocates half-open connections (main). Consequently, they can only be freed on half-open cleanup notifications from transports. Goal is to simplify state tracking within the session layer but it's also a first step towards allowing builtin apps to track and cleanup outstanding connects. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I8a535906d13eb7f8966deb82333839de80f8049f
2021-04-20tcp: req app deq notification on fifo fullFlorin Coras1-0/+7
If fifo full, default to requesting an app deq notification and forcing an ack (window update) if zero rcv window sent is still active. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Iade7e1722503da149c62c465c472edbb0a5599f7
2021-04-14session tcp vcl: api to update connection attributesFlorin Coras1-0/+2
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ifdd6024daf044751895bb8d2deabad41d3a80c92
2021-04-07session: fix coverity warningFlorin Coras1-1/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id2c06f49bcae1a26a2d16d58f9da7a4d3175bf3c
2021-04-06session: basic support for interrupt modeFlorin Coras1-0/+30
Experimental support for session layer interrupt mode. When enabled (use-private-rx-mqs must be set) session queue node switches to interrupt state when lightly loaded, i.e., no events and less than 1 vector/dispatch. Because transport protocols require a periodic time update, when in interrupt state the session queue node workers register a timerfd with the unix-epoll-input node that when triggered signals, i.e., wakes up, the queue node. Under light load, the timer is set to trigger every 1ms whereas if no session is allocated, the worker moves to idle state and the timeout is set to 100ms. Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I905b00777fbc025faf9c4074fce4c516cd139387
2021-04-05tcp: time infra improvementsFlorin Coras1-0/+7
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I998c0686f9f7dc556dda8b28e23bbed127d0aafc
2021-03-29svm session vcl: per app rx message queuesFlorin Coras1-0/+5
Add option to use per app private segments for app to vpp message queues, as opposed to exposing internal message queues segment. When so configured, internal message queues are still polled by the session queue node but external app message queues are handled by a new input node (appsl-rx-mqs-input) that runs in interrupt state. Signaling of the node, when mqs receive new messages, is done through eventfds epolled by worker epoll input nodes. Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Iffe8ce5a9944a56a14e6d0f492a850cb9e392d16
2020-12-28session: convert evt q segment to fifo segmentFlorin Coras1-3/+3
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I63a44e11322f6fe27255820524e022f6d710b083
2020-12-01session: make pacer worker load awareFlorin Coras1-0/+6
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I71b9d54311fcad808fcdaad0df2dca8c161d580e
2020-11-25session: add startup option to poll in mainFlorin Coras1-0/+3
Type: improvement Needed to support multi-worker tests Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I68d5590cece24a744513dc6c324dfb2861a38a94
2020-11-09session: remove support for shm bapi attachmentFlorin Coras1-2/+1
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I21bda0c46406aff54ad8fe5e44491e8e332de170
2020-10-26session: fix feature disableFlorin Coras1-0/+4
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I69e912ddf64d8ec89f8d93e02a201781b99de0bd
2020-04-17session tcp: track half open in app wrkFlorin Coras1-0/+4
Type: improvement Do extra checks when establishing an active connect and cleanup pending connects if application detaches. Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ibe9349db57b313ba2aa5ea3960ef5cf755f5098a
2020-04-08udp: cleanup input nodeFlorin Coras1-0/+2
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ida9daefc20a161b36d6f36c56267123c7f2efc01
2020-04-08session: alloc exact number of bufs for multi-seg deqsSimon Zhang1-0/+1
Type: refactor Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com> Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I11cf806e22158e021a9a405eb4487a9ed6fdbccf