]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: quic: implement datagram cleanup for quic_receiver_buf
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 6 Oct 2022 12:45:09 +0000 (14:45 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 13 Oct 2022 09:06:48 +0000 (11:06 +0200)
commit91b2305ad79bb7086840797b6e98bd791992444f
treeeb8a3354ab187a831fc61e4c7c251e24d6875b35
parent1cba8d60f3f9ef6abf632386f490fd0b0dc2e6b5
MINOR: quic: implement datagram cleanup for quic_receiver_buf

Each time data is read on QUIC receiver socket, we try to reuse the
first datagram of the currently used quic_receiver_buf instead of
allocating a new one. This algorithm is suboptimal if there is several
unused datagrams as only the first one is tested and its buffer removed
from quic_receiver_buf.

If QUIC traffic is quite substential, this can lead to an important
number of quic_dgram occurences allocated from pool_head_quic_dgram and
a lack of free space in allocated quic_receiver_buf buffers.

To improve this, each time we want to reuse a datagram, we pop elements
until a non-yet released datagram is found or the list is empty. All
intermediary elements are freed and the last found datagram can be
reused. This operation has been extracted in a dedicated function named
quic_rxbuf_purge_dgrams().

This should improve memory consumption incured by quic_dgram instances under heavy
QUIC traffic. Note that there is still room for improvement as if the
first datagram is still in use, it may block several unused datagram
after him. However this requires to support removal of datagrams out of
order which is currently not possible.

This should be backported up to 2.6.
src/quic_sock.c