bbr: Allow at least 10 packets to cover up user space latency
@@ -371,14 +371,9 @@ static void bbr_set_send_quantum(ngtcp2_bbr_cc *cc, ngtcp2_conn_stat *cstat) {
if (cstat->pacing_rate < 1.2 * 1024 * 1024 / 8 / NGTCP2_SECONDS) {
cstat->send_quantum = cstat->max_udp_payload_size;
- return;
- }
-
- if (cstat->pacing_rate < 24.0 * 1024 * 1024 / 8 / NGTCP2_SECONDS) {
+ } else if (cstat->pacing_rate < 24.0 * 1024 * 1024 / 8 / NGTCP2_SECONDS) {
cstat->send_quantum = cstat->max_udp_payload_size * 2;
- return;
- }
-
+ } else {
cstat->send_quantum =
(uint64_t)(cstat->pacing_rate * (double)(cstat->min_rtt == UINT64_MAX
? NGTCP2_MILLISECONDS
@@ -386,6 +381,10 @@ static void bbr_set_send_quantum(ngtcp2_bbr_cc *cc, ngtcp2_conn_stat *cstat) {
cstat->send_quantum = ngtcp2_min(cstat->send_quantum, 64 * 1024);
}
+ cstat->send_quantum =
+ ngtcp2_max(cstat->send_quantum, cstat->max_udp_payload_size * 10);
+}
+
static uint64_t bbr_inflight(ngtcp2_bbr_cc *cc, ngtcp2_conn_stat *cstat,
double gain) {
uint64_t quanta = 3 * cstat->send_quantum;
