aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session
AgeCommit message (Collapse)AuthorFilesLines
2019-08-05session: cache align transport base classFlorin Coras4-19/+20
Type:refactor Also remove tx stats. Expectation is that transports will keep track of them. Change-Id: I083b328d87d0ad3688b630ddb5ef97827a4dbc2b Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-08-01session: session pool migration notificationFlorin Coras6-0/+43
Type: feature Change-Id: Ia9a5b1a6d85c7f3f2e6db583b33b5b20029a1e88 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-08-01vppinfra: refactor clib_rwlock_t to use single condition variablejaszha031-1/+0
Previous implementation of clib_rwlock_t used two spinlocks: one writer lock, and one to guard the counter for the number of readers. This implementation uses a single condition variable rw_cnt which has the following properties: if a writer has the rwlock, rw_cnt = -1 if the rwlock is free, rw_cnt = 0 otherwise, rw_cnt > 0 and rw_cnt = number of readers rw_cnt will never be less than -1 Benchmarking: The results below are the cycle counts from test_rwlock.c, configured so that for 10000 iterations, 6 reader and 6 writer threads on separate cores are spawned such that each writer thread increments a global counter 10000 times in each iteration. For Taishan, 4 reader and 4 writer threads are spawned in each test. x86 Xeon old rwlock: 12.473e8, 11.655e8, 13.201e8, 11.347e8, 13.182e8 x86 Xeon new rwlock: 5.881e8, 5.796e8, 6.536e8, 5.540e8, 5.890e8 Aarch64 ThX2* old rwlock: 9.263e7, 8.933e7, 9.074e7, 8.979e7, 9.378e7 Aarch64 ThX2* new rwlock: 7.221e7, 8.107e7, 7.515e7, 7.672e7, 7.386e7 A72 old rwlock: 3.268e6, 3.200e6, 3.086e6, 3.176e6, 3.170e6 A72 new rwlock: 1.261e6, 1.288e6, 1.251e6, 1.229e6, 1.234e6 *ThunderX2 used additional gcc options "-march=armv8.1-a+crc+crypto+lse" Type: refactor Change-Id: I7c347d3037b36205ab532cbcb52a374c846eb275 Signed-off-by: Jason Zhang <jason.zhang2@arm.com> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com> Reviewed-by: Lijian Zhang <Lijian.Zhang@arm.com>
2019-07-29session: fix vpp to app msg generationFlorin Coras2-66/+28
Type:fix Freeing mq messages in vpp (producer), if enqueueing fails, invalidates consumer assumption that messages can be freed without a lock. Change-Id: I748a33b8846597bdad865945d8e899346d482434 Signed-off-by: Florin Coras <fcoras@cisco.com> Signed-off-by: Tal Saiag <tal.saiag@gmail.com>
2019-07-27session: define connection id lengthFlorin Coras1-3/+10
Type:feature To be used by transports overwriting the connection id. Change-Id: Ia5dbd9dccc2e3eb62e602514b24882ddc12ff1f2 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-07-26session: separate ctrl, new and old eventsFlorin Coras3-89/+88
Type: feature Change-Id: I5e030b23943c012d8191ff657165055d33ec87a2 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-07-26session tcp: handle rxt and acks as custom eventsFlorin Coras6-8/+71
Type: feature Control ack generation and retransmissions with session layer scheduler. Change-Id: Iacdf9f84ab81f44851980aa45a83e75f29be2b7b Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-07-25session: add transport deleted stateFlorin Coras3-10/+14
Type: fix Distinguish between closed and deleted states to avoid deleting the session prior to the transport connection. Change-Id: Ia285ce94b26a70773f8c0ce9d2c73095d3e2a337 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-07-23api: binary api cleanupDave Barach1-1/+2
Multiple API message handlers call vnet_get_sup_hw_interface(...) without checking the inbound sw_if_index. This can cause a pool_elt_at_index ASSERT in a debug image, and major disorder in a production image. Given that a number of places are coded as follows, add an "api_visible_or_null" variant of vnet_get_sup_hw_interface, which returns NULL given an invalid sw_if_index, or a hidden sw interface: - hw = vnet_get_sup_hw_interface (vnm, sw_if_index); + hw = vnet_get_sup_hw_interface_api_visible_or_null (vnm, sw_if_index); if (hw == NULL || memif_device_class.index != hw->dev_class_index) return clib_error_return (0, "not a memif interface"); Rename two existing xxx_safe functions -> xxx_or_null to make it obvious what they return. Type: fix Change-Id: I29996e8d0768fd9e0c5495bd91ff8bedcf2c5697 Signed-off-by: Dave Barach <dave@barachs.net>
2019-07-23session: reorganize dispatch logicFlorin Coras3-153/+141
Type:refactor Change-Id: Id796d0103e61e15c35a586d8cbd3d8916487b84d Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-07-23session: avoid postponing closeFlorin Coras1-14/+0
Type: feature Change-Id: I96e850fc15b79349abbb52d91c0314f255d635be Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-07-19session: improve event loggingFlorin Coras4-60/+49
Type:feature Change-Id: I67a52ee48963a66915e2ebd116626eb9c296a9a5 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-07-19session: Use parent_handle instead of transport_optsNathan Skrzypczak4-6/+6
Type: feature This is mostly used for quic in the case of a stream creation (i.e. connect on an already established QUIC session). We want do default parent_handle to INVALID to be able to distinguish it from parent_handle = 0 Change-Id: Id5ac0b0155a3c44e51334231b711e4fd87a96a10 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-07-17session: move constants definitionFlorin Coras2-2/+3
Type:refactor Change-Id: Ie4a89ae603cd365b28795c92daa08d5943e692ea Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-07-17session: use llist in session node evt handlingFlorin Coras3-66/+145
Type: refactor Change-Id: I24159e0a848f552b4e27acfb5fe6f2cd91b50a19 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-07-17session: grab mq lock until ctrl event is enqueuedFlorin Coras1-2/+1
Type: fix Change-Id: I26a6af7f92316f7a8a5309047b3b3605b87ca327 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-07-16session: fix node enable sequenceVladimir Kropylev1-1/+1
Type: fix Change the sequence to first allocate session_manager and then enable the session-nodes. During “session enable”, sometimes an issue was seen when in some cases POLLING node calls transport_update_time -> tcp_update_time -> tcp_set_time_now which access tcp_main.wrk_ctx before tcp_main_enable allocates the wrk_ctx. 0 0x00007ffff73f7778 in tcp_set_time_now (wrk=<optimized out>) at src/vnet/tcp/tcp.h:953 1 tcp_update_time (now=11.059735140000001, thread_index=<optimized out>) at src/vnet/tcp/tcp.c:1192 2 0x00007ffff75a75de in transport_update_time (time_now=11.059735140000001, thread_index=thread_index@entry=1 '\001') at src/vnet/session/transport.c:740 3 0x00007ffff75a0f4c in session_queue_node_fn (vm=0x7fff74913480, node=0x7fff75e7d5c0, frame=<optimized out>) at src/vnet/session/session_node.c:873 Change-Id: Id2288dd05ba179af2ff22c58bac1331fc21a1c7d Signed-off-by: Vladimir Kropylev <vladimir.kropylev@enea.com>
2019-07-15session: allow transports to generate closed notificationsFlorin Coras5-27/+42
In contrast to the closing notification, whereby a transport informs the session layer that is beginning the closing procedure, this allows transports to notify the session layer of the fact that the transport is "fully" closed, i.e., it expects no more data. Also: - adds app closed state for sessions - changes tcp to have it notify when an active close has finished Type: feature Change-Id: I13c738006c03f85015e05ab82843a33a69382aaf Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-07-12quic: fix show session verboseAloys Augustin1-1/+2
Proprely display quic connections in show session verbose, and add a small fix for UDPC listeners and UDP sessions formatting. Change-Id: I33f83e77bf357347623d87ad23c483aba60a9bb2 Signed-off-by: Aloys Augustin <aloaugus@cisco.com> Type: feature
2019-07-12session: add thread index to all formattersAloys Augustin2-2/+3
Add a thread_index argument to half-open and listener session formatters because QUIC can have listeners and half-open sessions in any thread. Change-Id: I1de60e35ece4c68ba8cfdd6b63f211bc620d687b Signed-off-by: Aloys Augustin <aloaugus@cisco.com> Type: feature
2019-07-09session: notify app of session and transport cleanupFlorin Coras5-3/+39
Type:feature Change-Id: Ic9515c0b11ca6f75503f47ec6b2c58d240afb144 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-07-09tcp: remove warning for multi-seg scnario.Simon Zhang1-1/+0
Type: fix Change-Id: I64e2082bd8ac5b0be21e10407dc29ba4c3f4cab3 Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com>
2019-07-08session: add flag to disable session lookupNathan Skrzypczak5-5/+15
Type: feature Change-Id: I1369859be0a722ea37e5d3ecb35dee5684fc69f8 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-07-08session: target app.fib_index in unbind_uriNathan Skrzypczak1-3/+6
Type: fix Change-Id: Iafcf85315c73bcd73af20bd84b1ccba030e2065b Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-07-03quic: fifo notifications fixAloys Augustin1-0/+1
Add SESSION_IO_EVT_RX handling in session_send_evt_to_thread to allow internal apps to send rx events ("tx notifications") to quic. Add a call to quic_send_packets in quic_custom_app_rx_callback to ensure QUIC ACKs are sent if there is no other activity on the connection. Type: fix Change-Id: I885e01e6475e5b0274f274e9dd34d4a771719e69 Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
2019-06-29svm: rename fifo tx notifications to reflect useFlorin Coras2-3/+3
Type: refactor Change-Id: I651db44acdcb666a9c63e1037352cf88c68795b5 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-06-28session: add half_open_has_fifos for UDPCNathan Skrzypczak4-6/+31
Type: fix Change-Id: Iede83a4e72b88fd55bf56ec0ca71c9196ce743cd Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-06-27session: Add transport vft protocol optionsNathan Skrzypczak5-13/+23
Type: refactor Change-Id: I4e0afc206e4871596c2ed8a6ca00914a379f1526 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-06-25tcp: delivery rate estimatorFlorin Coras2-0/+27
Type: feature First cut implementation with limited testing. The feature is not enabled by default and the expectation is that cc algorithms will enable it on demand. Change-Id: I92b70cb4dabcff0e9ccd1d725952c4880af394da Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-06-24session: full lock on session_send_evt_to_threadNathan Skrzypczak1-10/+2
Type: fix This was causing issues in QUIC when an app client & the protocol app compete for the worker msg_queue. Might not be ideal performance- wise. Change-Id: I629892253d5b5d968f31ad1d56f18463e143d6b4 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-06-20quic: remove session flags identifying Q/S sessionsNathan Skrzypczak1-1/+0
Type: refactor Change-Id: Id68c5ae6d57df0fc556bbf583a66e538e641ffb1 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-06-19session: call session_dequeue_notify after svm_fifo_dequeue_dropVladimir Kropylev1-1/+4
Type: fix dequeue_notify callback at app-layer needs to know available space in fifo, so, session_dequeue_notify should be called after svm_fifo_dequeue_drop Change-Id: I136675d29ec32bea9b33a05deb6710f72ce8d5b1 Signed-off-by: Vladimir Kropylev <vladimir.kropylev@enea.com>
2019-06-17session: use listener_handle instead of listener_indexNathan Skrzypczak6-9/+10
Type: refactor Change-Id: I97fa59a0ba0b6b7a98698926020ffffcf6ae6ba3 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-06-12session: use session handles as app listener handlesFlorin Coras5-63/+51
Type: refactor Change-Id: I421750147a8a821bd0b522daf6c2b7239e551f12 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-06-09svm: improve fifo segment showFlorin Coras1-18/+5
Type: refactor Change-Id: I6933205cfb04bc31cabe6e3b1a8044cace93f84c Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-05-25tcp: handle fin+rst in same frameFlorin Coras1-1/+8
Change-Id: Ie7a6c7b92a6beeb356f01384216a4982fb3d420e Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-05-16Add transport_opts to connect_sock bapiNathan Skrzypczak5-6/+26
Needed by QUIC to distinguish Q/Ssessions Change-Id: Idcc9e46f86f54a7d06ce6d870edec1766e95c82d Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-05-14QUIC multi thread updateAloys Augustin1-1/+1
* Add support for multiple threads * Replace quicly buffers with fifos * Fix cleanup of sessions * Update quicly release version Change-Id: I551f936bbec05a15703f043ee85c8e1ba0ab9723 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-05-14svm: improve fifo segment prealloc supportFlorin Coras1-3/+8
- track fifo segment free and chunk freelist memory - improve fifo alloc. If there are enough chunks to satisfy a fifo allocation request but not enough free memory, allocate a multi-chunk fifo - add apis to preallocate chunks and fifo headers - more tests Change-Id: If18dba7ab856272c9f565d36ac36365139793e0b Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-05-09session: segment manager fixesFlorin Coras2-2/+4
- fix segment size rounding for 4GB segments - fix initialization of first segment size - cleanup fifo segment info retrieval Change-Id: I5ebf20f71ea797087653e7e76fa2e37b2686ec40 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-05-08session: send tx events when data is dequeuedFlorin Coras4-11/+23
Change-Id: Ib8cb19361c42e38e3f68d7147358378fff161eb1 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-05-07add TLS endpoint functionYu Ping1-5/+6
a bit like QUIC, and the added function can get the endpoint info in TLS, so that the VCL layer can get those info correctly Change-Id: Ied7aa3077087c1814499364dfa7654a088ad9910 Signed-off-by: Yu Ping <ping.yu@intel.com>
2019-05-03session/svm: apis for fifo shrinkingFlorin Coras2-0/+65
Change-Id: Ie519683bb90aae6fb95f2a09e251cded1890ed41 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-04-30svm: more fifo refactor/cleanupFlorin Coras3-16/+15
Change-Id: Ie76c69641c8598164d0d00fd498018037258fd86 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-04-26svm: fifo segment support for chunk allocationFlorin Coras2-2/+26
Change-Id: Ie96706b4d8bcb32d2d5f065bc765f95f4e9369e7 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-04-25session: cleanup segment manager and fifo segmentFlorin Coras8-379/+402
Change-Id: I984f347fb465c0c405cef668d8690457e81788e2 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-04-25session: use teps in accept/connect notificationsFlorin Coras6-48/+40
Change-Id: I58e713661a38cecbfdebd4609292d9d12e880cd2 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-04-24Add get_endpoint in transport vftAloys Augustin5-13/+88
This allows QUIC & TLS specific logic to be implemented, and meaningfull IP/port to be returned when connection is overridden. Change-Id: Id79c59fe4d7b16d36f0e96ad3e281c4026b5fe65 Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
2019-04-24QUIC: Add multi-stream support to internal test appsAloys Augustin3-0/+10
Change-Id: Iab07697ef482529e62c11433cffa1f8f894e5bb7 Signed-off-by: Aloys Augustin <aloaugus@cisco.com> Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-04-24session: remove unused fifo allo return valueFlorin Coras3-11/+7
Change-Id: I50a6bcc127e4b44becc4b694bdd3018ac9bfab5c Signed-off-by: Florin Coras <fcoras@cisco.com>