MINOR: quic: Add packet loss and maximum cc window to "show quic"

Add the number of packet losts and the maximum congestion control window computed
by the algorithms to "show quic".
Same thing for the traces of existent congestion control algorithms.

Must be backported to 2.7 and 2.6.
diff --git a/include/haproxy/quic_conn-t.h b/include/haproxy/quic_conn-t.h
index fdeb9da..2213a7f 100644
--- a/include/haproxy/quic_conn-t.h
+++ b/include/haproxy/quic_conn-t.h
@@ -579,6 +579,7 @@
 	size_t mtu;
 	/* Congestion window. */
 	uint64_t cwnd;
+	uint64_t mcwnd;
 	/* Minimum congestion window. */
 	uint64_t min_cwnd;
 	/* Prepared data to be sent (in bytes). */
diff --git a/include/haproxy/quic_conn.h b/include/haproxy/quic_conn.h
index 5689110..6806d4f 100644
--- a/include/haproxy/quic_conn.h
+++ b/include/haproxy/quic_conn.h
@@ -538,6 +538,7 @@
 	quic_loss_init(&path->loss);
 	path->mtu = max_dgram_sz;
 	path->cwnd = QUIC_MIN(10 * max_dgram_sz, QUIC_MAX(max_dgram_sz << 1, 14720U));
+	path->mcwnd = path->cwnd;
 	path->min_cwnd = max_dgram_sz << 1;
 	path->prep_in_flight = 0;
 	path->in_flight = 0;
diff --git a/include/haproxy/quic_loss-t.h b/include/haproxy/quic_loss-t.h
index 4fb2084..8ab41b2 100644
--- a/include/haproxy/quic_loss-t.h
+++ b/include/haproxy/quic_loss-t.h
@@ -54,6 +54,7 @@
 	unsigned int rtt_min;
 	/* Number of NACKed sent PTO. */
 	unsigned int pto_count;
+	unsigned long nb_lost_pkt;
 };
 
 #endif /* USE_QUIC */
diff --git a/include/haproxy/quic_loss.h b/include/haproxy/quic_loss.h
index e4cb82f..a5f67d7 100644
--- a/include/haproxy/quic_loss.h
+++ b/include/haproxy/quic_loss.h
@@ -38,6 +38,7 @@
 	ql->rtt_var = (QUIC_LOSS_INITIAL_RTT >> 1) << 2;
 	ql->rtt_min = 0;
 	ql->pto_count = 0;
+	ql->nb_lost_pkt = 0;
 }
 
 /* Return 1 if a persistent congestion is observed for a list of
diff --git a/src/quic_cc_cubic.c b/src/quic_cc_cubic.c
index 1a5fa4e..d22897b 100644
--- a/src/quic_cc_cubic.c
+++ b/src/quic_cc_cubic.c
@@ -168,6 +168,7 @@
 	}
 
 	path->cwnd += inc;
+	path->mcwnd = QUIC_MAX(path->cwnd, path->mcwnd);
  leave:
 	TRACE_LEAVE(QUIC_EV_CONN_CC, cc->qc);
 }
@@ -217,6 +218,7 @@
 		/* Exit to congestion avoidance if slow start threshold is reached. */
 		if (path->cwnd >= c->ssthresh)
 			c->state = QUIC_CC_ST_CA;
+		path->mcwnd = QUIC_MAX(path->cwnd, path->mcwnd);
 		break;
 
 	case QUIC_CC_EVT_LOSS:
@@ -309,9 +311,10 @@
 	struct cubic *c = quic_cc_priv(cc);
 
 	path = container_of(cc, struct quic_path, cc);
