mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-08 08:07:10 +02:00
BUG/MINOR: quic: Non optimal first datagram.
This bug arrived with this commit:
b068e758f
MINOR: quic: simplify rescheduling for handshake
This commit introduced a bad side effect. Haproxy always replied by an ACK-only
datagram when it received the first client Initial packet. Then it handled
the CRYPTO data insided. And finally, it sent its own CRYPTO data. This broke
the packet coalescing rule whose aim is to optimally build and send as more
as QUIC packets by datagram.
To fix this, simply partially reverts this commit, to make the low level I/O
task return again if some CRYPTO were received. This will delay the
acknowledgement which will be sent with the CRYPTO data from the same
datagram again.
Must be backported to 3.0.
This commit is contained in:
parent
127083a7a2
commit
402ce29e9e
@ -755,6 +755,7 @@ struct task *quic_conn_io_cb(struct task *t, void *context, unsigned int state)
|
|||||||
st = qc->state;
|
st = qc->state;
|
||||||
TRACE_PROTO("connection state", QUIC_EV_CONN_IO_CB, qc, &st);
|
TRACE_PROTO("connection state", QUIC_EV_CONN_IO_CB, qc, &st);
|
||||||
|
|
||||||
|
/* TASK_HEAVY is set when received CRYPTO data have to be handled. */
|
||||||
if (HA_ATOMIC_LOAD(&tl->state) & TASK_HEAVY) {
|
if (HA_ATOMIC_LOAD(&tl->state) & TASK_HEAVY) {
|
||||||
qc_ssl_provide_all_quic_data(qc, qc->xprt_ctx);
|
qc_ssl_provide_all_quic_data(qc, qc->xprt_ctx);
|
||||||
HA_ATOMIC_AND(&tl->state, ~TASK_HEAVY);
|
HA_ATOMIC_AND(&tl->state, ~TASK_HEAVY);
|
||||||
@ -774,6 +775,16 @@ struct task *quic_conn_io_cb(struct task *t, void *context, unsigned int state)
|
|||||||
if (!qc_treat_rx_pkts(qc))
|
if (!qc_treat_rx_pkts(qc))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
/* TASK_HEAVY is set when received CRYPTO data have to be handled. These data
|
||||||
|
* must be acknowledged asap and replied to with others CRYPTO data. In this
|
||||||
|
* case, it is more optimal to delay the ACK to send it with the CRYPTO data
|
||||||
|
* from the same datagram.
|
||||||
|
*/
|
||||||
|
if (HA_ATOMIC_LOAD(&tl->state) & TASK_HEAVY) {
|
||||||
|
tasklet_wakeup(tl);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
if (qc->flags & QUIC_FL_CONN_TO_KILL) {
|
if (qc->flags & QUIC_FL_CONN_TO_KILL) {
|
||||||
TRACE_DEVEL("connection to be killed", QUIC_EV_CONN_PHPKTS, qc);
|
TRACE_DEVEL("connection to be killed", QUIC_EV_CONN_PHPKTS, qc);
|
||||||
goto out;
|
goto out;
|
||||||
|
Loading…
Reference in New Issue
Block a user