Skip to content

Commit

Permalink
report number of paths that were ECN-(in)capable; `quicly_stats_t::nu…
Browse files Browse the repository at this point in the history
…m_paths` is used in the anticipation of merging multipath #559
  • Loading branch information
kazuho committed Oct 17, 2023
1 parent 1c35a90 commit 4186233
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions include/quicly.h
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,16 @@ struct st_quicly_conn_streamgroup_state_t {
*/ \
uint64_t stream_data_resent; \
} num_bytes; \
struct { \
/** \
* number of paths that were ECN-capable \
*/ \
uint64_t ecn_validated; \
/** \
* number of paths that were deemed as ECN black holes \
*/ \
uint64_t ecn_failed; \
} num_paths; \
/** \
* Total number of each frame being sent / received. \
*/ \
Expand Down
8 changes: 8 additions & 0 deletions lib/quicly.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,15 @@ static size_t get_ecn_index_from_bits(uint8_t bits)

static void update_ecn_state(quicly_conn_t *conn, enum en_quicly_ecn_state new_state)
{
assert(new_state == QUICLY_ECN_ON || new_state == QUICLY_ECN_OFF);

conn->egress.ecn.state = new_state;
if (new_state == QUICLY_ECN_ON) {
++conn->super.stats.num_paths.ecn_validated;
} else {
++conn->super.stats.num_paths.ecn_failed;
}

QUICLY_PROBE(ECN_VALIDATION, conn, conn->stash.now, (int)new_state);
QUICLY_LOG_CONN(ecn_validation, conn, { PTLS_LOG_ELEMENT_SIGNED(state, (int)new_state); });
}
Expand Down

0 comments on commit 4186233

Please sign in to comment.