From: Frédéric Lécaille Date: Wed, 16 Dec 2020 16:33:11 +0000 (+0100) Subject: MINOR: quic: Add traces for in flght ack-eliciting packet counter. X-Git-Tag: v2.4-dev5~54 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f7e0b8d6ae191dc92779f6012e42bda10cf0b311;p=thirdparty%2Fhaproxy.git MINOR: quic: Add traces for in flght ack-eliciting packet counter. Add trace for this counter. Also shorten its variable name (->ifae_pkts). --- diff --git a/include/haproxy/quic_loss.h b/include/haproxy/quic_loss.h index ee7649c533..16fe5aa317 100644 --- a/include/haproxy/quic_loss.h +++ b/include/haproxy/quic_loss.h @@ -109,9 +109,12 @@ static inline struct quic_pktns *quic_loss_pktns(struct quic_conn *qc) struct quic_pktns *pktns; pktns = &qc->pktns[QUIC_TLS_PKTNS_INITIAL]; - for (i = QUIC_TLS_PKTNS_01RTT; i < QUIC_TLS_PKTNS_MAX; i++) + TRACE_PROTO("pktns", QUIC_EV_CONN_SPTO, qc->conn, pktns); + for (i = QUIC_TLS_PKTNS_01RTT; i < QUIC_TLS_PKTNS_MAX; i++) { + TRACE_PROTO("pktns", QUIC_EV_CONN_SPTO, qc->conn, &qc->pktns[i]); if (qc->pktns[i].tx.loss_time < pktns->tx.loss_time) pktns = &qc->pktns[i]; + } return pktns; } diff --git a/include/haproxy/xprt_quic-t.h b/include/haproxy/xprt_quic-t.h index 8e240a069e..37cbb46f0a 100644 --- a/include/haproxy/xprt_quic-t.h +++ b/include/haproxy/xprt_quic-t.h @@ -569,7 +569,7 @@ struct quic_path { /* Outstanding data (in bytes). */ uint64_t in_flight; /* Number of in flight ack-eliciting packets. */ - uint64_t in_flight_ae_pkts; + uint64_t ifae_pkts; }; /* The number of buffers for outgoing packets (must be a power of two). */ diff --git a/include/haproxy/xprt_quic.h b/include/haproxy/xprt_quic.h index 498ddb6109..17b325431f 100644 --- a/include/haproxy/xprt_quic.h +++ b/include/haproxy/xprt_quic.h @@ -1039,7 +1039,7 @@ static inline void quic_path_init(struct quic_path *path, int ipv4, path->min_cwnd = max_dgram_sz << 1; path->prep_in_flight = 0; path->in_flight = 0; - path->in_flight_ae_pkts = 0; + path->ifae_pkts = 0; quic_cc_init(&path->cc, algo, qc); } diff --git a/src/xprt_quic.c b/src/xprt_quic.c index 16c8c43527..3ab9328ecc 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -462,7 +462,7 @@ static void quic_trace(enum trace_level level, uint64_t mask, const struct trace pktns == &qc->pktns[QUIC_TLS_PKTNS_01RTT] ? "01RTT": "H"); if (pktns->tx.loss_time) chunk_appendf(&trace_buf, " loss_time=%dms", - TICKS_TO_MS(qc->timer - now_ms)); + TICKS_TO_MS(tick_remain(now_ms, pktns->tx.loss_time))); } if (lost_pkts && !LIST_ISEMPTY(lost_pkts)) { struct quic_tx_packet *pkt; @@ -477,7 +477,11 @@ static void quic_trace(enum trace_level level, uint64_t mask, const struct trace struct quic_conn *qc = conn->qc; const struct quic_pktns *pktns = a2; const int *duration = a3; + const uint64_t *ifae_pkts = a4; + if (ifae_pkts) + chunk_appendf(&trace_buf, " ifae_pkts=%llu", + (unsigned long long)*ifae_pkts); if (pktns) { chunk_appendf(&trace_buf, " pktns=%s pp=%d", pktns == &qc->pktns[QUIC_TLS_PKTNS_INITIAL] ? "I" : @@ -569,7 +573,8 @@ static inline void qc_set_timer(struct quic_conn_ctx *ctx) struct quic_pktns *pktns; unsigned int pto; - TRACE_ENTER(QUIC_EV_CONN_STIMER, ctx->conn); + TRACE_ENTER(QUIC_EV_CONN_STIMER, ctx->conn, + NULL, NULL, &ctx->conn->qc->path->ifae_pkts); qc = ctx->conn->qc; pktns = quic_loss_pktns(qc); if (tick_isset(pktns->tx.loss_time)) { @@ -581,7 +586,8 @@ static inline void qc_set_timer(struct quic_conn_ctx *ctx) * cancelled for a server which reached the anti-amplification limit. */ - if (!qc->path->in_flight_ae_pkts && quic_peer_validated_addr(ctx)) { + if (!qc->path->ifae_pkts && quic_peer_validated_addr(ctx)) { + TRACE_PROTO("timer cancellation", QUIC_EV_CONN_STIMER, ctx->conn); /* Timer cancellation. */ qc->timer = TICK_ETERNITY; goto out; @@ -1202,7 +1208,7 @@ static inline void qc_treat_newly_acked_pkts(struct quic_conn_ctx *ctx, pkt->pktns->tx.in_flight -= pkt->in_flight_len; qc->path->prep_in_flight -= pkt->in_flight_len; if (pkt->flags & QUIC_FL_TX_PACKET_ACK_ELICITING) - qc->path->in_flight_ae_pkts--; + qc->path->ifae_pkts--; ev.ack.acked = pkt->in_flight_len; ev.ack.time_sent = pkt->time_sent; quic_cc_event(&qc->path->cc, &ev); @@ -1237,7 +1243,7 @@ static inline void qc_release_lost_pkts(struct quic_pktns *pktns, pkt->pktns->tx.in_flight -= pkt->in_flight_len; qc->path->prep_in_flight -= pkt->in_flight_len; if (pkt->flags & QUIC_FL_TX_PACKET_ACK_ELICITING) - qc->path->in_flight_ae_pkts--; + qc->path->ifae_pkts--; /* Treat the frames of this lost packet. */ list_for_each_entry_safe(frm, frmbak, &pkt->frms, list) qc_treat_nacked_tx_frm(frm, pktns, ctx); @@ -1772,7 +1778,7 @@ int qc_send_ppkts(struct quic_conn_ctx *ctx) p->time_sent = time_sent; if (p->flags & QUIC_FL_TX_PACKET_ACK_ELICITING) { p->pktns->tx.time_of_last_eliciting = time_sent; - qc->path->in_flight_ae_pkts++; + qc->path->ifae_pkts++; } qc->path->in_flight += p->in_flight_len; p->pktns->tx.in_flight += p->in_flight_len; @@ -2401,7 +2407,8 @@ static struct task *process_timer(struct task *task, void *ctx, unsigned short s conn_ctx = task->context; qc = conn_ctx->conn->qc; - TRACE_ENTER(QUIC_EV_CONN_PTIMER, conn_ctx->conn); + TRACE_ENTER(QUIC_EV_CONN_PTIMER, conn_ctx->conn, + NULL, NULL, &qc->path->ifae_pkts); task->expire = TICK_ETERNITY; pktns = quic_loss_pktns(qc); if (tick_isset(pktns->tx.loss_time)) {