-	chunk_appendf(buf, " state=%s cwnd=%llu ssthresh=%d rpst=%dms",
+	chunk_appendf(buf, " state=%s cwnd=%llu mcwnd=%llu ssthresh=%d rpst=%dms",
 	              quic_cc_state_str(c->state),
 	              (unsigned long long)path->cwnd,
+	              (unsigned long long)path->mcwnd,
 	              (int)c->ssthresh,
 	              !tick_isset(c->recovery_start_time) ? -1 :
 	              TICKS_TO_MS(tick_remain(c->recovery_start_time, now_ms)));
diff --git a/src/quic_cc_newreno.c b/src/quic_cc_newreno.c
index 4d9bf13..65763d7 100644
--- a/src/quic_cc_newreno.c
+++ b/src/quic_cc_newreno.c
@@ -87,6 +87,7 @@
 	switch (ev->type) {
 	case QUIC_CC_EVT_ACK:
 		path->cwnd += ev->ack.acked;
+		path->mcwnd = QUIC_MAX(path->cwnd, path->mcwnd);
 		/* Exit to congestion avoidance if slow start threshold is reached. */
 		if (path->cwnd > nr->ssthresh)
 			nr->state = QUIC_CC_ST_CA;
@@ -123,6 +124,7 @@
 		acked = ev->ack.acked * path->mtu + nr->remain_acked;
 		nr->remain_acked = acked % path->cwnd;
 		path->cwnd += acked / path->cwnd;
+		path->mcwnd = QUIC_MAX(path->cwnd, path->mcwnd);
 		break;
 	}
 
@@ -182,11 +184,14 @@
 	struct nr *nr = quic_cc_priv(cc);
 
 	path = container_of(cc, struct quic_path, cc);
-	chunk_appendf(buf, " state=%s cwnd=%llu ssthresh=%ld recovery_start_time=%llu",
+	chunk_appendf(buf, " state=%s cwnd=%llu mcwnd=%llu ssthresh=%ld rpst=%dms pktloss=%llu",
 	              quic_cc_state_str(nr->state),
 	              (unsigned long long)path->cwnd,
+	              (unsigned long long)path->mcwnd,
 	              (long)nr->ssthresh,
-	              (unsigned long long)nr->recovery_start_time);
+	              !tick_isset(nr->recovery_start_time) ? -1 :
+	              TICKS_TO_MS(tick_remain(nr->recovery_start_time, now_ms)),
+	              (unsigned long long)path->loss.nb_lost_pkt);
 }
 
 static void (*quic_cc_nr_state_cbs[])(struct quic_cc *cc,
diff --git a/src/quic_conn.c b/src/quic_conn.c
index 2d90ab3..d87bf05 100644
--- a/src/quic_conn.c
+++ b/src/quic_conn.c
@@ -8454,9 +8454,11 @@
 		chunk_appendf(&trash, "  [01rtt]             rx.ackrng=%-6zu tx.inflight=%-6zu\n",
 		              pktns->rx.arngs.sz, pktns->tx.in_flight);
 
-		chunk_appendf(&trash, "  srtt=%-4u rttvar=%-4u rttmin=%-4u ptoc=%-4u cwnd=%-6llu\n",
+		chunk_appendf(&trash, "  srtt=%-4u rttvar=%-4u rttmin=%-4u ptoc=%-4u cwnd=%-6llu"
+		                      " mcwnd=%-6llu lostpkts=%-6llu\n",
 		              qc->path->loss.srtt >> 3, qc->path->loss.rtt_var >> 2,
-		              qc->path->loss.rtt_min, qc->path->loss.pto_count, (ullong)qc->path->cwnd);
+		              qc->path->loss.rtt_min, qc->path->loss.pto_count, (ullong)qc->path->cwnd,
+		              (ullong)qc->path->mcwnd, (ullong)qc->path->loss.nb_lost_pkt);
 
 
 		/* Streams */
diff --git a/src/quic_loss.c b/src/quic_loss.c
index 888b61d..a8696e9 100644
--- a/src/quic_loss.c
+++ b/src/quic_loss.c
@@ -190,6 +190,7 @@
 			(int64_t)largest_acked_pn >= pkt->pn_node.key + QUIC_LOSS_PACKET_THRESHOLD) {
 			eb64_delete(&pkt->pn_node);
 			LIST_APPEND(lost_pkts, &pkt->list);
+			ql->nb_lost_pkt++;
 			HA_ATOMIC_INC(&qc->prx_counters->lost_pkt);
 		}
 		else {