1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-11-03 12:33:15 +03:00
Commit Graph

49 Commits

Author SHA1 Message Date
Paul Farcasanu
aa90d99d76 move qlog to transport lite
Summary:
Context: T210787480

I want to add a client-side qlog that will allow us to inspect client behavior during the 0rtt bug.

Reviewed By: jbeshay

Differential Revision: D71145234

fbshipit-source-id: 7816f0a759ba4f60107aaf40c4376ced7c5d03f8
2025-04-01 20:10:07 -07:00
Joseph Beshay
31fbb343d1 Decode ACK_EXTENDED frame
Summary:
Add functionality for decoding the new ACK_EXTENDED frame.

Frame format:
```
ACK_EXTENDED Frame {
  Type (i) = 0xB1
  // Fields of the existing ACK (type=0x02) frame:
  Largest Acknowledged (i),
  ACK Delay (i),
  ACK Range Count (i),
  First ACK Range (i),
  ACK Range (..) ...,
  Extended Ack Features (i),
  // Optional ECN counts (if bit 0 is set in Features)
  [ECN Counts (..)],
  // Optional Receive Timestamps (if bit 1 is set in Features)
  [Receive Timestamps (..)]
}
// Fields from the existing ACK_ECN frame
ECN Counts {
  ECT0 Count (i),
  ECT1 Count (i),
  ECN-CE Count (i),
}
// Fields from the existing ACK_RECEIVE_TIMESTAMPS frame
Receive Timestamps {
  Timestamp Range Count (i),
  Timestamp Ranges (..) ...,
}
Timestamp Range {
  Gap (i),
  Timestamp Delta Count (i),
  Timestamp Delta (i) ...,
}
```

Reviewed By: sharmafb

Differential Revision: D68931149

fbshipit-source-id: 7eab52449db60fc41a5bf9aa48c0f695ccaca3f0
2025-02-24 12:32:50 -08:00
Konstantin Tsoy
d98c90c48d Change onReadData() to return an error
Summary:
All according to plan: https://fburl.com/gdoc/pebccgi1
Changing function definitions to return errors while still throwing.

Reviewed By: sharmafb

Differential Revision: D69567329

fbshipit-source-id: 5d40ee32fe185d5674785632a9a13e4cef996988
2025-02-14 19:21:05 -08:00
Konstantin Tsoy
476607c217 Clean up inline writes param
Summary: Clean up inline writes param

Differential Revision: D68977602

fbshipit-source-id: 4edb4ca08605fab76b56e706c2ccc85836018594
2025-02-04 23:51:44 -08:00
Konstantin Tsoy
14d8a46842 Clean up mvfstCheckIdleTimerOnWrites param
Summary: Clean up mvfstCheckIdleTimerOnWrites param

Reviewed By: sharmafb

Differential Revision: D68972795

fbshipit-source-id: f19f9947fa8a8affe4c4411c22d893cb95d71fe0
2025-02-04 23:51:44 -08:00
Matt Joras
b4b50d198e Add some logs to getStream CHECKs
Summary: As in title.

Reviewed By: jbeshay

Differential Revision: D68779912

fbshipit-source-id: 8161c8ab2d579a43c7283c70a8f1e231304b5b7e
2025-01-28 14:32:09 -08:00
Aman Sharma
6800a7511e API for reliable resets
Reviewed By: jbeshay

Differential Revision: D67360862

fbshipit-source-id: 163f030b866a5ba6fa89f8b97bb15875f8bbf2a0
2025-01-28 12:37:29 -08:00
Aman Sharma
29f6071b75 Make a checkpoint function for reliable resets
Summary: I'm making a `checkpoint` function in the QUIC API. This is to be used in conjunction with reliable resets. When we send data on a stream and want to mark which offset will constitute the reliable size in a future call to resetStreamReliably, we call this function. This function can potentially be called multiple times on a stream to advance the offset, but it is an error to call it after sending a reset.

Reviewed By: jbeshay

Differential Revision: D68592906

