haproxy/include/haproxy/quic_stream-t.h
Amaury Denoyelle a456920491 MEDIUM: quic: implement multi-buffered Tx streams
Complete the qc_stream_desc type to support multiple buffers on
emission. The main objective is to increase the transfer throughput.
The MUX is now able to transfer more data without having to wait ACKs.

To implement this feature, a new type qc_stream_buf is declared. it
encapsulates a buffer with a list element. New functions are defined to
retrieve the current buffer, release it or allocate a new one. Each
buffer is kept in the qc_stream_desc list until all of its data is
acknowledged.

On the MUX side, a qcs uses the current stream buffer to transfer data.
Once the buffer is full, it is released and a new one will be allocated
on a future qc_send() invocation.
2022-04-21 12:03:20 +02:00

49 lines
1.5 KiB
C

#ifndef _HAPROXY_QUIC_STREAM_T_H_
#define _HAPROXY_QUIC_STREAM_T_H_
#ifdef USE_QUIC
#include <import/ebtree-t.h>
#include <haproxy/buf-t.h>
#include <haproxy/list-t.h>
/* A QUIC STREAM buffer used for Tx.
*
* Currently, no offset is associated with an offset. The qc_stream_desc must
* store them in order and keep the offset of the oldest buffer. The buffers
* can be freed in strict order.
*/
struct qc_stream_buf {
struct buffer buf; /* STREAM payload */
struct list list; /* element for qc_stream_desc list */
};
/* QUIC STREAM descriptor.
*
* This structure is the low-level counterpart of the QUIC STREAM at the MUX
* layer. It is stored in the quic-conn and provides facility for Tx buffering.
*
* Once the MUX has finished to transfer data on a STREAM, it must release its
* QUIC STREAM descriptor. The descriptor will be kept by the quic_conn until
* all acknowledgement has been received.
*/
struct qc_stream_desc {
struct eb64_node by_id; /* node for quic_conn tree */
struct quic_conn *qc;
struct list buf_list; /* buffers waiting for ACK, oldest offset first */
struct qc_stream_buf *buf; /* current buffer used by the MUX */
uint64_t buf_offset; /* base offset of current buffer */
uint64_t ack_offset; /* last acknowledged offset */
struct eb_root acked_frms; /* ACK frames tree for non-contiguous ACK ranges */
int release; /* set to 1 when the MUX has finished to use this stream */
void *ctx; /* MUX specific context */
};
#endif /* USE_QUIC */
#endif /* _HAPROXY_QUIC_STREAM_T_H_ */