Expose per-path attempts and ACK queues in transport diagnostics

This commit is contained in:
evgeny committed 2026-10-23 10:25:27 +02:00
1 parent 1b3c4552fb
commit 147648ffd0
3 files changed
+16 -6

No files matched your search

+2
View File
@@ -80,6 +80,7 @@ utun_CORE_SOURCES = \
transport_layer/etcp_keepalive.c \
transport_layer/etcp_bbr.c \
transport_layer/etcp_tx.c \
transport_layer/etcp_tx.h \
transport_layer/etcp_loadbalancer.c \
transport_layer/etcp_debug.c \
transport_layer/etcp_dump.c \
@@ -267,6 +268,7 @@ libutun_a_SOURCES = \
transport_layer/etcp_keepalive.c \
transport_layer/etcp_bbr.c \
transport_layer/etcp_tx.c \
transport_layer/etcp_tx.h \
transport_layer/etcp_loadbalancer.c \
transport_layer/etcp_debug.c \
transport_layer/etcp_dump.c \
+8 -3
View File
@@ -1140,8 +1140,11 @@ static void send_metrics(struct control_server* server, struct control_client* c
rsp->etcp.input_send_q_packets = (uint32_t)queue_entry_count(conn->input_send_q);
rsp->etcp.input_wait_ack_bytes = (uint32_t)queue_total_bytes(conn->input_wait_ack);
rsp->etcp.input_wait_ack_packets = (uint32_t)queue_entry_count(conn->input_wait_ack);
rsp->etcp.ack_q_bytes = (uint32_t)queue_total_bytes(conn->ack_q);
rsp->etcp.ack_q_packets = (uint32_t)queue_entry_count(conn->ack_q);
rsp->etcp.ack_q_bytes = rsp->etcp.ack_q_packets = 0;
for (struct ETCP_LINK* link = conn->links; link; link = link->next) {
rsp->etcp.ack_q_bytes += (uint32_t)queue_total_bytes(link->ack_q);
rsp->etcp.ack_q_packets += (uint32_t)queue_entry_count(link->ack_q);
}
rsp->etcp.recv_q_bytes = (uint32_t)queue_total_bytes(conn->recv_q);
rsp->etcp.recv_q_packets = (uint32_t)queue_entry_count(conn->recv_q);
rsp->etcp.output_queue_bytes = (uint32_t)queue_total_bytes(conn->output_queue);
@@ -1153,7 +1156,9 @@ static void send_metrics(struct control_server* server, struct control_client* c
rsp->etcp.pkt_format_errors = (conn->links && conn->links->conn) ? (uint32_t)conn->links->conn->pkt_format_errors : 0;
/* Timer flags */
rsp->etcp.retrans_timer_active = (conn->retrans_timer != NULL) ? 1 : 0;
rsp->etcp.retrans_timer_active = 0;
for (struct ETCP_LINK* link = conn->links; link; link = link->next)
if (link->retrans_timer) rsp->etcp.retrans_timer_active = 1;
rsp->etcp.ack_resp_timer_active = (conn->ack_resp_timer != NULL) ? 1 : 0;
/* Connection IDs */
+6 -3
View File
@@ -78,15 +78,14 @@ void etcp_dump_conn_state(struct ETCP_CONN* conn) {
DLOG("ACK: hit_inf=%u hit_sndq=%u miss=%u link_wait=%u",
conn->cnt_ack_hit_inf, conn->cnt_ack_hit_sndq, conn->cnt_ack_miss, conn->cnt_link_wait);
DLOG("TIMERS: retrans=%s ack_resp=%s",
conn->retrans_timer ? "ACTIVE" : "free", conn->ack_resp_timer ? "ACTIVE" : "free");
DLOG("TIMERS: ack_resp=%s peer_window=%s",
conn->ack_resp_timer ? "ACTIVE" : "free", conn->ack_window_timer ? "ACTIVE" : "free");
DHDR(" --- QUEUES ---");
dump_queue("input", conn->input_queue);
dump_queue("send_input_q", conn->send_input_q);
dump_queue("input_send_q", conn->input_send_q);
dump_queue("input_wait_ack", conn->input_wait_ack);
dump_queue("ack_q", conn->ack_q);
dump_queue("recv_q", conn->recv_q);
dump_queue("output", conn->output_queue);
if (conn->transit_queues)
@@ -110,6 +109,7 @@ void etcp_dump_conn_state(struct ETCP_CONN* conn) {
DHDR(" --- POOLS ---");
dump_pool("inflight", conn->inflight_pool);
dump_pool("attempts", conn->attempt_pool);
dump_pool("io", conn->io_pool);
if (conn->instance) {
dump_pool("data", conn->instance->data_pool);
@@ -141,6 +141,9 @@ void etcp_dump_conn_state(struct ETCP_CONN* conn) {
DLOG("INFLIGHT: bytes=%u pkts=%u lim=%u pacing=%u",
link->inflight_bytes, link->inflight_packets,
link->inflight_lim_bytes, link->bbr_pacing_rate);
dump_queue("attempts", link->attempts); dump_queue("path_ACK", link->ack_q);
DLOG("RTO: timer=%s timeout_us=%u DATA_RTT_us=%u jitter_us=%u",
link->retrans_timer ? "ACTIVE" : "free", etcp_tx_rto_us(link), link->data_rtt_us, link->data_jitter_us);
DLOG("RTT: last=%u jitter=%u min_rtt_us=%u",
link->rtt_last, link->jitter,
link->bbr ? link->bbr->min_rtt_us : 0);