From: Frédéric Lécaille Date: Mon, 13 Dec 2021 11:30:54 +0000 (+0100) Subject: CLEANUP: quic: Remove cdata_len from quic_tx_packet struct X-Git-Tag: v2.6-dev1~276 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0371cd54d029423b9bff6aec79053a27845ce6bd;p=thirdparty%2Fhaproxy.git CLEANUP: quic: Remove cdata_len from quic_tx_packet struct This field is no more useful. Modify the traces consequently. Also initialize ->pn_node.key value to -1, which is an illegal value for QUIC packet number, and display it in traces if different from -1. --- diff --git a/include/haproxy/xprt_quic-t.h b/include/haproxy/xprt_quic-t.h index dbca9da024..e3ded3931a 100644 --- a/include/haproxy/xprt_quic-t.h +++ b/include/haproxy/xprt_quic-t.h @@ -500,8 +500,6 @@ struct quic_tx_packet { */ size_t in_flight_len; struct eb64_node pn_node; - /* The number of bytes of CRYPTO data in this packet. */ - unsigned int cdata_len; /* The list of frames of this packet. */ struct list frms; /* The time this packet was sent (usec). */ diff --git a/src/xprt_quic.c b/src/xprt_quic.c index 54112f1f45..08c4ad11a1 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -335,8 +335,8 @@ static void quic_trace(enum trace_level level, uint64_t mask, const struct trace } if (pkt) { const struct quic_frame *frm; - chunk_appendf(&trace_buf, " pn=%llu cdlen=%u", - (unsigned long long)pkt->pn_node.key, pkt->cdata_len); + if (pkt->pn_node.key != (uint64_t)-1) + chunk_appendf(&trace_buf, " pn=%llu",(ull)pkt->pn_node.key); list_for_each_entry(frm, &pkt->frms, list) chunk_tx_frm_appendf(&trace_buf, frm); chunk_appendf(&trace_buf, " tx.bytes=%llu", (unsigned long long)qc->tx.bytes); @@ -564,12 +564,11 @@ static void quic_trace(enum trace_level level, uint64_t mask, const struct trace (unsigned long long)qc->path->prep_in_flight, (unsigned long long)qc->path->in_flight); if (pkt) { - chunk_appendf(&trace_buf, " pn=%lu(%s) iflen=%llu cdlen=%llu", + chunk_appendf(&trace_buf, " pn=%lu(%s) iflen=%llu", (unsigned long)pkt->pn_node.key, pkt->pktns == &qc->pktns[QUIC_TLS_PKTNS_INITIAL] ? "I" : pkt->pktns == &qc->pktns[QUIC_TLS_PKTNS_01RTT] ? "01RTT": "H", - (unsigned long long)pkt->in_flight_len, - (unsigned long long)pkt->cdata_len); + (unsigned long long)pkt->in_flight_len); } } @@ -4334,7 +4333,6 @@ static inline int qc_build_frms(struct quic_tx_packet *pkt, if (!dlen) break; - pkt->cdata_len += dlen; /* CRYPTO frame length. */ flen = hlen + quic_int_getsize(dlen) + dlen; TRACE_PROTO(" CRYPTO frame length (flen)", @@ -4666,8 +4664,8 @@ static inline void quic_tx_packet_init(struct quic_tx_packet *pkt, int type) { pkt->type = type; pkt->len = 0; - pkt->cdata_len = 0; pkt->in_flight_len = 0; + pkt->pn_node.key = (uint64_t)-1; LIST_INIT(&pkt->frms); pkt->next = NULL; pkt->refcnt = 1;