Commit Graph

41 Commits

Author SHA1 Message Date
06a6a30f91 tls: allow engines to customize close
Change-Id: I11ac3e4f59206902e5dfc326f815c877c5dd6643
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-04-18 07:52:17 +00:00
69b68ef1a9 session: use app cb function wrappers
Change-Id: I77ad9eb4d4c7699397aa4be6a973ef37c60db4c5
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-04-02 21:12:56 +00:00
ddd98f3483 tls: make first segment and fifo size configurable
Change-Id: I6169ebdd3ac2d5d77fd2e12068c8aab6d8072c03
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-03-25 20:04:23 +00:00
bf7ce2cd3c tls: fixes and improvements
- disconnect sessions through session layer apis instead of directly
notifying the app worker.
- improve cli
- increase fifo sizes for tls app

Change-Id: I8a7d2865b3b00724e2a9da29fa4a906ea867da9b
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-03-11 09:15:01 +00:00
f8d2e86099 session/tls: remove unused t_app_index field
Change-Id: Idbf7f3a57dc399798b8dba9463daeb7d66470ab1
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-03-07 10:17:24 +00:00
f940f8a40f session: use transport custom tx for app transports
Change-Id: I675f7090fa6b2ffdfb4ee748df858bfb7e39ce5a
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-03-07 00:47:42 +00:00
fe97da3203 session: cleanup instances of deprecated io evts
Change-Id: Iad119e05ae5e570fbfcf66747c95822cee647c99
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-03-07 00:47:23 +00:00
8a140616a5 tls: add vcl test
Change-Id: If4c7efaf6506a827e7a95a56c2f6b6060df03fa1
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-02-20 09:34:30 +00:00
df57ea0a3e tls: fix openssl/mbedtls use of app_wrk index
Change-Id: I7ccc948357d815a1bd4279a7079cf4db2949183c
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-02-18 20:43:29 -08:00
a27a46eaeb session: move fifo allocation logic to app worker
Change-Id: I1662ec4b5503cb64a8a86a2441842311d959b3a6
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-02-18 19:06:39 -08:00
c1a4265b4b session: cleanup application interface
Change-Id: I89d240753b3f3c5e984aa303a7c8fa35fa59bf7f
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-02-11 16:05:37 +00:00
c9940fc20b session: refactor listen logic
Make app-listener the handle for app listens. Consequently transport and
local listen sessions are now associated to the app-listener.

Change-Id: I9397a26d42cccb100970b6b4794c15bac2e11465
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-02-09 16:17:32 +00:00
1ee7830e9e transport: cleanup
- move transport specific types to transport_types
- add transport wrapper functions for interaction with transport
protocol vfts

Change-Id: I93f70d884585fc2f41c4a605e310c80e8a8972f2
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-02-06 16:56:39 +00:00
288eaab596 session: cleanup part 1
Rename core data structures. This will break compatibility for out of
tree builtin apps.

- stream_session_t to session_t
- server_rx/tx_fifo to rx/tx_fifo
- stream_session.h to session_types.h
- update copyright

Change-Id: I414097c6e28bcbea866fbf13b8773c7db3f49325
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-02-04 22:00:54 +00:00
58a93e8ef2 tls: preallocate app sessions on connect/accept
Avoid allocating session and possibly reallocating thread session pool
on builtin session rx.

Change-Id: I70e7c604678b44ce8d22603489e247a2c5faa439
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-01-17 20:31:54 +00:00
d8e94ba823 Fix an issue in tls.c
Curernt code will overwrite parent_app_api_context, and defer the
setting after this value is used in callback.

Change-Id: Ie16e432fd0f4214e6deff3aa3b58b3be824b0331
Signed-off-by: Ping Yu <ping.yu@intel.com>
2019-01-03 00:16:46 +00:00
5a2ec8fc41 session: free session after transport and app confirm
In addition to that, a bit of refactoring.

Change-Id: Iea1eabc2167bcdef185ec53bc09bae087c5398e6
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-28 20:41:44 +00:00
fa76a76bf3 session: segment handle in accept/connect notifications
Change-Id: I03884b6cde9d4c38ae13d1994fd8d37d44016ef0
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-11-30 07:21:02 +00:00
178cf493d0 Remove c-11 memcpy checks from perf-critical code
Change-Id: Id4f37f5d4a03160572954a416efa1ef9b3d79ad1
Signed-off-by: Dave Barach <dave@barachs.net>
2018-11-14 15:54:01 +00:00
5665cedf57 session: extend connect api for internal apps
Change-Id: Ie4c5cfc4c97acb321a46b4df589dc44de1b616ba
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-10-28 14:57:26 +00:00
b7b929931a c11 safe string handling support
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab
Signed-off-by: Dave Barach <dave@barachs.net>
2018-10-23 13:06:46 +00:00
c01d578a62 tls: fix connection failures/interrupts at scale (VPP-1464)
Change-Id: I0bc4062c1fd3202ee201acb36a2bb14fc6ee1543
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-10-18 18:47:20 +00:00
eb97e5f548 tls: fix multi threaded medium scale test (VPP-1457)
- ensure session enqueue epoch does not wrap between two enqueues
- use 3 states for echo clients app, to distinguish between starting and
closing phases
- force tcp fin retransmit if out of buffers while sending a fin

