1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-08-09 20:42:44 +03:00
Commit Graph

18 Commits

Author SHA1 Message Date
Matt Joras
f041ec17ef Use folly::small_vector for ack blocks
Summary: By modifying `IntervalSet` a bit we can make it so it takes a `folly::small_vector` as the container. We expect that for real traffic there will not generally be a lot of ACK blocks per frame, so optimize for that.

Reviewed By: siyengar

Differential Revision: D18919975

fbshipit-source-id: 199a2ea9ba5003382e2d7d99fc7a6de7e8aafdca
2019-12-12 12:06:31 -08:00
Raghu Nallamothu
e06de27550 Merge Application Close Frame and Connection Close Frame
Summary: As a part of Draft 17, application close frame has been removed, we use connection close frame to represent both application close and connection close.

Reviewed By: mjoras

Differential Revision: D18580856

fbshipit-source-id: d274fa2d3dbc59b926bca5a2b8a20328ae582703
2019-12-03 15:02:06 -08:00
Subodh Iyengar
7ad8cea407 Remove iobufqueue from packetbuilder
Summary:
Get rid of IObufQueue usage in the PacketBuilder and replace it with a vanilla IOBuf.

This requires replacing QueueAppender with something else as well, so this diff adds a new class call BufAppender which does exactly the same things as a QueueAppender.

Having a BufAppender will allow us to avoid cloning the stream buffer in the future and avoid a clone during the write path.

Reviewed By: mjoras

Differential Revision: D18673517

fbshipit-source-id: 31fd7758688686371d038111514eb62d6b21672c
2019-11-28 21:38:28 -08:00
Matt Joras
b6e134fdee Use F14FastMap as the retranmission buffer.
Summary:
The retransmission buffer tracks stream frame data we have sent that is currently unacked. We keep this as a sorted `deque`. This isn't so bad for performance, but we can do better if we break ourselves of the requirement that it be sorted (removing a binary search on ACK).

To do this we make the buffer a map of offset -> `StreamBuffer`.

There were two places that were dependent on the sorted nature of the list.

1. For partial reliablity we call `shrinkBuffers` to remove all unacked buffers less than an offset. For this we now have to do it with a full traversal of the retransmission buffer instead of only having to do an O(offset) search. In the future we could make this better by only lazily deleting from the retransmission buffer on ACK or packet loss.

2. We used the start of the retransmission buffer to determine if a delivery callback could be fired for a given offset. We need some new state to track this. Instead of tracking unacked buffers, we now track acked ranges using the existing `IntervalSet`. This set should be small for the typical case, as we think most ACKs will come in order and just cause existing ranges to merge.

Reviewed By: yangchi

Differential Revision: D18609467

fbshipit-source-id: 13cd2164352f1183362be9f675c1bdc686426698
2019-11-27 00:25:25 -08:00
Aman Sharma
69ac8aeb62 De-templatize stream state machine logic
Summary: The state machine logic is quite abstruse, this modifies it to make it more readable.

Reviewed By: siyengar

Differential Revision: D18488301

fbshipit-source-id: c6fd52973880931e34904713e8b147f56d0c4629
2019-11-19 20:18:11 -08:00
Raghu Nallamothu
e06c0848e0 T24905463 - [quic][ping] Implement ping in Quic
Summary: Implement ping functionality in ping

Reviewed By: yangchi

Differential Revision: D17885286

fbshipit-source-id: 4c328d14a023057d6889818250c0129c06e60874
2019-10-21 17:07:12 -07:00
Subodh Iyengar
cbbc6b0c77 Custom variant for simple frames
Summary: Use a custom variant for simple frames

Reviewed By: mjoras

Differential Revision: D17781068

fbshipit-source-id: e059d33df4651c7e0a1c989cc8651c9cd661b14b
2019-10-07 22:43:32 -07:00
Subodh Iyengar
68c332acb1 Use custom variant type for write frames
Summary:
Use the custom variant type for write frames as well, now that
we use them for read frames.

