]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Reduce size of congestion control next_*_event fields.
authorMike Perry <mikeperry-git@torproject.org>
Wed, 21 Dec 2022 17:35:09 +0000 (17:35 +0000)
committerMike Perry <mikeperry-git@torproject.org>
Tue, 10 Jan 2023 15:46:03 +0000 (15:46 +0000)
Since these are derived from the number of SENDMEs in a cwnd/cc update,
and a cwnd should not exceed ~10k, there's plenty of room in uint16_t
for them, even if the network gets significantly faster.

src/core/or/congestion_control_nola.c
src/core/or/congestion_control_st.h
src/core/or/congestion_control_westwood.c

index 53bbf9e7b407929ae14088d5117ec351231e0c7b..d8ad69a78c768abadc33659bcd619dcd37003013 100644 (file)
@@ -108,7 +108,7 @@ congestion_control_nola_process_sendme(congestion_control_t *cc,
                "CC TOR_NOLA: Circuit %d "
                "CWND: %"PRIu64", "
                "INFL: %"PRIu64", "
-               "NCCE: %"PRIu64", "
+               "NCCE: %"PRIu16", "
                "SS: %d",
              CONST_TO_ORIGIN_CIRCUIT(circ)->global_identifier,
              cc->cwnd,
@@ -121,7 +121,7 @@ congestion_control_nola_process_sendme(congestion_control_t *cc,
                "CC TOR_NOLA: Circuit %"PRIu64":%d "
                "CWND: %"PRIu64", "
                "INFL: %"PRIu64", "
-               "NCCE: %"PRIu64", "
+               "NCCE: %"PRIu16", "
                "SS: %d",
              CONST_TO_OR_CIRCUIT(circ)->p_chan->global_identifier,
              CONST_TO_OR_CIRCUIT(circ)->p_circ_id,
index 08bf70f73bb95c128fe1919b5ea2b26d1a4ee281..0cc4e43938c4592720db28a50d29f6c8ce2726fe 100644 (file)
@@ -158,11 +158,11 @@ struct congestion_control_t {
    * It is also reset to 0 immediately whenever the circuit's orconn is
    * blocked, and when a previously blocked orconn is unblocked.
    */
-  uint64_t next_cc_event;
+  uint16_t next_cc_event;
 
   /** Counts down until we process a cwnd worth of SENDME acks.
    * Used to track full cwnd status. */
-  uint64_t next_cwnd_event;
+  uint16_t next_cwnd_event;
 
   /** Are we in slow start? */
   bool in_slow_start;
index e57a661b8578940958d07e409a5e7aa852ac96bd..d28ddf34422d7010e3d2c466b7538b17e3d303c6 100644 (file)
@@ -201,7 +201,7 @@ congestion_control_westwood_process_sendme(congestion_control_t *cc,
                  "CC: TOR_WESTWOOD Circuit %d "
                  "CWND: %"PRIu64", "
                  "INFL: %"PRIu64", "
-                 "NCCE: %"PRIu64", "
+                 "NCCE: %"PRIu16", "
                  "WRTT: %"PRIu64", "
                  "WSIG: %"PRIu64", "
                  "SS: %d",
@@ -218,7 +218,7 @@ congestion_control_westwood_process_sendme(congestion_control_t *cc,
                  "CC: TOR_WESTWOOD Circuit %"PRIu64":%d "
                  "CWND: %"PRIu64", "
                  "INFL: %"PRIu64", "
-                 "NCCE: %"PRIu64", "
+                 "NCCE: %"PRIu16", "
                  "WRTT: %"PRIu64", "
                  "WSIG: %"PRIu64", "
                  "SS: %d",