Change-Id: I6f2cab46affd1148aba2a33fb6d58bcc54f32805
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-10-16 17:14:39 +00:00
ef91534e66 tls: fix disconnects for sessions with pending data
TLS can enqueue events to itself when app session queue cannot be
entirely drained. If a pending disconnect is handled before any such
event, session layer may try to dequeue data on deallocated sessions.

Change-Id: I5bfc4d53ce95bc16b6a01e1b0e644aafa1ca311b
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-10-02 07:09:05 +00:00
b5e94e3c85 tls: use application interface apis
This also exposes app to tls sessions. As a result "sh session verbose"
will show for each tls session both the application's session (app to
tls) and the tls session (tls to tcp).

Change-Id: I1e65c63362ce58f314e762d7db78b44479e1e3a5
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-09-15 08:10:27 +00:00
2179513b71 session: lock app worker mq for io events
Also fixes vcl client/server stats and closing procedure.

Change-Id: I7d5a274ea0a3c8ea13062bf61bf402248dfe1a19
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-09-10 03:15:16 +00:00
da3eec1672 session: detect namespace for transport apps
Change-Id: I770607cb213d538a29d7bd5762682981b01e9d18
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-09-08 12:12:13 +00:00
74cac8839e session: fix reentrant listens
Change-Id: I72d400401a308012b43513179870823f6f921e44
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-09-07 21:30:44 +00:00
ab2f6dbf9f session: support multiple worker binds
Allows app workers to listen on the same session endpoint. Incoming
connects are spread across the workers in a round-robin fashion

Change-Id: Ib5f5817230d9abc6127a85cdbdcad70d980c0f7f
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-09-06 08:35:51 +00:00
e6446a3cd5 Fix race condition in tls half open ctx get/put
Change-Id: I603094215162bfe7d41bbff1b9fe8ab974aa3fab
Signed-off-by: Ping Yu <ping.yu@intel.com>
2018-08-29 17:34:14 +00:00
57791ad4de tls: fix handling of failed connects
Change-Id: I48f32fdf1859420d2966dd8553f3a8f9a082e2ae
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-08-28 08:24:50 +00:00
1553197f9a session: add support for multiple app workers
Refactor session layer to support multiple workers per application.

Change-Id: Ie67354688d396449d14bbbb8c56050206e307cd8
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-08-24 19:05:25 +00:00
decda5b466 optimize init_server to reduce session overhead
move un-necessary session based operation to listener
split orignal openssl ctx to be session based ctx and listen ctx

Change-Id: Id6c54f47b0e2171fd8924a45efcd5266ce5402d5
Signed-off-by: Ping Yu <ping.yu@intel.com>
2018-08-17 14:48:10 +00:00
a0c29a9a8a Fix a segment fault issue in TLS
The root cause is it uses a dangling reference after memory move
Need to call session_alloc first, then use index to get the app
listener point

Change-Id: If5b7e0d6ddc761e5327660c47ce620e375319b4d
Signed-off-by: Ping Yu <ping.yu@intel.com>
2018-08-16 19:11:05 -04:00
3c2fed5145 session: use msg queue for events
Change-Id: I3c58367eec2243fe19b75be78a175c5261863e9e
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-07-17 09:02:17 +00:00
5c9083d526 session: use generic session pool for listeners
Change-Id: I825f3822910a6ee368b9004e39ca16ac6833e30c
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-04-16 07:33:57 +00:00
cc5677b496 No need for this routine to be global
Causes subtle misbehavior elsewhere

Change-Id: I3a0ade26e8e03b8c5dc8e722f6a01fb99ec7a1e0
Signed-off-by: Dave Barach <dave@barachs.net>
2018-03-29 08:10:53 +00:00
0bee9ce4af session: allow builtin apps to register names
Change-Id: I4b428e170436671b329657283cf7653befc85c9f
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-03-23 14:20:10 +00:00
5090c57c4d session: fix coverity warnings
Change-Id: I022dc40476ea9c30957b12bf1bd0629c6eb41cda
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-03-19 17:15:56 +00:00
58d36f02b4 tls: add openssl engine
Change-Id: I6c215858d2c9c620787632b570950b15274c0df2
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-03-15 15:04:11 +00:00
d77eee64b1 tls: make tls engines pluggable
- add infra for pluggable tls "engines"
- makes mbedtls specific code a plugin

Change-Id: I2c5b099e2b69d2be0038e3ef02b208ff907727e7
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-03-08 21:53:33 +00:00