]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
The CC wake up deadline is now if we have TX allowance
authorMatt Caswell <matt@openssl.org>
Tue, 13 Jun 2023 12:08:00 +0000 (13:08 +0100)
committerPauli <pauli@openssl.org>
Tue, 27 Jun 2023 23:53:22 +0000 (09:53 +1000)
If we have TX allowance then there is no need to wait if we have something
to send - the wake up deadline is immediate.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21204)

ssl/quic/cc_newreno.c
test/quic_cc_test.c
test/recipes/75-test_quicapi_data/ssltraceref.txt

index 850ff9899a8dd178b4aadba13f44a14659cbde47..de4c10c6a292f5fbf8044f868375a3f687a61a43 100644 (file)
@@ -296,11 +296,16 @@ static uint64_t newreno_get_tx_allowance(OSSL_CC_DATA *cc)
 
 static OSSL_TIME newreno_get_wakeup_deadline(OSSL_CC_DATA *cc)
 {
-    /*
-     * The NewReno congestion controller does not vary its state in time, only
-     * in response to stimulus.
-     */
-    return ossl_time_infinite();
+    if (newreno_get_tx_allowance(cc) > 0) {
+        /* We have TX allowance now so wakeup immediately */
+        return ossl_time_zero();
+    } else {
+        /*
+         * The NewReno congestion controller does not vary its state in time,
+         * only in response to stimulus.
+         */
+        return ossl_time_infinite();
+    }
 }
 
 static int newreno_on_data_sent(OSSL_CC_DATA *cc, uint64_t num_bytes)
index 8d75a642c845b7ff266ffa0decb6029672dd278e..a6b45e3ed6d796f7c428db402e281c7a17f1eb90 100644 (file)
@@ -515,11 +515,8 @@ static int test_sanity(void)
     if (!TEST_uint64_t_ge(allowance = ccm->get_tx_allowance(cc), 1472))
         goto err;
 
-    /*
-     * No wakeups should be scheduled currently as we don't currently implement
-     * pacing.
-     */
-    if (!TEST_true(ossl_time_is_infinite(ccm->get_wakeup_deadline(cc))))
+    /* There is TX allowance so wakeup should be immediate */
+    if (!TEST_true(ossl_time_is_zero(ccm->get_wakeup_deadline(cc))))
         goto err;
 
     /* No bytes should currently be in flight. */
index 095a945f6eab45ba6425f46c2822e48a7cce00ee..e1510ccd87a9f7fd04ef45c4a2473439504108aa 100644 (file)
@@ -234,7 +234,7 @@ YeeuLO02zToHhnQ6KbPXOrQAqcL1kngO4g+j/ru+4AZThFkdkGnltvk=
         No extensions
 
 Received Datagram
-  Length: 256
+  Length: 234
 Received Packet
   Packet Type: Handshake
   Version: 0x00000001
@@ -267,8 +267,6 @@ Header:
     Finished, Length=32
       verify_data (len=32): ????????????????????????????????????????????????????????????????
 
-
-Received Frame: Ping
 Sent Frame: Ack  (without ECN)
     Largest acked: 1
     Ack delay (raw) 0
@@ -284,11 +282,5 @@ Sent Packet
   Source Conn Id: <zero length id>
   Payload length: 60
   Packet Number: 0x00000000
-Sent Frame: Ack  (without ECN)
-    Largest acked: 0
-    Ack delay (raw) 0
-    Ack range count: 0
-    First ack range: 0
-
 Sent Datagram
-  Length: 115
+  Length: 81