fbshipit-source-id: e301385a04dffdb9f23daa805ee74c574e4393c2
2025-01-28 10:52:55 -08:00
Aman Sharma
9e8fa06fb7 Fire readError and remove readCb only when reliable data has been read
Summary: See title

Reviewed By: afrind

Differential Revision: D67766485

fbshipit-source-id: 7283b438317f7b750e274414790777c7dd1572e9
2025-01-16 16:00:15 -08:00
Aman Sharma
2795a0d760 Make a more generic cancelByteEventCallbacksForStreamInternal
Summary:
With reliable resets, we'll want to cancel byte events where the offset is beyond what needs to be reliably delivered. Right now, we only have the functionality to cancel all byte events, or only those up to a certain point.

I'm adding a more generic `cancelByteEventCallbacksForStreamInternal` that takes in a function that can be used to determine which byte events need to be removed.

Reviewed By: afrind

Differential Revision: D67353621

fbshipit-source-id: fa7e758ee6cd40d247392108c28118b604ad6dbc
2024-12-23 13:21:30 -08:00
Aman Sharma
b7449f8385 Make a resetStreamInternal
Summary: I'm moving the implementation of `resetStream` to `resetStreamInternal` so that we can reuse a large chunk of the functionality when we implement reliable resets.

Reviewed By: kvtsoy

Differential Revision: D67303220

fbshipit-source-id: 16efce46570a0742e570d9b0b34a9477f9efbbdc
2024-12-18 12:42:38 -08:00
Aman Sharma
683b982c15 Remove superfluous looping through all resets
Summary: There's no need to loop through all the streams if we're just resetting one.

Reviewed By: hanidamlaj

Differential Revision: D67304631

fbshipit-source-id: 4817459ca7d1c1fd906b7640a0089c1c52e6e485
2024-12-17 22:29:50 -08:00
Aman Sharma
1528cf4d1a Modify sendRstSMHandler for reliable resets
Summary: This is just some additional plumbing that we need in order to send reliable resets. It's still not hooked up end-to-end, so we can't yet send reliable resets.

Reviewed By: mjoras

Differential Revision: D66772108

fbshipit-source-id: ee189959751ed03e294c6ef418d75d8ad4959690
2024-12-06 03:06:50 -08:00
Alan Frindell
900e22e18d Allow unset read callback during connection close
Summary:
setReadCallback didn't function properly during shutdown

1) it was completely ignored when state_ == CLOSING
2) cancelAllAppCallbacks made a copy of readCallbacks_

This is problematic for application constructs that use groups of streams -- eg: HTTP WebTransport.  When one stream (the WebTransport session) is reset during shutdown, it needs to clean up any dependent streams as well, including preventing them from getting error callbacks.

The fix is to use only the streamId's from readCallbacksCopy for iteration, but look up the actual callback value from readCallbacks_.

Note: there's an as yet unhandled corner case which is that a readError callback installs a new stream read callback, but it seems far fetched enough I'm not including a fix here.

Reviewed By: sharmafb

Differential Revision: D48159644

fbshipit-source-id: c9d522a6b200538193969d60d242a505831e4cd0
2024-12-04 14:05:11 -08:00
Joseph Beshay
816ac9089e Enable the experimental pacer for bbr2/bbr_testing
Summary:
This re-enables the experimental pacer for bbr2 and bbr_testing, and removes fireLoopEarly by default.

FireLoopEarly can still be enabled via a knob.

Reviewed By: ritengupta, kvtsoy

Differential Revision: D65919713

fbshipit-source-id: e5d08a807be091c11326e9705601bd9e6bf79991
2024-11-15 20:28:26 -08:00
Uri Hindri
b92b3232f4 fix wrong lambda call bug
Summary:
When using msvc and compiling quic with C++20 there's a weird issue that the Looper is initialized with the wrong callbacks.

I suspect that this is because the constructor was creating the lambda as part of the header file.
Moving the constructor code to the cpp file fixed the issue

Reviewed By: hanidamlaj, kvtsoy

Differential Revision: D65994029