Reviewed By: mjoras

Differential Revision: D17776862

fbshipit-source-id: 47093146d0f1565c22e5393ed012c70e2e23d279
2019-10-07 22:43:31 -07:00
Subodh Iyengar
04baa15a04 Custom variant type for packetheader
Summary:
Make a custom variant type for PacketHeader. By not relying on boost::variant
this reduces the code size of the implementation.

This uses a combination of a union type as well as a enum type to emulate a variant

Reviewed By: yangchi

Differential Revision: D17187589

fbshipit-source-id: 00c2b9b8dd3f3e73af766d84888b13b9d867165a
2019-09-19 17:31:47 -07:00
Matt Joras
72e677df33 Send windowed stream limit updates
Summary:
Implement sending stream limit updates in a windowed fashion, so that as a peer exhausts its streams we will grant it additional credit. This is implemented by having the stream manager check if an update is needed on removing streams, and the api layer potentially sending an update after it initiates the check for closed streams.

This also makes some driveby changes to use `std::lower_bound` instead of `std::find` for the sorted collections in the stream manager.

Reviewed By: yangchi

Differential Revision: D16808229

fbshipit-source-id: f6e3460d43e4d165e362164be00c0cec27cf1e79
2019-09-18 11:33:03 -07:00
Luca Niccolini
cf842aab47 cleanup some unused includes and using
Reviewed By: yangchi

Differential Revision: D16976466

fbshipit-source-id: c1fc2ee0795997f498ac7431542bbfbf1f0d2fb2
2019-08-24 02:03:39 -07:00
Matt Joras
049b512646 Write stream frame header and data separately.
Summary:
Prior to this diff we would clone out an entire flow control's worth of data from the writebuffer and then clone out a smaller portion of that to write into the packet builder. This is extremely wasteful when we have a large flow control window.

Additionally we would always write the stream data length field even when we are going to fill the remainder of the packet with the current stream frame. By first calculating the amount of data that needs to can be written and writing the header, we can now omit the data length field when we can fill the whole packet.

Reviewed By: yangchi

Differential Revision: D15769514

fbshipit-source-id: 95ac74eebcde87dd06de54405d7f69c42362e29c
2019-08-22 15:59:41 -07:00
Udip Pant
b64e4f99ef Interpret varint in MAX_STREAMS_FRAME as count and not as stream-id
Summary: post draft-17 it is interpreted as count not the max stream id

Reviewed By: mjoras

Differential Revision: D15523021

fbshipit-source-id: 779a1c5269eb8dbcdcd169303caa7a65e467339c
2019-05-28 14:48:56 -07:00
Bonnie Xu
f4ae0a1efd Updated files to change syntax.
Summary: Changed existing chrono syntax to chrono_literals syntax.

Reviewed By: mjoras, sharma95

Differential Revision: D15374649

fbshipit-source-id: 40033e90cca226266ef85e4fec629f290bc5dae6
2019-05-20 12:10:46 -07:00
Alan Frindell
90e5e1b3f1 Split stream state machine into send and receive state machines
Summary: This is step 1 for removing reset on reset, since the send side may need to transition to waiting for a reset ack while the read side is an any state.

Reviewed By: lnicco

Differential Revision: D15075849

fbshipit-source-id: 1e094942a8a1ca9a01d4161cd6309b4136a9cfbf
2019-05-06 14:05:31 -07:00
Udip Pant
4a9537798e Add correct license headers on some missing files
Summary: ^

Reviewed By: sharma95

Differential Revision: D15172546

fbshipit-source-id: bacc832752a433b86962e77bb19aff4504640e60
2019-05-01 22:42:04 -07:00
udippant
79032c7b9b fbshipit-source-id: f498ac5e677b2931d937ba78edd4373ba04dca2a 2019-04-25 21:33:43 -07:00
udippant
50d4939e9e Initial commit of mvfst 2019-04-22 23:42:46 -07:00