aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session
AgeCommit message (Collapse)AuthorFilesLines
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>
2021-03-26vlib: introduce vlib_get_elog_main()Damjan Marion1-1/+1
Type: improvement Change-Id: I73383eb15186021cd6527d112da8443a0082f129 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-03-26vlib: introduce vlib_get_main_by_index(), vlib_get_n_threads()Damjan Marion4-4/+4
Type: improvement Change-Id: If3da7d4338470912f37ff1794620418d928fb77f Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-03-25svm: add producer wait functionFlorin Coras1-1/+1
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I9488ad7e045c908b60b5821d9c48583f6d513c2f
2021-03-17session: fix populating chained buffersIvan Shvedunov1-3/+5
Type: fix Signed-off-by: Ivan Shvedunov <ivan4th@gmail.com> Change-Id: I3fdc1711d508bc5b0c2f56b3bd3fb4a56056eb54
2021-03-11session tls: deq notifications for custom txFlorin Coras1-0/+4
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I6ed2104e9d79c367ca36460047586f9b632c3315
2021-03-10session: check if fifo exists in cl bound notificationFlorin Coras1-1/+2
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I316575a4b199916920cad6be8f9b49025d6ccc2d
2021-02-28session svm: segment manager and fifo segment leaksFlorin Coras1-0/+2
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I4e00dd7f8ce1e56092dde9a073decae62d5475de
2021-02-24session: init ctrl msg without mq lockFlorin Coras1-102/+96
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I755e6da1fcf6f3bf3c72d6d36c4243b0919b7209
2021-02-15session: coverity fixFlorin Coras1-3/+0
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic28ee0e7cd313686b820e7003a47d17b844b8a89
2021-02-10vcl: validate seg handle on migrate only if neededFlorin Coras1-1/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I3c15a465f84f2ceb6bd5f1c459899824d4bc1c90
2021-02-09tls: dtls initial implementationFlorin Coras2-7/+8
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-02-09session: coverity fixesFlorin Coras1-2/+4
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2828287c58115aa08c0a4297c01cea60f41f4749
2021-02-05session svm: non blocking mqFlorin Coras2-4/+3
Avoid synchronizing producers and the consumer. Instead, only use mutex or spinlock (if eventfds are configured) to synchronize producers. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie2aafbdc2e07fced5d5e46ee2df6b30a186faa2f
2021-01-26session: clear ct fifo flag prior to notificationFlorin Coras1-6/+7
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I6db15780d87426eee852aa020c50cbdf45dc1f95
2021-01-25svm: add custom q implementation for mqFlorin Coras4-16/+17
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 Coras3-24/+25
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
2021-01-07vcl session: switch to generic cert key apisFlorin Coras4-101/+14
Remove the deprecated tls apis. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ia1e12bd813671146f0aca22e83d04c23ac13e595
2020-12-29session: remove fifo segment va allocatorFlorin Coras3-46/+7
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I7b2fd896dfa6df46916f46327975b95561809f00
2020-12-29svm vcl: allow random offsets for fifo segments in appsFlorin Coras2-12/+12
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I1658a9c19d8eae4c9a42c0a111d4ad343b8eb8a4
2020-12-29svm: allow mq attachments at random offsetsFlorin Coras6-45/+56
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic373cd2c11272da539eb4b0db27227f36f2f9688
2020-12-28session: convert evt q segment to fifo segmentFlorin Coras3-19/+21
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I63a44e11322f6fe27255820524e022f6d710b083
2020-12-24svm: split fifo into private and shared structsFlorin Coras8-56/+59
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id8e77e8b2623be719fd43a95e181eaa5b7df2b6e
2020-12-23svm: remove fifo segment heapFlorin Coras1-5/+3
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I518e096fe13847759806ff62009e73fd8f7451b7
2020-12-14session: free segment manager only from mainFlorin Coras1-4/+32
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Idb62154191e85651263be9ae116dd87b93e3a140
2020-12-14misc: move to new pool_foreach macrosDamjan Marion7-50/+50
Type: refactor Change-Id: Ie67dc579e88132ddb1ee4a34cb69f96920101772 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-12-04udp session: fix deq notification for dgramsFlorin Coras1-1/+4
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I1440c11fb9d962a05d877aebb4de364c86f9953e