1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-04-23 02:42:49 +03:00

29 Commits

Author SHA1 Message Date
Alan Frindell
1e1c7defef Use new priority queue implementation
Summary:
This adds the new priority queue implementation and a TransportSetting that controls whether it should be used or not.  The default is still the old priority queue, so this diff should not introduce any functional changes in production code.

One key difference is that with the new queue, streams with new data that become connection flow control blocked are *removed* from the queue, and added back once more flow control comes.  I think this will make the scheduler slightly more efficient at writing low-priority loss streams when there's high-pri data and no connection flow control, since it doesn't need to skip over those streams when building the packet.

If this diff regresses build size, D72476484 should get it back.

Reviewed By: mjoras

Differential Revision: D72476486

fbshipit-source-id: 9665cf3f66dcdbfd57d2199d5c832529a68cfac0
2025-04-17 08:43:19 -07:00
Matt Joras
67ce39cfdd Remove exception throwing from the stream manager and flow control.
Summary: I started with the QuicStreamManager, but it turns out that the path from the manager up to the close path touches a LOT, and so this is a big diff. The strategy is basically the same everywhere, add a folly::Expected and check it on every function and enforce that with [[nodiscard]]

Reviewed By: kvtsoy

Differential Revision: D72347215

fbshipit-source-id: 452868b541754d2ecab646d6c3cbd6aacf317d7f
2025-04-07 23:45:33 -07:00
Aman Sharma
1d82b3a1fd Modifications to currentReadOffset updates for flow control
Summary: With reliable resets, we're not going to advance the `currentReadOffset` to the `finalSize` until the application has read all of the reliable data. This is because we could still buffer additional bytes until we get all the reliable data, so we don't want to prematurely send flow control.

Reviewed By: mjoras

Differential Revision: D67681087

fbshipit-source-id: 9b041ce2ae15ccda4b8c6594759fcfe2deb04f64
2025-01-08 15:23:37 -08:00
Aman Sharma
185d853a9c Operations to conduct on Stream State when sending a reliable reset
Summary:
We appropriately adjust the following when we send a reliable reset:
- Write buffers, retransmission buffers, loss buffers, etc
- The `sumCurStreamBufferLen`, which seems to indicate the number of bytes sent to the transport minus the number of bytes written out to the wire.

Additionally, I'm introducing a `reliableSizeToPeer` variable within the stream state that keeps track of the reliable size we're sending to a peer. In future, we'll use this variable to ensure that we never increase the reliable size.

Note that none of the added logic is hooked up, so it's not executable.

Reviewed By: mjoras

Differential Revision: D64907994

fbshipit-source-id: 2a372a095c03757949c8866241ba20cabf711333
2024-12-04 12:59:58 -08:00
Matt Joras
8e06ca7df7 Change semantics of flowControlWindowFrequency to actually be useful
Summary:
I suspect that this was the intention from the start, which is that updates are triggered after windowSize / flowControlWindowFrequency is read.

For the current math this is ONLY true if the factor is two. Thsi is because it is subtracting curReadOffset from curAdvertisedOffset, which is the amount of window _remaining_.

Change the math so it works more usefully and e.g. frequencies of 4 work as expected. Conveniently, the math still works for factors of 2 which is the only currently usable one without crazy side effects.

Reviewed By: jbeshay, kvtsoy

Differential Revision: D66216119

fbshipit-source-id: 6d19855dea1c26440d7cc6f66a8c2a503cae2caf
2024-11-20 00:34:27 -08:00
Crystal Jin
0cbf9634b4 mvfstEnableFlowControlTimeBasedUpdates -> mvfstDisableFlowControlTimeBasedUpdates
Summary: That way we can keep the default to false in the mc. This makes adding params to ios or other platforms easier

Reviewed By: NishantNori

Differential Revision: D64791939

fbshipit-source-id: 23cf0e7962619d4754a766537a5cb87e92a22487
2024-10-23 14:48:59 -07:00
Aman Sharma
bc386475e5 Integrate RangeChain into write path of QUIC stack
Summary: See title

Reviewed By: mjoras

Differential Revision: D58216871

