MINOR: quic: Attach timer task to thread for the connection.
This is to avoid races between the connection I/O handler and this task
which share too much variables.
diff --git a/include/haproxy/xprt_quic-t.h b/include/haproxy/xprt_quic-t.h
index 543d670..dbca9da 100644
--- a/include/haproxy/xprt_quic-t.h
+++ b/include/haproxy/xprt_quic-t.h
@@ -627,7 +627,8 @@
uint32_t version;
/* QUIC transport parameters TLS extension */
int tps_tls_ext;
-
+ /* Thread ID this connection is attached to */
+ int tid;
int state;
uint64_t err_code;
unsigned char enc_params[QUIC_TP_MAX_ENCLEN]; /* encoded QUIC transport parameters */
diff --git a/src/xprt_quic.c b/src/xprt_quic.c
index 6556f77..46766ac 100644
--- a/src/xprt_quic.c
+++ b/src/xprt_quic.c
@@ -3424,7 +3424,8 @@
*/
static int quic_conn_init_timer(struct quic_conn *qc)
{
- qc->timer_task = task_new_anywhere();
+ /* Attach this task to the same thread ID used for the connection */
+ qc->timer_task = task_new(1UL << qc->tid);
if (!qc->timer_task)
return 0;
@@ -5066,7 +5067,7 @@
struct bind_conf *bc = __objt_listener(conn->target)->bind_conf;
struct quic_conn *qc = ctx->conn->qc;
- ctx->wait_event.tasklet->tid = quic_get_cid_tid(&qc->scid);
+ qc->tid = ctx->wait_event.tasklet->tid = quic_get_cid_tid(&qc->scid);
if (qc_ssl_sess_init(qc, bc->initial_ctx, &ctx->ssl,
qc->enc_params, qc->enc_params_len) == -1)
goto err;