aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/quic/quic.c
AgeCommit message (Collapse)AuthorFilesLines
2021-05-19quic: fix memory leak & crash on connection deleteDave Wallace1-2/+8
- quicly conn struct leaked on connection delete - Occasionally connection delete is called twice before connection is closed which caused a crash. Type: fix Change-Id: Ifaaaeda55f71d58c97fa4d6652bda60a3efd4b69 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2021-05-11quic: alloc ctx on udp threadFlorin Coras1-9/+10
UDP sessions are allocated on first worker because main does not poll. Consequently, quic should also allocate connection on first, to avoid multiple migration events. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ice229a42c399e87150e0f6dd76e2e06ab271556c
2021-05-07session: connects seg manager is always firstFlorin Coras1-3/+0
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-03quic: fix coverity warningFlorin Coras1-2/+2
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I277f2e9ae2b763f5833778406d11218211163e43
2021-05-03quic: improve udp dgram writeFlorin Coras1-10/+7
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2992c66d11fe6adc96b525b0fde533e5ff58d7e4
2021-04-30quic: report number of packets sent on custom txFlorin Coras1-14/+8
A transport's custom_tx function must report the number of segments that it enqueued. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie088c4215e6f17df639159820b8adf46b96fbb46
2021-04-23tls quic: improve error reportingFlorin Coras1-6/+6
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I92f0c1f7c0f4696fa12071440a643aa703d6306f
2021-04-22vcl session: refactor passing of crypto contextFlorin Coras1-6/+17
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-03-26vlib: convert foreach_vlib_main macro to be more gdb and clang-format friendlyDamjan Marion1-12/+11
Type: improvement Change-Id: I1152e58d7bfcb3c4347147f87a834d45ad51cdfe Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-02-15quic: Coverity fixNathan Skrzypczak1-1/+1
Type: fix Change-Id: I744cedb9c1b57945af5e83057e4759964fd2e104 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-01-22quic: quicly v0.1.2 updateMathias Raoul1-85/+139
- update quic plugin with new quicly/picotls API - remove packet allocator - remove crypto batching - update picotls plugin - add cli for quicly congestion control configuration Type: feature Change-Id: If76ef31c43b430eea2f7674539b2112aee0f351e Signed-off-by: Mathias Raoul <mathias.raoul@gmail.com>
2020-12-14misc: move to new pool_foreach macrosDamjan Marion1-10/+10
Type: refactor Change-Id: Ie67dc579e88132ddb1ee4a34cb69f96920101772 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-28quic: Fix protip #47 / unformat (input_line)Nathan Skrzypczak1-19/+41
Type: fix Change-Id: Id03f50c46d28c850865cc76692424d063a0c2cfb Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2020-09-24session tcp udp tls quic: improve cli formattingFlorin Coras1-1/+2
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Iae5dbb8aaaf82d8e95c2ee8bbbe6844c9dd49f80
2020-04-10quic: fix clean stream closeAloys Augustin1-9/+25
Properly close the stream sending side instead of resetting the entire stream. Change-Id: I2daca7e507daa7bf9cd6a27fa8828a9ea7d175f9 Type: fix Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
2020-04-04session tls: support tls deschedulingFlorin Coras1-1/+1
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ieb8bb9c6deb92479fdd3e045778fe5ae4782d1ea
2020-04-03session: improve error reportingFlorin Coras1-9/+11
Type: improvement Change-Id: I9dd850a1ce85b0adb5136233f176117e0ee38817 Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-04-03session udp: fix transport flags and migrationFlorin Coras1-4/+4
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I840d43e79b1f826380bd56485441510e45bdfc7f
2020-04-01session udp: support connect on listenersFlorin Coras1-1/+1
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I6aaaec20a2b6d4c6ddfbe659d9402acc1be2f7e2
2020-03-30session udp: flag for connected udpFlorin Coras1-2/+4
Type: improvement This can be used as alternative to udpc Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic3f7efe6728b25d4a8a0b61ddb36de66b4672c4f
2020-03-27quic: Check quicly version tag at compile timeMathiasRaoul1-11/+7
- updates the quicly version to 0.1.0-vpp - adds workaround for quicly_send()/assert_consistency() failure Type: feature Change-Id: I4c7e0ffc720ad9a685b89046a83646d59febd6cd Signed-off-by: MathiasRaoul <mathias.raoul@gmail.com> Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com> Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2020-03-25session: api to add new transport typesFlorin Coras1-0/+2
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: If4dee6dba1ea942daa921d566b35cdecdda680ee
2020-03-24quic: disable vnet_crypto and batching if no crypto engines are loadedMathiasRaoul1-2/+12
Type: fix Change-Id: I95d3f8431b468cefc8777526dd3b988a299f0687 Signed-off-by: MathiasRaoul <mathias.raoul@gmail.com>
2020-02-25svm: refactor fifoFlorin Coras1-17/+2
Type: refactor Switch from a wrapped byte space to a "continuous" one wherein fifo chunks are appended to the fifo as more data is enqueued and chunks are removed as data is dequeued. The fifo is still subject to a maximum size, i.e., maximum number of bytes that can be enqueued, so the max number of chunks associated to the fifo is also constrained. When enqueueing data, which must fit within the available free space, if not enough "supporting" chunk memory is available, the fifo asks the fifo segment for enough chunk memory to ensure that the write can succeed. To avoid allocating large amounts of small chunks due to small writes, if possible, the size of the chunks requested is lower capped by min_alloc. When dequeuing data, all the chunks that have been completely drained, i.e., head moved beyond the chunks’ end bytes, are unlinked from the fifo and returned to the fifo segment. The one exception to this is the last chunk which is never unlinked. Change-Id: I98c1dbd9135fb79650365c7e40c29238b96cd4ee Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-01-31quic: quicly crypto offloadingMathiasRaoul1-6/+91
- Implement our own quic packet allocator to allocate more memory at the end of the packet to store crypto offloading related data - 1RTT packets offloading encryption/decryption using vnet crypto - Add cli to change max packet per key Type: feature Change-Id: I7557fd457d7ba492329d5d8ed192509cbd727f9c Signed-off-by: MathiasRaoul <mathias.raoul@gmail.com>
2020-01-31quic: update quicly to v0.0.10-vppMathiasRaoul1-1/+1
Type: feature Signed-off-by: MathiasRaoul <mathias.raoul@gmail.com> Change-Id: I5452f8bbd0ff9e2a57f7bd7d134a8824efa5f30a
2020-01-06quic: call quic_send_packets only once per ctxAloys Augustin1-3/+7
This prevents unnecessary calls to quic_send_packets. Type: fix Change-Id: I7abe509aa8b7b9d5a01c9876046cf0f4507a79cf Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
2020-01-02session: fix listener global endpoint lookupFlorin Coras1-1/+1
Type: fix Ensure listeners for app transport protocols are added to lookup tables using their session endpoints instead of their transport connections, which can override the network connection id in the transport connection. Change-Id: I56fa3666bb1422c0799fc7143cd099751ff6e2e6 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-12-19quic: fix accept failureNathan Skrzypczak1-23/+23
Type: fix Change-Id: Ic85cedae268a3abc452a2b1d4cc6672a464e2d2c Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-12-18quic: Hotfix crypto context on migrateNathan Skrzypczak1-0/+17
Type: fix quicly_connections have internal references to crypto contexts which need to be updated when we switch thread as the supporting pools are thread-based. This under the assumption that the new contexts will be exactly identical Change-Id: I38083e59657ff068e347d9e7b47abe91a1167b6c Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-12-17quic: Implement crypto contextsNathan Skrzypczak1-68/+229
Type: feature Make quic use the crypto contexts. This introduces a crypto context pool backed by a hashtable giving ctx indexes by connect params (ckpair, engine, rx & tx fifo sizes). Applications keep the initialization vector common. Change-Id: I22ed6711196cd70a2f2f74240f12113c7af8dfcd Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-12-17quic: update quicly to v0.0.8-vppMathiasRaoul1-0/+1
Type: feature Signed-off-by: MathiasRaoul <mathias.raoul@gmail.com> Change-Id: I7470d79d1e39716ff83ba2d2b320813d79e2554c
2019-12-11quic: Add support for unidirectional streamsNathan Skrzypczak1-5/+14
Type: feature Change-Id: I3a642626a444504594c5e3df40dbc92df54136f0 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-12-11quic: Use per thread next_cidNathan Skrzypczak1-7/+9
Type: fix Change-Id: Ia89427257b78f6f7ba62c9d1076bf0593ee2dca7 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-12-11quic: Add aggregated quicly statsNathan Skrzypczak1-67/+186
Type: feature Change-Id: Ice8de7030a0330cfe77a58657701f0703e0695dd Signed-off-by: MathiasRaoul <mathias.raoul@gmail.com> Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-12-11quic: add more detailed statisticsMathiasRaoul1-0/+61
Type: feature Change-Id: I3df7b054ec08c7b307413d24468fc3df6a5aacc3 Signed-off-by: MathiasRaoul <mathias.raoul@gmail.com>
2019-12-10quic: removing quicly_send call from quic_accept_connectionMathiasRaoul1-9/+21
Type: fix Signed-off-by: MathiasRaoul <mathias.raoul@gmail.com> Change-Id: I429b50b88c8e029b06854c7433d0bc77619e98a3
2019-12-04quic: fix stream tx_fifo race conditionNathan Skrzypczak1-27/+48
Type: fix There is a race condition in when receiving TX from a client application : As egress_emit writes as much data as possible to the stream, if during egress_emit the app writes to the fifo, the data will be directly passed to quicly. Then TX callback happens and triggers a scheduler update telling quilcy the stream has data to send. When the next egress_emit is called and no more data has come, we have nothing to write, we return len = 0 to quicly which breaks an assert if a loss happens later on. Change-Id: I47e00a14dfc9068b5dac7b5c090a89124aea004f Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-12-04quic: clean accept/connect error codepathNathan Skrzypczak1-48/+51
Type: fix First attempt to clean the leftover state when accept_notify / connect_notify fails due to mq size constraints. vpp should now be left in a state such that clean state will eventually be reached when timers fire. Change-Id: I9e1166dab2778bf05d5af42d437769651369cae0 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-12-04quic: refactor connection search fnNathan Skrzypczak1-27/+31
Type: refactor Change-Id: I55aace44773e4fab0470d27b14dd68544f7d99c5 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-12-04quic: add conn-timeout config optionNathan Skrzypczak1-8/+10
Type: feature Change-Id: Ia9cb57b9f7c2d14a137556d6918763f1cb11850d Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-12-04quic: fix import typoNathan Skrzypczak1-1/+1
Type: fix Change-Id: Iab96ebc1579b0be5b711f975163f9ac96648d2ad Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-11-26quic: Refactor for crypto contextsNathan Skrzypczak1-154/+113
Type: refactor Change-Id: I5ec7079d34826edd7a3048ae1d44037386f5d3ff Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-11-22quic: Refactor quic rx callback for offloadNathan Skrzypczak1-111/+127
Type: refactor Change-Id: I1d90c8807e7eea4a77403bafc0628ec0d393c572 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-11-22quic: Remove qctx opening poolNathan Skrzypczak1-33/+15
Type: fix We don't need the pool anymore as we store the ctx index in the underlying UDP session opaque Change-Id: Iec9be9c84a1f929d94b084176a143d304b0acb83 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-11-20quic: Increase loggingNathan Skrzypczak1-29/+40
Type: fix Change-Id: I689649ad163e76fecdabe96a8c2be5be3068ffde Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-11-19quic: handle duplicate packet from quiclyDave Wallace1-2/+15
Type: fix Signed-off-by: Dave Wallace <dwallacelf@gmail.com> Change-Id: Ia4b1eb3c704374e27b260d88ae6ab628754468d3
2019-11-07quic: Add support for ckpair & crypto engineNathan Skrzypczak1-19/+46
quic choice used ckpair is now the one passed to connect or listen via mq. The crypto engine is chosen with the value passed to connect or listen via mq: * If NONE(0) is provided, we default to quic_main. default_crypto_engine (picotls at init, can be changed via debug cli : quic set crypto api [crypto engine]) * If PICTOLS/VPP is provided, use this one * Other values return an error Type: feature Change-Id: Ifab893d6d03c83f202e6c7e7a9936f546a4b1530 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-11-06quic: free qctx after udp cleanupNathan Skrzypczak1-22/+58
Type: fix As udp_session.opaque is qctx index, qctx free needs to happen after session cleanup. This patch also introduces * assert timer stop on ctx free * debug cli for listing quic ctx Change-Id: I3a58d226b094a0bbdf090b4f3eccbc2e11c6329b Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-11-04quic: enhance error reportingDave Wallace1-6/+19
Type: refactor Signed-off-by: Dave Wallace <dwallacelf@gmail.com> Change-Id: I710d00e4a6c4356d0f00f7592bf14b55596ec6ae