summaryrefslogtreecommitdiffstats
path: root/src/vnet/session
AgeCommit message (Collapse)AuthorFilesLines
2021-06-24session: fix session formated str output truncated in cliXiaoming Jiang2-12/+16
Type: fix Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com> Change-Id: I2c2b739a5aa246bbf53d6663efd403c3aee9dddd
2021-06-22session: avoid reordering unlisten and connect msgFlorin Coras1-6/+33
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ibe32f7965f8cf457c39845713b029c8a4647ee55
2021-06-18session: improve ct locking with multiple workersFlorin Coras5-165/+239
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id91c3be57d49745cb3db6c768a8d5d14133f899e
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-17session: optimize ct fifo segment allocationsFlorin Coras4-84/+359
Allocate per app pair segments with space for more than one fifo. Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ib96fe12b899cb14ff20c0be607814011e2c3fc6a
2021-06-12session: fix listener ct transport retrieval on acceptFlorin Coras1-6/+8
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ied2608e7a28c59c908803ca676abbe93072fadb8
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-06-03session: avoid ct connects loopFlorin Coras1-1/+2
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I99af136ecab9be1f9e00de6d197b8f1c74ab4b20
2021-06-03session: lcl transport info on acceptFlorin Coras2-0/+3
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ia46b0b8afed30f84b244c06f0457303f9e8832cd
2021-05-25srtp: basic implementation based on libsrtp2Florin Coras2-2/+3
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic5e99938a5f130e83de6d590d2f89252d055bceb
2021-05-21session: improve main thread connects rpcFlorin Coras2-18/+26
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-20session: fix transport half-open cleanup callFlorin Coras1-1/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I47d241a8f2f9e9d0761d14dcddd3327c3b28932c
2021-05-19session: cleanup event llist usageFlorin Coras3-41/+27
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I750c856ac81d951e8c0e62c710e0f35a0c80d6f9
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-18tls: fix dtls with no workersFlorin Coras2-1/+14
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Iecc33fda7f28c037289775ffe0525a50f89a2b8c
2021-05-18session: poll main thread if pending connectsFlorin Coras3-48/+76
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie8a15c50531f3ccd5f91dbc0779e4d9c0d146844
2021-05-18session: only handle old ctrl events per dispatchFlorin Coras1-6/+12
Avoids dispatching ctrl events generated while handling the current pending list. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ibeaf901ba4cf58a68fbd88e5ec3c23f6c2f6f145
2021-05-18session: move tx-buffers to tx ctxFlorin Coras2-16/+14
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I10ec410fb7f3acb47128dda23510162dc13b20d0
2021-05-16session: rpc for connects to mainFlorin Coras3-5/+88
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ifa47e1500e5cfb3c717f87b1d21131b9531c9005
2021-05-15session: fix coverity warningFlorin Coras1-1/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I24484a5192d7e683507ed640f75fb37914c0efb0
2021-05-14session: switch ct to vc and track half-opensFlorin Coras5-77/+220
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I7f9c4b9b6e523ab549087ad21724f34f08fca793
2021-05-14tls: switch dtls to vc and track half-opensFlorin Coras3-10/+73
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 Coras5-6/+14
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 Coras6-32/+36
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 connectionliuyacan8-4/+114
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 Coras8-116/+111
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-05-07session: connects seg manager is always firstFlorin Coras3-77/+23
By convention, connects segment manager will be first. Therefore it will be the one with the first segment wherein lies the app's message queue. Saves us the trouble of allocating it on first connect, if app started by listening, and we no longer need to track if it's assignable to a listener or if it can be removed. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Iba9a8ffaab618eeb41ec2144dcfee62d006dc7a2
2021-05-03session: lookup listener with iface addressliuyacan1-0/+26
We add interface address to the global lookup table, so we should use it as the key when lookup listener. Otherwise, when multiple threads listen on 0.0.0.0 (local scope disable), duplicate listeners and sessions would be allocated but only one works. Type: fix Signed-off-by: liuyacan <liuyacan@corp.netease.com> Change-Id: I86f36475c16e217c6c5293a62c4fb5c9477a191e
2021-05-01vlib: refactor trajectory trace debug featureBenoît Ganne1-5/+0
trajectory trace has been broken for a while because we used to save the buffer trajectory in a vector pointed to in opaque2. This does not work well when opaque2 is copied (eg. because of a clone) as 2 buffers end up sharing the same vector. This dedicates a full cacheline in the buffer metadata instead when trajectory is compiled in. No dynamic allocation, no sharing, no tears. Type: refactor Change-Id: I6a028ca1b48d38f393a36979e5e452c2dd48ad3f Signed-off-by: Benoît Ganne <bganne@cisco.com>
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-29session: cleanup CREATED sessions when listener goes downliuyacan3-0/+63
We should cleanup sessions in CREATED state when listener goes down, otherwise they may use unpredictable sessions as listeners later. Type: fix Signed-off-by: liuyacan <liuyacan@corp.netease.com> Change-Id: Ifbd0a0fb46275bd9d89e5aee19a70c1d01d15764
2021-04-27session: fix mq ext config cleanupFlorin Coras1-2/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I18eb1a71ac22017f75f835a23a57b023b46524ce
2021-04-26session: fix race condition in fifo allocationliuyacan3-43/+39
Under some timing conditions,VCL may receive CONNECTED/ACCEPTED event before ADD_SEGMENT event. Timing example: 2 threads call segment_manager_alloc_session_fifos() parallelly Thread 1 Thread 2 sm read lock | | | try to alloc fifo =>failed | | | sm read unlock | | | sm write lock | | | add segment | | | sm write unlock | | sm read lock | | | try to alloc fifo=>successful sm read lock | | sm read unlock | | | emit CONNECTED/ACCEPTED emit ADD_SEGMENT event | sm read unlock This commit move ADD_SEGMENT notification under the protection of the write lock in some scenarios. Type: fix Signed-off-by: liuyacan <liuyacan@corp.netease.com> Change-Id: I25d5475c5e6d37cfccefa9506f6030c26ce8ee9b
2021-04-23session: set connected session index for ctFlorin Coras1-2/+5
Set connected session index for ct as well. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id82ffcf5572b6a9d2769c0e685c7a0b4d1ea9e9f
2021-04-23tls quic: improve error reportingFlorin Coras1-1/+4
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I92f0c1f7c0f4696fa12071440a643aa703d6306f
2021-04-23session: set fifo's session index before vcl attachliuyacan1-0/+2
Current implementation may have timing issue: 1. The TCP 3-way-handshake is completed but the app is busy and does not process the CONNECTED event. 2. VPP receive some data from peer and try to send a RX event to VCL, but the fifo's client session index is not initialized yet. So this event will be sent to incorrect session 0. Type: fix Change-Id: I54f222232968bfaea5f4745284a1cfacc89482a9 Signed-off-by: liuyacan <liuyacan@corp.netease.com>
2021-04-22session: remove unused connect/listen msg membersFlorin Coras1-5/+0
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie46824f95f9488b04fa1f701ff94345e2dc83de2
2021-04-22vcl session: refactor passing of crypto contextFlorin Coras6-50/+36
Pass tls/quic crypto context using extended config instead of bloating conect/listen messages. Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I0bc637ae310e6c31ef1e16847501dcb81453ee94
2021-04-22vcl session: extended connect/listen configurationFlorin Coras4-18/+65
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic8d9386fef37ffd3446aaeb93a96ee6d60633831
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-15tcp: support for rate sample attr flagFlorin Coras1-1/+9
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I94b8063c9d8f9b811589c6815cb5c8ca6220f2b5
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 Coras8-26/+159
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ifdd6024daf044751895bb8d2deabad41d3a80c92
2021-04-07session: fix coverity warningFlorin Coras2-6/+6
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id2c06f49bcae1a26a2d16d58f9da7a4d3175bf3c
2021-04-06session: basic support for interrupt modeFlorin Coras4-4/+176
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 Coras4-2/+22
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I998c0686f9f7dc556dda8b28e23bbed127d0aafc
2021-04-01session: always clean rx mqs on app detachFlorin Coras1-4/+3
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I47b5b1ad693d131cfc332f6942c86967687a3f2b
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 Coras8-101/+496
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>