MEDIUM: quic: Limit the number of ACK ranges

When building a packet with an ACK frame, we store the largest acknowledged
packet number sent in this frame in the packet (quic_tx_packet struc).
When receiving an ack for such a packet we can purge the tree of acknowledged
packet number ranges from the range sent before this largest acknowledged
packet number.
This commit is contained in:
Frédéric Lécaille
2022-03-15 18:44:20 +01:00
committed by Amaury Denoyelle
parent 8f3ae0272f
commit 141982a4e1
2 changed files with 61 additions and 5 deletions

View File

@@ -991,6 +991,17 @@ static inline void quic_pktns_init(struct quic_pktns *pktns)
pktns->flags = 0;
}
/* Returns the current largest acknowledged packet number if exists, -1 if not */
static inline int64_t quic_pktns_get_largest_acked_pn(struct quic_pktns *pktns)
{
struct eb64_node *ar = eb64_last(&pktns->rx.arngs.root);
if (!ar)
return -1;
return eb64_entry(&ar->node, struct quic_arng_node, first)->last;
}
/* Discard <pktns> packet number space attached to <qc> QUIC connection.
* Its loss information are reset. Deduce the outstanding bytes for this
* packet number space from the outstanding bytes for the path of this