From ce3e9b02f5f77bf71322bc143dcab7834d8e4566 Mon Sep 17 00:00:00 2001 From: Joseph Beshay Date: Tue, 28 Jan 2025 10:10:09 -0800 Subject: [PATCH] Start sending ACK_ECN frames only after we've seen marked packets Summary: As title. Reviewed By: mjoras Differential Revision: D68642269 fbshipit-source-id: 40ad3a683a8efbbdf69e145be55aca7861081e0d --- quic/api/QuicPacketScheduler.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/quic/api/QuicPacketScheduler.cpp b/quic/api/QuicPacketScheduler.cpp index 92e3404d5..c2957b04c 100644 --- a/quic/api/QuicPacketScheduler.cpp +++ b/quic/api/QuicPacketScheduler.cpp @@ -606,10 +606,14 @@ Optional AckScheduler::writeNextAcks( .maxReceiveTimestampsPerAck : 0; - if (conn_.transportSettings.readEcnOnIngress) { - // If ECN is enabled and we can use it, this will currently take - // priority over sending receive timestamps. There is currently no provision - // for a frame time that includes both ECN counts and receive timestamps. + if (conn_.transportSettings.readEcnOnIngress && + (meta.ackState.ecnECT0CountReceived || + meta.ackState.ecnECT1CountReceived || + meta.ackState.ecnCECountReceived)) { + // If echoing ECN is enabled and we have seen marked packets, this will + // currently take priority over sending receive timestamps. There is + // currently no provision for a frame time that includes both ECN counts and + // receive timestamps. // TODO: explore design changes for an ACK frame that supports both ECN and // receive timestamps ackWriteResult = writeAckFrame(meta, builder, FrameType::ACK_ECN);