fbshipit-source-id: 9afc08946a676ec967c998416a6470d4884af550
2024-08-15 05:46:08 -07:00
Konstantin Tsoy
6652c38975 Add a transport setting to diable time based flow control updates
Summary: to experiment with

Reviewed By: sharmafb

Differential Revision: D60847248

fbshipit-source-id: 8e6b873331edfb87319e0758c6946461647c288f
2024-08-06 20:13:45 -07:00
Matt Joras
aefc9e369b Introduce quic::Optional
Summary:
The idea here is to make it so we can swap out the type we are using for optionality. In the near term we are going to try swapping towards one that more aggressively tries to save size.

For now there is no functional change and this is just a big aliasing diff.

Reviewed By: sharmafb

Differential Revision: D57633896

fbshipit-source-id: 6eae5953d47395b390016e59cf9d639f3b6c8cfe
2024-06-11 11:02:02 -07:00
Konstantin Tsoy
c0bee1c03c Autotune for stream flow control
Summary:
Double the initial stream flow control window every time we get a stream blocked from peer.
This essentially reduces the stream blocked spam in RTT constrained conditions and when the initial flow control window was suboptimal.

Reviewed By: mjoras

Differential Revision: D55490692

fbshipit-source-id: 16db0ce63e787feba2bbbed4b8bc79b6925480cd
2024-04-04 16:11:54 -07:00
Konstantin Tsoy
acfe58c9a8 Do not emit blocked frames more than once
Summary: Until a flow control update arrives

Reviewed By: mjoras

Differential Revision: D55528849

fbshipit-source-id: 904543f3d04aae1cbbceb34f5723039dc5fb94e2
2024-04-04 16:11:54 -07:00
Konstantin Tsoy
bf24fea2c8 Proactively send out a blocked stream frame if we've used up all the flow control window on write
Summary: Proactively send out a blocked stream frame if we've used up all the flow control window on write.

Reviewed By: mjoras

Differential Revision: D55527833

fbshipit-source-id: 9dd645cde6c99e413272a2c373ce9a691fa34c28
2024-04-04 16:11:54 -07:00
Konstantin Tsoy
264bf20d9a Update flow control settings names to reflect that these are indeed flow
Summary: Update flow control settings names to reflect that these are indeed flow control

Reviewed By: jbeshay

Differential Revision: D48137685

fbshipit-source-id: a48372e21cdd529480e25785a9bd5de456427ef3
2023-08-18 10:21:24 -07:00
Matt Joras
f5ea4a7c17 Connection receive window auto tuning.
Summary:
This allows the connection receive window to be dynamically increased.

The logic is simple. If the time between successive connection flow control updates is less than the 2 * SRTT, we are seriously connection flow control blocking the sender. In this case we double the target window.

This allows the window to grow to accomodate senders which are actually maintaining a high send rate, for data which is actually being consumed

Reviewed By: afrind

Differential Revision: D34289000

fbshipit-source-id: 6c846b26283846c05aab6fe12e4a361f75a1b423
2022-02-17 13:57:20 -08:00
Hani Damlaj
00e67c1bf9 mvfst License Header Update
Reviewed By: lnicco

Differential Revision: D33587012

fbshipit-source-id: 972eb440f0156c9c04aa6e8787561b18295c1a97
2022-01-18 13:56:12 -08:00
Hani Damlaj
2660a288b3 Update Company Name
Summary: - as title

Reviewed By: lnicco

Differential Revision: D33513410

fbshipit-source-id: 282b6f512cf83b9abb7990402661135b658f7bd1
2022-01-13 12:07:48 -08:00
Yang Chi
38c903ba2f Remove all QUIC_TRACEs
Summary: no longer used

Reviewed By: lnicco

Differential Revision: D28141008

fbshipit-source-id: 870d6574cc1657914a08f1ef5ee581cfef96aad1
2021-05-10 12:46:08 -07:00
Yang Chi
62b0d8b879 QUIC flow control accounts for DSR bytes
Summary:
This was completely missing previously, which led to Client quickly
shutting down a connection with flow control violation when server oversends in
DSR mode.

Reviewed By: mjoras

Differential Revision: D27940953

