aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session.c
AgeCommit message (Collapse)AuthorFilesLines
2021-06-18session: udp accept session state should be updated by appjxm1-2/+0
Type: fix Signed-off-by: jxm <jiangxiaoming@outlook.com> Change-Id: I6fb2620e7076e1e38a2ab85a70febe614b079e67
2021-06-11session: half-open free only on main threadFlorin Coras1-4/+3
TCP and (D)TLS clean up half-opens on main without a lock/barrier so cleanup initiated from first worker, e.g., cut-throughs, can corrupt the session pool. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2e5162831c0e201b22454f17fe55bfac44b85fa9
2021-05-25srtp: basic implementation based on libsrtp2Florin Coras1-1/+1
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic5e99938a5f130e83de6d590d2f89252d055bceb
2021-05-19session: fix session queue node access on disableFlorin Coras1-1/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie4e3623e7e00456437fac5fb8f9c9083f1aa2a2e
2021-05-18session: poll main thread if pending connectsFlorin Coras1-0/+2
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie8a15c50531f3ccd5f91dbc0779e4d9c0d146844
2021-05-16session: rpc for connects to mainFlorin Coras1-0/+1
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ifa47e1500e5cfb3c717f87b1d21131b9531c9005
2021-05-14session: switch ct to vc and track half-opensFlorin Coras1-11/+19
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I7f9c4b9b6e523ab549087ad21724f34f08fca793
2021-05-14tls: switch dtls to vc and track half-opensFlorin Coras1-9/+70
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-3/+4
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-20/+22
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-4/+39
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-48/+48
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-29session: accept notifies for sessions in created stateFlorin Coras1-0/+2
Makes sure we don't notify apps of sessions that are closing or multiple times for the same session. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I07145e5e00bbe8eb1df2946059459e9fe05cfeb7
2021-04-14session: fix next node add on transport registrationFlorin Coras1-7/+2
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I11eac12d2ae68a713e78ef68d09b692fce48c18e
2021-04-14session tcp vcl: api to update connection attributesFlorin Coras1-0/+12
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ifdd6024daf044751895bb8d2deabad41d3a80c92
2021-04-06session: basic support for interrupt modeFlorin Coras1-4/+26
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-03-30session: interrupt mode for session node on main threadFlorin Coras1-15/+20
Signal, and implicitly run, main thread session queue node via interrupts instead of the queue process node. Process node still needed for timers. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I5efd393effc8dad65e4125a3d0ad1be6b7484cb7
2021-03-29svm session vcl: per app rx message queuesFlorin Coras1-0/+6
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
2021-03-26vlib: convert foreach_vlib_main macro to be more gdb and clang-format friendlyDamjan Marion1-32/+28
Type: improvement Change-Id: I1152e58d7bfcb3c4347147f87a834d45ad51cdfe Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-03-26vlib: introduce vlib_get_main_by_index(), vlib_get_n_threads()Damjan Marion1-1/+1
Type: improvement Change-Id: If3da7d4338470912f37ff1794620418d928fb77f Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-02-15session: coverity fixFlorin Coras1-3/+0
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic28ee0e7cd313686b820e7003a47d17b844b8a89
2021-02-09tls: dtls initial implementationFlorin Coras1-1/+1
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-01-25svm: add custom q implementation for mqFlorin Coras1-3/+0
Add separate queue implementation for the message queue as it's custom tailored for fifo segments as opposed to binary api. Also move eventfds to the private data structures. Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I6df0c824ecd94c7904516373f92a9fffc6b04736
2021-01-09session svm: fix fifo migrationFlorin Coras1-14/+15
Allocate and attach a new pair of private fifos in the right private slice when a session is cloned. This ensures that private fifos are not shared between workers. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ib700d18104d2ca79aa8a07434cdcdcab0bef13a5
2020-12-29session: remove fifo segment va allocatorFlorin Coras1-6/+2
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I7b2fd896dfa6df46916f46327975b95561809f00
2020-12-29svm: allow mq attachments at random offsetsFlorin Coras1-3/+4
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic373cd2c11272da539eb4b0db27227f36f2f9688
2020-12-28session: convert evt q segment to fifo segmentFlorin Coras1-12/+13
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I63a44e11322f6fe27255820524e022f6d710b083
2020-12-24svm: split fifo into private and shared structsFlorin Coras1-6/+6
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id8e77e8b2623be719fd43a95e181eaa5b7df2b6e
2020-11-25session: add startup option to poll in mainFlorin Coras1-2/+5
Type: improvement Needed to support multi-worker tests Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I68d5590cece24a744513dc6c324dfb2861a38a94
2020-11-24svm: support for multi-segment enqueuesFlorin Coras1-11/+38
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I06c7022a6afbb146b23cbd3a430497ec9e8be73d
2020-11-24session: init lookup before dgram accept notificationFlorin Coras1-1/+3
Avoids potential session pointer invalidation Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ide9ba0ab732707d3dda6019ebb77f0b9489dfda7
2020-11-09session: remove support for shm bapi attachmentFlorin Coras1-38/+20
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I21bda0c46406aff54ad8fe5e44491e8e332de170
2020-11-09session: default to using memfd mq segmentsFlorin Coras1-0/+1
First step towards deprecating the use of binary api's segment for mq allocation. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I9d3d17e4d406575d64e0426bb65465130a84980a
2020-10-26session: fix feature disableFlorin Coras1-2/+16
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I69e912ddf64d8ec89f8d93e02a201781b99de0bd
2020-10-13session: allow custom config of segment basevaFlorin Coras1-0/+2
Type: improvement Change-Id: If9ea09d652c228004492cf47854a7f6c1f8b3bc2 Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-09-30svm: harmonize ssvm namesFlorin Coras1-2/+1
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I26e4ad6bfd9e0be7745f6ba948bf51550fd4215e
2020-09-30svm session: use new clib mem apis for segmentsFlorin Coras1-3/+5
"sh memory map" now reports shared memory segments mapped by session layer for applications. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I7debdcd06c7728abfb5cf817a1ccc37de495472c
2020-09-14session: add unix socket api for app attachmentFlorin Coras1-0/+2
This is an af_unix socket alternative to the binary api. To enable it, add use-app-socket-api under session stanza in startup.conf. When the socket api is enabled, attachments through the binary api are disabled. The socket api only works with memfd fifo segments, i.e., shm segments are not supported. Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I55ffcee201d004846daeeec85c700c7e7a578d43
2020-07-24session: cleanup lookup table for rejected sessionFlorin Coras1-1/+4
Type: fix Signed-off-by: Ivan Shvedunov <ivan4th@gmail.com> Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id20f693a5acdee74ab534e9964418973537b977f
2020-04-28vlib: add ASSERT to vlib_time_now(...)Dave Barach1-1/+1
Calling vlib_time_now (&vlib_global_main) from a worker thread is a bad mistake. ASSERT (vm->thread_index == __os_thread_index) will catch it. Type: improvement Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I55af6de84e06143f8f43adc62103b77267a7a441
2020-04-20session: avoid rx notifications on accepting sessionsFlorin Coras1-0/+5
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Iba37e528e968104c3ba9c8324438ba695ddddfd1
2020-04-17session tcp: track half open in app wrkFlorin Coras1-8/+37
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-13session: remove ho with fifos supportFlorin Coras1-21/+5
Type: refactor UDPC (removed) was the only consumer. Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2812bf58d3c68fe021ec73acaa1bd00ef3172846
2020-04-13session: cleanup debug codeFlorin Coras1-15/+1
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie6c03195019fe18c547b22f4387d7f2b14b71461
2020-04-13session: adding debug eventsSrikanth Akula1-0/+15
Type: feature Enhancing the debugging capability of tcp session layer by measing time spent for various events. This is meant only for debugging purpose Signed-off-by: Srikanth Akula <srakula@cisco.com> Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I9f401881b345bcae5f7d8050338637fd47b3723b Signed-off-by: Srikanth Akula <srakula@cisco.com>
2020-04-09session: fix leak on accept fifo alloc failureFlorin Coras1-3/+13
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ia928d6ea05ff7cb9a15e1ddc58234d000ebfd7fb
2020-04-09session: update fifo slice on session migrationFlorin Coras1-10/+44
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic5fb0f95c58ad70925a365004fe911ac8f2d2382
2020-04-08udp: cleanup input nodeFlorin Coras1-0/+30
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ida9daefc20a161b36d6f36c56267123c7f2efc01
2020-04-07session: add more session errorsFlorin Coras1-5/+9
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I9b246eb8a99020de9e5859147c456096fe2e3389
2020-04-06session udp: shared local endpointsFlorin Coras1-2/+2
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie7102355b95eefb233ec7d146e61819051a7bf07