diff options
author | Mike Perry <mikeperry-git@torproject.org> | 2022-12-21 17:35:09 +0000 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2023-01-10 11:56:21 -0500 |
commit | a9a27ffa3a2b134f7586d1259e2c077b0b6cb4f7 (patch) | |
tree | 54845fb0d08508641f26c53cd5412780f6cbf3f7 | |
parent | f4499bb5e27a96e1558f99edb081de473c13c7a6 (diff) | |
download | tor-a9a27ffa3a2b134f7586d1259e2c077b0b6cb4f7.tar.gz tor-a9a27ffa3a2b134f7586d1259e2c077b0b6cb4f7.zip |
Reduce size of congestion control next_*_event fields.
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.
-rw-r--r-- | src/core/or/congestion_control_nola.c | 4 | ||||
-rw-r--r-- | src/core/or/congestion_control_st.h | 4 | ||||
-rw-r--r-- | src/core/or/congestion_control_westwood.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/core/or/congestion_control_nola.c b/src/core/or/congestion_control_nola.c index 53bbf9e7b4..d8ad69a78c 100644 --- a/src/core/or/congestion_control_nola.c +++ b/src/core/or/congestion_control_nola.c @@ -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, diff --git a/src/core/or/congestion_control_st.h b/src/core/or/congestion_control_st.h index 08bf70f73b..0cc4e43938 100644 --- a/src/core/or/congestion_control_st.h +++ b/src/core/or/congestion_control_st.h @@ -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; diff --git a/src/core/or/congestion_control_westwood.c b/src/core/or/congestion_control_westwood.c index e57a661b85..d28ddf3442 100644 --- a/src/core/or/congestion_control_westwood.c +++ b/src/core/or/congestion_control_westwood.c @@ -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", |