Unblock and add flag counts for gfe2_reloadable_flag_quic_receive_ack_frequency. This change removes the enabling_blocked_by field and adds QUIC_RELOADABLE_FLAG_COUNT_N macros to track usage of the ACK_FREQUENCY processing logic. This code never sends ACK_FREQUENCY or IMMEDIATE_ACK. It advertises the capability to receive it and honors the frames when they arrive. PiperOrigin-RevId: 874680191
diff --git a/quiche/quic/core/quic_connection.cc b/quiche/quic/core/quic_connection.cc index d11c8f5..a20c97e 100644 --- a/quiche/quic/core/quic_connection.cc +++ b/quiche/quic/core/quic_connection.cc
@@ -2196,6 +2196,7 @@ ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); return false; } + QUIC_RELOADABLE_FLAG_COUNT_N(quic_receive_ack_frequency, 3, 7); if (auto packet_number_space = QuicUtils::GetPacketNumberSpace( last_received_packet_info_.decrypted_level) == APPLICATION_DATA) { @@ -2224,7 +2225,7 @@ QUIC_LOG_EVERY_N_SEC(ERROR, 120) << "Got unexpected ImmediateAck Frame."; return false; } - QUIC_RELOADABLE_FLAG_COUNT_N(quic_receive_ack_frequency, 1, 2); + QUIC_RELOADABLE_FLAG_COUNT_N(quic_receive_ack_frequency, 1, 7); if (last_received_packet_info_.decrypted_level == ENCRYPTION_FORWARD_SECURE) { uber_received_packet_manager_.OnImmediateAckFrame(); } else {
diff --git a/quiche/quic/core/quic_received_packet_manager.cc b/quiche/quic/core/quic_received_packet_manager.cc index 39aba3a..11bd357 100644 --- a/quiche/quic/core/quic_received_packet_manager.cc +++ b/quiche/quic/core/quic_received_packet_manager.cc
@@ -286,7 +286,7 @@ if (ack_now_) { // An IMMEDIATE_ACK frame arrived. Send an ack immediately. - QUIC_RELOADABLE_FLAG_COUNT_N(quic_receive_ack_frequency, 2, 2); + QUIC_RELOADABLE_FLAG_COUNT_N(quic_receive_ack_frequency, 2, 7); ack_timeout_ = now; return; } @@ -298,6 +298,9 @@ last_sent_largest_acked_ >= QuicPacketNumber(reordering_threshold_) && (last_received_packet_number <= last_sent_largest_acked_ - reordering_threshold_)) { + if (reordering_threshold_ > 1) { + QUIC_RELOADABLE_FLAG_COUNT_N(quic_receive_ack_frequency, 7, 7); + } // Ack immediately if the received packet number is less than or equal to // largest acked - reordering threshold. ack_timeout_ = now; @@ -347,10 +350,14 @@ last_sent_largest_acked_ < ack_frame_.packets.begin()->max() - 1)) { // If the lowest ACK range has not yet been reported, and might be trimmed // on the next packet arrival, send an ACK. + // This is an extreme case; it would be unsurprising if it never happened + // in production. + QUIC_RELOADABLE_FLAG_COUNT_N(quic_receive_ack_frequency, 6, 7); ack_timeout_ = now; return; } if (ReorderingExceedsThreshold()) { + QUIC_RELOADABLE_FLAG_COUNT_N(quic_receive_ack_frequency, 5, 7); ack_timeout_ = now; return; } @@ -395,6 +402,8 @@ // threshold. return false; } + // Cannot get here unless an ACK_FREQUENCY frame was received. + QUIC_RELOADABLE_FLAG_COUNT_N(quic_receive_ack_frequency, 4, 7); if (!HasMissingPackets() || GetLargestObserved() < QuicPacketNumber(reordering_threshold_)) { return false;