fbshipit-source-id: 5644c1a3da5217365df9de33258bb5b071ff8187
2021-05-05 09:47:46 -07:00
Yang Chi
7096026c4b Reset QUIC DSR stream
Summary:
clear DSR buffers, release flow control, calling release() on the
packetization request sender. For now the stream will own the sender until
stream itself is dead. We need to change this ownership model later to be able
to reset the pointer when we reset the stream.

Reviewed By: mjoras

Differential Revision: D27901663

fbshipit-source-id: d9d12ef95ae59c6f0fe7ac1b1589d8527b1bc48d
2021-05-04 18:38:59 -07:00
Matt Joras
382c1cdcc6 Remove partial reliability from mvfst.
Summary: As in title.

Reviewed By: yangchi

Differential Revision: D26701886

fbshipit-source-id: c7b36c616200b17fbf697eff4ba0d18695effb45
2021-03-03 15:30:21 -08:00
Andres Suarez
05d07cbfd0 Apply clang-format update fixes
Reviewed By: igorsugak

Differential Revision: D25849213

fbshipit-source-id: a2a538230e769b2c328ae3dd0a19dfbfd693fe3b
2021-01-09 15:39:52 -08:00
Matt Joras
a5ed2117f3 Properly account for unsent data on resetting a stream.
Summary: Without this unsent data is discounted from the effective stream flow control permanently. With enough reset streams this can pile up and potentially deadlock connection flow control.

Reviewed By: yangchi

Differential Revision: D24766394

fbshipit-source-id: 012772f257dcd014bea92e35109e63d30afdc465
2020-11-06 17:25:24 -08:00
Matt Joras
325a6465ec Always send flow control updates again when lost.
Summary: This was probably a premature optimization and introduces complexity for dubious gain. Additionally a sequence of losses could potentially cause multiple updates to be delayed.

Reviewed By: yangchi

Differential Revision: D23628058

fbshipit-source-id: d6cf70baec8c34f0209ea791dadc724795fe0c21
2020-09-10 14:58:59 -07:00
Bharat Parekh
0b88f5dd6f Changes to implement sending connection blocked frames
Summary: Implemented necessary changes to emit DATA BLOCKED frame when a QUIC connection is write blocked.

Reviewed By: mjoras

Differential Revision: D23067313

fbshipit-source-id: f80d7425c9a3c4e9b81405716bcd944c83b97ac2
2020-08-27 15:43:43 -07:00
Yang Chi
7bb0dddf34 Check cipher presence before decide to fire write looper for crypto
Summary: they now can be dropped

Reviewed By: mjoras

Differential Revision: D21476334

fbshipit-source-id: 646b993573fea460b0cd967bdb312cd849ac35d3
2020-05-08 16:17:44 -07:00
Luca Niccolini
5ca21a5278 rename infoCallback to statsCallback
Summary:
```
find ./quic | xargs -I{} sed -i "s/infoCallback/statsCallback/g" {}
find ./quic | xargs -I{} sed -i "s/InfoCallback/StatsCallback/g" {}
```

(Note: this ignores all push blocking failures!)

Reviewed By: mjoras

Differential Revision: D20860675

fbshipit-source-id: 4fe99a375b5983da51b6727d7f40788f89083ab3
2020-04-11 11:16:51 -07:00
Anton Frolov
1482011db5 Remove UNLIKELY and LIKELY calls from mvfst
Summary:
All instancesi of LIKELY and UNLIKELY probably should be removed. We will
add them back in if we see pathologies in performance profiles.

Reviewed By: mjoras

Differential Revision: D19163441

fbshipit-source-id: c4c2494d18ecfd28f00af1e68ecaf1e85c1a2e10
2020-01-06 17:44:07 -08:00
Bonnie Xu
0929100b18 Add transportStateUpdate event
Summary: Add transportStateUpdate event so it can be part of qlog.

Reviewed By: mjoras

Differential Revision: D16342467

fbshipit-source-id: 109189275d44996850b82646bab4a733a3a4c7a1
2019-07-25 11:52:19 -07:00
udippant
50d4939e9e Initial commit of mvfst 2019-04-22 23:42:46 -07:00