fbshipit-source-id: 9c5f47b62d0e0c74b5bce05f926e437e6aa2a3ab
2024-11-15 13:34:22 -08:00
Aman Sharma
1cc00f77a4 Move core functionality to QuicTransportBaseLite [24/n]
Summary:
There are many files in this diff, but the relevant ones are:
* quic/api/QuicSocket.h
* quic/api/QuicSocketLite.h
* quic/api/QuicTransportBase.h
* quic/api/QuicTransportBaseLite.cpp
* quic/observer/SocketObserverContainer.h

The purpose of this is to include the observer functionality within the Lite class. Ideally, we'd remove it from the Lite class, but that's going to require some more detailed changes to the interfaces we're using, because observers are used quite a lot within common code (for example, AckHandlers.cpp).

I'll make those changes some time after the QuicTransportBase split, as they're going to take a while.

Reviewed By: jbeshay, mjoras, kvtsoy

Differential Revision: D65685667

fbshipit-source-id: feb07bcf35d6af2e5c2b538ff463b01b67c6aff9
2024-11-14 13:02:10 -08:00
Crystal Jin
95898ef8b7 Fall back to evb timer if no pacer timer set
Reviewed By: kvtsoy

Differential Revision: D65848549

fbshipit-source-id: 38c1e9b8c820dbe2848cb132d7e49079c45eb67d
2024-11-13 16:57:21 -08:00
Crystal Jin
a5fd828b90 Move setPacingFunction to when pacer is set
Reviewed By: hanidamlaj

Differential Revision: D65845962

