From: Amaury Denoyelle Date: Tue, 17 May 2022 13:01:25 +0000 (+0200) Subject: OPTIM: quic: realign empty Rx buffer X-Git-Tag: v2.6-dev11~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82c51b561e82100aedbf88c957b2b70a1d83c122;p=thirdparty%2Fhaproxy.git OPTIM: quic: realign empty Rx buffer quic_rx_pkts_del() function removes packets from QUIC RX buffer. In most cases, the buffer will be emptied after it. In this case, it's useful to realign it. This will avoid future data wrapping and use of an unnecessary junk to fill a too small contiguous space. --- diff --git a/include/haproxy/xprt_quic.h b/include/haproxy/xprt_quic.h index 967a43d8dd..ce65e8bf86 100644 --- a/include/haproxy/xprt_quic.h +++ b/include/haproxy/xprt_quic.h @@ -1149,6 +1149,9 @@ static inline void quic_rx_pkts_del(struct quic_conn *qc) LIST_DELETE(&pkt->qc_rx_pkt_list); pool_free(pool_head_quic_rx_packet, pkt); } + + /* In frequent cases the buffer will be emptied at this stage. */ + b_realign_if_empty(&qc->rx.buf); } /* Increment the reference counter of */