Summary:
The existing batch writers do not handle failed writes to the AsyncUDPSocket. A packet that fails to be written is detected as a packet loss later when feedback is received from the peer. This negatively impacts the congestion controller because of the fake loss signal, and artificially inflates the number of retransmitted packets/bytes.
This change adds a new batch writer (SinglePacketBackpressuretBatchWriter) that retains the buffers when a write fails. For subsequent writes, the writer retries the same buffer. No new packets are scheduled until the retried buffer succeeds.
Notes:
- To make sure that retry writes are scheduled, the write callback is installed on the socket when a buffer needs to be retried.
- The retries are for an already scheduled packet. The connection state reflects the timing of the first attempt. This could still have an impact on rtt samples, etc. but it this is a milder impact compared to fake losses/retranmissions.
- Any changes outside of the batch writer only impact the new batch writer. Existing batch writers do not use the fields and are not affected by the changes in this diff.
Reviewed By: kvtsoy
Differential Revision: D57597576
fbshipit-source-id: 9476d71ce52e383c5946466f64bb5eecd4f5d549
Summary:
This is the major transition that updates mvfst code to use the new interfaces. The new Folly implementations of the interfaces maintain all the existing behavior of folly types so this should not introduce any functional change. The core changes are:
- Update the BatchWriters to use the new interfaces.
- Update the FunctionLooper to use the new interfaces.
- Change QuicServerTransport to take the folly types and wrap them in the new types for use in the QuicTransportBase.
The rest of the diff is for updating all the existing uses of the QuicTrasnport to initialize the necessary types and pass them to the QUIC transport instead of directly passing folly types.
Reviewed By: mjoras
Differential Revision: D51413481
fbshipit-source-id: 5ed607e12b9a52b96148ad9b4f8f43899655d936
Summary:
We've been using `--config mvfst.use_libev=true` to link in mvfst mobile instead of full mvfst into CLI tools etc. It allowed for fast initial development, but is a pain when integrating into actual apps (e.g. ig4a).
This change adds a separate set of "mobile" targets that can be used instead of the buck config option.
The main (new) target that will be used is `quic/client:client_mobile` - this is a high level one that will be included by MNS.
Here is a list of all of the new targets:
```
* quic/client:client_mobile
* quic/client:state_and_handshake_mobile
* quic/fizz/client:fizz_client_handshake_mobile
* quic/happyeyeballs:happyeyeballs_mobile
* quic/api:transport_mobile
* quic/api:quic_batch_writer_mobile
* quic/common:events_mobile
* quic/common:timers_mobile
* quic/common:looper_mobile
* quic/common:quic_async_udp_socket_wrapper_mobile
* quic/common:quic_async_udp_socket_impl_mobile
* quic/common:socket_util_mobile
```
Most of the new "*_mobile" targets share a lot of deps with existing non-mobile targets, and I'll collapse those in a separate diff.
Reviewed By: jbeshay, lhuang04
Differential Revision: D49779629
fbshipit-source-id: ec33d9f82244148f57d580d03894823ba6bb4947
Summary: Falling back from GSO to the SinglePacket writer (sendmsg) misses the opportunity to use sendmmsg. This changes the fallback path to be GSO -> sendmmsg.
Reviewed By: kvtsoy
Differential Revision: D48337541
fbshipit-source-id: ab663d28921fd78dd94dadfd7f8cbe36ec027df0
Summary: Broke in one of the previous commits.
Reviewed By: hanidamlaj
Differential Revision: D47962468
fbshipit-source-id: 532e9356cb7e1bba2e45ac0a18440a12aed1eb25
Summary:
The new writer will use a single IOBuf for in-place writes via a
accessor.
Reviewed By: jbeshay, mjoras
Differential Revision: D47648606
fbshipit-source-id: c6094eb3445587337f8a03e203aeadb2954f76b1
Summary:
QuicBatchWriterFactoryMobile.cpp will be compiled for mvfst mobile,
QuicBatchWriterFactory.cpp will be used for normal mvfst.
Reviewed By: jbeshay, mjoras
Differential Revision: D47113897
fbshipit-source-id: eeda30f6205a9eec380f0304fc442464e10b8653