fbshipit-source-id: 9d14e9845c6232b9825c20c7c67e2f49ac2fed73
2024-11-13 10:39:16 -08:00
Aman Sharma
c10bf16cfc Move core functionality to QuicTransportBaseLite [23/n][take 2]
Summary: This is pretty much the same as D65605100, which was reverted due to a cycle detection ([link](https://fb.workplace.com/groups/mobile.sheriffs/posts/27342968238658432/?comment_id=27343054638649792)). It turns out that the issue was that I didn't run `xplat/cross_plat_devx/somerge_maps/compute_merge_maps.py`.

Reviewed By: jbeshay

Differential Revision: D65761171

fbshipit-source-id: fc852ec13e54ea6ea45b4fda6b4556a78f38fc7f
2024-11-11 18:44:57 -08:00
Alex Jackson Lambert
f8a5876111 Revert D65605100: Move core functionality to QuicTransportBaseLite [23/n]
Differential Revision:
D65605100

Original commit changeset: aaa7f394b669

Original Phabricator Diff: D65605100

fbshipit-source-id: a087043af67d5ea30ab6d040162d1e72fdf67425
2024-11-08 19:24:37 -08:00
Aman Sharma
3f7555ae98 Move core functionality to QuicTransportBaseLite [23/n]
Summary: See title.

Reviewed By: hanidamlaj

Differential Revision: D65605100

fbshipit-source-id: aaa7f394b6699401ff84c1e5ed010e42670e39f0
2024-11-08 18:08:32 -08:00
Matt Joras
65bc1417f3 Add alpn to transport summary event
Summary: As in title, useful.

Reviewed By: kvtsoy

Differential Revision: D65508296

fbshipit-source-id: f068611399797df4dd422828373b1ddbbceec7df
2024-11-05 18:12:45 -08:00
Aman Sharma
a4247ec4d5 Move core functionality to QuicTransportBaseLite [21/n]
Summary: See title.

Reviewed By: mjoras

Differential Revision: D65282152

fbshipit-source-id: 273a2df9aca0aa84b2e1137d99a473e02de0953b
2024-11-01 11:46:43 -07:00
Aman Sharma
ae605980c5 Move core functionality to QuicTransportBaseLite [20/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64971971

fbshipit-source-id: 91c9fddcf77bbf26fa86bb00a1fa7f6c3b6f55dc
2024-10-30 10:53:30 -07:00
Matt Joras
80bd5e5f37 Rework the interactions between the per packet callbacks.
Summary:
Our main use case for this right now is on the client side. So don't waste time doing all the callbacks per packet.

Also make it so the read callbacks don't update the loopers and check for closed streams every packet, defer that to the upper layer. In practice this means that when both options are on, these callbacks (besides the read callbacks) / checks / looper updates only happen once per read event.

Reviewed By: kvtsoy

Differential Revision: D65037206

fbshipit-source-id: 71119c9d2d857fcde747ea68676375d44b52c82f
2024-10-27 16:04:39 -07:00
Richard Barnes
b0749a562e Remove unused-but-set variables in quic/api/QuicTransportBaseLite.cpp +1
Summary:
Required for LLVM-19 upgrade.

This diff removes a variable that was set, but which was not used.

LLVM-19 has a warning `-Wunused-but-set-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused but set variables often indicate a programming mistake, but can also just be unnecessary cruft that harms readability and performance.

Removing this variable will not change how your code works, but the unused variable may indicate your code isn't working the way you thought it was. If you feel the diff needs changes before landing, **please commandeer** and make appropriate changes: there are hundreds of these and responding to them individually is challenging.

For questions/comments, contact r-barnes.

 - If you approve of this diff, please use the "Accept & Ship" button :-)

Reviewed By: hanidamlaj

Differential Revision: D64996230

fbshipit-source-id: 027b82a7fbf82b550157f9e75fe42557463250ee
2024-10-25 17:26:13 -07:00
Alan Frindell
0c061201af Defer stream available callbacks until connCallback_ is set
Summary: If the peer sends higher stream limits in the settings, these callbacks may be invoked before the app has a chance to set the connection callback.

Reviewed By: sharmafb

Differential Revision: D64214648

fbshipit-source-id: 6a8a9b8d4d9e02a2baad672d69a43ba61daba918
2024-10-25 15:02:38 -07:00
Aman Sharma
784bd91424 Move core functionality to QuicTransportBaseLite [19/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64771233

fbshipit-source-id: 3584af1ce77a4ca53de83a2fb6bf8f6d3f9ed999
2024-10-24 15:01:02 -07:00
Aman Sharma
6691c8dde2 Move core functionality to QuicTransportBaseLite [18/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64771210

fbshipit-source-id: 58e79264bfc2826ba0822f1bb51877d3d7c8d06d
2024-10-24 15:01:02 -07:00
Aman Sharma
384c39f862 Move core functionality to QuicTransportBaseLite [17/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64547922

fbshipit-source-id: fa1e7c22122062b468878a232f545ba1f2619925
2024-10-23 18:25:46 -07:00
Aman Sharma
6875e7cdf5 Move core functionality to QuicTransportBaseLite [16/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64546909

fbshipit-source-id: de8989a0c292dfa8ff05d943ffaee23f1e6923d3
2024-10-23 13:39:16 -07:00
Aman Sharma
520ae73630 Move core functionality to QuicTransportBaseLite [15/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64542784

fbshipit-source-id: a155c441b3d2cf0a8220e7ddebd94f0335cb9420
2024-10-23 10:02:08 -07:00
Aman Sharma
c1b9dcbb89 Move core functionality to QuicTransportBaseLite [14/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64342347

fbshipit-source-id: 721414fdca39f70d8902b3df5afb0fde0d171480
2024-10-16 12:40:37 -07:00
Aman Sharma
0882df9999 Move core functionality to QuicTransportBaseLite [13/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64342282

fbshipit-source-id: 93faad3e53b1aba27dae268fc690480acf27d705
2024-10-16 12:40:37 -07:00
Aman Sharma
40e0652725 Move core functionality to QuicTransportBaseLite [12/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64338559

fbshipit-source-id: 7c2c884e0c855c443874ab1b891bd285d24c4cf1
2024-10-16 12:40:37 -07:00
Konstantin Tsoy
013bf7cc34 Prioritize read callbacks for unidirectional/control streams
Summary: Prioritize read callbacks for unidirectional/control streams optionally.

Reviewed By: mjoras

Differential Revision: D64439116

fbshipit-source-id: b4fe424db99921558d4672d9b21e992369072ca9
2024-10-16 12:10:44 -07:00
Aman Sharma
5c8a4463ea Move core functionality to QuicTransportBaseLite [11/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64185699

fbshipit-source-id: 7f79eeb4f1f1cf043b8e3e3a513f407c796dc51e
2024-10-14 11:58:31 -07:00
Aman Sharma
cfbdfda64b Move core functionality to QuicTransportBaseLite [10/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64065782

fbshipit-source-id: b0fb37e57b59ac6f28cf6f0b2d59d750a63398ca
2024-10-14 11:58:31 -07:00
Aman Sharma
9374a6b0e4 Move core functionality to QuicTransportBaseLite [9/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64065220

fbshipit-source-id: e027275d565ee8967de4eb4855475244bae334a0
2024-10-14 11:58:31 -07:00
Alan Frindell
a7fbe490ad Move QuicSocket callbacks outside of QuicSocket
Summary:
I have need of these in the proxygen WebTransport implementation, and don't want the full dependency on QuicSocket.

Also refactored WriteCallback into StreamWriteCallback and ConnWriteCallback, leaving the original WriteCallback as both for now.

Reviewed By: hanidamlaj

Differential Revision: D63486821

fbshipit-source-id: 4b16ad871c4deac4e262c12835ad5c457e9240da
2024-10-10 22:13:23 -07:00
Aman Sharma
b7169e3cf7 Move core functionality to QuicTransportBaseLite [8/n]
Summary: See title.

Reviewed By: mjoras

Differential Revision: D64065153

fbshipit-source-id: 5c9515dcaba1ef1f30d49f701e366f715854527a
2024-10-09 17:37:33 -07:00
Aman Sharma
c62dac180e Move core functionality to QuicTransportBaseLite [7/n]
Summary: See title.

Reviewed By: mjoras

Differential Revision: D64065113

fbshipit-source-id: 31f9a29a88bf763156d42c49df9db0f6f8e1a9d0
2024-10-09 17:37:33 -07:00
Aman Sharma
a253b7d782 Move core functionality to QuicTransportBaseLite [6/n]
Summary: See title.

Reviewed By: mjoras

Differential Revision: D63994476

fbshipit-source-id: 136e9ba9a972ac58b8a5fc6b336f6c3a4eaf38f5
2024-10-09 17:37:33 -07:00
Aman Sharma
7be7cfffb0 Move core functionality to QuicTransportBaseLite [5/n]
Summary: See title.

Reviewed By: mjoras

Differential Revision: D63986096

fbshipit-source-id: 5543b943acf5397db3951186f50181e1c31b7e0b
2024-10-08 11:12:03 -07:00
Aman Sharma
e0e445ff01 Move core functionality to QuicTransportBaseLite [4/n]
Summary: See title.

Reviewed By: mjoras

Differential Revision: D63984103

fbshipit-source-id: f21f3c4759dfa463319cefb7731c793c0fa9905d
2024-10-08 11:12:03 -07:00
Aman Sharma
5a9ebd333d Move core functionality to QuicTransportBaseLite [3/n]
Summary: See title.

Reviewed By: mjoras

Differential Revision: D63917728

fbshipit-source-id: 4e5389c1747b59cf30fea37ed9e5802007f2e49b
2024-10-08 11:12:03 -07:00
Aman Sharma
e5c822b9d4 Move core functionality to QuicTransportBaseLite [2/n]
Summary: See title.

Reviewed By: mjoras

Differential Revision: D63914228

fbshipit-source-id: 3860b33688a4efe99374a55dde226b7ceaab8d2f
2024-10-08 11:12:03 -07:00
Aman Sharma
0b2743fdae Move core functionality to QuicTransportBaseLite [1/n]
Summary: See title

Reviewed By: mjoras

Differential Revision: D63860679

fbshipit-source-id: b7116792c2bf99a98f62d719febddd133cce94d5
2024-10-04 17:28:20 -07:00